/* QWERTY visual ledger + attendance + Financial Load polish, v88. */

/* One upright attendance chart, retaining the original full-width footprint. */
.adash-charts.adash-charts-combined {
  display: block;
  min-height: 330px;
  padding: .5rem .35rem .15rem;
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, #2563eb 3%, transparent), transparent 45%),
    var(--surface);
}
.adash-chart-combined { position: relative; width: 100%; height: 320px; min-height: 320px; }
.adash-dot.blue { background: #2563eb !important; }
.adash-dot.green { background: #16a34a !important; }
.adash-stat-title:has(+ .adash-stat-row) { min-height: 1.2em; }

/* A single, owner-oriented colour language used by every finance ledger. */
.ledger-happiness-legend { display:flex; flex-wrap:wrap; gap:.4rem .75rem; align-items:center; }
.ledger-happiness-legend span { display:inline-flex; align-items:center; gap:.34rem; font-size:.7rem; font-weight:750; color:var(--text-soft); }
.ledger-happiness-legend span::before { content:""; width:.62rem; height:.62rem; border-radius:4px; border:1px solid transparent; }
.ledger-happiness-legend .legend-income::before { background:#dcfce7; border-color:#86efac; }
.ledger-happiness-legend .legend-employee-expense::before { background:#fef9c3; border-color:#fde047; }
.ledger-happiness-legend .legend-expense::before { background:#fee2e2; border-color:#fca5a5; }
.ledger-happiness-legend .legend-new-bill::before { background:#ede9fe; border-color:#c4b5fd; }
.ledger-happiness-legend .legend-auto-bill::before { background:#dbeafe; border-color:#93c5fd; }
.balance-colour-legend { padding:.48rem .7rem; border-top:1px solid var(--border); border-bottom:1px solid var(--border); background:color-mix(in srgb,var(--surface-2) 62%,var(--surface)); }

:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-income > td { background:#ecfdf3 !important; }
:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-employee-expense > td { background:#fffbdf !important; }
:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-expense > td { background:#fff1f2 !important; }
:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-new-bill > td { background:#f5f3ff !important; }
:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-auto-bill > td { background:#eff6ff !important; }
:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-opening > td { background:#f8fafc !important; }
:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-adjustment > td { background:#f1f5f9 !important; color:#64748b; }
:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-income > td:first-child { box-shadow:inset 4px 0 #22c55e; }
:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-employee-expense > td:first-child { box-shadow:inset 4px 0 #eab308; }
:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-expense > td:first-child { box-shadow:inset 4px 0 #ef4444; }
:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-new-bill > td:first-child { box-shadow:inset 4px 0 #8b5cf6; }
:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-auto-bill > td:first-child { box-shadow:inset 4px 0 #3b82f6; }
:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-opening > td:first-child { box-shadow:inset 4px 0 #94a3b8; }
:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-adjustment > td:first-child { box-shadow:inset 4px 0 #cbd5e1; }
:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-income:hover > td { background:#dcfce7 !important; }
:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-employee-expense:hover > td { background:#fef9c3 !important; }
:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-expense:hover > td { background:#fee2e2 !important; }
:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-new-bill:hover > td { background:#ede9fe !important; }
:where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-auto-bill:hover > td { background:#dbeafe !important; }

/* Financial Load: modern command-centre styling without changing any workflow or data. */
.fl-page {
  position:relative;
  gap:1.1rem;
  padding:.15rem;
  isolation:isolate;
}
.fl-page::before {
  content:"";
  position:absolute;
  z-index:-1;
  inset:-1rem -1rem auto;
  height:250px;
  border-radius:0 0 34px 34px;
  background:
    radial-gradient(circle at 12% 15%, rgba(96,165,250,.18), transparent 32%),
    radial-gradient(circle at 82% 0%, rgba(139,92,246,.16), transparent 31%),
    linear-gradient(135deg, rgba(239,246,255,.94), rgba(250,245,255,.84));
}
.fl-page > .fl-head {
  position:relative;
  overflow:hidden;
  align-items:center;
  min-height:112px;
  padding:1.25rem 1.35rem;
  border:1px solid rgba(255,255,255,.65);
  border-radius:22px;
  background:linear-gradient(126deg,#152a68 0%,#254fc7 48%,#6d28d9 100%);
  box-shadow:0 18px 44px rgba(30,64,175,.18);
}
.fl-page > .fl-head::after {
  content:"";
  position:absolute;
  width:290px;
  height:290px;
  right:-96px;
  top:-156px;
  border-radius:50%;
  border:42px solid rgba(255,255,255,.08);
  pointer-events:none;
}
.fl-page > .fl-head .fl-title,
.fl-page > .fl-head .fl-title i,
.fl-page > .fl-head .text-soft { color:#fff !important; }
.fl-page > .fl-head .fl-title { font-size:clamp(1.3rem,2vw,1.75rem); letter-spacing:-.025em; }
.fl-page > .fl-head .text-soft { max-width:760px; margin:.35rem 0 0; opacity:.78; line-height:1.5; }
.fl-page > .fl-head .fl-back,
.fl-page > .fl-head .btn.btn-ghost,
.fl-page > .fl-head .fl-month {
  border-color:rgba(255,255,255,.28);
  background:rgba(255,255,255,.14);
  color:#fff;
  box-shadow:none;
  backdrop-filter:blur(10px);
}
.fl-page > .fl-head .fl-month option { color:#0f172a; background:#fff; }
.fl-page > .fl-head .btn.btn-primary,
.fl-page > .fl-head .btn.btn-success { border-color:#fff; background:#fff; color:#254fc7; box-shadow:0 8px 20px rgba(15,23,42,.18); }
.fl-page > .fl-head .btn:hover { transform:translateY(-1px); }

.fl-kpi-grid { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:.8rem; }
.fl-kpi {
  position:relative;
  overflow:hidden;
  min-height:88px;
  padding:.9rem;
  border:1px solid color-mix(in srgb,var(--border) 76%,transparent);
  border-radius:16px;
  background:color-mix(in srgb,var(--surface) 94%,transparent);
  box-shadow:0 9px 26px rgba(15,23,42,.06);
  transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease;
}
.fl-kpi::after { content:""; position:absolute; inset:auto -22px -30px auto; width:86px; height:86px; border-radius:50%; background:color-mix(in srgb,var(--kpi,#2563eb) 9%,transparent); }
.fl-kpi:hover { transform:translateY(-3px); box-shadow:0 15px 34px rgba(15,23,42,.10); border-color:color-mix(in srgb,var(--kpi,#2563eb) 28%,var(--border)); }
.fl-kpi.blue{--kpi:#2563eb}.fl-kpi.green{--kpi:#16a34a}.fl-kpi.orange{--kpi:#f97316}.fl-kpi.red{--kpi:#dc2626}.fl-kpi.purple{--kpi:#7c3aed}.fl-kpi.teal{--kpi:#0d9488}
.fl-kpi-ic { position:relative; z-index:1; width:44px; height:44px; border-radius:14px; box-shadow:0 8px 18px color-mix(in srgb,var(--kpi) 24%,transparent); }
.fl-kpi-l { font-size:.7rem; letter-spacing:.035em; text-transform:uppercase; }
.fl-kpi-v { margin:.08rem 0; font-size:1.18rem; }

.fl-two-col { grid-template-columns:minmax(0,2.25fr) minmax(280px,.75fr); gap:1rem; }
.fl-panel,
.fl-summary-strip,
.fl-payroll-summary,
.fl-single-form,
.fl-detail-head {
  border:1px solid color-mix(in srgb,var(--border) 76%,transparent);
  border-radius:18px !important;
  background:var(--surface);
  box-shadow:0 10px 30px rgba(15,23,42,.055);
}
.fl-panel { padding:1rem 1.05rem; }
.fl-panel-head { margin:-.1rem -.1rem .75rem; padding:.12rem .1rem .72rem; border-bottom:1px solid color-mix(in srgb,var(--border) 70%,transparent); }
.fl-panel-head h2 { font-size:.94rem; }
.fl-panel-head h2 i { width:28px; height:28px; display:grid; place-items:center; border-radius:9px; color:#4f46e5; background:#eef2ff; }
.fl-side .fl-panel { overflow:hidden; }
.fl-list-row { padding:.65rem .2rem; border-bottom:1px solid color-mix(in srgb,var(--border) 62%,transparent); }
.fl-list-row:hover { background:color-mix(in srgb,#2563eb 4%,var(--surface)); }
.fl-chart-wrap { height:226px; }

.fl-table { border-collapse:separate; border-spacing:0; }
.fl-table thead th { position:sticky; top:0; z-index:2; padding:.68rem .62rem; color:#475569; background:#f8fafc; border-bottom:1px solid #e2e8f0; font-size:.67rem; text-transform:uppercase; letter-spacing:.045em; }
.fl-table tbody td { padding:.68rem .62rem; border-bottom:1px solid color-mix(in srgb,var(--border) 66%,transparent); }
.fl-table tbody tr { transition:background .16s ease,transform .16s ease; }
.fl-table tbody tr:hover { background:#f8fbff; }
.fl-table tbody tr:last-child td { border-bottom:0; }
.fl-system-row td { background:#f5f3ff; }
.fl-type-chip { padding:.22rem .58rem; border:1px solid color-mix(in srgb,var(--c) 24%,transparent); }

.fl-summary-strip,
.fl-payroll-summary { gap:0; overflow:hidden; padding:0; }
.fl-summary-strip > div,
.fl-payroll-summary > div { flex:1 1 145px; padding:.9rem 1rem; border-right:1px solid var(--border); }
.fl-summary-strip > div:last-child,
.fl-payroll-summary > div:last-child { border-right:0; }
.fl-summary-strip span,
.fl-payroll-summary span { text-transform:uppercase; letter-spacing:.035em; font-size:.67rem; }
.fl-summary-strip strong,
.fl-payroll-summary strong { margin-top:.18rem; }
.fl-note { margin:.05rem .2rem 0; padding:.65rem .8rem; border-radius:12px; background:color-mix(in srgb,#2563eb 5%,var(--surface)); }

.fl-filters { border:1px solid var(--border); border-radius:16px; background:var(--surface); box-shadow:0 8px 22px rgba(15,23,42,.045); }
.fl-step { border-radius:13px; background:var(--surface); }
.fl-step.active { background:color-mix(in srgb,var(--accent) 7%,var(--surface)); box-shadow:0 7px 18px color-mix(in srgb,var(--accent) 10%,transparent); }
.fl-type-trigger,
.fl-type-menu { border-radius:14px; }
.fl-type-option { padding:.65rem; border-radius:10px; }
.fl-detail-ic { border-radius:15px; box-shadow:0 10px 22px color-mix(in srgb,var(--c,#2563eb) 24%,transparent); }
.fl-tab { position:relative; border-bottom:0; border-radius:10px 10px 0 0; }
.fl-tab.active { background:color-mix(in srgb,var(--accent) 8%,var(--surface)); }

[data-theme="dark"] .fl-page::before { background:radial-gradient(circle at 12% 15%,rgba(37,99,235,.12),transparent 32%),radial-gradient(circle at 82% 0%,rgba(124,58,237,.12),transparent 31%); }
[data-theme="dark"] :where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-income > td { background:rgba(22,163,74,.13) !important; }
[data-theme="dark"] :where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-employee-expense > td { background:rgba(234,179,8,.13) !important; }
[data-theme="dark"] :where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-expense > td { background:rgba(239,68,68,.13) !important; }
[data-theme="dark"] :where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-new-bill > td { background:rgba(139,92,246,.13) !important; }
[data-theme="dark"] :where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-auto-bill > td { background:rgba(59,130,246,.13) !important; }
[data-theme="dark"] :where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-opening > td,
[data-theme="dark"] :where(.balance-ledger-table,.spx-transaction-table) tr.ledger-tone-adjustment > td { background:rgba(100,116,139,.13) !important; }
[data-theme="dark"] .fl-table thead th { color:#cbd5e1; background:#172033; border-color:#334155; }
[data-theme="dark"] .fl-table tbody tr:hover { background:rgba(37,99,235,.08); }
[data-theme="dark"] .fl-system-row td { background:rgba(124,58,237,.12); }

@media (max-width:960px) {
  .fl-two-col { grid-template-columns:1fr; }
  .fl-side { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .fl-side > .fl-panel:first-child { grid-column:1/-1; }
}
@media (max-width:720px) {
  .adash-charts.adash-charts-combined { min-height:340px; padding:.25rem 0; }
  .adash-chart-combined { height:330px; min-height:330px; }
  .adash-head-right .adash-legend { font-size:.68rem; }
  .fl-page > .fl-head { min-height:0; padding:1rem; border-radius:18px; }
  .fl-page > .fl-head .fl-head-l { width:100%; }
  .fl-page > .fl-head .fl-head-actions { width:100%; }
  .fl-page > .fl-head .fl-head-actions > * { flex:1 1 135px; max-width:none; }
  .fl-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:.6rem; }
  .fl-kpi { min-height:82px; padding:.7rem; }
  .fl-kpi-ic { width:38px; height:38px; border-radius:12px; }
  .fl-kpi-v { font-size:1.02rem; }
  .fl-side { display:flex; }
  .fl-summary-strip > div,
  .fl-payroll-summary > div { flex:1 1 50%; border-bottom:1px solid var(--border); }
  .fl-table tbody tr { border-radius:14px; box-shadow:0 7px 20px rgba(15,23,42,.05); }
  .ledger-happiness-legend { overflow-x:auto; flex-wrap:nowrap; padding-bottom:.2rem; }
  .ledger-happiness-legend span { flex:0 0 auto; }
}
@media (max-width:430px) {
  .fl-kpi-grid { grid-template-columns:1fr; }
  .fl-kpi { min-height:76px; }
  .adash-chart-combined { height:300px; min-height:300px; }
}
