/* ═══════════════════════════════════════════════════════════
   PO MONITORING SYSTEM — style.css
   Design: Modern Glassmorphism + Professional Dark/Light
═══════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  --primary:        #3b82f6;
  --primary-dark:   #2563eb;
  --primary-light:  #dbeafe;
  --secondary:      #8b5cf6;
  --success:        #10b981;
  --warning:        #f59e0b;
  --danger:         #ef4444;
  --orange:         #f97316;
  --info:           #06b6d4;

  --bg:             #f0f4f8;
  --surface:        #ffffff;
  --surface-2:      #f8fafc;
  --border:         #e2e8f0;
  --border-dark:    #cbd5e1;

  --text:           #1e293b;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;

  --sidebar-bg:     #0f172a;
  --sidebar-text:   #cbd5e1;
  --sidebar-active: #3b82f6;
  --sidebar-hover:  #1e293b;
  --sidebar-width:  260px;
  --topbar-h:       64px;

  --radius:         12px;
  --radius-sm:      8px;
  --shadow:         0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-md:      0 4px 6px rgba(0,0,0,.07), 0 10px 20px rgba(0,0,0,.08);
  --shadow-lg:      0 10px 25px rgba(0,0,0,.12), 0 20px 48px rgba(0,0,0,.10);
  --transition:     0.22s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
       background: var(--bg); color: var(--text); min-height: 100vh; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
img { max-width: 100%; }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ══════════════════════════════════════════════════════════
   LOGIN SCREEN
══════════════════════════════════════════════════════════ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}

/* Animated background shapes */
.login-bg-shapes { position: absolute; inset: 0; pointer-events: none; }
.shape {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(59,130,246,.15), rgba(139,92,246,.1));
  animation: float 6s ease-in-out infinite;
}
.shape-1 { width: 400px; height: 400px; top: -100px; left: -100px; animation-delay: 0s; }
.shape-2 { width: 300px; height: 300px; bottom: -80px; right: 10%; animation-delay: 2s; }
.shape-3 { width: 200px; height: 200px; top: 40%; right: -60px; animation-delay: 4s; }
@keyframes float {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

.login-card {
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 24px;
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 50px rgba(0,0,0,.5);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.logo-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(59,130,246,.4);
}
.login-logo h1 { color: white; font-size: 26px; font-weight: 700; letter-spacing: -.3px; }
.login-logo p { color: rgba(255,255,255,.5); font-size: 13px; margin-top: 4px; }

.login-card .form-group { margin-bottom: 18px; }
.login-card label {
  display: block;
  color: rgba(255,255,255,.7);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
}
.login-card input {
  width: 100%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: white;
  transition: var(--transition);
  outline: none;
}
.login-card input::placeholder { color: rgba(255,255,255,.3); }
.login-card input:focus {
  border-color: var(--primary);
  background: rgba(59,130,246,.1);
  box-shadow: 0 0 0 3px rgba(59,130,246,.2);
}
.input-with-toggle { position: relative; }
.input-with-toggle input { padding-right: 44px; }
.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.4);
  font-size: 15px;
  transition: color .2s;
}
.toggle-pw:hover { color: rgba(255,255,255,.7); }

.btn-login {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  margin-top: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(59,130,246,.4);
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(59,130,246,.5); }
.btn-login:active { transform: translateY(0); }
.login-error {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.3);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 13px;
  text-align: center;
}
.login-footer {
  text-align: center;
  margin-top: 24px;
  color: rgba(255,255,255,.3);
  font-size: 12px;
}

