/* ═══════════════════════════════════════════════════════
   ABSAN MANUFACTURING ERP — GLOBAL STYLESHEET
   Color Scheme: Red (#DC2626) + White (#FFFFFF)
════════════════════════════════════════════════════════ */

:root {
  /* ── Red palette ── */
  --red-50:  #FFF1F1;
  --red-100: #FFE4E4;
  --red-200: #FECACA;
  --red-300: #FCA5A5;
  --red-400: #F87171;
  --red-500: #EF4444;
  --red-600: #DC2626;
  --red-700: #B91C1C;
  --red-800: #991B1B;
  --red-900: #7F1D1D;

  /* ── Neutrals ── */
  --gray-50:  #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* ── Semantic ── */
  --primary:        #DC2626;
  --primary-hover:  #B91C1C;
  --primary-light:  #FFF1F1;
  --white:          #ffffff;
  --text-primary:   #111827;
  --text-secondary: #6B7280;
  --text-muted:     #9CA3AF;
  --border:         #E5E7EB;
  --bg-page:        #F6F7FA;
  --bg-card:        #ffffff;

  /* ── Layout ── */
  --sidebar-w:      260px;
  --sidebar-coll-w: 72px;
  --header-h:       64px;

  /* ── Effects ── */
  --r-sm:  6px;
  --r:     8px;
  --r-lg:  12px;
  --r-xl:  16px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:    0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --shadow-md: 0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.05);
  --shadow-lg: 0 20px 25px rgba(0,0,0,.10), 0 10px 10px rgba(0,0,0,.04);
  --trans:     all .2s ease;
}

/* ════════════════════════════════════
   RESET & BASE
════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}
a  { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; outline: none; }
img { max-width: 100%; display: block; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ════════════════════════════════════
   SIDEBAR
════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: #0F1117;
  position: fixed;
  left: 0; top: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: width .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar.collapsed { width: var(--sidebar-coll-w); }

/* Header */
.sidebar-header {
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.sidebar-logo {
  width: 38px; height: 38px;
  object-fit: contain;
  border-radius: var(--r);
  flex-shrink: 0;
  /* the mark is brand red; the sidebar is near-black, so render it white */
  filter: brightness(0) invert(1);
  background: rgba(255,255,255,.08);
  padding: 4px;
}
.sidebar-brand { overflow: hidden; white-space: nowrap; }
.brand-name  { color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -.3px; display: block; }
.brand-sub   { color: rgba(255,255,255,.4); font-size: 11px; display: block; margin-top: 1px; }
.sidebar.collapsed .brand-name,
.sidebar.collapsed .brand-sub { opacity: 0; }

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}
.nav-group-label {
  color: rgba(255,255,255,.3);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 10px 4px;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar.collapsed .nav-group-label { opacity: 0; height: 0; padding: 0; margin: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r);
  color: rgba(255,255,255,.55);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--trans);
  margin-bottom: 1px;
  white-space: nowrap;
  position: relative;
  user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.nav-item.active { background: var(--red-600); color: #fff; }
.nav-item.active:hover { background: var(--red-700); }
.nav-item i { width: 18px; text-align: center; flex-shrink: 0; font-size: 14px; }
.nav-item span { overflow: hidden; transition: opacity .2s; }
.sidebar.collapsed .nav-item span { opacity: 0; width: 0; }

.nav-pill {
  margin-left: auto;
  background: var(--red-500);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar.collapsed .nav-pill { display: none; }

/* Footer */
.sidebar-footer {
  padding: 12px 8px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r);
  cursor: pointer;
  transition: var(--trans);
}
.sidebar-user:hover { background: rgba(255,255,255,.07); }
.user-avatar-sm {
  width: 32px; height: 32px;
  background: var(--red-600);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-username { color: rgba(255,255,255,.8); font-size: 13px; font-weight: 500; display: block; white-space: nowrap; }
.sidebar-role     { color: rgba(255,255,255,.35); font-size: 11px; display: block; white-space: nowrap; }
.sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; }

/* ════════════════════════════════════
   MAIN WRAPPER
════════════════════════════════════ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .3s cubic-bezier(.4,0,.2,1);
}
.sidebar.collapsed ~ .main-wrapper { margin-left: var(--sidebar-coll-w); }

/* ════════════════════════════════════
   TOP HEADER
════════════════════════════════════ */
.top-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-xs);
}
.sidebar-toggle {
  width: 36px; height: 36px;
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  transition: var(--trans);
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--gray-100); color: var(--gray-800); }
.header-breadcrumb { flex: 1; }
.page-title { font-size: 17px; font-weight: 700; color: var(--gray-900); }

