/* =========================================================================
   PackApp Pro  -  Unified UI Stylesheet
   Satu sistem konsisten untuk seluruh tampilan. Tidak ada elemen yang melebar.
   ========================================================================= */

/* ---- CSS Variables (dark default) ---- */
:root {
  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --topbar-height: 64px;

  /* Colors  -  dark theme (clean, vibrant) */
  --bg-dark: #0b1220;
  --bg-card: #121a2b;
  --bg-card-light: #172238;
  --bg-surface: #0f172a;
  --bg-secondary: #0b1220;

  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-strong: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --text-on-accent: #ffffff;

  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.16);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.16);
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.16);
  --info: #06b6d4;
  --info-soft: rgba(6, 182, 212, 0.16);

  --text-primary: #eaf2ff;
  --text-secondary: #9fb0cc;
  --text-muted: #7b8ba8;

  --border: rgba(148, 163, 184, 0.18);
  --border-soft: rgba(148, 163, 184, 0.1);

  --shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.4);
  --shadow-md: 0 8px 20px rgba(2, 6, 23, 0.35);
  --shadow-lg: 0 16px 36px rgba(2, 6, 23, 0.45);
  --shadow-xl: 0 24px 50px rgba(2, 6, 23, 0.55);
  --shadow-3d: 0 18px 40px rgba(99, 102, 241, 0.28), 0 6px 16px rgba(2, 6, 23, 0.4);

  /* Spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-6: 24px;
  --s-8: 32px;
  --s-12: 48px;

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-full: 9999px;

  /* Font size */
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;

  /* Transition */
  --dur: 0.25s;
  --ease: ease;
}

/* ---- Light theme overrides ---- */
[data-theme="light"] {
  --bg-dark: #f3f6fb;
  --bg-card: #ffffff;
  --bg-card-light: #f8faff;
  --bg-surface: #eef3fb;
  --bg-secondary: #f3f6fb;

  --accent: #4f46e5;
  --accent-light: #6366f1;
  --accent-strong: #4338ca;
  --accent-glow: rgba(79, 70, 229, 0.18);
  --text-on-accent: #ffffff;

  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.12);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.12);
  --danger: #e11d48;
  --danger-soft: rgba(225, 29, 72, 0.12);
  --info: #0891b2;
  --info-soft: rgba(8, 145, 178, 0.12);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --border: rgba(15, 23, 42, 0.1);
  --border-soft: rgba(15, 23, 42, 0.06);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 18px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 30px rgba(15, 23, 42, 0.1);
  --shadow-xl: 0 24px 45px rgba(15, 23, 42, 0.12);
  --shadow-3d: 0 14px 30px rgba(79, 70, 229, 0.16), 0 6px 14px rgba(15, 23, 42, 0.08);
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  width: 100%;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Roboto", sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;      /* mencegah horizontal scroll / melebar */
  overflow-y: auto;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---- Background glow (non-intrusive) ---- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(99, 102, 241, 0.18) 0%, transparent 38%),
    radial-gradient(circle at 88% 12%, rgba(6, 182, 212, 0.14) 0%, transparent 34%),
    radial-gradient(circle at 78% 82%, rgba(236, 72, 153, 0.12) 0%, transparent 36%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] body::before {
  background:
    radial-gradient(circle at 12% 18%, rgba(79, 70, 229, 0.1) 0%, transparent 38%),
    radial-gradient(circle at 88% 12%, rgba(8, 145, 178, 0.08) 0%, transparent 34%),
    radial-gradient(circle at 78% 82%, rgba(219, 39, 119, 0.07) 0%, transparent 36%);
}

/* =========================================================================
   Login Screen
   ========================================================================= */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 40px;
  width: 420px;
  max-width: 92vw;
  max-height: 92vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: fadeIn 0.5s ease;
}

.login-logo {
  font-size: 56px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 12px var(--accent-glow));
  display: inline-block;
}

.login-title {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-light), var(--text-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin-top: 4px;
}

/* =========================================================================
   Shell Layout (Sidebar + Main)
   ========================================================================= */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-card-light) 100%);
  border-right: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transition: width var(--dur) var(--ease);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar.collapsed .sidebar-header {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px 6px;
  gap: 8px;
  min-height: auto;
}

.sidebar.collapsed .sidebar-header-left {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  justify-content: center;
  gap: 0;
}

.sidebar.collapsed .sidebar-logo,
.sidebar.collapsed .sidebar-title {
  display: none;
}

