/* ============================================================================
   NGRO ERP — Design System v2.0
   Archivo central de estilos. Todas las páginas incluyen solo este CSS.
   ============================================================================ */

/* ── IMPORTS ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800&display=swap');

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  1. CSS VARIABLES — DARK MODE (default)                                 ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
:root {
  /* Surfaces */
  --bg-body:      #0a0a0b;
  --bg-sidebar:   #0f0f10;
  --bg-topbar:    rgba(15,15,16,.85);
  --bg-card:      #141416;
  --bg-card-alt:  #1a1a1d;
  --bg-input:     #1a1a1d;
  --bg-hover:     #1e1e21;
  --bg-active:    #252528;
  --bg-badge:     #252528;

  /* Borders */
  --border:       #222225;
  --border-light: #2c2c30;
  --border-focus: #fbce02;

  /* Text */
  --text:         #e8e8ed;
  --text-secondary: #8e8e93;
  --text-muted:   #555558;
  --text-inverse: #0a0a0b;

  /* Brand */
  --brand:        #fbce02;
  --brand-dim:    rgba(251,206,2,.10);
  --brand-glow:   rgba(251,206,2,.25);

  /* Semantic */
  --green:        #30d158;
  --green-bg:     rgba(48,209,88,.08);
  --green-border: rgba(48,209,88,.20);
  --red:          #ff453a;
  --red-bg:       rgba(255,69,58,.08);
  --red-border:   rgba(255,69,58,.20);
  --gold:         #ffd60a;
  --gold-bg:      rgba(255,214,10,.08);
  --blue:         #0a84ff;
  --blue-bg:      rgba(10,132,255,.08);
  --purple:       #bf5af2;
  --orange:       #ff9f0a;
  --teal:         #5ac8fa;

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(0,0,0,.4);
  --shadow-md:    0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:    0 12px 40px rgba(0,0,0,.6);
  --shadow-glow:  0 0 20px rgba(251,206,2,.08);

  /* Layout */
  --sidebar-w:    250px;
  --sidebar-collapsed-w: 70px;
  --topbar-h:     56px;
  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    16px;
  --radius-xl:    20px;

  /* Transitions */
  --ease:         cubic-bezier(.4,0,.2,1);
  --duration:     .2s;
}

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  2. LIGHT MODE                                                          ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
body.light {
  --bg-body:      #f3f3f6;
  --bg-sidebar:   #ffffff;
  --bg-topbar:    rgba(255,255,255,.88);
  --bg-card:      #ffffff;
  --bg-card-alt:  #f7f7f9;
  --bg-input:     #f2f2f5;
  --bg-hover:     #ececef;
  --bg-active:    #e4e4e8;
  --bg-badge:     #ececef;

  --border:       #dcdce0;
  --border-light: #e8e8ec;
  --border-focus: #d4a900;

  --text:         #1c1c1e;
  --text-secondary: #6e6e73;
  --text-muted:   #aeaeb2;
  --text-inverse: #ffffff;

  --brand:        #d4a900;
  --brand-dim:    rgba(212,169,0,.08);
  --brand-glow:   rgba(212,169,0,.15);

  --green:        #1e8c3a;
  --green-bg:     rgba(30,140,58,.06);
  --green-border: rgba(30,140,58,.15);
  --red:          #c0392b;
  --red-bg:       rgba(192,57,43,.06);
  --red-border:   rgba(192,57,43,.15);
  --gold:         #9a7200;
  --gold-bg:      rgba(154,114,0,.06);
  --blue:         #007aff;
  --blue-bg:      rgba(0,122,255,.06);
  --purple:       #9b59b6;
  --orange:       #e67e22;
  --teal:         #1abc9c;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.06);
  --shadow-md:    0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:    0 12px 40px rgba(0,0,0,.10);
  --shadow-glow:  0 0 20px rgba(212,169,0,.06);
}

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  3. RESET & BASE                                                        ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-body);
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
  overflow-x: hidden;
}

a { color: var(--brand); text-decoration: none; transition: color var(--duration); }
a:hover { color: var(--text); }

img { max-width: 100%; height: auto; }

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  4. LAYOUT — Sidebar + Topbar + Content                                ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar content";
  min-height: 100vh;
  transition: grid-template-columns .3s var(--ease);
}

/* Collapsed sidebar state */
.layout.sidebar-collapsed { grid-template-columns: var(--sidebar-collapsed-w) 1fr; }

/* ── SIDEBAR ── */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform .3s var(--ease), width .3s var(--ease);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Logo area */
.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.sidebar-brand img { height: 28px; width: auto; filter: brightness(0) invert(1); transition: filter var(--duration); }
body.light .sidebar-brand img { filter: brightness(0); }
.sidebar-brand-text { font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--text-muted); }
.sidebar-brand-toggle {
  margin-left: auto;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px 6px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--duration); opacity: 0;
}
.sidebar-brand:hover .sidebar-brand-toggle { opacity: 1; }
.sidebar-brand-toggle:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-brand-toggle i { font-size: 13px; transition: transform .3s var(--ease); }

/* Section groups */
.sidebar-section { padding: 12px 0 4px; }

.sidebar-section-title {
  padding: 0 20px;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: color var(--duration);
}
.sidebar-section-title:hover { color: var(--text-secondary); }
.sidebar-section-title .chevron {
  font-size: 9px;
  transition: transform .2s var(--ease);
  opacity: .5;
}
.sidebar-section.collapsed .chevron { transform: rotate(-90deg); }
.sidebar-section.collapsed .sidebar-links { display: none; }

/* Nav links */
.sidebar-links { list-style: none; padding: 2px 8px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all .15s var(--ease);
  cursor: pointer;
  position: relative;
  text-decoration: none;
}
.sidebar-link:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-link.active {
  background: var(--brand-dim);
  color: var(--brand);
  font-weight: 600;
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}

.sidebar-link .icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: .6;
  transition: opacity var(--duration);
}
.sidebar-link:hover .icon,
.sidebar-link.active .icon { opacity: 1; }

.sidebar-link .badge-todo {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .05em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-badge);
  color: var(--text-muted);
}

.sidebar-link .badge-count {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--brand-dim);
  color: var(--brand);
  border: 1px solid var(--brand-glow);
  flex-shrink: 0;
  letter-spacing: -.02em;
}

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── SIDEBAR COLLAPSE BUTTON ── */
.sidebar-collapse-btn {
  width: 100%; height: 40px;
  background: transparent; border: none; border-top: 1px solid var(--border);
  cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--duration);
}
.sidebar-collapse-btn:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-collapse-btn i { transition: transform .3s var(--ease); font-size: 14px; }

