:root {
  color-scheme: dark;
  --page-bg: #000000;
  --shell-bg: #000000;
  --shell-bg-soft: #070707;
  --shell-line: rgba(255, 255, 255, 0.06);
  --topbar-height: 68px;
  --active-zone-gap: 18px;
  --content-bg: #191d25;
  --content-bg-2: #202530;
  --content-bg-3: #252b37;
  --content-line: rgba(255, 255, 255, 0.06);
  --text: #f5f7fb;
  --text-soft: #c7cfde;
  --text-muted: #8b96aa;
  --text-faint: #5f697b;
  --accent: #1fb9ff;
  --accent-soft: rgba(31, 185, 255, 0.16);
  --positive: #53d57b;
  --positive-soft: rgba(83, 213, 123, 0.14);
  --warning: #f1c160;
  --danger: #ff6a6a;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.30);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 11px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--page-bg);
  color: var(--text);
  font-family: Manrope, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 400;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

/* BALPHARM shell geometry, adapted only for Personal ERP modules. */
.app-body { min-height: 100vh; background: var(--page-bg); }
.shell-frame { display: flex; min-height: 100vh; width: 100%; background: var(--page-bg); }

.sidenav {
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: 88px;
  flex: 0 0 88px;
  padding-top: calc(var(--topbar-height) + var(--active-zone-gap));
  min-height: 100vh;
  max-height: 100vh;
  overflow: visible;
  z-index: 20;
}
.sidenav-panel {
  position: relative;
  width: 88px;
  min-height: calc(100vh - var(--topbar-height) - var(--active-zone-gap));
  max-height: calc(100vh - var(--topbar-height) - var(--active-zone-gap));
  padding: 18px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
  background: rgba(8, 10, 14, 0.20);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  box-shadow: 0 20px 34px rgba(0, 0, 0, 0.16);
  transition: width .24s ease, box-shadow .24s ease, background .24s ease;
}
.sidenav:hover .sidenav-panel,
.sidenav:focus-within .sidenav-panel {
  width: 244px;
  background: rgba(8, 10, 14, 0.27);
  box-shadow: 18px 0 32px rgba(0, 0, 0, 0.24);
}
.menu-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  scrollbar-width: none;
}
.mobile-menu-list { display: none; }
.menu-list::-webkit-scrollbar, .tabs::-webkit-scrollbar { width: 0; height: 0; }
.menu-item {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.menu-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--text-soft); }
.menu-item:focus-visible { outline: 0; background: rgba(255, 255, 255, 0.04); }
.menu-item.active, .menu-item.active:hover { color: var(--accent); background: transparent; }
.menu-icon, .menu-icon svg { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; }
.menu-icon { flex: 0 0 18px; }
.menu-group { display: flex; flex-direction: column; gap: 4px; }
.menu-group summary { list-style: none; }
.menu-group summary::-webkit-details-marker { display: none; }
.menu-caret { display: inline-flex; color: var(--text-faint); transition: transform .18s ease, color .18s ease, opacity .18s ease; }
.menu-caret svg { width: 16px; height: 16px; }
.menu-group[open] > .menu-item-group .menu-caret { transform: rotate(90deg); }
.menu-group.active > .menu-item-group { color: var(--accent); }
.submenu-list { display: flex; flex-direction: column; gap: 3px; padding: 0 0 4px 40px; overflow: hidden; transition: opacity .18s ease, max-height .22s ease, padding .22s ease; }
.submenu-item { min-height: 31px; display: inline-flex; align-items: center; color: var(--text-faint); font-size: .75rem; font-weight: 600; transition: color .18s ease; }
.submenu-item::before { content: ""; width: 4px; height: 4px; margin-right: 9px; border-radius: 999px; background: currentColor; opacity: .38; }
.submenu-item:hover, .submenu-item.active { color: var(--accent); }
.menu-label {
  flex: 1;
  overflow: hidden;
  font-size: .82rem;
  font-weight: 500;
  transition: opacity .18s ease, max-width .22s ease, transform .22s ease;
}
.sidenav:not(:hover):not(:focus-within) .menu-item { justify-content: center; padding: 0; gap: 0; min-height: 40px; }
.sidenav:not(:hover):not(:focus-within) .menu-label {
  width: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateX(-8px);
}
.sidenav:not(:hover):not(:focus-within) .menu-caret { width: 0; opacity: 0; overflow: hidden; }
.sidenav:not(:hover):not(:focus-within) .submenu-list { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; pointer-events: none; }
.sidenav:not(:hover):not(:focus-within) .menu-icon,
.sidenav:not(:hover):not(:focus-within) .menu-icon svg { width: 22px; height: 22px; flex-basis: 22px; }