.sidebar-header {
  padding: 16px var(--s-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: var(--topbar-height);
  flex-shrink: 0;
}

.sidebar-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-3d);
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-logo {
  width: 36px;
  height: 36px;
  font-size: 16px;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-light), #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.25;
  max-width: 170px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sidebar.collapsed .sidebar-title {
  display: none;
}


.sidebar-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-light);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-toggle:hover {
  background: rgba(99, 102, 241, 0.28);
}

.theme-toggle {
  width: auto;
  min-width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-light);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  flex-shrink: 0;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.theme-label {
  white-space: nowrap;
}

.theme-toggle:hover {
  background: rgba(99, 102, 241, 0.28);
  transform: none;
}

[data-theme="light"] .theme-toggle {
  background: rgba(79, 70, 229, 0.1);
  color: var(--accent);
  border-color: rgba(79, 70, 229, 0.25);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-section-title {
  padding: 10px var(--s-4) 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar.collapsed .nav-section-title {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px var(--s-4);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item:hover {
  background: rgba(99, 102, 241, 0.12);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.22), rgba(6, 182, 212, 0.12));
  color: var(--accent-light);
  border-left-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent), inset 0 0 24px rgba(99, 102, 241, 0.12);
}

[data-theme="light"] .nav-item.active {
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.14), rgba(8, 145, 178, 0.08));
  color: var(--accent-strong);
}

[data-theme="light"] .nav-item:hover {
  background: rgba(79, 70, 229, 0.08);
}

.sidebar.collapsed .nav-item {
  padding: 11px var(--s-3);
  justify-content: center;
  gap: 0;
}

.sidebar.collapsed .nav-item > span:not(.icon) {
  display: none;
}

.nav-item .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

[data-theme="light"] .nav-item .icon {
  background: transparent;
  background: transparent;
  background: rgba(79, 70, 229, 0.1);
  color: var(--accent);
}
[data-theme="light"] 

.sidebar.collapsed .nav-item .icon {
  width: auto;
  margin: 0;
}

.sidebar-footer {
  padding: 16px var(--s-4);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar.collapsed #sidebarLogout {
  font-size: 0;
  padding: 8px;
  width: 40px;
  min-width: 40px;
}
.sidebar.collapsed #sidebarLogout::before {
  content: "M";
  font-size: 18px;
}
.sidebar.collapsed .sidebar-footer {
  flex-direction: column;
  padding: 12px var(--s-3);
  gap: 8px;
  text-align: center;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 4px 12px var(--accent-glow);
  flex-shrink: 0;
}

.sidebar.collapsed .avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.sidebar-footer > span {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.sidebar.collapsed .sidebar-footer > span {
  display: none;
}

/* Main content wrapper */
.main-content {
  position: absolute;
  left: var(--sidebar-width);
  right: 0;
  top: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
  transition: left var(--dur) var(--ease);
}

.sidebar.collapsed ~ .main-content,
body:has(.sidebar.collapsed) .main-content {
  left: var(--sidebar-collapsed);
}

.main-content.collapsed {
  left: var(--sidebar-collapsed);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px var(--s-8);
  height: var(--topbar-height);
  flex-shrink: 0;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.3px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 2px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Content area  -  full width within sidebar, never overflows */
.content-area {
  flex: 1;
  padding: var(--s-6) var(--s-8) var(--s-12);
  width: 100%;
  min-width: 0;
  overflow: visible;
}

/* =========================================================================
   App root & page views
   ========================================================================= */
#app-root {
  width: 100%;
  min-width: 0;
  visibility: hidden;
}

#app-root.ready {
  visibility: visible;
}

.page-view {
  display: none;
  width: 100%;
  min-width: 0;
}

.page-view.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

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

/* =========================================================================
   Cards
   ========================================================================= */
.card {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card-light) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  margin-bottom: var(--s-6);
  box-shadow: var(--shadow-md);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.3);
}

.card-body {
  padding: var(--s-6);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}

.card-header-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.card-title .icon {
  font-size: 20px;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--border);
}

.card__title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-primary);
}

.card__subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* =========================================================================
   Stats Grid
   ========================================================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-4);
  margin-bottom: var(--s-6);
  width: 100%;
}

.stat-card {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card-light) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  box-shadow: var(--shadow-md);
  transition: all 0.25s ease;
  min-width: 0;
  overflow: hidden;
}