/* ── SIDEBAR COLLAPSED STATE ── */
.layout.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-w); }
.layout.sidebar-collapsed .sidebar-brand { padding: 16px 0; justify-content: center; gap: 0; }
.layout.sidebar-collapsed .sidebar-brand-text { display: none; }
.layout.sidebar-collapsed .sidebar-brand-toggle { display: none; }
.layout.sidebar-collapsed .sidebar-brand img { margin: 0 auto; }
.layout.sidebar-collapsed .sidebar-section-title { display: none; }
.layout.sidebar-collapsed .sidebar-links { padding: 2px 10px; }
.layout.sidebar-collapsed .sidebar-link {
  justify-content: center; padding: 10px; gap: 0; border-radius: var(--radius-sm);
}
.layout.sidebar-collapsed .sidebar-link .icon { margin: 0; }
/* Hide text nodes — target everything after icon */
.layout.sidebar-collapsed .sidebar-link .link-label { display: none; }
.layout.sidebar-collapsed .sidebar-link .badge-todo { display: none; }
.layout.sidebar-collapsed .sidebar-link .badge-count { display: none; }
.layout.sidebar-collapsed .sidebar-link.active::before { display: none; }
.layout.sidebar-collapsed .sidebar-link.active { border-left: 3px solid var(--brand); }
.layout.sidebar-collapsed .sidebar-footer { padding: 8px 10px; }
.layout.sidebar-collapsed .sidebar-footer .sidebar-link { justify-content: center; padding: 10px; gap: 0; }
.layout.sidebar-collapsed .sidebar-footer .link-label { display: none; }
.layout.sidebar-collapsed .sidebar-collapse-btn i { transform: rotate(180deg); }

/* Tooltips on hover (collapsed only) */
.layout.sidebar-collapsed .sidebar-link[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  background: var(--bg-active); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 6px 12px;
  white-space: nowrap; font-size: 12px; font-weight: 500;
  color: var(--text); z-index: 1000; pointer-events: none;
  box-shadow: var(--shadow-md);
  animation: tooltipIn .15s var(--ease);
}
@keyframes tooltipIn { from { opacity:0; transform: translateY(-50%) translateX(-6px); } to { opacity:1; transform: translateY(-50%) translateX(0); } }

@media (max-width: 768px) {
  .sidebar-collapse-btn { display: none; }
  .sidebar-brand-toggle { display: none; }
}

/* ── PRIVACY MODE ── */
.privacy-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 0; margin-right: 4px;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--duration); font-size: 16px;
}
.privacy-toggle:hover { background: var(--bg-hover); color: var(--text); }
.privacy-toggle.active { background: var(--brand-dim); color: var(--brand); }

/* Blur amounts in privacy mode */
body.privacy-mode .rpt-money,
body.privacy-mode .rpt-row-total td:not(:first-child):not(:nth-child(2)),
body.privacy-mode .rpt-row-result td:not(:first-child):not(:nth-child(2)),
body.privacy-mode .rpt-row-subtotal td:not(:first-child):not(:nth-child(2)),
body.privacy-mode .rpt-row-margin td:not(:first-child):not(:nth-child(2)),
body.privacy-mode .dash-hcard-value,
body.privacy-mode .dash-kcard-value,
body.privacy-mode .dash-hcard-sub,
body.privacy-mode .dash-hcard-delta,
body.privacy-mode .dash-delta-up,
body.privacy-mode .dash-delta-dn,
body.privacy-mode .prf-bank-box .prf-value,
body.privacy-mode .prf-days {
  color: transparent !important;
  text-shadow: 0 0 10px var(--text-muted);
}
body.privacy-mode .rpt-var-up,
body.privacy-mode .rpt-var-dn,
body.privacy-mode span.rpt-var-up,
body.privacy-mode span.rpt-var-dn,
body.privacy-mode td.rpt-var-up,
body.privacy-mode td.rpt-var-dn {
  color: transparent !important;
  text-shadow: 0 0 6px var(--text-muted);
}
body.privacy-mode canvas { filter: blur(10px); transition: filter .3s; }

/* ── TOPBAR ── */
.topbar {
  grid-area: topbar;
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: var(--bg-topbar);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 150;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-hamburger {
  display: none; /* shown on mobile */
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--text-secondary);
}
.topbar-hamburger svg { width: 22px; height: 22px; }

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.topbar-breadcrumb span { color: var(--text-secondary); }
.topbar-breadcrumb .bc-sep { opacity: .4; }
.topbar-breadcrumb .bc-current { color: var(--text); font-weight: 600; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Theme toggle (pill) */
.theme-toggle {
  position: relative;
  width: 44px; height: 24px;
  background: var(--bg-active);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--duration);
}
.theme-toggle input { display: none; }
.theme-toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: transform .25s var(--ease), background var(--duration);
}
.theme-toggle input:checked ~ .theme-toggle-thumb {
  transform: translateX(20px);
  background: var(--brand);
}

/* User widget */
.topbar-user-wrap { position: relative; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: background var(--duration);
  background: none; border: none; font: inherit;
}
.topbar-user:hover { background: var(--bg-hover); }
.topbar-user-chevron { font-size: 10px; color: var(--text-muted); transition: transform .2s var(--ease); }
.topbar-user-wrap.open .topbar-user-chevron { transform: rotate(180deg); }

.topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand-dim);
  border: 2px solid var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  overflow: hidden;
}
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.topbar-user-info { display: flex; flex-direction: column; }
.topbar-user-name { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.2; }
.topbar-user-role { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

/* User dropdown */
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 180px; padding: 4px 0;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .15s var(--ease), transform .15s var(--ease), visibility .15s;
  z-index: 500;
}
.topbar-user-wrap.open .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: 13px; color: var(--text);
  text-decoration: none; transition: background var(--duration);
}
.user-dropdown-item:hover { background: var(--bg-hover); }
.user-dropdown-item i { font-size: 14px; color: var(--text-muted); }
.user-dropdown-logout { color: var(--red); }
.user-dropdown-logout i { color: var(--red); }
.user-dropdown-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ── CONTENT ── */
.content {
  grid-area: content;
  padding: 28px;
  max-width: 1600px;
  width: 100%;
  overflow-x: hidden;
}
/* Allow report pages to scroll their tables horizontally */
.content.content-reports {
  overflow-x: visible;
}

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  5. PAGE HEADER                                                         ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head-left { display: flex; flex-direction: column; gap: 4px; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--text); line-height: 1.2; }
.page-subtitle { font-size: 12px; color: var(--text-secondary); }

.page-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  6. CARDS                                                               ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--duration), box-shadow var(--duration), transform var(--duration);
}
.card:hover { border-color: var(--border-light); }
.card-clickable:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); cursor: pointer; }

.card-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Hero KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  transition: all .2s var(--ease);
}
.kpi-card:hover { border-color: var(--border-light); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.kpi-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 8px;
  opacity: .5;
}
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-bottom: 4px;
}
.kpi-sub { font-size: 12px; color: var(--text-secondary); }
.kpi-delta {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 6px;
}
.kpi-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 2px;
  opacity: .5;
}

/* Semantic color helpers */
.c-green  { color: var(--green) !important; }
.c-red    { color: var(--red) !important; }
.c-gold   { color: var(--gold) !important; }
.c-blue   { color: var(--blue) !important; }
.c-purple { color: var(--purple) !important; }
.c-orange { color: var(--orange) !important; }
.c-brand  { color: var(--brand) !important; }

.bg-green  { background: var(--green-bg) !important; }
.bg-red    { background: var(--red-bg) !important; }
.bg-gold   { background: var(--gold-bg) !important; }
.bg-blue   { background: var(--blue-bg) !important; }

