/* ============================================================
   COMMON.CSS — GST Accounting System v2
   Complete shared design system
   ============================================================ */

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --primary:          #667eea;
  --primary-dark:     #764ba2;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-soft:     #f0f2ff;
  --primary-border:   #d6d9ff;

  --success:      #4CAF50;
  --success-soft: #e8f5e9;
  --success-dark: #2e7d32;

  --warning:      #FF9800;
  --warning-soft: #fff8e1;
  --warning-dark: #e65100;

  --danger:       #f44336;
  --danger-soft:  #ffebee;
  --danger-dark:  #c62828;

  --purple:       #9C27B0;
  --purple-soft:  #f3e5f5;
  --purple-dark:  #6a1b9a;

  --blue:         #1565c0;
  --blue-soft:    #e3f2fd;

  --gold:         #f9a825;
  --gold-soft:    #fffde7;

  --teal:         #00897B;
  --teal-soft:    #e0f2f1;

  --text-primary:   #1a1d23;
  --text-secondary: #4a5568;
  --text-muted:     #9aa0b4;
  --text-light:     #c4c9d9;

  --bg-page:  #f0f2f8;
  --bg-card:  #ffffff;
  --bg-input: #f8f9ff;
  --bg-hover: #f5f7ff;

  --border:       #e8eaf0;
  --border-focus: var(--primary);

  --shadow-sm: 0 1px 4px rgba(102,126,234,0.08);
  --shadow-md: 0 4px 16px rgba(102,126,234,0.12);
  --shadow-lg: 0 8px 32px rgba(102,126,234,0.18);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.18);

  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-full: 999px;

  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition: all 0.2s ease;

  --sidebar-w:          56px;
  --sidebar-w-expanded: 220px;
  --topbar-h:           56px;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 12px;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(102,126,234,0.35);
  gap: 12px;
}
.topbar-left  { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-biz {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.15);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  border: 2px solid rgba(255,255,255,0.4);
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* Hamburger */
.topbar-menu-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  transition: var(--transition);
  padding: 0;
}
.topbar-menu-btn:hover { background: rgba(255,255,255,0.25); }
.topbar-menu-btn span {
  display: block;
  width: 16px; height: 2px;
  background: white;
  border-radius: 2px;
  transition: var(--transition);
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: var(--topbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: white;
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 16px rgba(102,126,234,0.08);
  z-index: 150;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.25s cubic-bezier(0.4,0,0.2,1);
}
.sidebar.expanded { width: var(--sidebar-w-expanded); }

/* Header */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  min-height: 54px;
  overflow: hidden;
  background: var(--primary-soft);
  flex-shrink: 0;
}
.sidebar-logo  { font-size: 1.3rem; flex-shrink: 0; }
.sidebar-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s 0.05s;
  flex: 1;
}
.sidebar.expanded .sidebar-title { opacity: 1; }
.sidebar-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s;
  display: none;
  align-items: center;
  justify-content: center;
}
.sidebar.expanded .sidebar-close { opacity: 1; }

/* User */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  min-height: 58px;
  flex-shrink: 0;
}
.su-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.su-info {
  min-width: 0;
  opacity: 0;
  transition: opacity 0.2s 0.05s;
}
.sidebar.expanded .su-info { opacity: 1; }
.su-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.su-role { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition);
  border: none;
  border-right: 3px solid transparent;
  background: none;
  cursor: pointer;
  font-family: var(--font);
  width: 100%;
  position: relative;
}
.nav-item:hover           { background: var(--primary-soft); color: var(--primary); }
.nav-item.active          { background: var(--primary-soft); color: var(--primary); font-weight: 700; border-right-color: var(--primary); }
.nav-item.active .nav-icon{ transform: scale(1.1); }
.nav-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
  transition: transform 0.2s;
}
.nav-label {
  opacity: 0;
  transition: opacity 0.2s 0.05s;
  flex: 1;
}
.sidebar.expanded .nav-label { opacity: 1; }

/* Tooltip when collapsed */
.nav-item::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #1a1d23;
  color: white;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 300;
}
.nav-item:hover::after          { opacity: 1; }
.sidebar.expanded .nav-item::after { display: none; }

