/* ============================================================
   PORTWEST IMS — Design System
   Aesthetic: Refined Industrial · Precision Craft
   Fonts: DM Sans (body) + DM Mono (data) + Hind Siliguri (Bengali)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&family=Hind+Siliguri:wght@400;500;600;700&display=swap');

/* ─── Tokens ─────────────────────────────────────────────── */
:root {
  --brand:        #0F4C81;
  --brand-light:  #1A6BB5;
  --brand-ghost:  #E8F1FB;
  --accent:       #E85D26;
  --accent-ghost: #FEF0EA;
  --success:      #1A9C6B;
  --success-bg:   #E8F7F2;
  --warning:      #C47B00;
  --warning-bg:   #FEF7E6;
  --danger:       #C9342A;
  --danger-bg:    #FCECEA;
  --info:         #1A6BB5;
  --info-bg:      #E8F1FB;

  --bg:           #F6F7F9;
  --surface:      #FFFFFF;
  --surface-2:    #F0F2F5;
  --border:       #E2E6EC;
  --border-strong:#C8CDD6;

  --text-primary: #111827;
  --text-secondary:#4B5563;
  --text-muted:   #9CA3AF;
  --text-inverted:#FFFFFF;

  --sidebar-w:    240px;
  --header-h:     60px;

  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    14px;
  --radius-xl:    20px;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:    0 12px 32px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.06);

  --font-body:    'DM Sans', 'Hind Siliguri', sans-serif;
  --font-mono:    'DM Mono', monospace;
  --font-bn:      'Hind Siliguri', sans-serif;

  --transition:   all .18s cubic-bezier(.4,0,.2,1);
}

/* Dark mode */
[data-theme="dark"] {
  --bg:           #0D1117;
  --surface:      #161B22;
  --surface-2:    #1E252E;
  --border:       #30363D;
  --border-strong:#484F58;
  --text-primary: #E6EDF3;
  --text-secondary:#8B949E;
  --text-muted:   #484F58;
  --brand-ghost:  #0F2A45;
  --accent-ghost: #3A1A0A;
  --success-bg:   #0A2A1E;
  --warning-bg:   #2A1E08;
  --danger-bg:    #2A0E0C;
  --info-bg:      #0F2A45;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.3);
  --shadow-md:    0 4px 12px rgba(0,0,0,.4);
  --shadow-lg:    0 12px 32px rgba(0,0,0,.5);
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background .3s, color .3s;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-light); }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ─── Bengali language ───────────────────────────────────── */
[lang="bn"], .bn { font-family: var(--font-bn) !important; }
body.lang-bn .en { display: none !important; }
body.lang-bn .bn { display: inline !important; }
body:not(.lang-bn) .bn { display: none !important; }
body:not(.lang-bn) .en { display: inline !important; }

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

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform .25s ease;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-brand {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 32px; height: 32px;
  background: var(--brand);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.5px;
  flex-shrink: 0;
}
.brand-text { line-height: 1.2; }
.brand-name { font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: -.2px; }
.brand-sub  { font-size: 10px; color: var(--text-muted); font-weight: 400; letter-spacing: .5px; text-transform: uppercase; }

.sidebar-role {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.role-selector {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}
.role-selector:focus { border-color: var(--brand); }

.nav-section-label {
  padding: 14px 16px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  border-radius: 0;
  position: relative;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
.nav-item:hover { background: var(--brand-ghost); color: var(--brand); }
.nav-item.active {
  background: var(--brand-ghost);
  color: var(--brand);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--brand);
  border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  line-height: 1.4;
}
.nav-badge.warning { background: var(--warning); }
.nav-badge.info    { background: var(--info); }

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 32px; height: 32px;
  background: var(--brand);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: var(--text-muted); }

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