.delta-up   { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.delta-down { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }

.border-green:hover { border-color: var(--green-border) !important; }
.border-red:hover   { border-color: var(--red-border) !important; }
.border-gold:hover  { border-color: rgba(255,214,10,.25) !important; }

.bar-green  { background: linear-gradient(90deg, var(--green), transparent); }
.bar-red    { background: linear-gradient(90deg, var(--red), transparent); }
.bar-gold   { background: linear-gradient(90deg, var(--gold), transparent); }

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  7. TABLES                                                              ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-wrap-scroll { overflow-x: auto; }

table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.tbl th {
  text-align: left;
  padding: 10px 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-card-alt);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 5;
}
table.tbl td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
table.tbl tbody tr { transition: background var(--duration); }
table.tbl tbody tr:hover { background: var(--bg-hover); }
table.tbl tbody tr:last-child td { border-bottom: none; }

table.tbl .n { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .fw { font-weight: 600; }
table.tbl .mono { font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif; font-size: 12px; letter-spacing: -.02em; }

/* Row clickable */
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl tbody tr.clickable:hover { background: var(--brand-dim); }

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  8. FORMS                                                               ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
}

.form-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: all .15s var(--ease);
  outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--border-focus);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--brand-dim);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { appearance: none; cursor: pointer; }

.form-row { display: grid; gap: 16px; margin-bottom: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.form-group { display: flex; flex-direction: column; }

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  9. BUTTONS                                                             ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  border: 1px solid transparent;
  border-radius: 50px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  transition: all .15s var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }

.btn-primary { background: var(--brand); color: var(--text-inverse); border-color: var(--brand); }
.btn-primary:hover { filter: brightness(1.1); box-shadow: var(--shadow-glow); color: var(--text-inverse); }

.btn-dark { background: var(--text); color: var(--bg-body); }
.btn-dark:hover { opacity: .85; color: var(--bg-body); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-ghost:hover { border-color: var(--border-light); color: var(--text); background: var(--bg-hover); }

.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-sm { padding: 5px 12px; font-size: 11px; }
.btn-lg { padding: 12px 28px; font-size: 14px; }

/* FAB */
.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--text-inverse);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transition: all .2s var(--ease);
  z-index: 100;
}
.fab:hover { transform: scale(1.08); }
.fab svg { width: 24px; height: 24px; stroke-width: 2.5; }

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  10. BADGES & TAGS                                                      ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}
.badge-green, .badge-red, .badge-gold, .badge-blue, .badge-muted {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 600;
  border: 1px solid transparent;
}
.badge-green { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.badge-red   { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.badge-gold  { background: var(--gold-bg); color: var(--gold); border-color: rgba(255,214,10,.2); }
.badge-blue  { background: var(--blue-bg); color: var(--blue); border-color: rgba(10,132,255,.2); }
.badge-muted { background: var(--bg-badge); color: var(--text-secondary); }

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  11. UTILITY                                                            ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
.mono { font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif; font-size: 12px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.money { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.fw-bold { font-weight: 700 !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.gap-1 { gap: 8px !important; }
.gap-2 { gap: 16px !important; }
.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.items-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.hidden { display: none !important; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: .3; }
.empty-state p { font-size: 14px; }

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  12. ANIMATIONS                                                         ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pop {
  0%  { transform: scale(.85); opacity: .3; }
  60% { transform: scale(1.04); }
  100%{ transform: scale(1); opacity: 1; }
}

.anim-fade-up { animation: fadeUp .3s var(--ease) both; }
.anim-fade-in { animation: fadeIn .3s var(--ease) both; }
.anim-pop     { animation: pop .4s cubic-bezier(.34,1.56,.64,1) both; }

/* Stagger delays */
.delay-1 { animation-delay: .05s; }
.delay-2 { animation-delay: .10s; }
.delay-3 { animation-delay: .15s; }
.delay-4 { animation-delay: .20s; }

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  13. RESPONSIVE                                                         ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .form-row-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "content";
  }

  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }

  /* Overlay when sidebar open */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 190;
  }
  .sidebar.open ~ .sidebar-overlay { display: block; }

  .topbar-hamburger { display: flex; }

  .content { padding: 16px; }

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

  .page-head { flex-direction: column; }
  .page-head-right { width: 100%; }

  .topbar-user-info { display: none; }
  .topbar-user-chevron { display: none; }
}

@media (max-width: 480px) {
  .content { padding: 12px; }
  .card { padding: 16px; }
  .form-card { padding: 20px; }
  .page-title { font-size: 18px; }
  .kpi-value { font-size: 22px; }
}

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  14. DATATABLE OVERRIDES (para compatibilidad con DataTables existente) ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
.dataTables_wrapper { font-size: 13px; color: var(--text); }
.dataTables_wrapper .dataTables_filter input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 6px 12px;
  outline: none;
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--brand-dim);
}
.dataTables_wrapper .dataTables_info { color: var(--text-muted); font-size: 12px; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--text-secondary) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--bg-card) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--brand) !important;
  color: var(--text-inverse) !important;
  border-color: var(--brand) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--bg-hover) !important;
  color: var(--text) !important;
}
.dataTables_wrapper .dataTables_length select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 4px 8px;
}

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  15. CHART.JS CONTAINER                                                 ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
.chart-wrap { position: relative; width: 100%; }
.chart-h200 { height: 200px; }
.chart-h260 { height: 260px; }
.chart-h300 { height: 300px; }

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  16. DASHBOARD                                                          ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */

/* ── Header ── */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.dash-greeting {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.15rem;
}
.dash-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Time Filter ── */
.dash-tf {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
}
.dash-tfb {
  padding: 6px 16px;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s;
  white-space: nowrap;
  letter-spacing: 0.02em;
  font-family: inherit;
}
.dash-tfb:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.dash-tfb.active {
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 10px rgba(48, 209, 88, 0.3);
}

/* ── Section Title ── */
.dash-section-title {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ── Hero Cards (3-col) ── */
.dash-hero-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}
.dash-hcard {
  border-radius: var(--radius);
  padding: 1.8rem 2rem;
  position: relative;
  overflow: hidden;
  cursor: default;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.dash-hcard:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.dash-hcard-green:hover { border-color: var(--green-border); }
.dash-hcard-red:hover   { border-color: var(--red-border); }
.dash-hcard-gold:hover  { border-color: rgba(255, 214, 10, 0.25); }

.dash-hcard-label {
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
  opacity: 0.55;
}
.dash-hcard-green .dash-hcard-label { color: var(--green); }
.dash-hcard-red .dash-hcard-label   { color: var(--red); }
.dash-hcard-gold .dash-hcard-label  { color: var(--gold); }

.dash-hcard-value {
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 0.3rem;
}
.dash-hcard-green .dash-hcard-value { color: var(--green); }
.dash-hcard-red .dash-hcard-value   { color: var(--red); }
.dash-hcard-gold .dash-hcard-value  { color: var(--gold); }

.dash-hcard-sub {
  font-size: 0.66rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.dash-hcard-delta {
  margin-bottom: 0.6rem;
}
.dash-delta-up {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--green-bg);
  color: var(--green);
  display: inline-block;
}
.dash-delta-dn {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--red-bg);
  color: var(--red);
  display: inline-block;
}
.dash-hcard-spark { height: 36px; }
.dash-hcard-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0.4;
}
.dash-hcard-bar.green { background: linear-gradient(90deg, var(--green), transparent); }
.dash-hcard-bar.red   { background: linear-gradient(90deg, var(--red), transparent); }
.dash-hcard-bar.gold  { background: linear-gradient(90deg, var(--gold), transparent); }