/* Footer */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 8px 0;
  flex-shrink: 0;
}
.nav-logout        { color: var(--danger-dark) !important; }
.nav-logout:hover  { background: var(--danger-soft) !important; }

/* Backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,20,40,0.45);
  backdrop-filter: blur(2px);
  z-index: 140;
}
.sidebar-backdrop.show { display: block; }

/* ══════════════════════════════════════════════════════════
   PAGE WRAPPER
══════════════════════════════════════════════════════════ */
.page-wrapper {
  margin-top: var(--topbar-h);
  margin-left: var(--sidebar-w);
  min-height: calc(100vh - var(--topbar-h));
  transition: margin-left 0.25s cubic-bezier(0.4,0,0.2,1);
  padding: 20px;
}

/* ══════════════════════════════════════════════════════════
   CONTAINER
══════════════════════════════════════════════════════════ */
.container {
  max-width: 1320px;
  margin: 0 auto;
}

/* ══════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: var(--font);
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.btn:active   { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.btn-back     { background: rgba(255,255,255,0.18); color: white; border: 1.5px solid rgba(255,255,255,0.35); }
.btn-back:hover { background: rgba(255,255,255,0.28); }

.btn-primary  { background: var(--primary-gradient); color: white; box-shadow: 0 2px 8px rgba(102,126,234,0.35); }
.btn-primary:hover  { box-shadow: 0 4px 16px rgba(102,126,234,0.45); transform: translateY(-1px); }

.btn-success  { background: linear-gradient(135deg,#4CAF50,#43A047); color: white; box-shadow: 0 2px 8px rgba(76,175,80,0.3); }
.btn-success:hover  { box-shadow: 0 4px 14px rgba(76,175,80,0.4); transform: translateY(-1px); }

.btn-danger   { background: linear-gradient(135deg,#f44336,#e53935); color: white; box-shadow: 0 2px 8px rgba(244,67,54,0.3); }
.btn-danger:hover   { box-shadow: 0 4px 14px rgba(244,67,54,0.4); transform: translateY(-1px); }

.btn-warning  { background: linear-gradient(135deg,#FF9800,#FB8C00); color: white; box-shadow: 0 2px 8px rgba(255,152,0,0.3); }
.btn-warning:hover  { box-shadow: 0 4px 14px rgba(255,152,0,0.4); transform: translateY(-1px); }

.btn-secondary { background: #607D8B; color: white; }
.btn-secondary:hover { background: #546E7A; transform: translateY(-1px); }

.btn-outline  { background: white; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover  { background: var(--primary-soft); }

.btn-ghost    { background: transparent; color: var(--text-secondary); border: 1.5px solid var(--border); }
.btn-ghost:hover    { background: var(--bg-hover); border-color: var(--primary); color: var(--primary); }

.btn-restore  { background: var(--warning); color: white; border: none; border-radius: var(--radius-sm); padding: 4px 10px; font-size: 0.75rem; font-weight: 700; cursor: pointer; transition: var(--transition); }
.btn-restore:hover  { background: #F57C00; transform: translateY(-1px); }
.btn-restore:disabled { background: #ddd; color: #aaa; cursor: not-allowed; transform: none; }

.btn-sm   { padding: 5px 12px;  font-size: 0.76rem; }
.btn-xs   { padding: 3px 8px;   font-size: 0.7rem;  }
.btn-lg   { padding: 11px 24px; font-size: 0.92rem; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); }

/* FY / Period buttons */
.fy-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.fy-btn {
  padding: 6px 13px;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  font-family: var(--font);
}
.fy-btn.active,
.fy-btn:hover { background: var(--primary-gradient); color: white; border-color: transparent; }

/* Period pill */
.stats-period-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.period-btn {
  padding: 5px 14px;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  white-space: nowrap;
  font-family: var(--font);
}
.period-btn:hover  { border-color: var(--primary); color: var(--primary); }
.period-btn.active { background: var(--primary-gradient); color: white; border-color: transparent; box-shadow: 0 2px 8px rgba(102,126,234,0.35); }

/* ══════════════════════════════════════════════════════════
   FILTER CARD
══════════════════════════════════════════════════════════ */
.filter-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.fg { display: flex; flex-direction: column; gap: 5px; }
.fg label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fg input,
.fg select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font);
  background: var(--bg-input);
  color: var(--text-primary);
  min-width: 130px;
  transition: var(--transition);
}
.fg input:focus,
.fg select:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}
.fg .hint { font-size: 0.68rem; color: var(--text-light); }