.stat-card > div:not(.stat-icon) {
  flex: 1;
  min-width: 0;
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.28);
  flex-shrink: 0;
}

.stat-value {
  font-size: clamp(15px, 1.8vw, 22px);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: var(--s-1);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.stat-card__value {
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
  min-width: 0;
}

.stat-card__label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: var(--s-1);
  line-height: 1.3;
}

.stat-card__delta {
  font-size: var(--text-xs);
  margin-top: var(--s-1);
}

.stat-card__delta.up {
  color: var(--success);
}

.stat-card__delta.down {
  color: var(--danger);
}

/* Aliases without BEM prefix for compatibility with dashboard markup */
.stat-card__value, .stat-value { font-size: clamp(15px, 1.8vw, 22px); font-weight: 800; line-height: 1.2; color: var(--text-primary); min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.stat-card__label, .stat-label { font-size: var(--text-xs); color: var(--text-secondary); margin-top: var(--s-1); line-height: 1.3; overflow-wrap: anywhere; }

/* =========================================================================
   Tables
   ========================================================================= */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-md);
}

.data-table,
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
  min-width: 100%;
  table-layout: auto;
}

.data-table th,
.table th,
.data-table td,
.table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-primary);
  vertical-align: middle;
  line-height: 1.45;
}

.data-table th,
.table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  background: rgba(99, 102, 241, 0.1);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table th:first-child,
.table th:first-child {
  border-top-left-radius: var(--r-sm);
}

.data-table th:last-child,
.table th:last-child {
  border-top-right-radius: var(--r-sm);
}

.data-table tbody tr,
.table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:nth-child(even),
.table tbody tr:nth-child(even) {
  background: rgba(148, 163, 184, 0.04);
}

.data-table tbody tr:hover,
.table tbody tr:hover {
  background: rgba(99, 102, 241, 0.1);
}

.data-table tbody tr:last-child td,
.table tbody tr:last-child td {
  border-bottom: none;
}

.data-table td:last-child,
.table td:last-child {
  white-space: nowrap;
}

.data-table td .btn + .btn,
.table td .btn + .btn {
  margin-left: 6px;
}

.data-table .badge,
.table .badge {
  vertical-align: middle;
}

/* Prevent wide tables from breaking layout when placed directly in cards */
.card > .data-table,
.card > .table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.card > .data-table thead,
.card > .data-table tbody,
.card > .data-table tfoot,
.card > .data-table tr,
.card > .table thead,
.card > .table tbody,
.card > .table tfoot,
.card > .table tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

[data-theme="light"] .data-table th,
[data-theme="light"] .table th {
  background: rgba(79, 70, 229, 0.08);
  color: var(--text-secondary);
}

[data-theme="light"] .data-table tbody tr:nth-child(even),
[data-theme="light"] .table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.02);
}

[data-theme="light"] .data-table tbody tr:hover,
[data-theme="light"] .table tbody tr:hover {
  background: rgba(79, 70, 229, 0.08);
}

/* =========================================================================
   Badges
   ========================================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-info {
  background: var(--info-soft);
  color: var(--info);
}

.badge-accent {
  background: rgba(99, 102, 241, 0.18);
  color: var(--accent-light);
}

.badge--success {
  background: var(--success-soft);
  color: var(--success);
}

.badge--warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge--info {
  background: var(--info-soft);
  color: var(--info);
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--text-on-accent);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--accent-glow);
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.14);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #16a34a);
  color: var(--text-on-accent);
}

.btn-success:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #e11d48);
  color: var(--text-on-accent);
}

.btn-danger:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning), #f97316);
  color: var(--text-on-accent);
}

.btn-warning:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.btn-info {
  background: linear-gradient(135deg, var(--info), #0ea5e9);
  color: var(--text-on-accent);
}

.btn-info:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 26px;
  font-size: 16px;
}

.btn-full,
.btn-block,
.btn--block {
  width: 100%;
}

.btn--primary {
  background: var(--accent);
  color: var(--text-on-accent);
}

.btn--primary:hover:not(:disabled) {
  background: var(--accent-light);
}

.btn--secondary {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-primary);
}

.btn--sm {
  padding: 6px 12px;
  font-size: var(--text-xs);
}

.btn--lg {
  padding: 12px 24px;
  font-size: var(--text-md);
}

/* =========================================================================
   Forms
   ========================================================================= */
.form-group {
  margin-bottom: var(--s-3);
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--s-1);
}

.form-control {
  width: 100%;
  min-width: 0;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}