/* Pop animation */
.dash-pop { animation: dashPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes dashPop {
  0%   { transform: scale(0.85); opacity: 0.2; }
  60%  { transform: scale(1.04); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── KPI Row ── */
.dash-krow {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}
.dash-kcard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.dash-kcard:hover {
  border-color: var(--border-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.dash-kcard-link {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.dash-kcard-link:hover {
  border-color: var(--brand);
  color: inherit;
}
.dash-kcard-icon {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}
.dash-kcard-link:hover .dash-kcard-icon { color: var(--brand); }

.dash-kcard-label {
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.dash-kcard-value {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.dash-kcard-sub {
  font-size: 0.57rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Chart Cards ── */
.dash-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.dash-chart-2 { grid-column: span 1; }
.dash-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
}
.dash-chart-title {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-chart-badge {
  font-size: 0.55rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
}
.dash-chart-badge.green { background: var(--green-bg); color: var(--green); }
.dash-chart-badge.gold  { background: var(--gold-bg); color: var(--gold); }
.dash-chart-badge.blue  { background: var(--blue-bg); color: var(--blue); }

.dash-chart-wrap { position: relative; }
.dash-chart-wrap.h200 { height: 200px; }
.dash-chart-wrap.h260 { height: 260px; }

/* ── Dashboard Tables ── */
.dash-table-wrap { overflow-x: auto; }
.dash-dtbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.77rem;
}
.dash-dtbl th {
  text-align: left;
  padding: 0.5rem 0.8rem;
  font-size: 0.56rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.dash-dtbl td {
  padding: 0.62rem 0.8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.dash-dtbl tr:last-child td { border-bottom: none; }
.dash-dtbl tr:hover td { background: var(--bg-hover); }

/* Bar track for tables */
.dash-bartrack {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.dash-barfill {
  height: 100%;
  border-radius: 2px;
  background: var(--green);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Empty state */
.dash-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .dash-hero-row { grid-template-columns: 1fr; }
  .dash-charts-row { grid-template-columns: 1fr; }
  .dash-hcard-value { font-size: 2rem; }
  .dash-header { flex-direction: column; }
}
@media (max-width: 640px) {
  .dash-krow { grid-template-columns: 1fr 1fr; }
  .dash-greeting { font-size: 1.2rem; }
  .dash-tfb { padding: 5px 11px; font-size: 0.66rem; }
}

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  17. REPORTS — SÁBANA / P&L / SHARES / SUPPLIERS                       ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */

/* ── Page header (shared across all report pages) ── */
.rpt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.rpt-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.rpt-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}
.rpt-filter-tag {
  color: var(--brand);
  font-weight: 700;
}

/* ── Year Picker ── */
.rpt-year-picker {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px 4px;
}
.rpt-year-picker a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.rpt-year-picker a:hover { background: var(--bg-hover); color: var(--text); }
.rpt-year-label {
  min-width: 80px;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
  padding: 0 0.5rem;
}

/* ── Report Nav Tabs (sub-reports) ── */
.rpt-nav {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.rpt-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1.2rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.15s;
  text-decoration: none;
}
.rpt-nav a:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border-light);
}
.rpt-nav a.active {
  background: var(--brand);
  color: var(--text-inverse);
  border-color: var(--brand);
  font-weight: 700;
}

/* ── Inner Tabs (P&L / One Shot, Ingresos / Egresos) ── */
.rpt-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.rpt-tab {
  padding: 0.7rem 1.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  font-family: inherit;
}
.rpt-tab:hover { color: var(--text); }
.rpt-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ── Table container ── */
.rpt-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-card);
  border-radius: 0 0 var(--radius) var(--radius);
  border: 1px solid var(--border);
  border-top: 0;
}
.rpt-container-full {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ── P&L Table ── */
.rpt-table {
  font-size: 0.75rem;
  min-width: 1600px;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
.rpt-table th,
.rpt-table td {
  padding: 6px 10px;
  white-space: nowrap;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  height: 35px;
}

/* Sticky first column */
.rpt-col-sticky {
  position: sticky;
  left: 0;
  background: var(--bg-card);
  z-index: 5;
  width: 400px;
  min-width: 400px;
  max-width: 400px;
  border-right: 1px solid var(--border);
  white-space: normal !important;
  line-height: 1.4;
}
/* Two-column sticky for P&L */
.rpt-col-s1 {
  position: sticky;
  left: 0;
  background: var(--bg-card);
  z-index: 5;
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  border-right: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
}
.rpt-col-s2 {
  position: sticky;
  left: 180px;
  background: var(--bg-card);
  z-index: 5;
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  border-right: 1px solid var(--border-light);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Section header rows */
.rpt-section-header {
  position: sticky;
  left: 0;
  z-index: 6;
  width: 400px;
  min-width: 400px;
  background: var(--bg-active);
  color: var(--text);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  padding-left: 15px;
  border-right: 1px solid var(--border);
}
.rpt-section-rest {
  background: var(--bg-active);
}

/* Header row */
.rpt-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-card-alt);
  z-index: 10;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  font-weight: 800;
  color: var(--text-secondary);
  font-size: 0.68rem;
  text-align: center;
}
.rpt-table thead th.rpt-col-sticky,
.rpt-table thead th.rpt-col-s1,
.rpt-table thead th.rpt-col-s2,
.rpt-table thead th.rpt-section-header { z-index: 20; }

/* Row types */
.rpt-row-cat td {
  background: var(--bg-card-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.rpt-row-cat:hover td { background: var(--bg-hover); }
.rpt-row-cat td.rpt-col-sticky,
.rpt-row-cat td.rpt-col-s1,
.rpt-row-cat td.rpt-col-s2 { background: var(--bg-card-alt); }
.rpt-row-cat:hover td.rpt-col-sticky,
.rpt-row-cat:hover td.rpt-col-s1,
.rpt-row-cat:hover td.rpt-col-s2 { background: var(--bg-hover); }

.rpt-row-sub td { background: var(--bg-card); }
.rpt-row-sub:hover td { background: var(--bg-hover); }
.rpt-row-sub td.rpt-col-sticky,
.rpt-row-sub td.rpt-col-s1,
.rpt-row-sub td.rpt-col-s2 { background: var(--bg-card); }
.rpt-row-sub:hover td.rpt-col-sticky,
.rpt-row-sub:hover td.rpt-col-s1,
.rpt-row-sub:hover td.rpt-col-s2 { background: var(--bg-hover); }

/* Totals */
.rpt-row-subtotal td {
  background: var(--bg-card-alt);
  font-weight: 700;
  border-top: 1px solid var(--border-light);
}
.rpt-row-subtotal td.rpt-col-s1,
.rpt-row-subtotal td.rpt-col-s2 { background: var(--bg-card-alt); }

.rpt-row-total td {
  background: var(--bg-active);
  font-weight: 800;
  border-bottom: 2px solid var(--border-light);
  color: var(--text);
}
.rpt-row-total td.rpt-col-s1,
.rpt-row-total td.rpt-col-s2,
.rpt-row-total td.rpt-col-sticky { background: var(--bg-active); }

.rpt-row-result td {
  font-weight: 800;
  font-size: 0.9rem;
  border-top: 2px solid var(--text);
  color: var(--text);
}
.rpt-row-result td.rpt-col-s1,
.rpt-row-result td.rpt-col-s2,
.rpt-row-result td.rpt-col-sticky { background: var(--bg-card); }

.rpt-row-margin td {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* Money / numeric cells */
.rpt-money {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
  text-align: right;
}
.rpt-zero { color: var(--text-muted); font-weight: 300; }
.rpt-future { opacity: 0.45 !important; }

/* Links inside reports */
.rpt-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.rpt-link:hover { color: var(--brand); text-decoration: underline; }
.rpt-link-active { color: var(--brand); font-weight: 800; pointer-events: none; }

/* Drill-down toggle */
.rpt-toggle {
  display: inline-block;
  transition: transform 0.2s;
  width: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.65rem;
}
.rpt-row-open .rpt-toggle { transform: rotate(90deg); color: var(--brand); }

/* Clickable rows (One Shot expandable) */
.rpt-clickable { cursor: pointer; transition: background-color 0.2s; }
.rpt-clickable:hover { background: var(--bg-hover) !important; }
.rpt-drilldown-active { background: var(--gold-bg) !important; border-bottom: 2px solid var(--brand); }

/* Expanded detail */
.rpt-expanded-content { background: var(--bg-card-alt); box-shadow: inset 0 3px 6px rgba(0,0,0,0.08); padding: 0 !important; }
.rpt-detail-table { width: 100%; margin: 0; }
.rpt-detail-table td { border-bottom: 1px solid var(--border); padding: 8px 20px; font-size: 0.75rem; color: var(--text-secondary); }
.rpt-detail-table tr:last-child td { border-bottom: none; }

/* Variation arrows — on spans (inside cells) */
span.rpt-var-up, span.rpt-var-dn { display: inline-block; margin-right: 0.5rem; }
.rpt-var-up { color: var(--green); font-weight: 700; font-size: 0.65rem; }
.rpt-var-dn { color: var(--red); font-weight: 700; font-size: 0.65rem; }
/* When used on <td> for coloring result rows, keep table-cell display */
td.rpt-var-up, td.rpt-var-dn { font-size: inherit; font-weight: inherit; }

/* Sub-section header inside table */
.rpt-subsection {
  background: var(--bg-card-alt);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-left: 25px;
}

/* Drilldown back button */
.rpt-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 1rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all 0.15s;
  text-decoration: none;
}
.rpt-back:hover { background: var(--bg-hover); color: var(--text); }

/* ── Report responsive ── */
@media (max-width: 960px) {
  .rpt-header { flex-direction: column; }
  .rpt-nav { gap: 0.3rem; }
  .rpt-nav a { padding: 0.35rem 0.8rem; font-size: 0.66rem; }
}
@media (max-width: 640px) {
  .rpt-title { font-size: 1rem; }
}

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  18. PROFILE                                                            ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */

/* ── Profile Card ── */
.prf-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 24px;
}

/* ── Avatar ── */
.prf-avatar {
  width: 130px; height: 130px;
  border-radius: 50%;
  border: 4px solid var(--border-light);
  overflow: hidden;
  background: var(--bg-card-alt);
  margin: 0 auto 20px;
  box-shadow: var(--shadow-md);
}
.prf-avatar img { width: 100%; height: 100%; object-fit: cover; }
.prf-avatar-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 52px; color: var(--text-muted);
}

/* ── Name hero ── */
.prf-name {
  font-size: 28px; font-weight: 800;
  letter-spacing: -.02em; line-height: 1.15;
  color: var(--text);
}
.prf-role {
  font-size: 14px; font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Data group ── */
.prf-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.prf-value {
  font-size: 15px; font-weight: 600;
  color: var(--text);
  word-break: break-word;
}
.prf-group { margin-bottom: 20px; }

/* ── Section dividers ── */
.prf-divider {
  border: none; border-top: 1px solid var(--border);
  margin: 24px 0;
}
.prf-section-title {
  font-size: 11px; font-weight: 700;
  letter-spacing: .10em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ── Badges ── */
.prf-badge {
  display: inline-flex; align-items: center;
  padding: 4px 14px; border-radius: 50px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.prf-badge-yes { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.prf-badge-no { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }

/* ── Bank box ── */
.prf-bank-box {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

/* ── Team chip ── */
.prf-chip {
  display: inline-block;
  padding: 6px 16px;
  background: var(--brand-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 700; font-size: 13px;
  color: var(--text);
}

/* ── Emergency contact highlight ── */
.prf-emergency {
  color: var(--red);
  font-weight: 600;
}
.prf-emergency i { margin-right: 6px; }

/* ── Days available ── */
.prf-days {
  font-size: 22px; font-weight: 800;
  color: var(--brand);
}

/* ── Doc link button ── */
.prf-doc-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px; border-radius: 50px;
  background: var(--bg-card-alt); border: 1px solid var(--border);
  color: var(--text); font-size: 12px; font-weight: 600;
  text-decoration: none; transition: all .15s var(--ease);
}
.prf-doc-btn:hover { background: var(--bg-hover); border-color: var(--border-light); color: var(--text); }

/* ── Profile layout grid ── */
.prf-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 24px; }
.prf-grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.prf-row { display: grid; gap: 16px; }
.prf-row-2 { grid-template-columns: 1fr 1fr; }
.prf-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── File upload ── */
.prf-file-drop {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 16px; text-align: center;
  background: var(--bg-card-alt);
  transition: border-color .2s;
}
.prf-file-drop:hover { border-color: var(--text-muted); }

/* ── Avatar edit ── */
.prf-avatar-edit { text-align: center; margin-bottom: 24px; }
.prf-avatar-edit .prf-avatar { margin-bottom: 12px; }
.prf-avatar-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px; border-radius: 50px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s var(--ease);
}
.prf-avatar-btn:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-light); }

/* ── Alert/toast ── */
.prf-alert {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-radius: var(--radius-lg);
  font-size: 13px; font-weight: 600; margin-bottom: 20px;
}
.prf-alert-ok { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.prf-alert-err { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .prf-grid, .prf-grid-form { grid-template-columns: 1fr; }
  .prf-row-2, .prf-row-3 { grid-template-columns: 1fr; }
  .prf-name { font-size: 22px; }
}

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  19. MODALS                                                             ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-overlay.open .modal-box { transform: translateY(0) scale(1); }

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 0;
  width: 90%; max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(.97);
  transition: transform .25s var(--ease);
  overflow: hidden;
}

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 12px;
}
.modal-head-title {
  font-size: 15px; font-weight: 700; color: var(--text);
}
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 18px; padding: 4px;
  transition: color .15s;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 8px 24px 20px; color: var(--text-secondary); font-size: 14px; }
.modal-body p { margin: 0; }

.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 24px 20px;
}

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  20. FAB (FLOATING ACTION BUTTON)                                       ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
.fab-btn {
  position: fixed; bottom: 28px; right: 28px;
  width: 56px; height: 56px;
  border-radius: 50%; border: none;
  background: var(--bg-card); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer; z-index: 100;
  transition: all .2s var(--ease);
  text-decoration: none;
}
.fab-btn:hover { transform: scale(1.08); }
.fab-btn svg { width: 24px; height: 24px; stroke-width: 2.5; }

.fab-orange { border: 2px solid var(--orange); }
.fab-orange svg { stroke: var(--orange); }
.fab-orange:hover { background: var(--orange); }
.fab-orange:hover svg { stroke: var(--text-inverse); }

.fab-green { border: 2px solid var(--green); }
.fab-green svg { stroke: var(--green); }
.fab-green:hover { background: var(--green); }
.fab-green:hover svg { stroke: var(--text-inverse); }

.fab-blue { border: 2px solid var(--blue); }
.fab-blue svg { stroke: var(--blue); }
.fab-blue:hover { background: var(--blue); }
.fab-blue:hover svg { stroke: var(--text-inverse); }

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  21. TIMESHEETS                                                         ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */

/* ── Week picker ── */
.ts-week-picker {
  display: inline-flex; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 50px; padding: 4px 6px;
}
.ts-week-picker a {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  color: var(--text-muted); text-decoration: none;
  transition: all .15s var(--ease);
}
.ts-week-picker a:hover { background: var(--bg-hover); color: var(--text); }
.ts-week-label {
  min-width: 130px; text-align: center;
  font-size: 13px; font-weight: 700; color: var(--text);
}

/* ── Grand total counter ── */
.ts-grand {
  text-align: right;
}
.ts-grand-num {
  font-size: 28px; font-weight: 800; color: var(--text); line-height: 1;
}
.ts-grand-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted);
}

/* ── Timesheet grid table ── */
.ts-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; table-layout: fixed;
}
.ts-table th {
  text-align: center; padding: 10px 8px;
  font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); background: var(--bg-card-alt);
  border-bottom: 1px solid var(--border);
}
.ts-table th:first-child { text-align: left; padding-left: 20px; width: 28%; }
.ts-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ts-table td:first-child { padding-left: 20px; }
.ts-table tbody tr { transition: background .15s; }
.ts-table tbody tr:hover { background: var(--bg-hover); }
.ts-table tbody tr:last-child td { border-bottom: none; }

.ts-th-today {
  color: var(--brand) !important;
  border-bottom: 2px solid var(--brand);
}
.ts-th-weekend { background: var(--bg-active); }
.ts-td-weekend { background: var(--bg-card-alt); }
.ts-td-total {
  text-align: center; font-weight: 800; font-size: 14px;
  color: var(--text); background: var(--bg-card-alt);
  border-left: 1px solid var(--border);
}
.ts-table th:last-child, .ts-table td.ts-td-total { width: 64px; }
.ts-td-total-zero { color: var(--text-muted); font-weight: 500; }

/* ── Hour input cells ── */
.ts-input {
  width: 100%; padding: 8px 0;
  text-align: center; font-weight: 600; font-size: 14px;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: all .15s var(--ease);
  outline: none;
}
.ts-input:hover { border-color: var(--border-light); }
.ts-input:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-dim);
}
.ts-input:disabled {
  background: var(--bg-card-alt); color: var(--text-muted);
  border-color: transparent; cursor: not-allowed;
}
.ts-input::placeholder { color: var(--border-light); font-weight: 400; }

