:root{
  --app-bg:#f3f4f6;
  --card-bg:#ffffff;
  --border:#e5e7eb;
  --text:#111827;
  --muted:#6b7280;
  --primary:#2563eb;
  --primary-light:#eff6ff;
  --primary-dark:#1d4ed8;
  --sidebar-bg:#ffffff;
  --sidebar-link:#374151;
  --sidebar-active-bg:var(--primary-light);
  --sidebar-active-text:var(--primary-dark);
  --radius:14px;
  --shadow:0 4px 16px rgba(17,24,39,.07);
  --shadow-sm:0 1px 3px rgba(0,0,0,.06);
  --shadow-md:0 4px 12px rgba(0,0,0,.08);
}

html,body{height:100%;}
body{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: var(--app-bg);
  color: var(--text);
  font-size: 0.9rem;
}

a{color:inherit;}
.page-subtitle{color:var(--muted); font-size:.9rem;}

/* ── Layout shell ─────────────────────────────────────────────────────────── */
.app-shell{
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

.app-sidebar{
  width: 260px;
  min-width: 260px;
  flex-shrink: 0;
  padding: 14px 10px 14px 10px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  z-index: 100;
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}
.app-sidebar::-webkit-scrollbar{ width: 4px; }
.app-sidebar::-webkit-scrollbar-thumb{ background: #e5e7eb; border-radius: 4px; }

/* ── Sidebar Search ── */
.sidebar-search-wrap{
  padding: 0 6px;
  margin-bottom: 10px;
  position: relative;
}
.sidebar-search-wrap i{
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: .8rem;
  pointer-events: none;
}
#sidebarSearch{
  padding-left: 30px !important;
  border-radius: 8px !important;
  font-size: .8rem;
  height: 32px;
  border: 1px solid var(--border);
  background: #f9fafb;
  width: 100%;
  outline: none;
  color: var(--text);
}
#sidebarSearch:focus{
  border-color: rgba(37,99,235,.4);
  box-shadow: 0 0 0 2px rgba(37,99,235,.1);
  background: #fff;
}
.nav-search-empty{
  font-size:.78rem; color:var(--muted);
  text-align:center; padding: 10px 0;
  display: none;
}

