/* ============================================================
   Dalal Industries — PO Tracking System
   Complete Design System — Logo Brand Theme
   Brand Colors: Green #7ab929 | Grey #6b7280
   ============================================================ */

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

/* --- CSS Variables (Logo-Based Brand Colors) --- */
:root {
  /* Backgrounds */
  --bg-dark:       #0e1117;
  --bg-card:       #161d26;
  --bg-card2:      #1c2535;
  --bg-input:      #0e1117;
  --bg-sidebar:    linear-gradient(180deg, #131a24 0%, #0e1117 100%);
  --bg-sidebar-footer: rgba(0,0,0,0.2);

  /* Layout */
  --sidebar-w:     262px;

  /* Brand — Logo Green */
  --accent:        #7ab929;
  --accent-light:  #8fd42e;
  --accent-dark:   #5a8e1a;
  --accent-glow:   rgba(122,185,41,0.14);
  --accent-border: rgba(122,185,41,0.35);

  /* Brand — Logo Grey */
  --grey:          #6b7280;
  --grey-light:    #9ca3af;
  --grey-dark:     #4b5563;

  /* Status Colors */
  --gold:          #d4a017;
  --red:           #f05252;
  --orange:        #e3823a;
  --blue:          #4d9ef7;
  --purple:        #a78bfa;
  --teal:          #14b8a6;

  /* Text */
  --text-primary:  #edf2f7;
  --text-secondary:#9ca3af;
  --text-muted:    #6b7280;

  /* Borders */
  --border:        rgba(255,255,255,0.07);
  --border-hover:  rgba(122,185,41,0.3);

  /* Misc */
  --shadow:        0 8px 32px rgba(0,0,0,0.45);
  --shadow-lg:     0 20px 60px rgba(0,0,0,0.6);
  --radius:        12px;
  --radius-sm:     8px;
  --topbar-h:      62px;
  --transition:    all 0.22s ease;
}

/* --- Light Theme Override --- */
:root.light-theme {
  /* Backgrounds */
  --bg-dark:       #f3f4f6;
  --bg-card:       #ffffff;
  --bg-card2:      #e5e7eb;
  --bg-input:      #ffffff;
  --bg-sidebar:    linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
  --bg-sidebar-footer: rgba(0,0,0,0.03);

  /* Accent overrides for light background contrast */
  --accent:        #659e1c;
  --accent-light:  #7ab929;
  --accent-dark:   #4a7813;
  --accent-glow:   rgba(122,185,41,0.08);
  --accent-border: rgba(122,185,41,0.25);

  /* Brand — Logo Grey overrides */
  --grey:          #4b5563;
  --grey-light:    #6b7280;
  --grey-dark:     #374151;

  /* Status Colors */
  --gold:          #b58004;
  --red:           #dc2626;
  --orange:        #c25e1a;
  --blue:          #1d4ed8;
  --purple:        #6d28d9;
  --teal:          #0f766e;

  /* Text Colors */
  --text-primary:  #111827;
  --text-secondary:#374151;
  --text-muted:    #6b7280;

  /* Borders */
  --border:        #d1d5db;
  --border-hover:  rgba(122,185,41,0.5);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-light); }
img { max-width: 100%; }
table { border-collapse: collapse; width: 100%; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.3s ease, background 0.22s ease;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  min-height: 82px;
  background: rgba(122,185,41,0.04);
}

.sidebar-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--grey-dark);
  padding: 14px 12px 5px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  background: var(--accent-glow);
  color: var(--text-primary);
  border-left-color: rgba(122,185,41,0.4);
}
.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-left: 3px solid var(--accent);
  font-weight: 600;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-sidebar-footer);
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.user-avatar {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(122,185,41,0.35);
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-role { font-size: 11px; color: var(--text-muted); }
.btn-logout {
  display: block;
  text-align: center;
  padding: 9px;
  background: rgba(240,82,82,0.08);
  border: 1px solid rgba(240,82,82,0.2);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}
.btn-logout:hover { background: rgba(240,82,82,0.18); color: var(--red); }

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  transition: margin 0.3s ease;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}
.topbar-date { color: var(--text-secondary); }

