/* ============================================================
   VDK Oil Management System — Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  --sidebar-bg:     #1a1f2e;
  --sidebar-hover:  #252c3f;
  --sidebar-active: #2d3654;
  --accent:         #4f7df3;
  --bg-main:        #f4f6fb;
  --bg-card:        #fff;
  --border:         #e5e9f2;
  --text-primary:   #1e2537;
  --text-muted:     #6b7280;
  --success:        #22c55e;
  --warning:        #f59e0b;
  --danger:         #ef4444;
  --sidebar-width:  240px;
  --topbar-height:  60px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:      0 4px 12px rgba(0,0,0,.08);
  --radius:         10px;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-main);
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* ── Layout ─────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.brand-icon {
  width: 38px; height: 38px;
  /*background: var(--accent);*/
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

.brand-icon img {
  width: 38px; height: 38px;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 700; font-size: 15px; color: #fff; line-height: 1.2; }
.brand-sub  { font-size: 10px; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .06em; }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 0 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.12) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.3);
  padding: 12px 18px 4px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: rgba(255,255,255,.65);
  font-size: 13.5px;
  font-weight: 400;
  border-left: 3px solid transparent;
  transition: all .18s;
  cursor: pointer;
}
.sidebar-nav .nav-link i { font-size: 16px; flex-shrink: 0; }
.sidebar-nav .nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
  border-left-color: rgba(79,125,243,.5);
}
.sidebar-nav .nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 500;
}

/* Sidebar Footer */
.sidebar-footer {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.user-avatar { font-size: 24px; color: rgba(255,255,255,.5); flex-shrink: 0; }
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-name  { font-size: 13px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: 11px; color: rgba(255,255,255,.4); }

.logout-btn {
  color: rgba(255,255,255,.4);
  font-size: 18px;
  padding: 6px;
  border-radius: 6px;
  transition: all .18s;
  flex-shrink: 0;
}
.logout-btn:hover { color: var(--danger); background: rgba(239,68,68,.12); }

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 999;
  pointer-events: none;
}
.sidebar-overlay.active {
  display: block;
  pointer-events: auto;
}

/* ── Main Content ────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}
.hamburger-btn:hover { background: var(--bg-main); }

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.topbar-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ── Page Content ────────────────────────────────────────────── */
.page-content {
  padding: 28px;
  flex: 1;
}

/* ── Summary Cards ───────────────────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.summary-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border);
  transition: box-shadow .2s;
}
.summary-card:hover { box-shadow: var(--shadow-md); }

.summary-icon {
  width: 50px; height: 50px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.summary-icon.blue   { background: rgba(79,125,243,.12); color: var(--accent); }
.summary-icon.green  { background: rgba(34,197,94,.12);  color: var(--success); }
.summary-icon.orange { background: rgba(245,158,11,.12); color: var(--warning); }
.summary-icon.red    { background: rgba(239,68,68,.12);  color: var(--danger); }
.summary-icon.purple { background: rgba(139,92,246,.12); color: #8b5cf6; }
.summary-icon.teal   { background: rgba(20,184,166,.12); color: #14b8a6; }

.summary-info { min-width: 0; }
.summary-value { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.summary-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Table Wrapper ───────────────────────────────────────────── */
.table-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.table-toolbar-title {
  font-size: 15px;
  font-weight: 600;
}

.table-responsive { overflow-x: auto; }

