/* =============================================
   GAI IMS — Main Stylesheet (QMS Design System)
   File: public/css/style.css
   ============================================= */

/* ===== CSS VARIABLES (QMS Color Palette) ===== */
:root {
  --navy:    #0f2540;
  --navy2:   #1a3a5c;
  --navy3:   #234d78;
  --orange:  #e8500a;
  --orange2: #f06830;
  --gold:    #d4960a;
  --gold2:   #f0b429;
  --green:   #0a6b3a;
  --green2:  #148f52;
  --red:     #b91c1c;
  --red2:    #dc2626;
  --purple:  #6d28d9;
  --purple2: #7c3aed;
  --blue:    #1d4ed8;
  --blue2:   #2563eb;
  --bg:      #e8ecf4;
  --surface: #ffffff;
  --surface2:#f4f6fb;
  --border:  #d1d8e8;
  --border2: #b8c4d8;
  --text:    #0d1b2a;
  --text2:   #2d3f55;
  --muted:   #6b7a90;
  --muted2:  #9aabb8;
  --shadow:  0 2px 14px rgba(15,37,64,.10);
  --shadow2: 0 8px 32px rgba(15,37,64,.18);
  --radius:  10px;
  --radius2: 14px;

  /* inline style compatibility */
  --card-bg: #ffffff;
}

/* ===== RESET & BASE ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'DM Sans', sans-serif;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* Base text color for all content */

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--surface2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }

.custom-scroll::-webkit-scrollbar { width: 4px; }
.custom-scroll::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* ===== SIDEBAR (disabled) ===== */
#sidebar { display: none !important; }

/* ===== GLASS CARD → Light Card ===== */
.card {
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: var(--radius2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--text);
}

.card-shadow {
  box-shadow: var(--shadow2);
}

/* ===== STAT CARDS ===== */
.stat-card {
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: var(--radius2);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  color: var(--text);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow2);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  border-radius: var(--radius2) var(--radius2) 0 0;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  border-radius: 50%;
  opacity: 0.06;
}

.stat-card.blue::before  { background: linear-gradient(90deg, var(--blue), var(--blue2)); }
.stat-card.blue::after   { background: var(--blue); }
.stat-card.amber::before { background: linear-gradient(90deg, var(--orange), var(--orange2)); }
.stat-card.amber::after  { background: var(--orange); }
.stat-card.green::before { background: linear-gradient(90deg, var(--green), var(--green2)); }
.stat-card.green::after  { background: var(--green); }
.stat-card.red::before   { background: linear-gradient(90deg, var(--red), var(--red2)); }
.stat-card.red::after    { background: var(--red); }

/* Stat numbers & labels */
.stat-card .text-2xl,
.stat-card .text-3xl,
.stat-card [class*="font-bold"] { color: var(--navy) !important; }
.stat-card .text-xs,
.stat-card .text-sm             { color: var(--muted) !important; }

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--navy2), var(--navy3));
  color: #fff;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(15,37,64,0.20);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--navy3), var(--navy2));
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15,37,64,0.28);
}

.btn-dark {
  background: var(--surface2);
  color: var(--text2);
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border2);
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-dark:hover {
  background: var(--border);
  color: var(--navy2);
  transform: translateY(-1px);
}

.btn-green {
  background: linear-gradient(135deg, var(--green), var(--green2));
  color: #fff;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(10,107,58,0.20);
}

.btn-green:hover {
  background: linear-gradient(135deg, var(--green2), var(--green));
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(10,107,58,0.28);
}

.btn-red {
  background: linear-gradient(135deg, var(--red), var(--red2));
  color: #fff;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(185,28,28,0.20);
}

.btn-red:hover {
  background: linear-gradient(135deg, var(--red2), var(--red));
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(185,28,28,0.28);
}