/* ── Brand ── */
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 8px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
  transition: background .15s;
}
.brand:hover{background:#f9fafb;}
.brand-mark{
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  color: #fff;
  display:flex; align-items:center; justify-content:center;
  font-weight:700;
  font-size: .9rem;
  flex-shrink: 0;
}
.brand-name{font-weight:700; line-height:1.1; font-size: .92rem;}
.brand-sub{color:var(--muted); font-size:.78rem;}

/* ── Top-level section buttons (Operations / Finance / People / etc.) ── */
.nav-section-btn {
  display: flex; align-items: center; width: 100%;
  padding: 0.35rem 0.9rem; font-size: 0.69rem; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase; color: #9ca3af;
  background: none; border: none; cursor: pointer; margin-top: 0.3rem;
  transition: color 0.15s;
}
.nav-section-btn:hover { color: #4b5563; }
body.dark-mode .nav-section-btn { color: #666; }
body.dark-mode .nav-section-btn:hover { color: #ccc; }
.nav-section-btn .chev { margin-left: auto; font-size: 0.6rem; transition: transform 0.2s; }
.nav-section-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

/* ── Sub-section buttons (Inventory / Procurement / etc. within Operations) ── */
.nav-sub-section-btn {
  display: flex; align-items: center; width: 100%;
  padding: 0.42rem 0.7rem 0.42rem 1rem;
  font-size: 0.78rem; font-weight: 600;
  color: var(--sidebar-link);
  background: none; border: none; cursor: pointer;
  border-radius: 10px;
  margin: 1px 4px;
  gap: 6px;
  transition: background .15s, color .15s;
}
.nav-sub-section-btn:hover { background: #f3f4f6; }
.nav-sub-section-btn .chev { margin-left: auto; font-size: 0.6rem; transition: transform 0.2s; color: #9ca3af; }
.nav-sub-section-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.nav-sub-section-btn[aria-expanded="true"] { color: var(--primary-dark); background: var(--primary-light); }
.nav-sub-section-btn i.module-icon { color: var(--muted); font-size: .78rem; }
.nav-sub-section-btn[aria-expanded="true"] i.module-icon { color: var(--primary-dark); }
body.dark-mode .nav-sub-section-btn { color: #ccc; }
body.dark-mode .nav-sub-section-btn:hover { background: #0f3460; }
body.dark-mode .nav-sub-section-btn[aria-expanded="true"] { background: #0f3460; color: #60a5fa; }

/* ── Nav links (leaves) ── */
.app-sidebar .nav-link {
  width: calc(100% - 8px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px 7px 14px;
  border-radius: 9px;
  color: var(--sidebar-link);
  text-decoration: none;
  margin: 1px 4px;
  font-weight: 500;
  font-size: .82rem;
  transition: background .12s, color .12s;
}
.app-sidebar .nav-link i { font-size: .78rem; color: #9ca3af; flex-shrink: 0; }
.app-sidebar .nav-link:hover { background: #f3f4f6; color: var(--text); }
.app-sidebar .nav-link:hover i { color: #6b7280; }
.app-sidebar .nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}
.app-sidebar .nav-link.active i { color: var(--primary-dark); }

/* ── Nav sub-section indent ── */
.nav-sub { padding-left: 14px !important; }

/* ── Group label (smaller secondary divider) ── */
.nav-group-label {
  font-size: 0.62rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: #d1d5db;
  padding: 0.55rem 1rem 0.15rem 1.5rem;
}
body.dark-mode .nav-group-label { color: #2a3a5a; }

.nav-divider { border-top: 1px solid #f3f4f6; margin: 0.4rem 10px; }
body.dark-mode .nav-divider { border-top-color: #1e2a4a; }

/* ── Quick Actions bar ── */
.quick-actions {
  padding: 2px 4px 10px;
}
.qa-label {
  font-size: 0.62rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: #d1d5db;
  padding: 0.3rem 0.5rem 0.25rem;
}
.qa-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
}
.qa-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 6px;
  border-radius: 9px; background: #f3f4f6;
  color: var(--sidebar-link); text-decoration: none;
  font-size: 0.69rem; font-weight: 500; line-height: 1.2;
  transition: background .12s, color .12s;
  text-align: center;
}
.qa-btn i { font-size: 1rem; color: var(--primary); }
.qa-btn:hover { background: var(--primary-light); color: var(--primary-dark); }
.qa-btn:hover i { color: var(--primary-dark); }
body.dark-mode .qa-btn { background: #0f3460; color: #ccc; }
body.dark-mode .qa-btn:hover { background: #1a4a80; color: #fff; }
body.dark-mode .qa-btn i { color: #60a5fa; }

/* ── Sidebar standalone home link ── */
.sidebar-home {
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  margin: 2px 4px 2px !important;
}

/* ── Sidebar footer ── */
.sidebar-footer {
  margin-top: auto;
  padding: 12px 8px 4px;
  border-top: 1px solid var(--border);
}
.sidebar-footer .small { font-size: .72rem; }
.sidebar-footer .fw-semibold { font-size: .82rem; }

/* ══════════════════════════════════════════════════════════════════════════
   MINI SIDEBAR RAIL + CONTEXT PANEL  (business/ERP org type only)
   ══════════════════════════════════════════════════════════════════════════ */

/* Shell wrapper that holds rail + panel side by side */
.app-sidebar-shell {
  display: flex;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

/* ── Icon Rail ── */
.sidebar-rail {
  width: 70px;
  min-width: 70px;
  background: #1e293b;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 8px;
  overflow: hidden;
  flex-shrink: 0;
  scrollbar-width: none;
}

.rail-brand {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .95rem;
  margin-bottom: 14px;
  flex-shrink: 0;
  text-decoration: none;
  transition: opacity .15s;
}
.rail-brand:hover { opacity: .85; }

.rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 58px;
  padding: 8px 4px;
  border-radius: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 0.6rem;
  font-weight: 500;
  line-height: 1.2;
  transition: background .15s, color .15s;
  margin: 1px 0;
  text-align: center;
  text-decoration: none;
}
.rail-btn i { font-size: 1.1rem; transition: color .15s; }
.rail-btn:hover { background: rgba(255,255,255,.09); color: #e2e8f0; }
.rail-btn:hover i { color: #e2e8f0; }
.rail-btn.active, .rail-btn.panel-active {
  background: rgba(37,99,235,.25);
  color: #93c5fd;
}
.rail-btn.active i, .rail-btn.panel-active i { color: #93c5fd; }

.rail-spacer { flex: 1; }

.rail-divider {
  width: 36px;
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 6px 0;
  flex-shrink: 0;
}

.rail-user {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.rail-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #334155;
  color: #cbd5e1;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 600;
}

/* ── Context Panel ── */
.sidebar-panel {
  width: 0;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width .22s cubic-bezier(.4,0,.2,1), min-width .22s cubic-bezier(.4,0,.2,1);
  flex-shrink: 0;
}
.sidebar-panel.open {
  width: 240px;
  min-width: 240px;
}
body.dark-mode .sidebar-panel { background: #16213e; border-right-color: #0f3460; }

.sidebar-panel-header {
  display: flex;
  align-items: center;
  padding: 13px 12px 10px 14px;
  font-weight: 700;
  font-size: .82rem;
  color: #111827;
  border-bottom: 1px solid var(--border);
  min-width: 240px;
  gap: 7px;
  flex-shrink: 0;
}
.sidebar-panel-header i { color: var(--primary); font-size: .9rem; }
body.dark-mode .sidebar-panel-header { color: #e0e0e0; border-bottom-color: #0f3460; }

.panel-close-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  padding: 3px 5px;
  border-radius: 5px;
  font-size: .85rem;
  display: flex; align-items: center;
  transition: background .12s, color .12s;
}
.panel-close-btn:hover { background: #f3f4f6; color: #374151; }
body.dark-mode .panel-close-btn:hover { background: #0f3460; color: #e0e0e0; }

.sidebar-panel-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 0 12px;
  min-width: 240px;
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}
.sidebar-panel-body::-webkit-scrollbar { width: 3px; }
.sidebar-panel-body::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 3px; }

/* Panel content blocks (one per module) */
.panel-content { display: none; }
.panel-content.active { display: block; }

/* Panel links */
.panel-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 14px;
  color: #374151;
  text-decoration: none;
  font-size: .81rem;
  font-weight: 500;
  border-radius: 8px;
  margin: 1px 6px;
  transition: background .12s, color .12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-link i { font-size: .76rem; color: #9ca3af; flex-shrink: 0; }
.panel-link:hover { background: #f3f4f6; color: #111827; }
.panel-link:hover i { color: #6b7280; }
.panel-link.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.panel-link.active i { color: var(--primary-dark); }
body.dark-mode .panel-link { color: #ccc; }
body.dark-mode .panel-link:hover { background: #0f3460; color: #fff; }
body.dark-mode .panel-link.active { background: #0f3460; color: #60a5fa; }

/* Panel section label */
.panel-section {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: #d1d5db;
  padding: 0.55rem 14px 0.12rem;
}
body.dark-mode .panel-section { color: #2a3a5a; }

/* Panel divider */
.panel-divider { border-top: 1px solid #f3f4f6; margin: 4px 10px; }
body.dark-mode .panel-divider { border-top-color: #1e2a4a; }

/* Advanced items toggle */
.panel-advanced-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 14px;
  margin: 2px 6px;
  font-size: .78rem;
  color: #9ca3af;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  width: calc(100% - 12px);
  transition: background .12s, color .12s;
}
.panel-advanced-btn:hover { background: #f3f4f6; color: #6b7280; }
.panel-advanced-btn .chev { margin-left: auto; font-size: .58rem; transition: transform .2s; }
.panel-advanced-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.panel-advanced-collapse { padding-left: 10px; }
body.dark-mode .panel-advanced-btn { color: #555; }
body.dark-mode .panel-advanced-btn:hover { background: #0f3460; color: #94a3b8; }

/* ── Topbar Quick Actions (FAB group) ── */
.fab-group {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-right: 4px;
}
.fab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 7px;
  background: #f3f4f6;
  color: #374151;
  text-decoration: none;
  font-size: .88rem;
  transition: background .12s, color .12s;
  border: 1px solid var(--border);
  position: relative;
}
.fab-btn:hover { background: var(--primary-light); color: var(--primary); border-color: rgba(37,99,235,.3); }
body.dark-mode .fab-btn { background: #0f3460; color: #ccc; border-color: #1a4a80; }
body.dark-mode .fab-btn:hover { background: #1a4a80; color: #60a5fa; }

/* ── Main content area ────────────────────────────────────────────────────── */
.app-main {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
}

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.app-topbar {
  height: 58px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.topbar-title { font-weight: 600; color: #111827; font-size: .88rem; }
.topbar-spacer { flex: 1; }
.topbar-search {
  position: relative;
  width: min(420px, 45vw);
}
.topbar-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: .8rem;
}
.topbar-search input {
  padding-left: 34px !important;
  border-radius: 999px !important;
  border: 1px solid var(--border) !important;
  background: #f9fafb !important;
  font-size: .82rem !important;
  height: 34px;
}
.topbar-search input:focus {
  border-color: rgba(37,99,235,.4) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1) !important;
  background: #fff !important;
}
.topbar-user .btn { border-radius: 999px; font-size: .78rem; }
.app-topbar .btn-outline-secondary { border-color: var(--border); color: var(--muted); }
.app-topbar .btn-outline-secondary:hover { background: #f3f4f6; color: var(--text); border-color: #d1d5db; }

/* ── Content ──────────────────────────────────────────────────────────────── */
.app-content { padding: 22px 24px; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--card-bg);
  transition: box-shadow .15s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card .card-body { padding: 18px; }
.card-header {
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0 !important;
  border-bottom: 1px solid var(--border);
  padding: 12px 18px;
  font-weight: 600;
  font-size: .88rem;
  background: #fafafa;
}

/* ── Stat/KPI cards ─────────────────────────────────────────────────────── */
.stat-card { text-align: center; padding: 20px 16px; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 4px; }
.stat-card .stat-icon { font-size: 1.4rem; margin-bottom: 8px; opacity: .8; }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table { --bs-table-bg: transparent; font-size: .84rem; }
.table thead th {
  color: var(--muted);
  font-weight: 600;
  font-size: .71rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  background: #fafafa;
  white-space: nowrap;
}
.table td, .table th { vertical-align: middle; padding: 10px 12px; }
.table-hover tbody tr { transition: background .1s; }
.table-hover tbody tr:hover { background: #f0f7ff !important; }
.table tbody tr:not(:last-child) { border-bottom: 1px solid #f3f4f6; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge { font-weight: 500; font-size: .71rem; border-radius: 6px; padding: .28em .55em; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn { border-radius: 8px; font-weight: 500; font-size: .83rem; transition: all .12s; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-secondary { border-width: 1px; }
.btn-sm { padding: .32rem .65rem; font-size: .78rem; }
.btn-lg { border-radius: 10px; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: 9px;
  border: 1px solid var(--border);
  font-size: .85rem;
}
.form-control:focus, .form-select:focus {
  border-color: rgba(37,99,235,.4);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-label { font-weight: 500; font-size: .82rem; margin-bottom: .35rem; }

.alert { border-radius: 10px; font-size: .85rem; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb { font-size: .78rem; margin-bottom: 14px; }
.breadcrumb-item + .breadcrumb-item::before { color: #d1d5db; }
.breadcrumb-item.active { color: var(--muted); }

/* ── Action bar ───────────────────────────────────────────────────────────── */
.action-bar {
  position: sticky;
  bottom: 10px;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  padding: 12px;
  background: rgba(243,244,246,.85);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  margin-top: 12px;
}
.action-bar > * { width: 100%; max-width: 1100px; }
.action-bar .btn { box-shadow: var(--shadow-sm); }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination { font-size: .82rem; gap: 2px; }
.page-link { border-radius: 8px !important; border-color: var(--border); color: var(--muted); padding: .35rem .6rem; }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }
.page-link:hover { background: #f3f4f6; color: var(--text); }

/* ── Page header helper ──────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-header h2, .page-header h3 { margin-bottom: 0; font-weight: 700; }

/* ── Dark Mode ─────────────────────────────────────────────────────────── */
body.dark-mode {
  --app-bg: #0f172a;
  --card-bg: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --sidebar-bg: #1e293b;
  --sidebar-link: #cbd5e1;
  --sidebar-active-bg: rgba(37,99,235,.2);
  --sidebar-active-text: #93c5fd;
  background-color: #0f172a !important;
  color: #e2e8f0 !important;
}
body.dark-mode .card { background-color: #1e293b !important; border-color: #334155 !important; }
body.dark-mode .card-header { background-color: #263245 !important; color: #e2e8f0 !important; border-color: #334155 !important; }
body.dark-mode .table { --bs-table-bg: transparent; color: #e2e8f0; }
body.dark-mode .table thead th { background: #263245; color: #94a3b8; border-color: #334155; }
body.dark-mode .table-hover tbody tr:hover { background: rgba(37,99,235,.12) !important; }
body.dark-mode .table tbody tr { border-bottom-color: #2d3f55; }
body.dark-mode .form-control, body.dark-mode .form-select {
  background-color: #263245; color: #e2e8f0; border-color: #334155;
}
body.dark-mode .form-control::placeholder { color: #64748b; }
body.dark-mode aside { background-color: #1e293b !important; border-right-color: #334155 !important; }
body.dark-mode .app-topbar { background-color: #1e293b !important; border-bottom-color: #334155 !important; }
body.dark-mode .badge.bg-light { background-color: #334155 !important; color: #e2e8f0 !important; }
body.dark-mode .list-group-item { background-color: #1e293b; color: #e2e8f0; border-color: #334155; }
body.dark-mode .list-group-item:hover { background-color: #263245; }
body.dark-mode .alert { border-color: #334155; }
body.dark-mode .input-group-text { background-color: #263245; color: #e2e8f0; border-color: #334155; }
body.dark-mode .btn-outline-secondary { color: #94a3b8; border-color: #475569; }
body.dark-mode .text-muted { color: #94a3b8 !important; }
body.dark-mode .bg-light { background-color: #1e293b !important; }
body.dark-mode .nav-link { color: #cbd5e1; }
body.dark-mode .nav-link:hover { color: #f1f5f9; background-color: #263245; }
body.dark-mode .nav-link.active { background: rgba(37,99,235,.25); color: #93c5fd; }
body.dark-mode .nav-link.active i { color: #93c5fd; }
body.dark-mode .nav-link i { color: #64748b; }
body.dark-mode .nav-link:hover i { color: #94a3b8; }
body.dark-mode .page-link { background-color: #1e293b; border-color: #334155; color: #e2e8f0; }
body.dark-mode .dropdown-menu { background-color: #1e293b; border-color: #334155; }
body.dark-mode .dropdown-item { color: #e2e8f0; }
body.dark-mode .dropdown-item:hover { background-color: #263245; }
body.dark-mode .table-light { --bs-table-bg: #263245; color: #e2e8f0; }
body.dark-mode .card-header { background-color: #263245 !important; }
body.dark-mode #sidebarSearch { background: #263245; color: #e2e8f0; border-color: #334155; }
body.dark-mode #sidebarSearch:focus { border-color: rgba(37,99,235,.5); background: #1e293b; }
body.dark-mode .brand-mark { background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%); }
body.dark-mode .brand:hover { background: #263245; }

/* ── Print styles ──────────────────────────────────────────────────────── */
@media print {
  aside, .topbar, nav.navbar, .sidebar-footer,
  .btn, .pagination, .no-print { display: none !important; }
  .app-content { margin: 0 !important; padding: 0 !important; }
  body { background: white !important; color: black !important; }
  .card { border: 1px solid #ccc !important; box-shadow: none !important; }
  a[href]:after { content: none !important; }
  .badge { border: 1px solid #999; }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 767.98px){
  .app-content{ padding: 14px; }
  .app-topbar{ display: none; }
}
@media (min-width: 768px){
  .offcanvas-backdrop{ display: none !important; }
}