select.form-control {
  cursor: pointer;
}

select.form-control option {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 10px 14px;
}

select.form-control option[value=""] {
  color: var(--text-secondary);
  font-style: italic;
}

[data-theme="light"] .form-control {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
}

[data-theme="light"] .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-3);
  align-items: end;
}

.form-help {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--s-1);
}

/* =========================================================================
   Modals
   ========================================================================= */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 6, 23, 0.72);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  padding: var(--s-4);
  overflow-y: auto;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card-light) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(124, 58, 237, 0.15);
  transform: scale(0.96);
  animation: modalEnter 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  padding: var(--s-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card-light) 100%);
  z-index: 1;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.modal-title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: rgba(99, 102, 241, 0.12);
  border: none;
  color: var(--accent-light);
  font-size: 22px;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(99, 102, 241, 0.28);
  color: var(--text-on-accent);
  transform: scale(1.05);
}

.modal-body {
  padding: var(--s-6);
  overflow-y: auto;
  max-height: calc(90vh - 120px);
  min-width: 0;
}

.modal-footer {
  padding: var(--s-4);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  position: sticky;
  bottom: 0;
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card-light) 100%);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

[data-theme="light"] .modal {
  background: rgba(15, 23, 42, 0.35);
}

[data-theme="light"] .modal-content {
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(109, 40, 217, 0.1);
}

/* =========================================================================
   Recipe / Ingredient items
   ========================================================================= */
.recipe-card {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card-light) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  margin-bottom: var(--s-6);
  box-shadow: var(--shadow-md);
  transition: all 0.25s ease;
  min-width: 0;
}

.recipe-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: var(--s-2);
}

.recipe-name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

.recipe-name small {
  display: block;
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: var(--s-1);
}

.recipe-meta {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.ingredient-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--bg-surface);
  border-radius: var(--r-md);
  margin-bottom: var(--s-2);
  border: 1px solid var(--border);
  flex-wrap: wrap;
  min-width: 0;
}

.ingredient-name {
  font-weight: 500;
  flex: 1;
  min-width: 110px;
  color: var(--text-primary);
}

.ingredient-qty {
  color: var(--accent-light);
  font-weight: 600;
  white-space: nowrap;
}

.ingredient-unit {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  margin-left: 4px;
  white-space: nowrap;
}

/* =========================================================================
   Calculator
   ========================================================================= */
.calc-container {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card-light) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: var(--shadow-md);
  min-width: 0;
}

.calc-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

.calc-actions .btn {
  width: 100%;
}

.calc-result {
  background: var(--bg-surface);
  border-radius: var(--r-md);
  padding: var(--s-4);
  margin-top: var(--s-4);
  border: 1px solid var(--border);
}

.calc-result-item {
  display: flex;
  justify-content: space-between;
  padding: var(--s-1) 0;
  border-bottom: 1px solid var(--border-soft);
}

.calc-result-item:last-child {
  border-bottom: none;
}

.calc-total {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--accent-light);
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 2px solid var(--accent);
}

/* =========================================================================
   Empty states
   ========================================================================= */
.empty {
  text-align: center;
  padding: var(--s-12) var(--s-4);
  color: var(--text-secondary);
}

.empty__icon {
  font-size: 48px;
  margin-bottom: var(--s-3);
  display: block;
}

.empty__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--s-2);
}

.empty__desc {
  font-size: var(--text-sm);
}

/* =========================================================================
   Stock indicators
   ========================================================================= */
.stock-low {
  color: var(--danger);
  font-weight: 600;
}

.stock-ok {
  color: var(--success);
}

.stock-warning {
  color: var(--warning);
}

/* =========================================================================
   Grid & layout utilities
   ========================================================================= */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.stack--sm {
  gap: var(--s-2);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: var(--s-2);
}

.gap-3 {
  gap: var(--s-3);
}

.gap-4 {
  gap: var(--s-4);
}

.mb-2 {
  margin-bottom: var(--s-2);
}

.mb-3 {
  margin-bottom: var(--s-3);
}

.mb-4 {
  margin-bottom: var(--s-4);
}

.mt-2 {
  margin-top: var(--s-2);
}

.mt-3 {
  margin-top: var(--s-3);
}

.mt-4 {
  margin-top: var(--s-4);
}

.text-sm {
  font-size: var(--text-sm);
}

.text-xs {
  font-size: var(--text-xs);
}

.text-muted {
  color: var(--text-secondary);
}