.btn-outline {
  background: var(--surface2);
  color: var(--text2);
  border: 1.5px solid var(--border2);
  padding: 7px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-outline:hover {
  background: var(--border);
  border-color: var(--navy2);
  color: var(--navy2);
}

.btn-outline.active {
  background: rgba(232,80,10,0.10);
  color: var(--orange);
  border-color: var(--orange);
}

/* ===== FORM INPUTS ===== */
.form-input {
  width: 100%;
  border: 1.5px solid var(--border);
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  outline: none;
  background: var(--surface);
  color: var(--text);
  transition: all 0.18s;
}

.form-input::placeholder { color: var(--muted2); }

.form-input:focus {
  border-color: var(--navy2);
  box-shadow: 0 0 0 3px rgba(26,58,92,0.09);
  background: var(--surface);
}

.form-input[readonly] {
  background: var(--surface2);
  color: var(--muted);
  cursor: not-allowed;
}

.form-input option { background: var(--surface); color: var(--text); }

.form-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

/* Native inputs & selects (Tailwind classes) */
input:not(.form-input),
select:not(.form-input),
textarea:not(.form-input) {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 11px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: .18s;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--navy2);
  box-shadow: 0 0 0 3px rgba(26,58,92,0.09);
}

input[type="date"] {
  color-scheme: light;
  color: var(--text);
  background: var(--surface);
}

select option {
  background: var(--surface) !important;
  color: var(--text) !important;
}