/* ── Account/project cell ── */
.ts-client-tag {
  font-size: 9px; font-weight: 800; text-transform: uppercase;
  color: var(--orange); display: block; margin-bottom: 2px;
}
.ts-account-name { font-weight: 700; font-size: 13px; color: var(--text); line-height: 1.2; }

/* ── Save bar ── */
.ts-save-bar {
  padding: 16px 20px; text-align: right;
  border-top: 1px solid var(--border);
  background: var(--bg-card-alt);
}

/* ── Alert banners ── */
.ts-alert {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-radius: var(--radius-lg);
  margin-bottom: 20px; font-size: 13px;
}
.ts-alert i { font-size: 20px; flex-shrink: 0; }
.ts-alert-title { font-weight: 700; margin-bottom: 2px; }
.ts-alert-ok { background: var(--green-bg); border: 1px solid var(--green-border); color: var(--green); }
.ts-alert-warn { background: var(--gold-bg); border: 1px solid rgba(255,214,10,.2); color: var(--gold); }

/* ── Review cards ── */
.ts-user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.ts-user-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: border-color .15s, box-shadow .15s;
}
.ts-user-card:hover { border-color: var(--border-light); box-shadow: var(--shadow-sm); }
.ts-user-card-approved { border-color: var(--green-border); background: var(--green-bg); }