/* --- Theme Switcher --- */
.theme-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 2px;
  gap: 2px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.theme-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition);
}
.theme-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}
:root.light-theme .theme-btn:hover {
  background: rgba(0,0,0,0.06);
}
.theme-btn.active {
  background: var(--accent);
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(122,185,41,0.4);
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content { padding: 24px; }

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-msg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  margin: 0 24px 0;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}
.flash-success { background: rgba(122,185,41,0.12); border: 1px solid rgba(122,185,41,0.3); color: var(--accent-light); }
.flash-error   { background: rgba(240,82,82,0.12);  border: 1px solid rgba(240,82,82,0.3);  color: var(--red); }
.flash-warning { background: rgba(227,130,58,0.12); border: 1px solid rgba(227,130,58,0.3); color: var(--orange); }
.flash-close { background: none; border: none; cursor: pointer; color: inherit; font-size: 16px; }
@keyframes slideDown { from { transform: translateY(-10px); opacity:0; } to { transform: translateY(0); opacity:1; } }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}
.card:hover { border-color: var(--border-hover); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   KPI STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.green::before  { background: linear-gradient(90deg, var(--accent), var(--accent-light)); }
.stat-card.blue::before   { background: linear-gradient(90deg, var(--blue), #7ab8ff); }
.stat-card.red::before    { background: linear-gradient(90deg, var(--red), #ff8080); }
.stat-card.gold::before   { background: linear-gradient(90deg, var(--gold), #f0c040); }
.stat-card.purple::before { background: linear-gradient(90deg, var(--purple), #c4b5fd); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-hover); }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-card.green  .stat-icon { background: rgba(122,185,41,0.14); }
.stat-card.blue   .stat-icon { background: rgba(77,158,247,0.14); }
.stat-card.red    .stat-icon { background: rgba(240,82,82,0.14); }
.stat-card.gold   .stat-icon { background: rgba(212,160,23,0.14); }
.stat-card.purple .stat-icon { background: rgba(167,139,250,0.14); }

.stat-info { flex: 1; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-change { font-size: 11px; margin-top: 4px; }
.stat-change.up   { color: var(--accent); }
.stat-change.down { color: var(--red); }

/* ============================================================
   CHARTS GRID
   ============================================================ */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

/* ============================================================
   DATA TABLE
   ============================================================ */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead { background: var(--bg-card2); }
.data-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background 0.15s;
}
.data-table tbody tr:hover { background: rgba(122,185,41,0.04); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .text-muted { color: var(--text-muted); font-size: 12px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-pending     { background: rgba(107,114,128,0.15); color: var(--grey-light); }
.badge-production  { background: rgba(77,158,247,0.15);  color: var(--blue); }
.badge-pp          { background: rgba(167,139,250,0.15); color: var(--purple); }
.badge-cutting     { background: rgba(212,160,23,0.15);  color: var(--gold); }
.badge-packing     { background: rgba(122,185,41,0.15);  color: var(--accent); }
.badge-shipped     { background: rgba(122,185,41,0.18);  color: var(--accent-light); border: 1px solid rgba(122,185,41,0.4); }
.badge-cancelled   { background: rgba(240,82,82,0.1);    color: var(--red); }
.badge-overdue     { background: rgba(240,82,82,0.18);   color: var(--red); border: 1px solid rgba(240,82,82,0.4); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.65} }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 2px 10px rgba(122,185,41,0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(122,185,41,0.35);
}
.btn-secondary { background: var(--bg-card2); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg-card); color: var(--text-primary); }
.btn-danger  { background: rgba(240,82,82,0.1);  color: var(--red);    border: 1px solid rgba(240,82,82,0.25); }
.btn-danger:hover  { background: rgba(240,82,82,0.22); }
.btn-warning { background: rgba(227,130,58,0.1); color: var(--orange); border: 1px solid rgba(227,130,58,0.25); }
.btn-warning:hover { background: rgba(227,130,58,0.22); }
.btn-info    { background: rgba(77,158,247,0.1); color: var(--blue);   border: 1px solid rgba(77,158,247,0.25); }
.btn-info:hover    { background: rgba(77,158,247,0.22); }
.btn-sm   { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 7px 9px; font-size: 14px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   FORMS
   ============================================================ */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.form-label.required::after { content: ' *'; color: var(--red); }
.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  transition: var(--transition);
  width: 100%;
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled { opacity: 0.5; cursor: not-allowed; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint  { font-size: 11px; color: var(--text-muted); }
.form-error { font-size: 11px; color: var(--red); }

/* Input with prefix ($ sign) */
.input-group { position: relative; }
.input-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}
.input-group .form-control { padding-left: 28px; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-container { margin-top: 6px; }
.progress-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.progress-bar  { height: 6px; background: var(--bg-card2); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-light)); transition: width 0.8s ease; }
.progress-fill.danger  { background: linear-gradient(90deg, var(--red), #ff8080); }
.progress-fill.warning { background: linear-gradient(90deg, var(--orange), #f0c040); }

/* ============================================================
   MILESTONES TRACKER
   ============================================================ */
.milestones-track {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 0;
  position: relative;
}
.milestones-track::before {
  content: '';
  position: absolute;
  top: 28px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.milestone-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  position: relative;
  z-index: 1;
}
.milestone-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-card2);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--transition);
}
.milestone-dot.done    { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px rgba(122,185,41,0.4); }
.milestone-dot.pending { border-color: var(--border); opacity: 0.5; }
.milestone-label { font-size: 10px; color: var(--text-muted); text-align: center; font-weight: 600; max-width: 60px; line-height: 1.3; }
.milestone-date  { font-size: 10px; color: var(--accent); }

/* ============================================================
   FILTERS BAR
   ============================================================ */
.filters-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.filter-search {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.filter-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.filter-search .form-control { padding-left: 34px; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.page-header-title { font-size: 22px; font-weight: 800; color: var(--text-primary); }
.page-header-sub   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  padding: 16px;
  flex-wrap: wrap;
}
.page-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.page-btn:hover  { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.94) translateY(10px);
  transition: transform 0.25s ease;
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(122,185,41,0.04);
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; padding: 4px; transition: var(--transition); }
.modal-close:hover { color: var(--red); }
.modal-body   { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ============================================================
   PERMISSIONS GRID (User Management)
   ============================================================ */
.perms-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.perm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}
.perm-item:hover { border-color: var(--accent); color: var(--text-primary); }
.perm-item input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.perm-item.checked { border-color: var(--accent-border); background: var(--accent-glow); color: var(--text-primary); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  position: relative;
  overflow: hidden;
}
.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(122,185,41,0.13) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%,  rgba(77,158,247,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 10% 60%,  rgba(122,185,41,0.05) 0%, transparent 50%);
}
/* Animated particles */
.login-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(122,185,41,0.15) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.3;
}
.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 20px;
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 42px 40px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(122,185,41,0.08);
}
.login-logo {
  display: block;
  margin: 0 auto 28px;
  height: 62px;
  width: auto;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}
.login-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.login-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 30px;
}
.login-form { display: flex; flex-direction: column; gap: 16px; }
.btn-login {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 16px rgba(122,185,41,0.3);
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(122,185,41,0.4);
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
}
.login-error {
  background: rgba(240,82,82,0.1);
  border: 1px solid rgba(240,82,82,0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--red);
  font-size: 13px;
  text-align: center;
}
.login-divider { text-align: center; margin-top: 16px; font-size: 12px; color: var(--text-muted); }
.login-divider a { color: var(--accent); }

/* ============================================================
   ITEMS TABLE IN PO FORM
   ============================================================ */
.items-table { margin-top: 8px; }
.items-table table { background: var(--bg-card2); }
.items-table th { font-size: 11px; }
.items-table input, .items-table select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 12.5px;
  width: 100%;
}
.items-table input:focus, .items-table select:focus { outline: none; border-color: var(--accent); }
.btn-add-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--accent-glow);
  border: 1px dashed var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  margin-top: 10px;
  transition: var(--transition);
}
.btn-add-row:hover { background: rgba(122,185,41,0.2); }

/* ============================================================
   PORTAL SPECIFIC
   ============================================================ */
.portal-track-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.po-number { font-size: 20px; font-weight: 800; color: var(--accent); }
.po-meta { display: flex; gap: 20px; flex-wrap: wrap; margin: 10px 0; }
.po-meta-item { font-size: 13px; color: var(--text-secondary); }
.po-meta-item strong { color: var(--text-primary); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon  { font-size: 48px; margin-bottom: 16px; }
.empty-title { font-size: 18px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.empty-desc  { font-size: 13px; color: var(--text-muted); }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-success { color: var(--accent); }
.text-danger  { color: var(--red); }
.text-warning { color: var(--orange); }
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.fw-bold      { font-weight: 700; }
.fw-medium    { font-weight: 600; }
.d-flex       { display: flex; }
.align-center { align-items: center; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.mt-12        { margin-top: 12px; }
.mt-16        { margin-top: 16px; }
.mt-24        { margin-top: 24px; }
.mb-16        { margin-bottom: 16px; }
.mb-24        { margin-bottom: 24px; }
.hidden       { display: none !important; }
.amount       { font-family: 'Courier New', monospace; font-weight: 700; color: var(--accent); }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: rgba(122,185,41,0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(122,185,41,0.5); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 24px 0 60px rgba(0,0,0,0.5); }
  .sidebar-close { display: block; }
  .main-wrapper { margin-left: 0; }
  .menu-toggle { display: flex; align-items: center; }
  .charts-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 16px; }
  .login-card { padding: 28px 20px; }
  .perms-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .filters-bar { padding: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .milestones-track { gap: 4px; }
  .milestone-label { font-size: 9px; max-width: 50px; }
  .perms-grid { grid-template-columns: repeat(2, 1fr); }
}