/* ===== SKU FIELD ===== */
.sku-field {
  border: 1.5px dashed var(--orange) !important;
  background: rgba(232,80,10,0.05) !important;
  font-family: 'JetBrains Mono', monospace;
  color: var(--orange) !important;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* ===== TABLE ===== */
.data-table {
  border-collapse: collapse !important;
}
.data-table thead th {
  background: var(--navy);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 9px 11px;
  border-bottom: none;
  white-space: nowrap;
}

/* Enquiry tabs */
.enq-tab {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.enq-tab:hover { background: var(--surface2); }
.enq-tab-active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.data-table tbody tr {
  transition: background 0.15s;
}
.data-table tbody tr td {
  border-bottom: 1px solid var(--border);
  border-right: none !important;
}
.data-table thead th {
  border-right: none !important;
}
.enq-po-separator td {
  border-top: 2px solid var(--navy) !important;
}

.data-table tbody tr:hover { background: var(--surface2); }
.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody td {
  padding: 8px 11px;
  font-size: 0.78rem;
  color: var(--text);
  border-right: none;
}

/* ===== BADGES ===== */
.badge {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
}

.badge-pending   { background: #fff8e0; color: #a05a00;  border: 1px solid #f0d080; }
.badge-transit   { background: #eff6ff; color: #1d4ed8;  border: 1px solid #bfdbfe; }
.badge-received  { background: #e6f7ee; color: var(--green); border: 1px solid #a7f3d0; }
.badge-cancelled { background: #fff0f0; color: var(--red);   border: 1px solid #fecaca; }
.badge-in        { background: #e6f7ee; color: var(--green); border: 1px solid #a7f3d0; }
.badge-out       { background: #fff0f0; color: var(--red);   border: 1px solid #fecaca; }
.badge-return    { background: #f5f3ff; color: var(--purple);border: 1px solid #ddd6fe; }

/* ===== LOADER ===== */
.loader {
  border: 3px solid var(--border);
  border-top: 3px solid var(--orange);
  border-radius: 50%;
  width: 36px; height: 36px;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 12px rgba(232,80,10,0.20);
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== ANIMATIONS ===== */
.animate-fade-in {
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== DROPDOWN ===== */
.custom-dropdown-list {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius2);
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: var(--shadow2);
  display: none;
  margin-top: 5px;
}

.custom-dropdown-item {
  padding: 9px 13px;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.custom-dropdown-item:last-child { border-bottom: none; }
.custom-dropdown-item:hover { background: var(--surface2); color: var(--navy2); }

.custom-dropdown-item strong { display: block; font-weight: 600; color: var(--text); }
.custom-dropdown-item span   { font-size: 0.73rem; color: var(--muted); }

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
}

.page-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy2);
  letter-spacing: 0.01em;
}

.page-subtitle {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 3px;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  box-shadow: var(--shadow);
}

/* ===== SECTION DIVIDER ===== */
.section-divider {
  display: flex; align-items: center; gap: 12px; margin: 20px 0;
}

.section-divider span {
  font-size: 0.7rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.07em; white-space: nowrap;
}

.section-divider::before,
.section-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ===== TRANSACTION CARD BORDERS ===== */
.txn-green  { border-top: 3px solid var(--green)  !important; box-shadow: 0 0 24px rgba(10,107,58,0.08)  !important; }
.txn-red    { border-top: 3px solid var(--red)    !important; box-shadow: 0 0 24px rgba(185,28,28,0.08)  !important; }
.txn-purple { border-top: 3px solid var(--purple)  !important; box-shadow: 0 0 24px rgba(109,40,217,0.08) !important; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(8,18,35,0.55);
  backdrop-filter: blur(2px);
  z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: visible;
  box-shadow: var(--shadow2);
  animation: fadeIn 0.22s ease-out;
  color: var(--text);
}

/* ===== CLICKABLE CARDS ===== */
.clickable-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.clickable-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow2) !important;
}

/* ===== LOW STOCK ALERT CARDS ===== */
.low-stock-card {
  background: rgba(185,28,28,0.05);
  border: 1px solid rgba(185,28,28,0.18);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  color: var(--text);
}

/* ===== PO ITEM ROW ===== */
.po-item-row {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  position: relative;
  transition: border-color 0.2s;
  color: var(--text);
}

.po-item-row:focus-within { border-color: var(--navy2); }

/* ===== TAILWIND TEXT COLOR OVERRIDES (Light Theme) ===== */

/* Content area — dark readable text */
.text-white     { color: var(--text) !important; }
.text-gray-100  { color: var(--text) !important; }
.text-gray-200  { color: var(--text2) !important; }
.text-gray-300  { color: var(--text2) !important; }
.text-gray-400  { color: var(--muted) !important; }
.text-gray-500  { color: var(--muted) !important; }
.text-gray-600  { color: var(--muted) !important; }
.text-slate-100 { color: var(--text) !important; }
.text-slate-200 { color: var(--text2) !important; }
.text-slate-300 { color: var(--muted) !important; }

/* Keep accent colors as-is */
.text-red-400    { color: var(--red)    !important; }
.text-green-400  { color: var(--green2) !important; }
.text-blue-400   { color: var(--blue2)  !important; }
.text-yellow-400 { color: var(--gold)   !important; }
.text-purple-400 { color: var(--purple2)!important; }
.text-black      { color: var(--text)   !important; }

/* Headings */
.page-title, h1, h2, h3 { color: var(--navy2); }

/* ===== TAILWIND BG OVERRIDES ===== */
.bg-white\/5,
.bg-white\/10,
.bg-white\/4    { background: var(--surface2) !important; }
.bg-gray-800,
.bg-gray-900,
.bg-slate-800,
.bg-slate-900   { background: var(--surface)  !important; }
.border-gray-800 { border-color: var(--border) !important; }

/* Low stock bg in dark mode was green/red transparent — fix for light */
.bg-green-900\/50 { background: rgba(10,107,58,0.08)  !important; }
.bg-red-900\/50   { background: rgba(185,28,28,0.08)  !important; }
.border-red-900\/30{ border-color: rgba(185,28,28,0.18) !important; }

/* ===== TAILWIND BORDER OVERRIDES ===== */
.border-white\/10,
.border-white\/5,
.border-white\/8  { border-color: var(--border)  !important; }
.border-white\/12 { border-color: var(--border2) !important; }

/* hover states in content area */
.hover\:bg-blue-900\/30:hover { background: rgba(29,78,216,0.08) !important; }
.hover\:text-red-400:hover    { color: var(--red) !important; }

/* ===== DASHBOARD ===== */
.dash-stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:20px; }
.stat-label { font-size:0.72rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:0.08em; margin-bottom:4px; }
.stat-value { font-size:1.8rem; font-weight:900; font-family:monospace; color:var(--text); margin:4px 0; }
.stat-value.red { color:var(--red); }
.stat-sub { font-size:0.72rem; color:var(--muted); margin-top:4px; }
.section-title { font-size:0.95rem; font-weight:700; color:var(--navy2); }

/* ===== INVENTORY ===== */
.inv-stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:16px; }
.inv-stat-card { background:var(--card-bg); border:1px solid var(--border); border-radius:14px; padding:16px 20px; }
.inv-stat-card.blue  { border-top:3px solid #3B82F6; }
.inv-stat-card.green { border-top:3px solid #10B981; }
.inv-stat-card.red   { border-top:3px solid #F43F5E; }
.inv-stat-card.amber { border-top:3px solid #F59E0B; }
.inv-stat-label { font-size:0.7rem; font-weight:700; color:var(--text-muted); letter-spacing:1px; }
.inv-stat-value { font-size:1.8rem; font-weight:900; margin-top:4px; }
.inv-stat-value.blue  { color:#3B82F6; }
.inv-stat-value.green { color:#10B981; }
.inv-stat-value.red   { color:#F43F5E; }
.inv-stat-value.amber { color:#F59E0B; }
.inv-header-actions { display:flex; gap:8px; }
.btn-export-csv { padding:10px 18px; background:linear-gradient(135deg,#10B981,#059669); border:none; border-radius:12px; color:white; font-weight:700; font-size:0.85rem; cursor:pointer; font-family:inherit; }
.inv-pagination { display:flex; justify-content:space-between; align-items:center; padding:16px; border-top:1px solid var(--border); }
.inv-page-info { font-size:0.78rem; color:var(--muted); font-weight:500; }
.inv-page-btns { display:flex; gap:8px; }
.sort-icon { font-size:0.7rem; margin-left:4px; opacity:0.5; }
.th-sortable { cursor:pointer; user-select:none; }
.dash-activity-grid { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
.dash-activity-card { height:420px; }
.dash-activity-header { display:flex; justify-content:space-between; align-items:center; padding:20px; border-bottom:1px solid var(--border); flex-shrink:0; }
.dash-activity-body { overflow-y:auto; flex:1; padding:16px; }
.dash-filter-btns { display:flex; gap:4px; }

/* ===== COMMON SECTION STATS ===== */
.section-stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:20px; }
.sec-stat { border-radius:16px; padding:20px; border-top-width:3px; border-top-style:solid; }
.sec-stat-label { font-size:0.72rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:0.08em; margin-bottom:8px; }
.sec-stat-value { font-size:2rem; font-weight:800; }
.sec-stat.amber { background:rgba(245,158,11,0.08); border-color:rgba(245,158,11,0.2); border-top-color:#F59E0B; }
.sec-stat.amber .sec-stat-value { color:#F59E0B; }
.sec-stat.blue  { background:rgba(59,130,246,0.08); border-color:rgba(59,130,246,0.2); border-top-color:#3B82F6; }
.sec-stat.blue  .sec-stat-value { color:#3B82F6; }
.sec-stat.green { background:rgba(16,185,129,0.08); border-color:rgba(16,185,129,0.2); border-top-color:#10B981; }
.sec-stat.green .sec-stat-value { color:#10B981; }
.sec-stat.red   { background:rgba(244,63,94,0.08); border-color:rgba(244,63,94,0.2); border-top-color:#F43F5E; }
.sec-stat.red   .sec-stat-value { color:#F43F5E; }
.sec-stat.purple{ background:rgba(168,85,247,0.08); border-color:rgba(168,85,247,0.2); border-top-color:#a855f7; }
.sec-stat.purple .sec-stat-value { color:#a855f7; }

/* ===== FILTER/TIME BUTTONS ===== */
.filter-btn { padding:7px 16px; border-radius:20px; font-size:0.8rem; font-weight:600; cursor:pointer; font-family:inherit; border:1px solid var(--border); background:transparent; color:var(--muted); }
.filter-btn.active-amber { border-color:rgba(245,158,11,0.5); background:rgba(245,158,11,0.12); color:#F59E0B; }

/* ===== PAGINATION ===== */
.table-pagination { display:flex; justify-content:space-between; align-items:center; padding:14px 16px; border-top:1px solid var(--border); }
.table-pagination-info { font-size:0.78rem; color:var(--muted); }
.table-pagination-btns { display:flex; gap:8px; }
.table-pagination-btn { padding:6px 16px; border-radius:8px; border:1px solid var(--border); background:transparent; color:var(--muted); font-size:0.8rem; cursor:pointer; font-family:inherit; }

/* ===== SEARCH BAR ===== */
.section-search { position:relative; min-width:220px; }
.section-search i { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--muted); font-size:0.8rem; }
.section-search input { width:100%; padding:9px 12px 9px 34px; background:var(--surface2); border:1px solid var(--border); border-radius:10px; color:var(--text); font-size:0.85rem; font-family:inherit; outline:none; }

/* ===== TRANSACTION ===== */
.txn-wrap { max-width:560px; margin:0 auto; }
.txn-card { padding:32px; margin-bottom:24px; }
.txn-title { font-family:'Rajdhani',sans-serif; font-size:1.5rem; font-weight:700; color:var(--navy2); margin-bottom:4px; }
.txn-subtitle { font-size:0.85rem; color:var(--muted); margin-bottom:24px; }
.txn-stock-info { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:16px; padding:16px; border-radius:12px; background:#f8f9fc; border:1px solid var(--border); }
.txn-stock-label { font-size:0.7rem; color:var(--muted); font-weight:700; text-transform:uppercase; margin-bottom:4px; }
.txn-stock-value { font-weight:700; font-size:1.2rem; font-family:monospace; color:var(--navy); }
.txn-unit-value { font-weight:700; color:var(--navy); }
.txn-qty-input { font-family:monospace; font-weight:700; font-size:1.1rem; }
.txn-confirm-btn { width:100%; padding:12px; border-radius:10px; border:none; background:var(--navy2); color:#fff; font-weight:700; font-size:0.95rem; cursor:pointer; font-family:inherit; }

/* ===== ADMIN EDIT ===== */
.admin-tabs { display:flex; gap:4px; margin-bottom:20px; background:var(--surface2); padding:4px; border-radius:10px; width:fit-content; }
.admin-tab-btn { padding:8px 20px; border-radius:8px; border:none; background:transparent; color:var(--muted); font-weight:600; font-size:0.85rem; cursor:pointer; font-family:inherit; }
.admin-tab-btn.active { background:var(--navy); color:#fff; font-weight:700; }
.masters-stat-cards { display:grid; grid-template-columns:1fr 1fr 1fr 1fr; gap:16px; margin-bottom:24px; }
.master-stat-card { background:var(--card-bg); border:1px solid var(--border); border-radius:16px; padding:20px; cursor:pointer; transition:all .2s; }
.master-stat-card:hover { transform:translateY(-2px); }
.master-stat-label { font-size:0.7rem; font-weight:700; color:var(--text-muted); letter-spacing:1px; margin-bottom:8px; }
.master-stat-value { font-size:2rem; font-weight:900; }
.master-stat-sub { font-size:0.75rem; color:var(--muted); margin-top:4px; }
.po-header-btn { padding:10px 22px; background:linear-gradient(135deg,#F59E0B,#D97706); border:none; border-radius:12px; color:#0D1117; font-weight:800; font-size:0.9rem; cursor:pointer; display:flex; align-items:center; gap:8px; font-family:inherit; }

/* ===== PO APPROVAL LOCK ===== */
.lock-screen { display:flex; align-items:center; justify-content:center; min-height:60vh; }
.lock-card { background:white; border-radius:20px; padding:48px; text-align:center; width:100%; max-width:420px; box-shadow:0 8px 32px rgba(0,0,0,0.08); }
.lock-icon { font-size:3rem; margin-bottom:16px; }
.lock-title { font-size:1.3rem; font-weight:800; color:var(--text); margin-bottom:8px; }
.lock-subtitle { font-size:0.85rem; color:var(--muted); margin-bottom:24px; }
.lock-input { margin-bottom:12px; text-align:center; }
.lock-btn { width:100%; padding:13px; background:#1a2332; border:none; border-radius:10px; color:white; font-size:0.95rem; font-weight:700; cursor:pointer; font-family:inherit; }

/* ===== MODALS ===== */
.legacy-modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.75); z-index:9999; align-items:center; justify-content:center; padding:20px; }
.legacy-modal-box { background:#fff; border:1px solid var(--border); border-radius:20px; padding:32px; width:100%; max-height:92vh; overflow-y:auto; }
.modal-section-label { font-size:0.72rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:0.1em; margin-bottom:12px; text-align:center; }
.modal-field-label { display:block; font-size:0.72rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:0.08em; margin-bottom:8px; }
.modal-select { width:100%; padding:11px 14px; background:var(--surface2); border:1px solid var(--border); border-radius:10px; color:var(--text); font-size:0.88rem; font-family:inherit; outline:none; appearance:none; }
.modal-divider { border-top:1px solid var(--border); margin:20px 0 14px; padding-top:16px; }
.modal-people-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:14px; }
.modal-submit-btn { width:100%; padding:14px; border:none; border-radius:12px; background:linear-gradient(135deg,#F59E0B,#D97706); color:#0D1117; font-size:0.95rem; font-weight:800; cursor:pointer; font-family:inherit; display:flex; align-items:center; justify-content:center; gap:8px; margin-top:8px; }
.modal-close-btn { background:var(--surface2); border:none; border-radius:8px; width:32px; height:32px; color:var(--muted); cursor:pointer; font-size:1rem; }
.edit-tab-btn { padding:16px; border:none; background:transparent; color:var(--muted); font-size:0.88rem; font-weight:700; cursor:pointer; border-bottom:2px solid transparent; font-family:inherit; }
.edit-tab-btn.active { color:var(--gold); border-bottom-color:var(--gold); }
.modal-section-divider { font-size:0.85rem; font-weight:700; color:var(--text); margin-bottom:14px; padding-bottom:8px; border-bottom:1px solid var(--border); }
.item-img-box { background:var(--surface2); border:2px dashed var(--border); border-radius:14px; padding:20px; text-align:center; margin-bottom:10px; min-height:160px; display:flex; flex-direction:column; align-items:center; justify-content:center; }

/* ===== HISTORY MODAL ===== */
.hist-modal-box { background:#1a2d47; }
.hist-modal-header { display:flex; justify-content:space-between; align-items:flex-start; padding:24px 28px 16px; }
.hist-modal-title { font-size:1.2rem; font-weight:800; color:#e2e8f0; margin-bottom:4px; }
.hist-sku-label { font-size:0.88rem; font-weight:700; color:var(--gold); }
.hist-close-btn { background:#2d3f55; border:none; border-radius:8px; width:32px; height:32px; color:#94a3b8; cursor:pointer; font-size:1rem; display:flex; align-items:center; justify-content:center; }
.hist-modal-filters { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; padding:0 28px 16px; border-bottom:1px solid #2d3f55; }
.hist-filter-btn { padding:7px 16px; border-radius:8px; background:#2d3f55; color:#94a3b8; border:1px solid #3d5068; font-size:0.8rem; font-weight:600; cursor:pointer; font-family:inherit; }
.hist-filter-btn.active { background:var(--gold); color:#0d1b2a; border-color:var(--gold); }
.hist-date-label { font-size:0.72rem; color:#64748b; font-weight:600; }
.hist-date-input { background:#2d3f55; border:1px solid #3d5068; border-radius:8px; padding:5px 10px; color:#e2e8f0; font-size:0.78rem; font-family:inherit; outline:none; }
.hist-table { width:100%; border-collapse:collapse; font-size:0.82rem; }
.hist-thead-row { border-bottom:1px solid #2d3f55; }
.hist-th { padding:12px 16px; text-align:left; color:#64748b; font-size:0.7rem; font-weight:700; text-transform:uppercase; letter-spacing:0.08em; }
.hist-modal-footer { display:flex; justify-content:space-between; align-items:center; padding:14px 28px; border-top:1px solid #2d3f55; }
.hist-record-count { font-size:0.78rem; color:#64748b; font-weight:500; }
.hist-page-btn { padding:6px 16px; border-radius:8px; background:#2d3f55; border:1px solid #3d5068; color:#94a3b8; font-size:0.8rem; cursor:pointer; font-family:inherit; }

/* ===== VENDOR MODAL ===== */
.vendor-modal-overlay { display:none; position:fixed; inset:0; background:rgba(8,18,35,.6); z-index:9000; align-items:center; justify-content:center; padding:16px; backdrop-filter:blur(2px); }
.vendor-modal-box { background:#fff; border-radius:14px; padding:28px; max-width:520px; width:100%; box-shadow:0 24px 80px rgba(0,0,0,.25); animation:fadeIn .2s ease; }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .page-title { font-size: 1.25rem; }
  .dash-stats-grid { grid-template-columns:repeat(2,1fr); }
  .dash-activity-grid { grid-template-columns:1fr; }
}

/* ===== TOPBAR ===== */
.topbar{background:linear-gradient(135deg,var(--navy) 0%,var(--navy3) 100%);color:#fff;height:58px;display:flex;align-items:center;justify-content:space-between;padding:0 18px;position:sticky;top:0;z-index:300;box-shadow:0 2px 20px rgba(0,0,0,.35);}
.tb-brand{display:flex;align-items:center;gap:10px;flex-shrink:0;}
.tb-logo{font-family:'Rajdhani',sans-serif;font-size:1.2rem;font-weight:700;letter-spacing:.5px;color:#fff;}
.tb-ver{background:var(--orange);color:#fff;font-size:.55rem;padding:2px 7px;border-radius:20px;letter-spacing:2px;text-transform:uppercase;font-weight:800;}
.tb-sync{font-size:.65rem;color:rgba(255,255,255,.5);margin-left:8px;}
.tb-nav{display:flex;gap:1px;align-items:center;overflow-x:auto;flex:1;margin:0 10px;}
.nb{background:transparent;border:none;color:rgba(255,255,255,.65);font-family:'DM Sans',sans-serif;font-size:.76rem;padding:6px 10px;border-radius:6px;cursor:pointer;transition:.15s;font-weight:500;white-space:nowrap;position:relative;}
.nb:hover{background:rgba(255,255,255,.14);color:#fff;}
.tnav-item {
  display:flex; align-items:center; gap:6px;
  padding:6px 10px; border-radius:8px; cursor:pointer;
  color:rgba(255,255,255,0.65); font-size:0.78rem; font-weight:500;
  transition:all 0.18s; white-space:nowrap; flex-shrink:0;
}
.tnav-item:hover { background:rgba(255,255,255,0.10); color:#fff; }
.tnav-item i { font-size:0.78rem; }
.tnav-active{background:rgba(232,80,10,0.20)!important;color:#fff!important;border:1px solid rgba(232,80,10,0.40)!important;}
.nb.tnav-active{background:rgba(232,80,10,0.20)!important;color:#fff!important;}
/* Orders dropdown */
#orders-dropdown, #txn-dropdown {
  position:fixed; top:62px; left:auto;
  background:linear-gradient(135deg,#0f2540,#1a3a5c);
  border:1px solid rgba(255,255,255,0.12);
  border-radius:10px; box-shadow:0 8px 32px rgba(0,0,0,0.30);
  z-index:999; min-width:180px; padding:6px;
  display:none;
}
.tnav-drop-item {
  display:flex; align-items:center; gap:8px;
  padding:8px 12px; border-radius:8px; cursor:pointer;
  color:rgba(255,255,255,0.75); font-size:0.82rem; font-weight:500;
  transition:all 0.15s;
}
.tnav-drop-item:hover { background:rgba(255,255,255,0.10); color:#fff; }
/* nav-scroll no scrollbar */
#nav-scroll-row::-webkit-scrollbar { display:none; }
#nav-scroll-row { scrollbar-width:none; }

/* ===== TOPBAR USER SECTION ===== */
.tb-user {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  border-left: 1px solid rgba(255,255,255,0.10);
  padding-left: 12px;
  margin-left: 6px;
}
.tb-avatar {
  height: 28px;
  width: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.15);
}
.tb-uname {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.tb-urole {
  font-size: 0.62rem;
  color: var(--orange2);
}
.tb-logout {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.18s;
}
.tb-logout:hover {
  background: rgba(220,38,38,0.3);
  color: #fff;
}

/* ===== MAIN CONTENT ===== */
.main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 14px;
}
#loader {
  position: fixed;
  top: 58px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 400;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.view-section {
  display: none;
}
.view-section.active {
  display: block;
  animation: fadeIn 0.22s ease;
}

/* ===== PAGE LAYOUT FIX ===== */
.page-header { display:flex; flex-direction:row; justify-content:space-between; align-items:center; margin-bottom:22px; flex-wrap:wrap; gap:10px; }
.page-header > div { text-align:left; }
.flex-col { flex-direction:column; }
.flex-col.page-header { flex-direction:row !important; }
.max-w-xl { max-width:580px; }
.max-w-2xl { max-width:760px; }
.mx-auto { margin-left:auto; margin-right:auto; }
.p-8 { padding:32px; }
.p-6 { padding:24px; }
.p-5 { padding:20px; }
.p-4 { padding:16px; }
.mb-6 { margin-bottom:24px; }
.mb-4 { margin-bottom:16px; }
.mb-1 { margin-bottom:4px; }
.mt-1 { margin-top:4px; }
.grid { display:grid; }
.grid-cols-2 { grid-template-columns:repeat(2,1fr); }
.grid-cols-3 { grid-template-columns:repeat(3,1fr); }
.gap-5 { gap:20px; }
.gap-4 { gap:16px; }
.gap-3 { gap:12px; }
.gap-2 { gap:8px; }
.gap-1 { gap:4px; }
.flex { display:flex; }
.flex-col { flex-direction:column; }
.flex-1 { flex:1; }
.flex-wrap { flex-wrap:wrap; }
.items-center { align-items:center; }
.items-start { align-items:flex-start; }
.justify-between { justify-content:space-between; }
.justify-center { justify-content:center; }
.justify-end { justify-content:flex-end; }
.w-full { width:100%; }
.overflow-hidden { overflow:hidden; }
.overflow-x-auto { overflow-x:auto; }
.overflow-y-auto { overflow-y:auto; }
.whitespace-nowrap { white-space:nowrap; }
.text-center { text-align:center; }
.text-right { text-align:right; }
.text-xs { font-size:0.75rem; }
.text-sm { font-size:0.85rem; }
.text-2xl { font-size:1.5rem; }
.text-3xl { font-size:1.875rem; }
.font-bold { font-weight:700; }
.font-semibold { font-weight:600; }
.uppercase { text-transform:uppercase; }
.tracking-wide { letter-spacing:0.05em; }
.rounded-xl { border-radius:12px; }
.border-b { border-bottom:1px solid var(--border); }
.border-t { border-top:1px solid var(--border); }
.relative { position:relative; }
.absolute { position:absolute; }
.left-3 { left:12px; }
.top-1\/2 { top:50%; }
.-translate-y-1\/2 { transform:translateY(-50%); }
.pl-9 { padding-left:36px; }
.py-2 { padding-top:8px; padding-bottom:8px; }
.py-3 { padding-top:12px; padding-bottom:12px; }
.px-3 { padding-left:12px; padding-right:12px; }
.w-auto { width:auto; }
.min-w-48 { min-width:192px; }
.space-y-0 > * + * { margin-top:0; }
.flex-shrink-0 { flex-shrink:0; }
.min-w-0 { min-width:0; }
.truncate { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.block { display:block; }
.hidden { display:none; }
.mr-2 { margin-right:8px; }
.ml-2 { margin-left:8px; }
.py-4 { padding-top:16px; padding-bottom:16px; }
.py-1\.5 { padding-top:6px; padding-bottom:6px; }
.px-8 { padding-left:32px; padding-right:32px; }
.text-base { font-size:1rem; }
.justify-content-center { justify-content:center; }
.md\:flex-row { flex-direction:row; }
.lg\:grid-cols-2 { grid-template-columns:repeat(2,1fr); }
.gap-6 { gap:24px; }
.p-4 { padding:16px; }
.flex-col { flex-direction:column; }
.md\:grid-cols-2 { grid-template-columns:repeat(2,1fr); }
.grid-cols-1 { grid-template-columns:1fr; }

/* PO items table — number spinners hide (numbers poore dikhein) */
.po-items-table input[type=number]::-webkit-inner-spin-button,
.po-items-table input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.po-items-table input[type=number] { -moz-appearance: textfield; appearance: textfield; }