.table {
  margin: 0;
  font-size: 13.5px;
}
.table thead th {
  background: #f9fafb;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  white-space: nowrap;
}
.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fafbfd; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-status.paid,
.badge-status.present,
.badge-status.done,
.badge-status.completed { background: rgba(34,197,94,.1); color: #16a34a; }
.badge-status.pending   { background: rgba(245,158,11,.1); color: #d97706; }
.badge-status.in_progress,
.badge-status.in-progress { background: rgba(79,125,243,.1); color: #3b67d9; }
.badge-status.absent,
.badge-status.overdue   { background: rgba(239,68,68,.1); color: #dc2626; }
.badge-status.high      { background: rgba(239,68,68,.1); color: #dc2626; }
.badge-status.medium    { background: rgba(245,158,11,.1); color: #d97706; }
.badge-status.low       { background: rgba(34,197,94,.1); color: #16a34a; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary-custom {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .18s, box-shadow .18s;
}
.btn-primary-custom:hover { background: #3d68e0; box-shadow: 0 4px 12px rgba(79,125,243,.3); color: #fff; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 15px;
  transition: all .18s;
  line-height: 1;
}
.btn-icon.edit   { color: var(--accent); }
.btn-icon.edit:hover   { background: rgba(79,125,243,.1); }
.btn-icon.delete { color: var(--danger); }
.btn-icon.delete:hover { background: rgba(239,68,68,.1); }
.btn-icon.view   { color: var(--text-muted); }
.btn-icon.view:hover   { background: var(--bg-main); }
.btn-icon.success { color: var(--success); }
.btn-icon.success:hover { background: rgba(34,197,94,.1); }

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 20px; }

/* ── Filter Bar ──────────────────────────────────────────────── */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.filter-bar .form-label { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; }
.filter-bar .form-control,
.filter-bar .form-select {
  font-size: 13px;
  height: 36px;
  padding: 6px 10px;
  border-color: var(--border);
}
.filter-bar .btn-filter {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0 18px;
  height: 36px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.filter-bar .btn-filter:hover { background: #3d68e0; }
.filter-bar .btn-reset {
  background: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0 14px;
  height: 36px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
}
.filter-bar .btn-reset:hover { background: var(--bg-main); }

/* ── Form Controls ───────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,125,243,.15);
}
.form-label { font-size: 13px; font-weight: 500; margin-bottom: 5px; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-header { border-bottom: 1px solid var(--border); }
.modal-footer { border-top: 1px solid var(--border); }
.modal-title  { font-size: 16px; font-weight: 600; }

/* ── Login Page ──────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1f2e 0%, #252c3f 50%, #1a1f2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 44px 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo-icon {
  width: 90px; height: 90px;
  background: var(--accent);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: #fff;
  margin-bottom: 12px;
}

.login-logo-icon img {
  width: 84px; height: 84px;
}

.login-logo-title { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.login-logo-sub   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.login-card .btn-login {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 11px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s;
  margin-top: 4px;
}
.login-card .btn-login:hover { background: #3d68e0; }

/* ── Attendance Hero ─────────────────────────────────────────── */
.attendance-hero {
  background: linear-gradient(135deg, var(--accent) 0%, #6a9af8 100%);
  border-radius: var(--radius);
  padding: 36px 32px;
  color: #fff;
  text-align: center;
  margin-bottom: 28px;
}
.attendance-date-label { font-size: 14px; opacity: .8; margin-bottom: 6px; }
.attendance-time {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
  line-height: 1;
}
.attendance-day-label { font-size: 16px; opacity: .8; margin-bottom: 24px; }
.attendance-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(255,255,255,.18);
  margin-bottom: 24px;
}
.btn-checkin {
  background: #fff;
  color: var(--accent);
  border: none;
  padding: 12px 36px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  margin: 0 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-checkin:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.btn-checkout {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 2px solid rgba(255,255,255,.4);
  padding: 12px 36px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  margin: 0 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-checkout:hover { background: rgba(255,255,255,.25); }

/* ── Tabs ────────────────────────────────────────────────────── */
.nav-tabs { border-bottom: 2px solid var(--border); }
.nav-tabs .nav-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 18px;
  margin-bottom: -2px;
  border-radius: 0;
  transition: all .18s;
}
.nav-tabs .nav-link:hover { color: var(--text-primary); background: var(--bg-main); }
.nav-tabs .nav-link.active { color: var(--accent); border-bottom-color: var(--accent); background: none; }

/* ── Kanban (Tasks) ──────────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.kanban-col {
  background: var(--bg-main);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
}
.kanban-col-header {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kanban-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.kanban-card-title { font-size: 13.5px; font-weight: 500; margin-bottom: 8px; }
.kanban-card-meta  { font-size: 11.5px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Reports ─────────────────────────────────────────────────── */
.report-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 24px;
  margin-bottom: 20px;
}
.report-metric { text-align: center; flex: 1; min-width: 120px; }
.report-metric-value { font-size: 20px; font-weight: 700; color: var(--accent); }
.report-metric-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

/* ── Alerts / Toast ──────────────────────────────────────────── */
.toast-container-custom {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 18px 12px 14px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  min-width: 260px;
  max-width: 380px;
  animation: slideInRight .25s ease;
}
.toast-item.success { border-left: 4px solid var(--success); }
.toast-item.error   { border-left: 4px solid var(--danger);  }
.toast-item.warning { border-left: 4px solid var(--warning); }
.toast-item.info    { border-left: 4px solid var(--accent);  }
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Low Stock Warning ───────────────────────────────────────── */
.low-stock { background: rgba(245,158,11,.06) !important; }
.critical-stock { background: rgba(239,68,68,.06) !important; }

/* ── Misc Utilities ──────────────────────────────────────────── */
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-warning { color: var(--warning) !important; }
.text-accent  { color: var(--accent)  !important; }
.text-muted   { color: var(--text-muted) !important; }
.fw-600       { font-weight: 600; }
.fs-12        { font-size: 12px; }
.fs-13        { font-size: 13px; }
.mt-18        { margin-top: 18px; }
.mb-18        { margin-bottom: 18px; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; opacity: .4; }
.empty-state p { font-size: 14px; }

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* Quick Links */
.quick-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.quick-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  transition: all .18s;
  cursor: pointer;
  text-decoration: none;
}
.quick-link-btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--shadow-sm); }

/* Production input table */
.input-rows-table { width: 100%; }
.input-rows-table th { font-size: 12px; color: var(--text-muted); font-weight: 600; padding: 6px 8px; }
.input-rows-table td { padding: 6px 8px; }
.calc-display {
  background: var(--bg-main);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 12px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.calc-item { display: flex; flex-direction: column; }
.calc-label { font-size: 11px; color: var(--text-muted); }
.calc-value { font-size: 16px; font-weight: 700; color: var(--text-primary); }

/* ── Mobile Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
  }
  #sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.active {
    display: block;
  }
  .main-content {
    margin-left: 0;
  }
  .hamburger-btn {
    display: flex;
  }
  .page-content {
    padding: 16px;
  }
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .summary-value { font-size: 18px; }
  .filter-bar { flex-direction: column; }
  .filter-bar > * { width: 100%; }
  .topbar-date { display: none; }
  .kanban-board { grid-template-columns: 1fr; }
  .attendance-time { font-size: 38px; }
  .login-card { padding: 32px 24px; }
  .table-toolbar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .summary-grid { grid-template-columns: 1fr; }
}

/* ── Print Styles ────────────────────────────────────────────── */
@media print {
  #sidebar,
  .topbar,
  .filter-bar,
  .table-toolbar .btn-primary-custom,
  .btn-icon,
  .hamburger-btn,
  .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  .print-header { display: block !important; }
  .table-wrapper { box-shadow: none; border: 1px solid #ddd; }
  body { background: #fff !important; }
}

.print-header {
  display: none;
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #333;
}
.print-header h2 { font-size: 20px; margin-bottom: 4px; }
.print-header p  { font-size: 12px; color: #555; }