.ts-user-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ts-user-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  overflow: hidden; background: var(--bg-card-alt);
  flex-shrink: 0; position: relative;
}
.ts-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ts-user-avatar-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: var(--text-muted);
  background: var(--bg-active);
}
.ts-user-name { font-weight: 700; font-size: 14px; color: var(--text); }
.ts-user-sub { font-size: 11px; color: var(--text-muted); }

.ts-user-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.ts-user-hours-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.ts-user-hours { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1; }
.ts-user-hours-target { font-size: 13px; font-weight: 400; color: var(--text-muted); }
.ts-user-hours-low { color: var(--red); }

.ts-user-obs {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--red);
}
.ts-user-obs i { margin-right: 4px; }

/* ── Review detail read-only values ── */
.ts-val {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; padding: 4px 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; color: var(--text);
}
.ts-val-zero { color: var(--text-muted); border-color: transparent; background: transparent; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .ts-user-grid { grid-template-columns: 1fr; }
  .ts-grand-num { font-size: 22px; }
}

/* ╔═══════════════════════════════════════════════════════════════════════════╗
   ║  22. ASSIGNMENTS                                                        ║
   ╚═══════════════════════════════════════════════════════════════════════════╝ */

.asg-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color var(--duration);
}
.asg-card:hover { border-color: var(--orange); }

.asg-account {
  background: var(--bg-hover);
  border-right: 1px solid var(--border);
  padding: 16px 20px;
  display: flex; flex-direction: column; justify-content: center;
}
.asg-client { font-size: 10px; text-transform: uppercase; font-weight: 800; letter-spacing: 1px; color: var(--orange); margin-bottom: 2px; }
.asg-name   { font-weight: 800; font-size: 15px; color: var(--text); margin: 0; }

.asg-team {
  padding: 14px 20px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}

.asg-chip {
  display: inline-flex; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 4px 10px 4px 4px; border-radius: 50px;
  font-size: 12px; font-weight: 600; color: var(--text);
  transition: border-color var(--duration);
}
.asg-chip:hover { border-color: var(--text-muted); }
.asg-chip img, .asg-chip-avatar {
  width: 24px; height: 24px; border-radius: 50%; margin-right: 8px; object-fit: cover;
}
.asg-chip-avatar {
  background: var(--bg-hover); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800;
}
.asg-chip-remove {
  margin-left: 8px; color: var(--red); cursor: pointer;
  opacity: .3; transition: opacity var(--duration);
  border: none; background: none; padding: 0; font-size: 14px;
}
.asg-chip-remove:hover { opacity: 1; }

.asg-add {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px dashed var(--border); background: transparent;
  color: var(--text-muted); display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: all var(--duration);
}
.asg-add:hover { border-color: var(--orange); color: var(--orange); background: var(--orange-bg); }