.header-right { display: flex; align-items: center; gap: 6px; }
.header-icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  transition: var(--trans);
  position: relative;
}
.header-icon-btn:hover { background: var(--gray-100); color: var(--gray-800); }
.header-icon-btn .fa-file-excel { color: #217346; }
.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--red-500);
  border-radius: 50%;
  border: 2px solid white;
}
.header-user {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--trans);
  margin-left: 4px;
}
.header-user:hover { background: var(--gray-100); }
.user-avatar {
  width: 32px; height: 32px;
  background: var(--red-600);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.user-label { font-size: 13px; font-weight: 500; color: var(--gray-700); }

/* ════════════════════════════════════
   CONTENT AREA
════════════════════════════════════ */
.content-area { flex: 1; padding: 24px; overflow-y: auto; }
.page-loading { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.page-loading p { margin-top: 12px; font-size: 13px; }

/* ════════════════════════════════════
   CARDS
════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.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: 14.5px; font-weight: 600; color: var(--gray-800);
  display: flex; align-items: center; gap: 8px;
}
.card-title i { color: var(--primary); font-size: 14px; }
.card-actions { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }
.card-body-sm { padding: 14px 20px; }

/* ════════════════════════════════════
   KPI CARDS
════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-xs);
  transition: var(--trans);
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--primary);
  opacity: 0;
  transition: opacity .2s;
}
.kpi-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi-card:hover::before { opacity: 1; }
.kpi-card.primary {
  background: linear-gradient(135deg, var(--red-600) 0%, var(--red-800) 100%);
  border-color: transparent;
  color: white;
}
.kpi-card.primary::before { display: none; }

.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; }
.kpi-label {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-secondary);
}
.kpi-card.primary .kpi-label { color: rgba(255,255,255,.7); }

.kpi-icon {
  width: 40px; height: 40px;
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.kpi-icon.red    { background: var(--red-50);   color: var(--red-600); }
.kpi-icon.blue   { background: #EFF6FF;          color: #2563EB; }
.kpi-icon.green  { background: #F0FDF4;          color: #16A34A; }
.kpi-icon.yellow { background: #FFFBEB;          color: #D97706; }
.kpi-icon.purple { background: #FAF5FF;          color: #9333EA; }
.kpi-icon.white  { background: rgba(255,255,255,.2); color: white; }

.kpi-value {
  font-size: 30px; font-weight: 800;
  color: var(--gray-900); line-height: 1;
  letter-spacing: -1px;
}
.kpi-card.primary .kpi-value { color: white; }

.kpi-footer { display: flex; align-items: center; gap: 6px; }
.kpi-trend {
  display: flex; align-items: center; gap: 3px;
  font-size: 12px; font-weight: 600;
  padding: 2px 7px; border-radius: 4px;
}
.kpi-trend.up   { color: #16A34A; background: #F0FDF4; }
.kpi-trend.down { color: #DC2626; background: var(--red-50); }
.kpi-trend.flat { color: var(--gray-500); background: var(--gray-100); }
.kpi-card.primary .kpi-trend { color: white; background: rgba(255,255,255,.2); }
.kpi-period { color: var(--text-muted); font-size: 11.5px; }
.kpi-card.primary .kpi-period { color: rgba(255,255,255,.55); }

/* ════════════════════════════════════
   LAYOUT GRIDS
════════════════════════════════════ */
.grid-2   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* ════════════════════════════════════
   DATA TABLES
════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table.dt {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.dt thead th {
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.dt tbody tr { border-bottom: 1px solid var(--gray-100); transition: background .1s; }
.dt tbody tr:last-child { border-bottom: none; }
.dt tbody tr:hover { background: #FAFBFE; }
.dt tbody td {
  padding: 11px 14px;
  color: var(--gray-700);
  vertical-align: middle;
}
.dt .num { text-align: right; font-variant-numeric: tabular-nums; }
.dt .actions { text-align: right; width: 90px; }
.no-data-row td {
  text-align: center;
  padding: 48px 16px !important;
  color: var(--text-muted);
  font-size: 13px;
}

/* ════════════════════════════════════
   BADGES
════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11.5px; font-weight: 500;
  white-space: nowrap;
}
.badge-red    { background: var(--red-50);   color: var(--red-700); }
.badge-green  { background: #F0FDF4;         color: #166534; }
.badge-blue   { background: #EFF6FF;         color: #1D4ED8; }
.badge-yellow { background: #FFFBEB;         color: #92400E; }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }
.badge-purple { background: #FAF5FF;         color: #7E22CE; }
.badge-teal   { background: #F0FDFA;         color: #0F766E; }

/* ════════════════════════════════════
   BUTTONS
════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: var(--r);
  font-size: 13.5px; font-weight: 500;
  transition: var(--trans);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.4;
}
.btn-sm  { padding: 5px 11px; font-size: 12.5px; }
.btn-lg  { padding: 10px 22px; font-size: 14.5px; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

.btn-primary  { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-outline  { background: white; color: var(--gray-700); border-color: var(--border); }
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-300); }

.btn-ghost    { background: none; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }

.btn-danger   { background: var(--red-50); color: var(--red-700); border-color: var(--red-200); }
.btn-danger:hover { background: var(--red-100); }

.btn-success  { background: #F0FDF4; color: #166534; border-color: #BBF7D0; }
.btn-success:hover { background: #DCFCE7; }

.btn-dark     { background: var(--gray-800); color: white; border-color: var(--gray-800); }
.btn-dark:hover { background: var(--gray-900); }

/* ════════════════════════════════════
   FORMS
════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-label .req { color: var(--primary); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 13.5px;
  color: var(--gray-900);
  background: white;
  transition: var(--trans);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled { background: var(--gray-50); color: var(--gray-400); cursor: not-allowed; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 34px;
}
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-hint  { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

/* ════════════════════════════════════
   SECTION HEADER
════════════════════════════════════ */
.section-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-titles { display: flex; flex-direction: column; gap: 3px; }
.section-title    { font-size: 20px; font-weight: 700; color: var(--gray-900); }
.section-subtitle { font-size: 13px; color: var(--text-secondary); }
.section-actions  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ════════════════════════════════════
   SEARCH BAR
════════════════════════════════════ */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}
.search-wrap i {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 13px;
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 13.5px;
  background: white;
  transition: var(--trans);
}
.search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}

/* ════════════════════════════════════
   TABS
════════════════════════════════════ */
.tab-bar {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 16px;
  font-size: 13.5px; font-weight: 500;
  color: var(--text-secondary);
  border: none; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--trans);
  background: none;
  cursor: pointer;
}
.tab-btn:hover { color: var(--gray-700); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ════════════════════════════════════
   ALERTS
════════════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: var(--r);
  font-size: 13.5px;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 12px;
  border-width: 1px; border-style: solid;
}
.alert i { flex-shrink: 0; margin-top: 1px; }
.alert-red    { background: var(--red-50);   color: var(--red-800);   border-color: var(--red-200); }
.alert-yellow { background: #FFFBEB;         color: #92400E;          border-color: #FDE68A; }
.alert-green  { background: #F0FDF4;         color: #166534;          border-color: #BBF7D0; }
.alert-blue   { background: #EFF6FF;         color: #1E40AF;          border-color: #BFDBFE; }

/* ════════════════════════════════════
   MODAL
════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 620px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  animation: modalIn .22s ease;
}
.modal-lg  { max-width: 860px; }
.modal-xl  { max-width: 1060px; }
.modal-sm  { max-width: 420px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.modal-close-btn {
  width: 32px; height: 32px;
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-400);
  transition: var(--trans);
}
.modal-close-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* ════════════════════════════════════
   TOASTS
════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--gray-900);
  color: white;
  padding: 12px 18px;
  border-radius: var(--r-lg);
  font-size: 13.5px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-md);
  animation: toastIn .3s ease;
  min-width: 280px; max-width: 380px;
  border-left: 4px solid rgba(255,255,255,.3);
}
.toast.success { background: #166534; border-left-color: #4ADE80; }
.toast.error   { background: var(--red-700); border-left-color: #FCA5A5; }
.toast.warning { background: #92400E; border-left-color: #FCD34D; }
.toast.info    { background: #1E3A5F; border-left-color: #60A5FA; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(80px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ════════════════════════════════════
   LOADING SPINNER
════════════════════════════════════ */
.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════
   PROGRESS BARS
════════════════════════════════════ */
.progress {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}
.progress-bar.red    { background: var(--red-500); }
.progress-bar.green  { background: #22C55E; }
.progress-bar.yellow { background: #EAB308; }
.progress-bar.blue   { background: #3B82F6; }

/* ════════════════════════════════════
   EMPTY STATE
════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  width: 64px; height: 64px;
  background: var(--gray-100);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px; color: var(--gray-400);
}
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--gray-500); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; max-width: 280px; margin: 0 auto 16px; }

/* ════════════════════════════════════
   BOM TREE
════════════════════════════════════ */
.bom-tree { font-size: 13.5px; }
.bom-node { margin-bottom: 2px; }
.bom-node-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r);
  transition: background .1s;
  cursor: default;
}
.bom-node-row:hover { background: var(--gray-50); }
.bom-node-row.root {
  background: var(--red-50);
  border: 1px solid var(--red-200);
  font-weight: 600;
  margin-bottom: 6px;
}
.bom-children {
  margin-left: 20px;
  border-left: 2px solid var(--gray-200);
  padding-left: 14px;
  margin-top: 2px;
}
.bom-node-row .node-code { color: var(--gray-500); font-size: 12px; min-width: 70px; }
.bom-node-row .node-name { flex: 1; }
.bom-node-row .node-qty  {
  font-size: 12px; color: var(--gray-600);
  background: var(--gray-100);
  padding: 2px 8px; border-radius: 4px;
}

/* ════════════════════════════════════
   MRP CARDS
════════════════════════════════════ */
.mrp-item {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: var(--trans);
}
.mrp-item.shortage  { border-color: var(--red-200);  background: var(--red-50); }
.mrp-item.excess    { border-color: #BBF7D0;         background: #F0FDF4; }
.mrp-item.adequate  { border-color: var(--border);   background: white; }
.mrp-item-header    { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.mrp-item-title     { flex: 1; font-weight: 600; font-size: 14px; }
.mrp-qty-row        { display: flex; gap: 24px; font-size: 13px; flex-wrap: wrap; }
.mrp-qty-item       { display: flex; flex-direction: column; gap: 2px; }
.mrp-qty-label      { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.mrp-qty-value      { font-size: 18px; font-weight: 700; }

/* ════════════════════════════════════
   WAREHOUSE GRID
════════════════════════════════════ */
.wh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.wh-location-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--trans);
  background: white;
}
.wh-location-card:hover  { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.wh-location-card.full   { border-color: var(--red-300); background: var(--red-50); }
.wh-location-card.empty  { border-color: var(--gray-200); background: var(--gray-50); }
.wh-loc-code { font-size: 12px; font-weight: 600; color: var(--gray-500); margin-bottom: 4px; }
.wh-loc-name { font-size: 13px; font-weight: 500; color: var(--gray-700); margin-bottom: 8px; }
.wh-loc-util { font-size: 12px; font-weight: 700; }

/* ════════════════════════════════════
   STAT LIST
════════════════════════════════════ */
.stat-list { display: flex; flex-direction: column; gap: 12px; }
.stat-row  { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stat-label { font-size: 13px; color: var(--gray-600); }
.stat-value { font-size: 14px; font-weight: 600; color: var(--gray-800); }

/* ════════════════════════════════════
   CHART CONTAINERS
════════════════════════════════════ */
.chart-wrap { position: relative; }
.chart-wrap canvas { max-width: 100%; }

/* ════════════════════════════════════
   DASHBOARD ACTIVITY
════════════════════════════════════ */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.activity-dot.red    { background: var(--red-500); }
.activity-dot.green  { background: #22C55E; }
.activity-dot.blue   { background: #3B82F6; }
.activity-dot.yellow { background: #EAB308; }
.activity-text { font-size: 13px; color: var(--gray-700); line-height: 1.5; flex: 1; }
.activity-time { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }

/* ════════════════════════════════════
   INVENTORY STOCK LEVEL
════════════════════════════════════ */
.stock-cell { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.stock-nums { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--gray-500); }

/* ════════════════════════════════════
   REPORT SECTION
════════════════════════════════════ */
.report-filter-bar {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
}
.report-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.report-kpi-cell {
  background: white;
  padding: 18px 20px;
  text-align: center;
}
.report-kpi-cell .rk-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 6px; }
.report-kpi-cell .rk-value { font-size: 24px; font-weight: 800; color: var(--gray-900); }
.report-kpi-cell .rk-sub   { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ════════════════════════════════════
   UTILITIES
════════════════════════════════════ */
.text-red    { color: var(--red-600); }
.text-green  { color: #16A34A; }
.text-yellow { color: #D97706; }
.text-blue   { color: #2563EB; }
.text-muted  { color: var(--text-muted); }
.text-bold   { font-weight: 600; }
.text-sm     { font-size: 12.5px; }
.text-xs     { font-size: 11.5px; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.d-flex      { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.flex-1      { flex: 1; }
.w-full      { width: 100%; }
.hidden      { display: none !important; }
.fw-500      { font-weight: 500; }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }
.divider     { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ════════════════════════════════════
   RESPONSIVE
════════════════════════════════════ */
@media (max-width: 1100px) {
  .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s ease; }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-wrapper { margin-left: 0 !important; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .content-area { padding: 16px; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, .top-header, .modal-overlay, .toast-container { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  .content-area { padding: 0; }
}