/* ══════════════════════════════════════════════════════════
   APP SHELL
══════════════════════════════════════════════════════════ */
.app-shell { display: flex; min-height: 100vh; }

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
}
.sidebar.collapsed { width: 70px; }
.sidebar.mobile-hidden { transform: translateX(-100%); }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  min-height: 70px;
}
.sidebar-logo { display: flex; align-items: center; gap: 12px; }
.sidebar-logo i { font-size: 24px; color: var(--primary); min-width: 32px; text-align: center; }
.sidebar-logo-text { overflow: hidden; white-space: nowrap; }
.logo-title { display: block; color: white; font-weight: 700; font-size: 16px; }
.logo-sub { color: rgba(255,255,255,.35); font-size: 11px; }
.sidebar-toggle {
  color: rgba(255,255,255,.4);
  font-size: 16px;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle:hover { color: white; background: rgba(255,255,255,.08); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  margin: 12px 8px;
  background: rgba(255,255,255,.04);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.06);
  overflow: hidden;
}
.user-avatar {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.user-info { overflow: hidden; white-space: nowrap; }
.user-name { display: block; color: white; font-weight: 600; font-size: 13px; }
.user-badge {
  display: inline-block;
  background: rgba(59,130,246,.2);
  color: #93c5fd;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  margin-top: 2px;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px; }
.nav-section-label {
  color: rgba(255,255,255,.25);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 16px 8px 6px;
  white-space: nowrap;
  overflow: hidden;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 2px;
}
.nav-item i { min-width: 20px; text-align: center; font-size: 16px; }
.nav-item:hover { background: var(--sidebar-hover); color: white; }
.nav-item.active { background: linear-gradient(135deg, rgba(59,130,246,.25), rgba(139,92,246,.15)); color: #93c5fd; border: 1px solid rgba(59,130,246,.25); }
.sidebar-footer { padding: 16px 8px; border-top: 1px solid rgba(255,255,255,.06); }
.btn-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.5);
  font-size: 14px;
  width: 100%;
  transition: var(--transition);
  white-space: nowrap;
  overflow: hidden;
}
.btn-logout i { min-width: 20px; text-align: center; }
.btn-logout:hover { background: rgba(239,68,68,.15); color: #fca5a5; }

/* ── MAIN CONTENT ───────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition);
}
.main-content.expanded { margin-left: 70px; }

/* ── TOPBAR ─────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-menu-btn { display: none; color: var(--text-muted); font-size: 20px; padding: 4px; }
.breadcrumb { font-size: 15px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.breadcrumb i { color: var(--primary); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-time { color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700;
}
.topbar-user-info { line-height: 1.3; }
.topbar-user-info span { display: block; font-weight: 600; font-size: 14px; }
.topbar-user-info small { color: var(--text-muted); font-size: 12px; }

/* ── PAGES ──────────────────────────────────────────────── */
.page { display: none; padding: 28px; animation: fadeIn .3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h2 { font-size: 22px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 10px; }
.page-header h2 i { color: var(--primary); }
.page-actions { display: flex; gap: 10px; }

/* ── STAT CARDS ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: white;
  flex-shrink: 0;
}
.stat-blue  .stat-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-green .stat-icon { background: linear-gradient(135deg, #10b981, #059669); }
.stat-orange .stat-icon { background: linear-gradient(135deg, #f97316, #ea580c); }
.stat-purple .stat-icon { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.stat-value { font-size: 32px; font-weight: 800; line-height: 1; }
.stat-blue   .stat-value { color: #3b82f6; }
.stat-green  .stat-value { color: #10b981; }
.stat-orange .stat-value { color: #f97316; }
.stat-purple .stat-value { color: #8b5cf6; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-wave {
  position: absolute;
  bottom: -10px; right: -10px;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: .07;
}
.stat-blue   .stat-wave { background: #3b82f6; }
.stat-green  .stat-wave { background: #10b981; }
.stat-orange .stat-wave { background: #f97316; }
.stat-purple .stat-wave { background: #8b5cf6; }

/* ── DASHBOARD GRID ─────────────────────────────────────── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── AGING BARS ─────────────────────────────────────────── */
.aging-bars { display: flex; flex-direction: column; gap: 20px; padding: 4px 0; }
.aging-item { display: flex; align-items: center; gap: 12px; }
.aging-label { width: 170px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; flex-shrink: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: #10b981; }
.dot-orange { background: #f59e0b; }
.dot-red { background: #ef4444; }
.aging-bar-wrap { flex: 1; height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.aging-bar { height: 100%; border-radius: 99px; transition: width .8s cubic-bezier(.4,0,.2,1); }
.bar-green  { background: linear-gradient(90deg, #10b981, #34d399); }
.bar-orange { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-red    { background: linear-gradient(90deg, #ef4444, #f87171); }
.aging-count { width: 28px; text-align: right; font-weight: 700; font-size: 15px; flex-shrink: 0; }

/* ── SEKTOR CHART ───────────────────────────────────────── */
.sektor-chart { display: flex; flex-direction: column; gap: 12px; }
.sektor-row { display: flex; align-items: center; gap: 10px; }
.sektor-name { width: 100px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.sektor-bar-wrap { flex: 1; height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.sektor-bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--secondary)); transition: width .8s; }
.sektor-nums { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ── CARD ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.card-header h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-header h3 i { color: var(--primary); }
.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }

/* ── FILTER BAR ─────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.search-wrap i {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.search-wrap input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: var(--transition);
}
.search-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.filter-bar select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  min-width: 150px;
}
.filter-bar select:focus { border-color: var(--primary); }

/* ── TABLE ──────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: rgba(59,130,246,.04); }
.table-footer { padding: 12px 16px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 13px; }
.loading-row { color: var(--text-muted); padding: 40px !important; }

/* ── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-muted   { background: #f1f5f9; color: #475569; }
.badge-purple  { background: #ede9fe; color: #5b21b6; }
.badge-orange  { background: #ffedd5; color: #9a3412; }

/* ── AGING BADGE ────────────────────────────────────────── */
.aging-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
}
.aging-normal  { background: #d1fae5; color: #065f46; }
.aging-warning { background: #fef3c7; color: #92400e; }
.aging-critical { background: #fee2e2; color: #991b1b; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; box-shadow: 0 2px 8px rgba(59,130,246,.35); }
.btn-primary:hover { box-shadow: 0 4px 14px rgba(59,130,246,.45); }
.btn-outline { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-warning { background: linear-gradient(135deg, var(--warning), #d97706); color: white; box-shadow: 0 2px 8px rgba(245,158,11,.3); }
.btn-danger  { background: linear-gradient(135deg, var(--danger), #dc2626); color: white; box-shadow: 0 2px 8px rgba(239,68,68,.3); }
.btn-success { background: linear-gradient(135deg, var(--success), #059669); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: var(--radius-sm); }

/* ── FORMS ──────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
.form-group input[readonly] { background: var(--bg); color: var(--text-muted); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.required { color: var(--danger); }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

/* ── UPLOAD ZONE ─────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-dark);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface-2);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(59,130,246,.05);
}
.upload-icon { font-size: 40px; color: var(--text-light); margin-bottom: 12px; }
.upload-text { font-size: 15px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.upload-hint { font-size: 12px; color: var(--text-light); }
.upload-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #dbeafe;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  border: 1px solid #93c5fd;
}
.file-icon { font-size: 28px; color: var(--danger); flex-shrink: 0; }
.file-info { flex: 1; overflow: hidden; }
.file-info span { display: block; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-remove-file {
  width: 28px; height: 28px;
  background: rgba(239,68,68,.1);
  color: var(--danger);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.btn-remove-file:hover { background: var(--danger); color: white; }
.existing-file {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 14px;
  background: #f0fdf4;
  border-radius: var(--radius-sm);
  border: 1px solid #86efac;
  font-size: 13px;
}
.existing-file i { color: var(--success); }
.existing-file a { color: var(--primary); font-weight: 600; text-decoration: underline; }
.upload-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 14px;
  background: #fefce8;
  border-radius: var(--radius-sm);
  border: 1px solid #fde68a;
  font-size: 12px;
  color: #78350f;
  line-height: 1.5;
}

/* ── ITEM TABLE ──────────────────────────────────────────── */
#itemTable input {
  width: 100%;
  padding: 6px 8px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  min-width: 80px;
}
#itemTable input:focus { border-color: var(--primary); outline: none; }

/* ── DETAIL PAGE ─────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-section { display: flex; flex-direction: column; gap: 20px; }
.detail-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-key { width: 160px; font-size: 13px; font-weight: 600; color: var(--text-muted); flex-shrink: 0; }
.detail-val { flex: 1; font-size: 14px; color: var(--text); }
.detail-items-card { grid-column: 1 / -1; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .2s;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-sm { max-width: 380px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.modal-header h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-header-danger { background: #fef2f2; }
.modal-header-danger h3 { color: var(--danger); }
.modal-close { width: 30px; height: 30px; border-radius: 8px; color: var(--text-muted); transition: var(--transition); display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.justify-center { justify-content: center; }
.confirm-icon { font-size: 40px; color: var(--danger); text-align: center; margin-bottom: 14px; margin-top: 8px; }

/* ── TOAST ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: #1e293b;
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  animation: slideUp .3s ease;
  max-width: 380px;
}
.toast-icon { font-size: 18px; }
.toast.toast-success .toast-icon { color: #34d399; }
.toast.toast-error   .toast-icon { color: #f87171; }
.toast.toast-warning .toast-icon { color: #fbbf24; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* ── UTILITIES ───────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 12px; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.d-none  { display: none !important; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar-menu-btn { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .page { padding: 16px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .search-wrap { min-width: 100%; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