/* Employee list inside modal */
.asg-emp-list {
  max-height: 300px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-hover); padding: 8px;
}
.asg-emp-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px;
  margin-bottom: 4px; display: flex; align-items: center;
  transition: background var(--duration);
}
.asg-emp-item:hover { background: var(--bg-hover); }
.asg-emp-item input[type="checkbox"] {
  width: 1.1em; height: 1.1em; margin-right: 10px;
  cursor: pointer; accent-color: var(--brand);
}
.asg-emp-item label { cursor: pointer; font-weight: 600; font-size: 13px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .asg-card { grid-template-columns: 1fr; }
  .asg-account { border-right: none; border-bottom: 1px solid var(--border); }
}


/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  23. UTILITIES                                                         ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */

.util-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.util-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: border-color .2s, background .2s;
}
.util-card:hover {
  border-color: var(--border-focus);
  background: var(--bg-card-alt);
}

.util-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.util-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--brand);
  flex-shrink: 0;
}
.util-card-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  line-height: 1.3;
}
.util-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 4px 0 0;
}
.util-card-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

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

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  24. TAB BUTTONS                                                       ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.tab-btn:hover {
  color: var(--text);
  border-color: var(--border-light);
  background: var(--bg-hover);
}
.tab-btn.active {
  color: var(--text-inverse);
  background: var(--brand);
  border-color: var(--brand);
}

/* ── Payroll child rows ── */
table.tbl tr[class*="child-"] { background: var(--bg-card); }
table.tbl tr[class*="child-"]:hover { background: var(--bg-card); }
table.tbl tr[class*="child-"] .tbl { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.tbl tr[class*="child-"] .tbl th { background: var(--bg-card-alt); }
table.tbl tr[class*="child-"] .tbl tbody tr:hover { background: var(--bg-hover); }
table.tbl tr[class*="child-"] .tab-btn { font-size: 12px; }

/* ============================================================================
   25. DASHBOARD
   ============================================================================ */

/* ── Header ── */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.dash-greeting {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}
.dash-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

/* ── Period filter toggle ── */
.dash-tf {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 3px;
}
.dash-tfb {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.dash-tfb:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.dash-tfb.active {
  background: var(--brand);
  color: #fff;
}

/* ── Section title ── */
.dash-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 1.5rem 0 .75rem;
}

/* ── Hero KPI row (3 cards) ── */
.dash-hero-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 900px) {
  .dash-hero-row { grid-template-columns: 1fr; }
}

.dash-hcard {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 18px 20px 14px;
  overflow: hidden;
  transition: border-color .2s;
}
.dash-hcard:hover { border-color: var(--border-medium); }
.dash-hcard-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.dash-hcard-value {
  font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.dash-hcard-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
}
.dash-hcard-delta {
  margin-top: 4px;
}
.dash-delta-up {
  font-size: 11px;
  font-weight: 700;
  color: #30d158;
}
.dash-delta-dn {
  font-size: 11px;
  font-weight: 700;
  color: #ff453a;
}
.dash-hcard-spark {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 120px;
  height: 36px;
  opacity: .5;
}
.dash-hcard-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.dash-hcard-bar.green { background: linear-gradient(90deg, #30d158, #30d15844); }
.dash-hcard-bar.red   { background: linear-gradient(90deg, #ff453a, #ff453a44); }
.dash-hcard-bar.gold  { background: linear-gradient(90deg, #ffd60a, #ffd60a44); }

/* Pop animation for values */
@keyframes dashPop {
  0%   { transform: scale(.92); opacity: .4; }
  60%  { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}
.dash-pop { animation: dashPop .35s ease-out; }

/* ── KPI row (secondary) ── */
.dash-krow {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.dash-kcard {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color .2s, box-shadow .2s;
  text-decoration: none;
  color: inherit;
}
.dash-kcard:hover {
  border-color: var(--border-medium);
}
.dash-kcard-link {
  cursor: pointer;
}
.dash-kcard-link:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  border-color: var(--brand);
}
.dash-kcard-icon {
  font-size: 18px;
  color: var(--brand);
  margin-bottom: 6px;
}
.dash-kcard-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.dash-kcard-value {
  font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.dash-kcard-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Charts ── */
.dash-charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 900px) {
  .dash-charts-row { grid-template-columns: 1fr; }
}
.dash-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 16px 18px;
  overflow: hidden;
}
.dash-chart-card.dash-chart-2 {
  /* already handled by grid */
}
.dash-chart-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.dash-chart-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 50px;
  color: #fff;
}
.dash-chart-badge.green { background: #30d158; }
.dash-chart-badge.gold  { background: #ff9f0a; }
.dash-chart-badge.blue  { background: #0a84ff; }
.dash-chart-wrap {
  position: relative;
  width: 100%;
}
.dash-chart-wrap.h260 { height: 260px; }
.dash-chart-wrap.h200 { height: 200px; }

/* ── Dashboard table ── */
.dash-table-wrap {
  max-height: 280px;
  overflow-y: auto;
}
.dash-dtbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.dash-dtbl thead th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: var(--bg-card);
}
.dash-dtbl tbody td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border-subtle, var(--border-light));
  color: var(--text-primary);
  font-size: 12px;
}
.dash-dtbl tbody tr:last-child td { border-bottom: none; }
.dash-dtbl tbody tr:hover td { background: var(--bg-hover); }

/* ── Mini bar track (for top accounts) ── */
.dash-bartrack {
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}
.dash-barfill {
  height: 100%;
  background: var(--brand);
  border-radius: 3px;
  transition: width .4s ease;
}

/* ── Empty state ── */
.dash-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 1.5rem 0;
}

/* ── Dashboard Nav Tabs (top-level) ── */
.dash-nav-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dash-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  font-family: inherit;
  margin-bottom: -1px;
}
.dash-nav-tab:hover {
  color: var(--text-primary, var(--text));
  background: var(--bg-hover);
}
.dash-nav-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.dash-nav-tab i {
  font-size: 14px;
}

/* ── Analytics loading state ── */
.dash-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4rem 2rem;
  color: var(--text-muted);
  font-size: 13px;
}
.dash-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-light);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: dashSpin .6s linear infinite;
}
@keyframes dashSpin {
  to { transform: rotate(360deg); }
}

/* ── Analytics panels ── */
.dash-panel {
  /* default visible */
}

@media (max-width: 768px) {
  .dash-nav-tabs { gap: 0; }
  .dash-nav-tab { padding: 8px 12px; font-size: 12px; }
  .dash-nav-tab i { display: none; }
}

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  MOBILE CARD LAYOUTS (responsive table → cards)                        ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */

/* ── My Expenses mobile cards ── */
.myexp-mobile { display: none; }
.myexp-desktop { display: block; }

@media (max-width: 768px) {
  .myexp-mobile { display: flex; flex-direction: column; gap: 10px; }
  .myexp-desktop { display: none; }
}

.myexp-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: background var(--duration), border-color var(--duration);
}
.myexp-card:active { background: var(--bg-hover); border-color: var(--border-light); }

.myexp-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.myexp-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.myexp-card-concept {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.myexp-card-date {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--mono, 'DM Sans', monospace);
}
.myexp-card-amount {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--mono, 'DM Sans', monospace);
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.myexp-card-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
}
.myexp-card-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

/* ── My Requests mobile cards ── */
.myreq-mobile { display: none; }
.myreq-desktop { display: block; }

@media (max-width: 768px) {
  .myreq-mobile { display: flex; flex-direction: column; gap: 10px; }
  .myreq-desktop { display: none; }
}