.text-soft {
  color: var(--text-secondary);
}

.font-bold {
  font-weight: 700;
}

.w-full {
  width: 100%;
}

.overflow-hidden {
  overflow: hidden;
}

.text-right {
  text-align: right;
}

/* =========================================================================
   Toast
   ========================================================================= */
.toast {
  position: fixed;
  top: var(--s-4);
  right: var(--s-4);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-md);
  color: var(--text-on-accent);
  z-index: 9999;
  font-size: var(--text-sm);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  min-width: 0;
  max-width: 90vw;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.toast.success {
  background: var(--success);
}

.toast.danger {
  background: var(--danger);
}

.toast.warning {
  background: var(--warning);
}

.toast.info {
  background: var(--info);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* =========================================================================
   Scrollbar
   ========================================================================= */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.14);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.22);
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

/* =========================================================================
   Responsive  -  mencegah melebar pada layar kecil
   ========================================================================= */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar {
    padding: 14px var(--s-6);
  }

  .content-area {
    padding: var(--s-4) var(--s-6) var(--s-8);
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-collapsed);
    z-index: 110;
  }

  .sidebar:not(.collapsed) {
    width: var(--sidebar-width);
    box-shadow: var(--shadow-xl);
  }

  .sidebar.collapsed .sidebar-title,
  .sidebar.collapsed .nav-section-title,
  .sidebar.collapsed .nav-item > span:not(.icon),
  .sidebar.collapsed .sidebar-footer > span {
    display: none;
  }

  .sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
    gap: 0;
  }

  .sidebar:not(.collapsed) .nav-item {
    justify-content: flex-start;
  }

  .main-content,
  .main-content.collapsed {
    left: var(--sidebar-collapsed);
  }

  .topbar {
    padding: 12px var(--s-4);
  }

  .page-title {
    font-size: 20px;
  }

  .content-area {
    padding: var(--s-4) var(--s-4) var(--s-8);
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    margin: var(--s-2);
  }

  .modal-body {
    max-height: calc(95vh - 140px);
  }

  .login-card {
    width: 92vw;
    padding: 32px 24px;
    max-height: 95vh;
  }

  .table-wrapper {
    overflow-x: auto;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-2);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .content-area {
    padding: var(--s-2) var(--s-3) var(--s-6);
  }

  .stat-card {
    padding: var(--s-3);
  }

  .card {
    padding: var(--s-4);
  }

  .modal-content {
    border-radius: var(--r-md);
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: var(--s-4);
  }

  .btn {
    padding: 10px 16px;
    font-size: 13px;
  }
}

/* =========================================================================
   Print-friendly tweaks
   ========================================================================= */