/* ─── Top bar ────────────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.page-title { font-size: 17px; font-weight: 700; color: var(--text-primary); letter-spacing: -.3px; }
.page-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

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

/* ─── 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: 1.5px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  outline: none;
  font-family: inherit;
  cursor: pointer;
}
.btn:active { transform: scale(.98); }
.btn-primary   { background: var(--brand); color: white; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-light); border-color: var(--brand-light); }
.btn-secondary { background: var(--surface); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-danger    { background: var(--danger); color: white; border-color: var(--danger); }
.btn-success   { background: var(--success); color: white; border-color: var(--success); }
.btn-warning   { background: var(--warning); color: white; border-color: var(--warning); }
.btn-ghost     { background: transparent; color: var(--brand); border-color: transparent; }
.btn-ghost:hover { background: var(--brand-ghost); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface); color: var(--text-secondary); }
.btn-icon:hover { border-color: var(--border-strong); color: var(--text-primary); }

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ─── KPI cards ──────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border);
}
.kpi-card.danger::before  { background: var(--danger); }
.kpi-card.warning::before { background: var(--warning); }
.kpi-card.success::before { background: var(--success); }
.kpi-card.info::before    { background: var(--info); }
.kpi-label { font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.kpi-value { font-size: 32px; font-weight: 700; color: var(--text-primary); line-height: 1; margin-bottom: 6px; letter-spacing: -1px; font-family: var(--font-mono); }
.kpi-sub   { font-size: 12px; color: var(--text-muted); }
.kpi-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; margin-top: 6px; }
.kpi-trend.up   { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-icon { position: absolute; top: 16px; right: 16px; font-size: 22px; opacity: .15; }

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
}
.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-danger   { background: var(--danger-bg);  color: var(--danger); }
.badge-info     { background: var(--info-bg);    color: var(--info); }
.badge-neutral  { background: var(--surface-2);  color: var(--text-secondary); border: 1px solid var(--border); }
.badge-brand    { background: var(--brand-ghost); color: var(--brand); }
.badge-accent   { background: var(--accent-ghost); color: var(--accent); }

/* ─── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { border-bottom: 2px solid var(--border); }
th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  white-space: nowrap;
  background: var(--surface-2);
}
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--brand-ghost); }
.td-primary { font-weight: 600; color: var(--text-primary); }
.td-mono { font-family: var(--font-mono); font-size: 12px; }

/* ─── Form elements ──────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-primary); margin-bottom: 5px; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,76,129,.1); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ─── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: rgba(201,52,42,.2); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(196,123,0,.2); }
.alert-success { background: var(--success-bg); color: var(--success); border-color: rgba(26,156,107,.2); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border-color: rgba(26,107,181,.2); }
.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-content { flex: 1; }
.alert-title { font-weight: 700; margin-bottom: 2px; }

/* ─── Tabs ───────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--border); gap: 0; margin-bottom: 20px; overflow-x: auto; }
.tab-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: var(--transition);
  font-family: inherit;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(12px) scale(.98);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: none; }
.modal-lg { max-width: 800px; }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.modal-close { background: none; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; line-height: 1; padding: 4px; border-radius: var(--radius-sm); transition: var(--transition); }
.modal-close:hover { background: var(--surface-2); color: var(--text-primary); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ─── Toast notifications ────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--text-primary);
  color: var(--surface);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideInUp .25s ease, fadeOut .3s 2.7s forwards;
  max-width: 340px;
}
.toast.success { background: var(--success); }
.toast.danger  { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes slideInUp { from { opacity:0; transform: translateY(16px); } to { opacity:1; transform: none; } }
@keyframes fadeOut   { from { opacity:1; } to { opacity:0; pointer-events:none; } }

/* ─── Progress / stock bars ──────────────────────────────── */
.progress { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 4px; transition: width .6s ease; }
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger  { background: var(--danger); }
.progress-bar.info    { background: var(--info); }

/* ─── Filters bar ────────────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.search-wrap input { padding-left: 34px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 15px; pointer-events: none; }

/* ─── Status dot ─────────────────────────────────────────── */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.success { background: var(--success); }
.status-dot.warning { background: var(--warning); animation: pulse-dot 2s infinite; }
.status-dot.danger  { background: var(--danger);  animation: pulse-dot 1.5s infinite; }
.status-dot.info    { background: var(--info); }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ─── Separator ──────────────────────────────────────────── */
.sep { height: 1px; background: var(--border); margin: 20px 0; }

/* ─── Grid helpers ───────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.col-span-2 { grid-column: span 2; }

/* ─── Utility ────────────────────────────────────────────── */
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-8  { gap: 8px; }
.flex-gap-12 { gap: 12px; }
.flex-gap-16 { gap: 16px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-brand { color: var(--brand); }
.font-mono { font-family: var(--font-mono); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.w-full { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Dark mode toggle ───────────────────────────────────── */
.theme-toggle {
  width: 36px; height: 20px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  border: none;
  transition: background .2s;
  flex-shrink: 0;
}
.theme-toggle.on { background: var(--brand); }
.theme-toggle::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  background: white;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.theme-toggle.on::after { transform: translateX(16px); }

/* ─── Lang toggle ────────────────────────────────────────── */
.lang-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.lang-btn {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.lang-btn.active { background: var(--brand); color: white; }

/* ─── Sidebar mobile ─────────────────────────────────────── */
.menu-toggle { display: none; }
.sidebar-overlay { display: none; }

/* ─── Notification bell ──────────────────────────────────── */
.notif-btn {
  position: relative;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
}
.notif-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.notif-pip {
  position: absolute;
  top: -4px; right: -4px;
  width: 14px; height: 14px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}

/* ─── Price comparison widget ────────────────────────────── */
.price-cmp {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 12px 0;
}
.price-col { text-align: center; }
.price-label-sm { font-size: 10px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.price-val { font-size: 22px; font-weight: 700; font-family: var(--font-mono); color: var(--text-primary); }
.price-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.price-arrow { font-size: 20px; color: var(--text-muted); }
.price-delta {
  text-align: center;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.price-delta.positive { background: var(--danger-bg); color: var(--danger); }
.price-delta.negative { background: var(--success-bg); color: var(--success); }

/* ─── Animations ─────────────────────────────────────────── */
.animate-in { animation: fadeInUp .35s ease forwards; }
@keyframes fadeInUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
.stagger-1 { animation-delay: .05s; }
.stagger-2 { animation-delay: .10s; }
.stagger-3 { animation-delay: .15s; }
.stagger-4 { animation-delay: .20s; }
.stagger-5 { animation-delay: .25s; }

/* ─── Loading skeleton ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--surface-2) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); z-index: 300; }
  .sidebar.open { transform: none; }
  .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 290; }
  .main-wrap { margin-left: 0; }
  .menu-toggle { display: flex; }
  .grid-2, .grid-3, .grid-4, .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .price-cmp { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px; }
}