/* Search */
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap input,
.search-box {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font);
  background: var(--bg-input);
  transition: var(--transition);
}
.search-wrap input:focus,
.search-box:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}
.search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.85rem;
}
.search-clear {
  background: var(--bg-hover);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: var(--transition);
  font-family: var(--font);
}
.search-clear:hover { background: var(--border); }

/* ══════════════════════════════════════════════════════════
   STAT CARDS
════���═════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px,1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card:hover  { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card.green  { border-left-color: var(--success); }
.stat-card.orange { border-left-color: var(--warning); }
.stat-card.red    { border-left-color: var(--danger);  }
.stat-card.purple { border-left-color: var(--purple);  }
.stat-card.blue   { border-left-color: var(--blue);    }
.stat-card.gold   { border-left-color: var(--gold);  background: var(--gold-soft);  }
.stat-card.teal   { border-left-color: var(--teal);  background: var(--teal-soft);  }
.stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 5px;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.stat-sub { font-size: 0.68rem; color: var(--text-muted); margin-top: 3px; }
.stat-period-tag {
  position: absolute; top: 8px; right: 10px;
  font-size: 0.68rem;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

/* Stats strip */
.stats-strip { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 12px; margin-bottom: 18px; }
.ss-card          { background: var(--bg-card); border-radius: var(--radius-md); padding: 14px 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); border-left: 4px solid var(--primary); }
.ss-card.green    { border-left-color: var(--success); }
.ss-card.orange   { border-left-color: var(--warning); }
.ss-card.red      { border-left-color: var(--danger);  }
.ss-card.purple   { border-left-color: var(--purple);  }
.ss-label         { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; font-weight: 700; }
.ss-value         { font-size: 1.2rem; font-weight: 800; color: var(--text-primary); margin-top: 3px; }
.ss-sub           { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* Quick stat (index) */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px,1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.qs-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  text-align: center;
  transition: var(--transition);
}
.qs-card:hover  { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.qs-card.green  { border-top-color: var(--success); }
.qs-card.orange { border-top-color: var(--warning); }
.qs-card.red    { border-top-color: var(--danger);  }
.qs-card.purple { border-top-color: var(--purple);  }
.qs-card.teal   { border-top-color: var(--teal);    }
.qs-value { font-size: 1.3rem; font-weight: 800; color: var(--text-primary); min-height: 28px; }
.qs-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; font-weight: 700; margin-top: 3px; }
.qs-sub   { font-size: 0.7rem; color: var(--text-light); margin-top: 2px; }

/* Net profit banner */
.np-banner {
  border-radius: var(--radius-md);
  padding: 18px 24px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border: 2px solid;
}
.np-banner.profit  { background: var(--success-soft); border-color: var(--success); }
.np-banner.loss    { background: var(--danger-soft);  border-color: var(--danger);  }
.np-banner h2      { font-size: 0.95rem; font-weight: 700; }
.np-banner .np-amount { font-size: 1.7rem; font-weight: 800; }
.np-banner .np-margin { font-size: 0.82rem; margin-top: 3px; color: var(--text-secondary); }

/* ══════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════ */
.section-card,
.table-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 18px;
  overflow: hidden;
}
.section-header,
.table-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: linear-gradient(to right, #fafbff, white);
}
.section-header h3,
.table-header h3 { font-size: 0.92rem; font-weight: 700; color: var(--text-primary); }

.page-header {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h2 { font-size: 1.05rem; font-weight: 700; }
.page-header p  { font-size: 0.8rem; color: var(--text-muted); margin-top: 3px; }

.banner-card {
  background: var(--primary-gradient);
  color: white;
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.banner-card h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 3px; }
.banner-card p  { font-size: 0.82rem; opacity: 0.85; }
.banner-right   { text-align: right; }
.banner-date    { font-size: 0.78rem; opacity: 0.8; margin-bottom: 6px; }
.role-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
}