@media print {
  body::before {
    display: none;
  }
  .sidebar,
  .topbar,
  .btn,
  .modal,
  .toast {
    display: none !important;
  }
  .content-area {
    padding: 0;
  }
  /* Kop surat di pojok kiri atas saat dicetak  -  tidak mengganggu konten lain */
  .print-kop {
    width: 100%;
    page-break-after: avoid;
    display: block !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 12px !important;
    padding-bottom: 8px !important;
    border-bottom: 2px solid #222 !important;
    overflow: hidden !important;
    clear: both !important;
  }
  .print-kop img[alt="Kop Surat"] {
    width: 80% !important;
    height: auto !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    display: block !important;
    float: none !important;
  }
  /* Tidak ada lagi kop di pojok kanan  -  semua kop di pojok kiri atas, di atas header */
  .print-kop-right {
    display: block !important;
    text-align: left !important;
  }
  .print-kop-right img[alt="Kop Surat"] {
    width: 80% !important;
    height: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .print-kop > div {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  /* Pastikan semua blok konten di bawah kop surat selalu di bawah, tidak melilit */
  .print-kop + * {
    clear: both !important;
    margin-top: 10px !important;
  }
  .print-kop ~ .meta,
  .print-kop ~ .sheet,
  .print-kop ~ .nota,
  .print-kop ~ table,
  .print-kop ~ h1,
  .print-kop ~ h2,
  .print-kop ~ hr {
    clear: both !important;
    margin-top: 12px !important;
  }
  /* Atur ukuran halaman untuk form cetak */
  @page {
    margin: 12mm;
    size: A4 portrait;
  }
  body {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}


/* --- Extra vibrant accents --- */
.stats-grid .stat-card:nth-child(6n+1) .stat-icon { background: var(--info-soft); color: var(--info); border: 1px solid rgba(6,182,212,0.25); }
.stats-grid .stat-card:nth-child(6n+2) .stat-icon { background: var(--warning-soft); color: var(--warning); border: 1px solid rgba(245,158,11,0.25); }
.stats-grid .stat-card:nth-child(6n+3) .stat-icon { background: var(--success-soft); color: var(--success); border: 1px solid rgba(34,197,94,0.25); }
.stats-grid .stat-card:nth-child(6n+4) .stat-icon { background: rgba(99,102,241,0.16); color: var(--accent-light); border: 1px solid rgba(99,102,241,0.28); }
.stats-grid .stat-card:nth-child(6n+5) .stat-icon { background: rgba(236,72,153,0.16); color: #ec4899; border: 1px solid rgba(236,72,153,0.28); }
.stats-grid .stat-card:nth-child(6n) .stat-icon { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(244,63,94,0.25); }
[data-theme="light"] .stats-grid .stat-card:nth-child(6n+5) .stat-icon { color: #db2777; }

[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.15); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, 0.25); }
[data-theme="light"] .btn-secondary { background: rgba(15, 23, 42, 0.04); }
[data-theme="light"] .btn-secondary:hover:not(:disabled) { background: rgba(15, 23, 42, 0.08); }

/* =========================================================================
   Pengaturan  -  Toast, Modal, Layout
   ========================================================================= */

/* Form actions wrapper */
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  justify-content: flex-start;
}

/* Form row  -  2-column grid for side-by-side inputs */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
  align-items: start;
}

/* btn-full (full width button) */
.btn-full {
  width: 100%;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.show {
  display: flex;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1;
}
.modal-content {
  position: relative;
  z-index: 2;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalFadeIn 0.3s ease;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}
.btn-close {
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.btn-close:hover {
  color: var(--text-primary);
}

/* Toast notification */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
#toast-container > div {
  pointer-events: auto;
  animation: toastSlideIn 0.3s ease;
}
@keyframes toastSlideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastSlideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

/* Form help text */
.form-help {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  display: block;
}

/* Pengaturan  -  form grid responsive tweaks */
@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr !important;
  }
  .modal-content {
    max-width: 92vw;
    max-height: 92vh;
  }
  .modal-body {
    max-height: calc(92vh - 140px);
  }
}

/* =========================================================================
   Missing utilities referenced by app.js (added during cleanup)
   ========================================================================= */

/* Table row action group */
.table-actions {
  display: flex;
  gap: 6px;
}

/* Stock status cell colors */
.stock-low { color: var(--danger); font-weight: 700; }
.stock-ok  { color: var(--success); font-weight: 700; }

/* Secondary badge (was missing from CSS) */
.badge-secondary {
  background: var(--border-soft);
  color: var(--text-muted);
}

/* Print kop left alignment */
.print-kop-left { text-align: left; }

/* Calc result item */
.calc-result-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.calc-total {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 13px;
}

/* Product block (print pengemasan) */
.product-block { margin-bottom: 16px; break-inside: avoid; page-break-inside: avoid; }
.product-block-header {
  margin: 8px 0 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: var(--bg-card-light);
}
.product-block-title { font-weight: 700; font-size: 11.5px; margin-bottom: 4px; }
.product-block-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 10.5px; color: var(--text-secondary); }

/* Backup modal full-width button */
.btn-full { width: 100%; }

/* Toast container (fallback if not defined elsewhere) */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
#toast-container > div { pointer-events: auto; }

/* Ensure modals can be reopened (closeModal only hides, doesn't destroy) */
.modal { display: none; }
.modal.show { display: flex; }

/* =========================================================================
   SVG Icon Styling (replaces emoji throughout the app)
   ========================================================================= */
.icon-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* Nav item icons */
.nav-item .icon svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Sidebar logo icon */
.sidebar-logo svg {
  width: 100%;
  height: 100%;
}

/* Login logo icon */
.login-logo svg {
  width: 56px;
  height: 56px;
}

/* Theme toggle icon */
.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* Stat card icons */
.stat-icon svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* Card title icons */
.card-title .icon svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Ensure SVG inherits currentColor so it follows text/theme colors */
.icon-svg,
.nav-item .icon svg,
.stat-icon svg,
.card-title .icon svg,
.sidebar-logo svg,
.login-logo svg,
.theme-toggle svg {
  fill: currentColor;
  color: currentColor;
}