.main-shell { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--page-bg); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--topbar-height);
  padding: 14px 20px;
  background: var(--shell-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-left, .breadcrumbs, .topbar-right, .theme-switch, .user-box, .panel-actions, .filter-row {
  display: flex;
  align-items: center;
}
.topbar-left { gap: 18px; min-width: 0; flex: 1; }
.topbar-brand { display: inline-flex; align-items: center; justify-content: flex-start; width: 72px; min-width: 72px; max-width: 72px; flex: 0 0 72px; }
.brand-logo { display: block; width: 72px; min-width: 72px; max-width: 100%; height: auto; }
.breadcrumbs { gap: 8px; min-width: 0; flex-wrap: wrap; }
.crumb { color: var(--text-faint); font-size: .78rem; font-weight: 600; }
.crumb.current { color: var(--text-soft); }
.crumb-sep { color: var(--text-faint); display: inline-flex; }
.crumb-sep svg { width: 15px; height: 15px; }
.topbar-right { gap: 12px; flex-wrap: wrap; }
.theme-switch { gap: 10px; }
.switch-dot {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.switch-dot svg { width: 18px; height: 18px; }
.switch-dot.active, .switch-dot:hover { color: var(--text); }
.switch-dot:disabled { opacity: .35; cursor: default; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-box { gap: 8px; min-height: 38px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.user-meta { text-align: right; }
.user-meta strong { display: block; font-size: .8rem; font-weight: 600; }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-soft);
}
.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--content-bg-2) 0%, var(--content-bg) 100%);
  border: 1px solid var(--content-line);
  box-shadow: 0 24px 48px rgba(0, 0, 0, .22);
  display: grid;
  gap: 12px;
  z-index: 40;
}
.user-menu-person { display: grid; gap: 4px; }
.user-menu-person strong { font-size: .88rem; }
.user-menu-person span { color: var(--text-muted); font-size: .78rem; }
.user-menu-panel form { margin: 0; }
.user-menu-logout {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,.04);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.user-menu-logout:hover { background: rgba(255,255,255,.08); }
.user-menu-logout svg { width: 18px; height: 18px; }