.myreq-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.myreq-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.myreq-card-type {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.myreq-card-dates {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.myreq-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.myreq-card-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  UNIVERSAL TABLE → CARDS (MOBILE)                                       ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */

@media (max-width: 768px) {
  /* Transform table into stacked cards */
  .tbl.tbl-cards-ready { border: none; background: none; border-collapse: separate; }
  .tbl.tbl-cards-ready thead { display: none; }
  .tbl.tbl-cards-ready tbody { display: flex; flex-direction: column; gap: 10px; }
  .tbl.tbl-cards-ready tbody tr {
    display: block;
    background: var(--bg-card-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
  }
  .tbl.tbl-cards-ready tbody tr:hover { background: var(--bg-card-alt); }

  /* Each cell becomes a stacked label + value block */
  .tbl.tbl-cards-ready tbody td {
    display: block;
    padding: 4px 0;
    border: none;
    background: none;
    font-size: 13px;
    text-align: left !important;
  }
  .tbl.tbl-cards-ready tbody td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
    line-height: 1.3;
  }

  /* Empty / DataTables "no data" row */
  .tbl.tbl-cards-ready tbody td:empty,
  .tbl.tbl-cards-ready tbody td.dataTables_empty { display: block; text-align: center; }
  .tbl.tbl-cards-ready tbody td.dataTables_empty::before { display: none; }

  /* ── Primary cell: card title ── */
  .tbl.tbl-cards-ready tbody td[data-card-primary] {
    font-weight: 700;
    font-size: 15px;
    padding-bottom: 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
  }
  .tbl.tbl-cards-ready tbody td[data-card-primary]::before {
    display: none;
  }

  /* ── Secondary info (dates) — compact inline row ── */
  .tbl.tbl-cards-ready tbody td[data-card-secondary] {
    display: inline-block;
    font-size: 12px;
    color: var(--muted);
    padding: 2px 10px 2px 0;
  }
  .tbl.tbl-cards-ready tbody td[data-card-secondary]::before {
    display: inline;
    font-size: 10px;
    margin-right: 4px;
  }

  /* ── Actions cell: buttons row at bottom ── */
  .tbl.tbl-cards-ready tbody td[data-card-actions] {
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
  }
  .tbl.tbl-cards-ready tbody td[data-card-actions]::before {
    display: none;
  }
  .tbl.tbl-cards-ready tbody td[data-card-actions] .btn {
    font-size: 12px;
    padding: 6px 10px;
  }
  /* Forms inside action cells (approve/reject/pay) stay inline */
  .tbl.tbl-cards-ready tbody td[data-card-actions] form {
    display: inline;
  }
  .tbl.tbl-cards-ready tbody td[data-card-actions] > div,
  .tbl.tbl-cards-ready tbody td[data-card-actions] > span {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
  }

  /* ── Amount / money cells ── */
  .tbl.tbl-cards-ready tbody td[data-card-amount] {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
  }

  /* ── Inline styles override fix ── */
  .tbl.tbl-cards-ready tbody td[style*="text-align:right"],
  .tbl.tbl-cards-ready tbody td[style*="text-align:center"],
  .tbl.tbl-cards-ready tbody td[style*="text-align: right"],
  .tbl.tbl-cards-ready tbody td[style*="text-align: center"] {
    text-align: left !important;
  }

  /* ── Multi-line cell content (badges, descriptions, sub-text) ── */
  .tbl.tbl-cards-ready tbody td .badge-muted,
  .tbl.tbl-cards-ready tbody td .badge-gold,
  .tbl.tbl-cards-ready tbody td .badge-blue,
  .tbl.tbl-cards-ready tbody td .badge-green,
  .tbl.tbl-cards-ready tbody td .badge-red {
    display: inline-block;
  }

  /* ── Hidden cells (COD columns on cards) ── */
  .tbl.tbl-cards-ready tbody td[data-card-hide] {
    display: none;
  }

  /* DataTables pagination & filter on cards view */
  .tbl.tbl-cards-ready + .dataTables_info,
  .dataTables_wrapper .tbl.tbl-cards-ready ~ * { font-size: 12px; }
}

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  PWA & MOBILE ENHANCEMENTS                                             ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */

/* ── iOS safe areas (notch, home indicator) ── */
@supports (padding-top: env(safe-area-inset-top)) {
  .topbar {
    padding-top: env(safe-area-inset-top);
    height: calc(var(--topbar-h) + env(safe-area-inset-top));
  }
  .sidebar {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .content {
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
  @media (max-width: 768px) {
    .content { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  }
}

/* ── Touch-friendly tap targets ── */
@media (max-width: 768px) {
  .topbar { padding: 0 16px; }
  .topbar-right { gap: 8px; }
  .topbar-hamburger { padding: 8px; }

  /* Bigger tap targets for sidebar links on mobile */
  .sidebar-link { padding: 12px 14px; font-size: 14px; }

  /* Tables: card-style scrolling hint */
  .table-wrap-scroll { position: relative; }
  .table-wrap-scroll::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 24px;
    background: linear-gradient(to left, var(--bg-card), transparent);
    pointer-events: none;
    border-radius: 0 var(--radius) var(--radius) 0;
  }

  /* DataTables compact on mobile */
  .dataTables_wrapper .dataTables_filter { text-align: left !important; margin-bottom: 12px; }
  .dataTables_wrapper .dataTables_filter input { width: 100%; }
  .dataTables_wrapper .dataTables_paginate { text-align: center !important; padding-top: 12px; }

  /* Page actions stack vertically */
  .page-head-right { flex-direction: column; align-items: stretch; }
  .page-head-right .btn { width: 100%; justify-content: center; }
  .page-head-right .form-select { width: 100% !important; min-width: 0 !important; }

  /* Modal responsive */
  .modal-box { width: 95vw; max-height: 85vh; margin: 20px auto; }

  /* Employee dashboard banner */
  .emp-banner { flex-direction: column; }
  .emp-banner-stat { min-width: auto; }

  /* OPP vision panels */
  .dash-charts-row { grid-template-columns: 1fr !important; }

  /* Fix inline grid overrides from dashboard */
  [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
}

/* ── Small phones ── */
@media (max-width: 380px) {
  .content { padding: 10px; }
  .page-title { font-size: 16px; }
  .topbar-breadcrumb { font-size: 11px; }
  .card { padding: 14px; }
  .btn { padding: 8px 14px; font-size: 12px; }
}

/* ── Standalone PWA mode adjustments ── */
@media (display-mode: standalone) {
  /* Remove any browser-specific UI padding */
  body { -webkit-tap-highlight-color: transparent; }

  /* Smoother scrolling for PWA */
  .content { -webkit-overflow-scrolling: touch; }
  .sidebar { -webkit-overflow-scrolling: touch; }
}

/* ── Prevent horizontal scroll on layout ── */
.layout { overflow-x: hidden; max-width: 100vw; }
/* Report pages need visible overflow for table scroll */
.layout.layout-reports { overflow-x: visible; }

/* ── Print: hide sidebar and topbar ── */
@media print {
  .sidebar, .topbar, .sidebar-overlay, .topbar-hamburger { display: none !important; }
  .layout { grid-template-columns: 1fr !important; grid-template-areas: "content" !important; }
  .content { padding: 0 !important; max-width: 100% !important; }
}