/* Module cards (index) */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.module-card {
  background: var(--bg-card);
  padding: 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
  cursor: pointer;
  display: block;
  position: relative;
  overflow: hidden;
}
.module-card::after {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 70px; height: 70px;
  border-radius: 50%;
  background: rgba(102,126,234,0.05);
}
.module-card:hover        { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.module-card.green        { border-left-color: var(--success-dark); }
.module-card.orange       { border-left-color: var(--warning-dark); }
.module-card.blue         { border-left-color: var(--blue); }
.module-card.red          { border-left-color: var(--danger-dark); }
.module-card.purple       { border-left-color: var(--purple-dark); }
.module-card.teal         { border-left-color: var(--teal); }
.module-card.gold         { border-left-color: var(--gold); }
.module-card .icon        { font-size: 28px; margin-bottom: 10px; }
.module-card h3           { margin-bottom: 5px; font-size: 0.95rem; font-weight: 700; }
.module-card p            { color: var(--text-muted); font-size: 0.8rem; line-height: 1.5; }
.status-badge             { display: inline-block; padding: 3px 9px; border-radius: var(--radius-full); font-size: 0.68rem; font-weight: 700; margin-top: 10px; }
.status-ready             { background: var(--success-soft); color: var(--success-dark); }
.status-master            { background: var(--purple-soft); color: var(--purple-dark); }

/* Biz cards */
.biz-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(320px,1fr)); gap: 16px; }
.biz-card { background: var(--bg-card); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--border); overflow: hidden; transition: var(--transition); }
.biz-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.biz-card-header { padding: 16px 20px; display: flex; justify-content: space-between; align-items: flex-start; background: linear-gradient(135deg,#f8f9ff,#eef0ff); border-bottom: 1px solid #e8eaff; }
.biz-card-header.inactive { background: #f9f9f9; border-bottom-color: #eee; }
.biz-name  { font-size: 1rem; font-weight: 800; color: var(--text-primary); }
.biz-gstin { font-size: 0.73rem; color: var(--text-muted); font-family: monospace; margin-top: 2px; }
.biz-card-body { padding: 14px 20px; }
.biz-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid #f5f5f5; font-size: 0.83rem; }
.biz-row:last-child { border-bottom: none; }
.biz-row-label { color: var(--text-muted); }
.biz-row-value { font-weight: 600; color: var(--text-primary); }
.biz-card-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ══════════════════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════════════════ */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: #f6f7fc;
  padding: 10px 14px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  letter-spacing: 0.4px;
}
thead th.right  { text-align: right; }
thead th.center { text-align: center; }
thead th.sortable { cursor: pointer; user-select: none; transition: var(--transition); }
thead th.sortable:hover        { background: var(--primary-soft); color: var(--primary); }
thead th.sort-active,
thead th.sort-asc,
thead th.sort-desc             { background: var(--primary-soft); color: var(--primary); border-bottom-color: var(--primary); }

/* Sort arrows */
.sort-arrow {
  display: inline-flex;
  flex-direction: column;
  margin-left: 4px;
  vertical-align: middle;
  gap: 1px;
  opacity: 0.3;
  font-size: 0.58rem;
  line-height: 1;
}
thead th.sort-active .sort-arrow                              { opacity: 1; }
thead th.sort-active .sort-arrow .arr-up                      { display: none; }
thead th.sort-active .sort-arrow .arr-down                    { display: none; }
thead th.sort-active.asc  .sort-arrow .arr-up                 { display: block; color: var(--primary); }
thead th.sort-active.desc .sort-arrow .arr-down               { display: block; color: var(--primary); }
thead th.sortable:not(.sort-active) .sort-arrow .arr-up,
thead th.sortable:not(.sort-active) .sort-arrow .arr-down     { display: block; }
.sort-icon { margin-left: 4px; font-size: 0.72rem; opacity: 0.4; }
thead th.sort-asc  .sort-icon,
thead th.sort-desc .sort-icon { opacity: 1; }

tbody tr              { border-bottom: 1px solid #f2f3f8; transition: background 0.15s; }
tbody tr:last-child   { border-bottom: none; }
tbody tr:hover        { background: var(--bg-hover); }
tbody tr.total-row    { background: var(--gold-soft) !important; font-weight: 700; }
tbody tr.restored-row { background: var(--success-soft) !important; }
tbody td {
  padding: 11px 14px;
  font-size: 0.83rem;
  vertical-align: middle;
  color: var(--text-secondary);
}
tbody td strong { color: var(--text-primary); }
tbody td.right  { text-align: right; }
tbody td.center { text-align: center; }
tbody td.mono   { font-family: 'Courier New', monospace; font-size: 0.79rem; }
td.profit { color: var(--success-dark); font-weight: 700; }
td.loss   { color: var(--danger-dark);  font-weight: 700; }

/* Sort strip */
.sort-strip {
  background: var(--primary-soft);
  border: 1.5px solid var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.8rem;
  color: var(--primary);
  margin-bottom: 12px;
  display: none;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sort-strip.show { display: flex; }
.sort-chip {
  background: var(--primary-gradient);
  color: white;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}
.sort-chip button { background: none; border: none; color: white; cursor: pointer; font-size: 0.85rem; line-height: 1; padding: 0; opacity: 0.8; }
.sort-chip button:hover { opacity: 1; }
.highlight { background: #fff59d; border-radius: 3px; padding: 0 2px; }

/* ══════════════════════════════════════════════════════════
   BADGES
════════════════════════════���═════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge-delivered,
.badge-active,
.badge-counted,
.badge-accepted,
.badge-create    { background: var(--success-soft); color: var(--success-dark); }
.badge-rto,
.badge-rejected,
.badge-delete,
.badge-high,
.badge-inactive  { background: var(--danger-soft);  color: var(--danger-dark);  }
.badge-shipped,
.badge-blue,
.badge-converted_prepaid,
.badge-edit      { background: var(--blue-soft);    color: var(--blue); }
.badge-placed,
.badge-master,
.badge-restore   { background: var(--purple-soft);  color: var(--purple-dark); }
.badge-confirmed { background: #e8eaf6; color: #3949ab; }
.badge-cancelled,
.badge-grey,
.badge-notcounted{ background: #f5f5f5; color: #616161; border: 1px solid #e0e0e0; }
.badge-status    { background: var(--warning-soft); color: var(--warning-dark); }
.badge-medium    { background: var(--warning-soft); color: #f57f17; }
.badge-low       { background: var(--success-soft); color: var(--success-dark); }
.badge-blocked   { background: #f5f5f5; color: #616161; border: 1px solid #ddd; }
.badge-prepaid   { background: var(--success-soft); color: var(--success-dark); }
.badge-cod       { background: #fff3e0; color: var(--warning-dark); }
.badge-partial   { background: var(--blue-soft);    color: var(--blue); }
.badge-igst      { background: var(--warning-soft); color: #f57f17; }
.badge-cgst_sgst { background: var(--success-soft); color: var(--success-dark); }
.badge-business  { background: var(--success-soft); color: var(--success-dark); }
.gst-rate-badge  { background: #e8eaf6; color: #3949ab; padding: 2px 6px; border-radius: var(--radius-full); font-size: 0.72rem; font-weight: 700; }
.biz-rank {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: white;
  font-weight: 800;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ══════════════════════════════════════════════════════════
   TABS
══════════════════════════════════════════════════════════ */
.tabs {
  display: flex;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tab-btn {
  flex: 1;
  min-width: 100px;
  padding: 13px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  font-family: var(--font);
  white-space: nowrap;
}
.tab-btn:hover:not(.active) { background: var(--bg-hover); color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--primary-soft); }
.tab-content        { display: none; }
.tab-content.active { display: block; }

/* ══════════════════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════════════════ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 16px;
  flex-wrap: wrap;
}
.page-btn {
  padding: 6px 13px;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  font-family: var(--font);
}
.page-btn:hover,
.page-btn.active { background: var(--primary-gradient); color: white; border-color: transparent; box-shadow: 0 2px 8px rgba(102,126,234,0.35); }
.page-info { font-size: 0.78rem; color: var(--text-muted); padding: 0 4px; }

/* ══════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,20,40,0.6);
  backdrop-filter: blur(3px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.show,
.modal-overlay.active { display: flex; }

.modal {
  background: white;
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 95%;
  max-width: 500px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.22s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}
.modal-header h2 { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.modal h2 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border);
  padding-bottom: 12px;
  font-weight: 700;
}
.close-btn {
  background: var(--bg-hover);
  border: none;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.close-btn:hover { background: var(--danger-soft); color: var(--danger); }

/* Confirm modal */
.confirm-modal,
.confirm-box {
  background: white;
  border-radius: var(--radius-xl);
  padding: 36px 28px;
  width: 90%;
  max-width: 420px;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.22s ease;
}
.confirm-modal .icon  { font-size: 3.5rem; margin-bottom: 12px; }
.confirm-modal h3     { font-size: 1.1rem; margin-bottom: 8px; font-weight: 700; }
.confirm-modal p      { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 8px; }
.confirm-modal .order-info {
  background: var(--warning-soft);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 12px 0 20px;
  font-size: 0.85rem;
  color: var(--warning-dark);
  font-weight: 600;
}

/* Form */
.form-group { margin-bottom: 15px; }
.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-family: var(--font);
  background: var(--bg-input);
  color: var(--text-primary);
  transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}
.form-group textarea { resize: vertical; min-height: 70px; }
.form-hint { font-size: 0.68rem; color: var(--text-muted); margin-top: 4px; }

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.single { grid-template-columns: 1fr; }
.form-section {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  grid-column: 1/-1;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
  letter-spacing: 0.5px;
}
.form-section:first-child { border-top: none; padding-top: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.readonly-val {
  padding: 9px 12px;
  background: #f8f9fa;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Password */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 42px; width: 100%; }
.pw-eye,
.pw-toggle {
  position: absolute;
  right: 11px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  opacity: 0.4;
  transition: opacity 0.2s;
  padding: 4px;
}
.pw-eye:hover,
.pw-toggle:hover { opacity: 0.85; }

/* Misc modal bits */
.warn-box {
  background: var(--warning-soft);
  border: 1.5px solid #ffe0b2;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.82rem;
  color: #e65100;
  margin-bottom: 16px;
}
.warn-box strong { display: block; margin-bottom: 4px; font-size: 0.88rem; }

.snapshot-preview {
  background: #f8f9fa;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  color: var(--text-primary);
  max-height: 120px;
  overflow-y: auto;
  border: 1px solid var(--border);
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-all;
}
.restored-strip {
  font-size: 0.72rem;
  color: var(--success-dark);
  background: var(--success-soft);
  border-radius: 4px;
  padding: 2px 6px;
  display: inline-block;
  margin-top: 3px;
}
.diff-wrap  { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.diff-old   { background: var(--danger-soft);  color: var(--danger-dark);  padding: 2px 7px; border-radius: 4px; font-size: 0.75rem; font-family: monospace; text-decoration: line-through; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diff-new   { background: var(--success-soft); color: var(--success-dark); padding: 2px 7px; border-radius: 4px; font-size: 0.75rem; font-family: monospace; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diff-arrow { color: var(--text-light); font-size: 0.8rem; }

/* ══════════════════════════════════════════════════════════
   PROFILE
══════════════════════════════════════════════════════════ */
.profile-top { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; }
.profile-avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--primary-gradient); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: white; font-weight: 700; flex-shrink: 0; }
.profile-info h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.profile-info p  { font-size: 0.84rem; color: var(--text-muted); margin-bottom: 2px; }
.profile-stats   { display: grid; grid-template-columns: repeat(auto-fill,minmax(130px,1fr)); gap: 12px; margin-bottom: 20px; }
.ps-card { background: var(--primary-soft); border-radius: var(--radius-md); padding: 12px 14px; text-align: center; }
.ps-val  { font-size: 1.2rem; font-weight: 800; color: var(--text-primary); }
.ps-lbl  { font-size: 0.72rem; color: var(--text-muted); margin-top: 3px; text-transform: uppercase; }

.profile-card { background: var(--bg-card); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--border); overflow: hidden; }
.profile-card-header { padding: 14px 20px; background: var(--primary-gradient); color: white; }
.profile-card-header h3 { font-size: 0.95rem; font-weight: 700; }
.profile-card-body { padding: 18px 20px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.info-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #f5f5f5; font-size: 0.84rem; gap: 12px; }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.info-value { color: var(--text-primary); font-weight: 600; text-align: right; word-break: break-word; max-width: 60%; }

/* ══════════════════════════════════════════════════════════
   CHARTS
══════════════════════════════════════════════════════════ */
.bar-chart-wrap { padding: 20px; overflow-x: auto; }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 220px; min-width: 600px; }
.bc-group  { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; min-width: 55px; }
.bc-bars   { display: flex; align-items: flex-end; gap: 2px; height: 185px; width: 100%; justify-content: center; }
.bc-bar    { border-radius: 4px 4px 0 0; min-height: 3px; transition: height 0.4s; cursor: pointer; position: relative; flex: 1; max-width: 22px; }
.bc-bar:hover .bc-tip { display: block; }
.bc-tip {
  display: none;
  position: absolute; bottom: calc(100% + 4px); left: 50%;
  transform: translateX(-50%);
  background: #333; color: white;
  padding: 5px 8px; border-radius: 6px;
  font-size: 0.7rem; white-space: nowrap; z-index: 10;
}
.bc-tip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 4px solid transparent; border-top-color: #333; }
.bc-label { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; text-align: center; }

.donut-wrap   { display: flex; align-items: center; justify-content: center; gap: 28px; padding: 20px; flex-wrap: wrap; }
.donut-svg    { width: 140px; height: 140px; transform: rotate(-90deg); }
.donut-legend { display: flex; flex-direction: column; gap: 10px; }
.donut-item   { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; }
.donut-dot    { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

.progress-wrap { display: flex; align-items: center; gap: 8px; }
.progress-bar  { flex: 1; height: 8px; background: #eee; border-radius: 4px; overflow: hidden; min-width: 60px; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.5s; }

.activity-wrap  { padding: 16px 20px; overflow-x: auto; }
.activity-chart { display: flex; align-items: flex-end; gap: 4px; height: 80px; min-width: 500px; }
.act-bar-wrap   { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; min-width: 24px; }
.act-bar        { border-radius: 3px 3px 0 0; min-height: 3px; width: 100%; transition: height 0.4s; cursor: pointer; position: relative; }
.act-bar:hover .act-tip { display: block; }
.act-tip { display: none; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: #333; color: white; padding: 4px 7px; border-radius: 5px; font-size: 0.68rem; white-space: nowrap; z-index: 10; }
.act-tip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 3px solid transparent; border-top-color: #333; }
.act-label { font-size: 0.58rem; color: var(--text-muted); text-align: center; }

.risk-bar-wrap { display: flex; align-items: center; gap: 6px; }
.risk-bar      { height: 6px; border-radius: 3px; flex: 1; max-width: 70px; background: #eee; }
.risk-fill     { height: 100%; border-radius: 3px; }

.rate-good { color: var(--success-dark); font-weight: 700; }
.rate-warn { color: #f57f17;             font-weight: 700; }
.rate-bad  { color: var(--danger-dark);  font-weight: 700; }
.change-up   { color: var(--success-dark); font-size: 0.78rem; font-weight: 700; }
.change-down { color: var(--danger-dark);  font-size: 0.78rem; font-weight: 700; }
.change-same { color: var(--text-muted);   font-size: 0.78rem; }

/* ══════════════════════════════════════════════════════════
   COMPARISON
════════════���═════════════════════════════════════════════ */
.cmp-grid { display: grid; grid-template-columns: 1fr auto 1fr; }
.cmp-col  { padding: 16px 20px; }
.cmp-col.a { background: var(--primary-soft); border-radius: var(--radius-md) 0 0 var(--radius-md); }
.cmp-col.b { background: var(--success-soft); border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.cmp-mid   { display: flex; flex-direction: column; justify-content: center; align-items: center; background: white; padding: 0 12px; }
.cmp-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }
.cmp-row   { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,0.05); font-size: 0.85rem; }
.cmp-row:last-child { border-bottom: none; }
.cmp-row .key { color: var(--text-muted); }
.cmp-row .val { font-weight: 700; }
.vs-circle { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-gradient); color: white; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 800; margin: 6px 0; }

/* ══════════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  top: 72px; right: 20px;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  z-index: 9999;
  transform: translateX(calc(100% + 24px));
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.show    { transform: translateX(0); }
.toast.success { background: linear-gradient(135deg,#4CAF50,#43A047); }
.toast.error   { background: linear-gradient(135deg,#f44336,#e53935); }
.toast.info    { background: linear-gradient(135deg,#2196F3,#1976D2); }
.toast.warning { background: linear-gradient(135deg,#FF9800,#FB8C00); }

/* ══════════════════════════════════════════════════════════
   LOADING
══════════════════════════════════════════════════════════ */
.loading { text-align: center; padding: 52px 20px; color: var(--text-muted); font-size: 0.9rem; }
.empty   { text-align: center; padding: 52px 20px; color: var(--text-light); font-size: 0.9rem; }
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(102,126,234,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.stats-loading-bar { height: 3px; background: linear-gradient(90deg,#667eea,#764ba2,#667eea); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 3px; margin-bottom: 10px; display: none; }
.stats-loading-bar.show { display: block; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ══════════════════════════════════════════════════════════
   LAYOUT HELPERS
══════════════════════════════════════════════════════════ */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }

/* ══════════════════════════════════════════════════════════
   UTILITIES
══════════════════════════════════════════════════════════ */
.text-muted    { color: var(--text-muted)   !important; }
.text-primary  { color: var(--primary)      !important; }
.text-success  { color: var(--success-dark) !important; }
.text-danger   { color: var(--danger-dark)  !important; }
.text-warning  { color: var(--warning-dark) !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.fs-sm  { font-size: 0.78rem !important; }
.fs-xs  { font-size: 0.7rem  !important; }
.mono   { font-family: 'Courier New', monospace !important; }
.d-flex { display: flex; }
.align-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap       { flex-wrap: wrap; }
.gap-4  { gap: 4px;  } .gap-6  { gap: 6px;  } .gap-8  { gap: 8px;  }
.gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mb-4  { margin-bottom: 4px  !important; } .mb-8  { margin-bottom: 8px  !important; }
.mb-12 { margin-bottom: 12px !important; } .mb-16 { margin-bottom: 16px !important; }
.mb-20 { margin-bottom: 20px !important; }
.mt-4  { margin-top: 4px  !important; }    .mt-8  { margin-top: 8px  !important; }
.mt-12 { margin-top: 12px !important; }    .mt-16 { margin-top: 16px !important; }
.w-100 { width: 100%; }
.text-right  { text-align: right;  }
.text-center { text-align: center; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
  }
  .sidebar {
    width: 0;
    box-shadow: none;
  }
  .sidebar.open {
    width: 260px;
    box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  }
  .sidebar.open .sidebar-title,
  .sidebar.open .su-info,
  .sidebar.open .nav-label { opacity: 1; }
  .sidebar.open .sidebar-close { display: flex; }
  .page-wrapper  { margin-left: 0; padding: 14px 12px; }
  .topbar-biz    { display: none; }
  .filter-card   { flex-direction: column; }
  .fg input,
  .fg select     { min-width: 100%; }
  .stats-grid    { grid-template-columns: repeat(2,1fr); }
  .stats-strip   { grid-template-columns: repeat(2,1fr); }
  .two-col       { grid-template-columns: 1fr; }
  .profile-grid  { grid-template-columns: 1fr; }
  .form-grid,
  .form-row      { grid-template-columns: 1fr; }
  .tabs          { overflow-x: auto; }
  .modal         { padding: 20px; max-width: 100%; }
  .form-actions,
  .modal-footer  { flex-direction: column-reverse; }
  .form-actions .btn,
  .modal-footer .btn { width: 100%; justify-content: center; }
  .page-header   { flex-direction: column; align-items: flex-start; }
  .banner-card   { flex-direction: column; }
  .banner-right  { text-align: left; }
  .section-header,
  .table-header  { flex-direction: column; align-items: flex-start; }
  .cmp-grid      { grid-template-columns: 1fr; }
  .cmp-col.a     { border-radius: var(--radius-md) var(--radius-md) 0 0; }
  .cmp-col.b     { border-radius: 0 0 var(--radius-md) var(--radius-md); }
  .cmp-mid       { flex-direction: row; padding: 8px 12px; }
  .search-box    { width: 100%; }
}

@media (min-width: 769px) {
  .sidebar-close { display: none !important; }
}

@media (max-width: 480px) {
  .stats-grid   { grid-template-columns: repeat(2,1fr); }
  .stat-value   { font-size: 1.15rem; }
  .modal        { border-radius: var(--radius-lg); }
  .quick-stats  { grid-template-columns: repeat(2,1fr); }
}