.page-section { flex: 1; min-height: 0; padding: var(--active-zone-gap) 0 0; display: flex; flex-direction: column; }
.panel-surface {
  flex: 1;
  min-height: 100%;
  border-radius: var(--radius-xl);
  border-top-right-radius: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: linear-gradient(180deg, #1c2029 0%, #171b23 100%);
  border: 1px solid var(--content-line);
  padding: 14px 16px 18px;
  box-shadow: var(--shadow);
}
.panel-surface.panel-surface-tabs { padding-top: 8px; }
.panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 4px 2px 14px;
}
.panel-surface.panel-surface-tabs .panel-head { padding-top: 0; gap: 10px; }
.panel-head-main { min-width: 0; min-height: 0; display: flex; align-items: center; gap: 18px; }
.panel-head-table-toolbar { min-width: 0; width: max-content; margin-left: auto; justify-self: end; align-self: center; }
.panel-head-table-toolbar .table-toolbar { margin: 0; padding: 0; border: 0; justify-content: flex-end; }
.panel-head-table-toolbar .table-toolbar-actions { margin-left: 0; flex-wrap: nowrap; justify-content: flex-end; align-items: flex-end; }
.panel-head.panel-head-finance-promoted-toolbar { grid-template-columns: minmax(0, 1fr) max-content; align-items: center; column-gap: clamp(12px, 2vw, 42px); padding-top: 0; padding-bottom: 8px; }
.panel-head.panel-head-finance-promoted-toolbar .panel-head-main,
.panel-head.panel-head-finance-promoted-toolbar .panel-head-table-toolbar { align-self: center; }
.tabs { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-x: auto; padding: 4px 2px 14px; border: 0; margin-bottom: 10px; scrollbar-width: none; }
.tabs-inline { display: inline-flex; align-items: flex-end; padding: 0; margin: 0; border: 0; overflow: auto hidden; min-height: 34px; }
.panel-global-tabs { gap: 8px; }
.tab-button { position: relative; min-height: 34px; padding: 0 2px 8px; border: 0; border-radius: 0; background: transparent; color: var(--text-muted); font-size: .76rem; font-weight: 500; white-space: nowrap; transition: color .18s ease; cursor: pointer; }
.tab-button:hover { color: var(--text-soft); background: transparent; }
.tab-button.active { color: var(--text); background: transparent; font-weight: 800; }
.tab-button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 999px; background: var(--text); }
.action-button, .filter-chip, .table-tool-button { position: relative; min-height: 36px; padding: 0 2px 8px; border: 0; border-radius: 0; background: transparent; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: .8rem; font-weight: 500; transition: color .18s ease; cursor: pointer; }
.action-button:hover, .filter-chip:hover, .table-tool-button:hover { background: transparent; color: var(--text-soft); }
.action-button.erp-green-action { min-height: 38px; padding: 0 18px; border-radius: 8px; color: var(--positive); font-size: .84rem; font-weight: 700; line-height: 1; transition: background .16s ease, color .16s ease; }
.action-button.erp-green-action:hover, .action-button.erp-green-action:focus-visible { background: var(--positive-soft); color: var(--positive); outline: none; }
.operation-create-menu { position: relative; }
.operation-create-menu summary { list-style: none; }
.operation-create-menu summary::-webkit-details-marker { display: none; }
.operation-create-options { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 300px; padding: 8px; display: grid; gap: 2px; border: 1px solid var(--content-line); border-radius: 14px; background: var(--content-bg-2); box-shadow: 0 20px 40px rgba(0,0,0,.3); }
.operation-create-options a { padding: 10px 11px; display: grid; gap: 3px; border-radius: 9px; }
.operation-create-options a:hover { background: rgba(255,255,255,.04); }
.operation-create-options strong { color: var(--text-soft); font-size: .8rem; }
.operation-create-options span { color: var(--text-faint); font-size: .7rem; line-height: 1.4; }
.table-tool-button svg { width: 16px; height: 16px; }
.kpi-toggle-button { min-width: 40px; min-height: 34px; flex: 0 0 auto; padding: 0 2px 8px; color: var(--accent); }
.kpi-toggle-button:hover, .kpi-toggle-button.is-expanded { color: var(--text); }
.kpi-toggle-button:focus-visible { outline: 0; }
.kpi-toggle-button svg { width: 34px; height: 34px; transition: transform .16s ease; }
.kpi-toggle-button svg path { stroke-width: 1.2; }
.kpi-toggle-button.is-expanded svg { transform: rotate(180deg); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 14px; }
[data-kpi-panel][hidden] { display: none !important; }
.stat-card { min-height: 148px; padding: 16px 18px; background: linear-gradient(180deg,var(--content-bg-2) 0%,var(--content-bg) 100%); border: 1px solid var(--content-line); border-radius: var(--radius-lg); }
.stat-card-head { display: flex; align-items: center; gap: 14px; }
.stat-topline { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-topline span { color: var(--text-faint); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.stat-card strong { display: block; margin-top: 10px; font-size: 1.8rem; font-weight: 800; letter-spacing: -.04em; }
.stat-card p { min-height: calc(.8rem * 1.55 * 2); margin: 10px 0 0; color: var(--text-muted); font-size: .8rem; line-height: 1.55; }

.table-card { padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.table-card-head { min-height: 54px; padding: 4px 2px 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.page-heading-compact { min-width: 0; }
.page-heading-compact h1 { margin: 0; font-size: clamp(1.25rem, 1.5vw, 1.65rem); font-weight: 800; letter-spacing: -.04em; }
.page-heading-compact p { margin: 5px 0 0; color: var(--text-muted); font-size: .78rem; line-height: 1.45; }
.filter-row { gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.table-toolbar-meta { min-height: 34px; display: flex; align-items: center; gap: 4px; color: var(--text-muted); font-size: .76rem; font-weight: 600; }
.table-toolbar-actions { margin-left: auto; display: flex; align-items: flex-end; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.table-search { min-width: min(260px,24vw); min-height: 34px; padding: 0 0 8px; display: flex; align-items: center; gap: 10px; color: var(--text-muted); }
.table-search svg { width: 16px; height: 16px; flex: 0 0 16px; }
.table-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: .78rem; }
.table-search input::placeholder { color: var(--text-faint); }
.column-picker { position: relative; }
.column-picker summary { list-style: none; }
.column-picker summary::-webkit-details-marker { display: none; }
.column-picker-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 210px; padding: 8px; display: grid; gap: 2px; border: 1px solid var(--content-line); border-radius: 12px; background: var(--content-bg-2); box-shadow: 0 20px 40px rgba(0,0,0,.28); }
.column-picker-menu label { min-height: 34px; padding: 0 8px; display: flex; align-items: center; gap: 9px; color: var(--text-muted); font-size: .76rem; cursor: pointer; }
.column-picker-menu label:hover { color: var(--text); background: rgba(255,255,255,.035); border-radius: 8px; }
.column-picker-menu input { accent-color: var(--accent); }
.table-scroll { position: relative; overflow-x: auto; overflow-y: auto; max-height: clamp(360px, calc(100vh - var(--topbar-height) - 240px), 760px); border-radius: 16px; background: rgba(255,255,255,.028); isolation: isolate; scrollbar-gutter: stable; overscroll-behavior: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.table-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.table-scroll::-webkit-scrollbar-track { background: transparent; }
.table-scroll::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(255,255,255,.18); }
.data-table { position: relative; z-index: 1; width: 100%; min-width: 960px; border-collapse: separate; border-spacing: 0; border: 1px solid rgba(255,255,255,.08); border-radius: 16px; overflow: visible; }
.data-table th { position: sticky; top: 0; z-index: 12; padding: 13px 12px; background: rgba(44,53,67,.96); color: var(--text-muted); text-align: left; font-size: .7rem; font-weight: 700; letter-spacing: .04em; backdrop-filter: blur(8px); }
.data-table thead th:first-child { border-top-left-radius: 16px; }
.data-table thead th:last-child { border-top-right-radius: 16px; }
.table-head-trigger { width: 100%; min-height: 26px; padding: 0; border: 0; background: transparent; color: inherit; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; letter-spacing: inherit; font: inherit; cursor: pointer; }
.table-head-trigger:hover, .table-head-trigger.is-sorted { color: var(--text-soft); }
.table-head-trigger svg { width: 14px; height: 14px; opacity: .42; transition: transform .14s ease, opacity .14s ease; }
.table-head-trigger.is-sorted svg { opacity: 1; }
.table-head-trigger.is-desc svg { transform: rotate(180deg); }
.data-table tbody td { padding: 12px; border-top: 1px solid rgba(255,255,255,.04); color: var(--text-soft); font-size: .79rem; line-height: 1.45; vertical-align: top; background: rgba(255,255,255,.028); }
.data-table tbody tr:first-child td { border-top: 0; }
.data-table td strong { color: var(--text); font-weight: 700; }
.data-table tbody tr:hover td { background: rgba(255,255,255,.072); }
.data-table tbody tr:last-child td:first-child { border-bottom-left-radius: 16px; }
.data-table tbody tr:last-child td:last-child { border-bottom-right-radius: 16px; }
.table-empty-state { min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; text-align: center; }
.table-empty-state strong { color: var(--text-soft); font-size: .84rem; }
.table-empty-state span { max-width: 420px; color: var(--text-faint); font-size: .76rem; line-height: 1.5; }

/* Login remains a quiet Personal ERP entry surface. */
.eyebrow { margin: 0 0 8px; color: var(--text-muted); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.14); border-radius: 18px; background: var(--content-bg-2); color: var(--accent); font-size: 26px; font-weight: 800; }
.login-body { min-height: 100vh; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); }
.login-brand { position: relative; min-height: 100vh; padding: clamp(42px, 7vw, 108px); display: flex; flex-direction: column; justify-content: center; overflow: hidden; background: radial-gradient(circle at 20% 18%, rgba(31,185,255,.12), transparent 36%), linear-gradient(145deg, #11151c 0%, #171c25 54%, #101218 100%); }
.login-brand::after { content: ""; position: absolute; width: min(56vw,760px); aspect-ratio: 1; right: -22%; bottom: -42%; border: 1px solid rgba(255,255,255,.06); border-radius: 50%; box-shadow: 0 0 0 82px rgba(255,255,255,.018), 0 0 0 164px rgba(255,255,255,.012); }
.login-brand .brand-mark { margin-bottom: 72px; }
.login-brand h1 { margin: 0; font-size: clamp(46px,6vw,88px); line-height: .95; letter-spacing: -.055em; }
.login-lead { max-width: 560px; margin: 26px 0 0; color: var(--text-soft); font-size: clamp(18px,2vw,25px); line-height: 1.45; }
.login-balance { margin-top: 72px; display: flex; align-items: center; gap: 14px; color: var(--text-muted); font-size: 12px; }
.login-balance i { width: 34px; height: 1px; background: var(--content-line); }
.login-balance strong { color: var(--positive); }
.login-form-zone { min-height: 100vh; padding: 42px; display: grid; place-items: center; background: #0c0e12; }
.login-form { width: min(100%,410px); }
.login-form header { margin-bottom: 34px; }
.login-form h2 { margin: 0 0 10px; font-size: 34px; letter-spacing: -.035em; }
.login-form header p:last-child { margin: 0; color: var(--text-muted); }
.login-form label { display: grid; gap: 9px; margin: 0 0 18px; color: var(--text-soft); font-size: 13px; font-weight: 650; }
.login-form input { width: 100%; height: 54px; border: 1px solid var(--content-line); border-radius: 14px; outline: none; padding: 0 16px; background: var(--content-bg); color: var(--text); }
.login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--content-bg-2); }
.form-error { margin: 0 0 18px; padding: 12px 14px; border-left: 3px solid var(--danger); background: rgba(255,106,106,.09); color: #ffc0c0; }
.primary-button { height: 54px; border: 0; border-radius: 14px; padding: 0 20px; background: var(--accent); color: #061017; font-weight: 800; cursor: pointer; }
.login-form .primary-button { width: 100%; }
.privacy-note { margin: 16px 0 0; color: var(--text-faint); font-size: 12px; text-align: center; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .panel-head, .panel-head.panel-head-finance-promoted-toolbar { grid-template-columns: 1fr; align-items: start; }
  .panel-head-table-toolbar { width: 100%; margin-left: 0; justify-self: stretch; overflow-x: auto; }
  .panel-head-table-toolbar .table-toolbar { width: max-content; min-width: 100%; }
  .panel-head-table-toolbar .table-toolbar-actions { justify-content: flex-start; }
  .table-card-head { align-items: flex-start; flex-direction: column; }
  .filter-row { justify-content: flex-start; }
}

@media (max-width: 720px) {
  .login-layout { display: block; }
  .login-brand { min-height: 42vh; padding: 34px 24px; justify-content: end; }
  .login-brand .brand-mark { margin-bottom: 42px; }
  .login-brand h1 { font-size: 48px; }
  .login-lead { font-size: 17px; }
  .login-balance { display: none; }
  .login-form-zone { min-height: 58vh; padding: 34px 24px 48px; place-items: start stretch; }
  .login-form { margin: auto; }

  .shell-frame { display: block; }
  .sidenav { position: fixed; inset: auto 0 0; width: 100%; min-height: 70px; max-height: 70px; padding: 0; z-index: 50; }
  .sidenav-panel, .sidenav:hover .sidenav-panel, .sidenav:focus-within .sidenav-panel { width: 100%; min-height: 70px; max-height: 70px; padding: 8px 10px; background: rgba(0,0,0,.92); box-shadow: 0 -8px 28px rgba(0,0,0,.28); backdrop-filter: blur(18px); }
  .menu-list { display: none; }
  .mobile-menu-list { width: 100%; display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; }
  .mobile-menu-item { min-height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 12px; color: var(--text-muted); }
  .mobile-menu-item.active { color: var(--accent); background: var(--accent-soft); }
  .mobile-menu-item svg { width: 21px; height: 21px; }
  .main-shell { min-height: 100vh; padding-bottom: 70px; }
  .topbar { position: sticky; min-height: 60px; padding: 10px 14px; }
  .topbar-brand { width: 65px; min-width: 65px; flex-basis: 65px; }
  .brand-logo { width: 65px; min-width: 65px; }
  .breadcrumbs .crumb:first-child, .crumb-sep, .theme-switch, .user-meta { display: none; }
  .page-section { padding: 14px 0 0 14px; }
  .panel-surface { padding: 8px 14px 16px; border-radius: 20px 0 0 0; }
  .panel-head-table-toolbar .table-toolbar-actions { flex-wrap: nowrap; }
  .panel-global-tabs { width: 100%; }
  .tab-button { padding-inline: 2px; }
  .stats-grid { grid-template-columns: 1fr; }
  .table-card { padding-top: 0; }
  .filter-row { flex-wrap: nowrap; width: 100%; overflow-x: auto; }
  .table-toolbar-actions { width: max-content; margin-left: 0; justify-content: flex-start; flex-wrap: nowrap; }
  .table-search { min-width: 210px; }
}

@media print {
  @page { size: landscape; margin: 12mm; }
  body.print-table { background: #fff; color: #111827; }
  body.print-table .sidenav,
  body.print-table .topbar,
  body.print-table .panel-head,
  body.print-table .stats-grid { display: none !important; }
  body.print-table .shell-frame,
  body.print-table .main-shell,
  body.print-table .page-section,
  body.print-table .panel-surface { display: block; min-height: 0; padding: 0; margin: 0; background: #fff; border: 0; box-shadow: none; }
  body.print-table .table-scroll { max-height: none; overflow: visible; background: #fff; }
  body.print-table .data-table { min-width: 0; border-color: #cbd5e1; color: #111827; }
  body.print-table .data-table th { position: static; background: #e5e7eb; color: #374151; }
  body.print-table .data-table td { background: #fff; color: #111827; border-top-color: #e5e7eb; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
