/* FINSACC visual system, based on the supplied dashboard and sign-in designs. */
:root {
  --navy: #102b43;
  --teal: #009c91;
  --teal-dark: #007d75;
  --mint: #eaf3f2;
  --page-bg: #f6f9fc;
  --content-bg: #f6f9fc;
  --sidebar-bg: #072f3a;
  --sidebar-surface: rgba(255,255,255,.05);
  --sidebar-border: rgba(255,255,255,.09);
  --sidebar-text: #f1f7f8;
  --sidebar-muted: #aac6ce;
  --sidebar-hover: rgba(255,255,255,.07);
  --sidebar-active: linear-gradient(110deg,#009c91,#008579);
  --sidebar-active-border: #00a89a;
  --card-border: #e3eaf0;
  --divider: #e9eef3;
  --card-shadow: 0 3px 6px rgba(16,43,67,.025),0 10px 25px rgba(16,43,67,.025);
  --btn-radius: 0;
  --blue: #009c91;
  --blue-600: #007d75;
  --accent-blue: 0,156,145;
  --accent-emerald: 0,167,121;
  --accent-violet: 36,111,205;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif; font-size: 16px; color: var(--navy); }
a { text-decoration: none; }
button,input,select,textarea { font: inherit; }
button,a,input,select,textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:where(a,button,input,select,textarea):focus-visible { outline: 3px solid #36b9b0; outline-offset: 3px; }
.ui-icon { width: 21px; height: 21px; flex: 0 0 auto; }
.app-shell { display: grid; grid-template-columns: 270px minmax(0,1fr); grid-template-rows: 82px minmax(0,1fr); height: 100vh; height: 100dvh; min-height: 0; border-radius: 0; }
.app-body { display: contents; }
.app-header { grid-column: 2; grid-row: 1; height: 82px; padding: 0 28px; gap: 24px; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--divider); z-index: 20; }
.header-leading,.header-actions { display: flex; align-items: center; min-width: 0; }
.header-leading { flex: 1; }
.header-actions { gap: 16px; flex-shrink: 0; }
.header-search { width: min(540px,100%); min-width: 150px; margin: 0; padding: 10px 14px; gap: 12px; border: 1px solid #d9e2eb; border-radius: 12px; background: linear-gradient(110deg,#fafbfd,#f5f7fa); color: #596b7d; }
.header-search input { min-width: 0; padding: 0; font-size: 13px; }
.header-search input::placeholder { color: #5a6d83; opacity: 1; }
.header-search kbd { white-space: nowrap; background: #eaf0f5; padding: 3px 7px; border-radius: 5px; font: 12px Inter, sans-serif; }
.header-period,.header-branch { min-height: 44px; padding: 10px 14px; background: linear-gradient(#fff,#fafbfd); color: var(--navy); font-size: 14px; font-weight: 600; box-shadow: 0 2px 3px rgba(16,43,67,.02); white-space: nowrap; }
.header-period { max-width: 205px; }
.header-period span { overflow: hidden; text-overflow: ellipsis; }
.header-period .ui-icon:last-child,.header-branch .ui-icon:last-child { width: 15px; height: 15px; margin-left: 4px; }
.header-notifications { border: 0; background: transparent; color: var(--navy); }
.user-btn { padding: 0 0 0 16px; min-height: 44px; border: 0; border-left: 1px solid var(--divider); border-radius: 0; background: transparent; gap: 13px; }
.user-avatar { display: flex; align-items: center; justify-content: center; width: 43px; height: 43px; border-radius: 50%; background: linear-gradient(135deg,#009c91,#00796e); color: #fff; font-size: 14px; font-weight: 500; }
.user-details { display: flex; flex-direction: column; gap: 3px; text-align: left; max-width: 160px; }
.user-details strong { color: #102538; font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-details>span { color: #617389; font-size: 13px; }
.user-btn>.ui-icon { width: 15px; height: 15px; margin-left: 6px; }
.user-staff-id { color: #6b7c8d; font-size: 12px; }
.mobile-menu-toggle,.mobile-brand { display: none; }
.app-sidebar { grid-column: 1; grid-row: 1 / -1; position: relative; display: flex; flex-direction: column; width: auto; min-width: 0; height: 100%; background: linear-gradient(150deg,#062c35,#07323f 70%,#063340); border: 0; isolation: isolate; }
.app-sidebar::before,.app-sidebar::after { content: ""; position: absolute; bottom: -80px; width: 400px; height: 170px; border-radius: 50%; pointer-events: none; z-index: -1; }
.app-sidebar::before { left: -160px; bottom: -45px; transform: rotate(30deg); background: linear-gradient(110deg,#00505a,#007f7d); opacity: .75; }
.app-sidebar::after { right: -170px; transform: rotate(-24deg); background: linear-gradient(90deg,#006c70,#00a89e); opacity: .65; }
.sidebar-brand { height: 96px; flex-shrink: 0; display: flex; align-items: center; padding: 0 28px; }
.finsacc-brand { display: inline-flex; align-items: center; }
.finsacc-brand img { display: block; max-width: none; object-fit: contain; }
.finsacc-brand-logo { width: 154px; height: 44px; }
.finsacc-brand-mark { width: 36px; height: 36px; }
.finsacc-brand .finsacc-brand-mark { display: none; }
.sidebar-inner { display: flex; flex-direction: column; padding: 10px 18px 28px; min-height: 0; overflow-x: hidden; }
.sidebar-inner nav { margin: 0; order: 0; }
.nav-group { margin: 0; }
.nav-label { display: none; }
.nav-item { min-height: 47px; padding: 11px 15px; border-radius: 10px; margin-bottom: 2px; font-size: 15px; font-weight: 500; text-align: left; }
.nav-left { gap: 14px; min-width: 0; }
.nav-left svg { width: 21px; height: 21px; flex-shrink: 0; }
.nav-left span { white-space: nowrap; }
.nav-caret { width: 14px; height: 14px; color: #d2e2e8; transform: rotate(-90deg); }
.nav-item--parent[aria-expanded="true"] .nav-caret { transform: rotate(0); }
.nav-item--parent.is-active { background: var(--sidebar-active); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.08),0 4px 10px rgba(0,0,0,.05); }
.nav-sub { margin: 3px 0 9px 25px; padding-left: 13px; gap: 2px; border-left: 1px solid rgba(255,255,255,.14); }
.nav-subitem { padding: 9px 12px; border-radius: 7px; font-size: 13px; font-weight: 450; color: #c3d9df; }
.nav-subitem.is-active { background: rgba(0,156,145,.18); border: 0; color: #7de5d8; }
.sidebar-tools { order: 1; margin-top: 22px; gap: 6px; }
.sidebar-search { padding: 9px; border-radius: 8px; }
.sidebar-search input { font-size: 12px; min-width: 0; }
.sidebar-tool-btn { width: 34px; height: 34px; flex-shrink: 0; border-radius: 8px; }
.sidebar-collapsed .app-shell { grid-template-columns: 82px minmax(0,1fr); }
.sidebar-collapsed .app-sidebar { width: auto; }
.sidebar-collapsed .sidebar-brand { padding: 0 21px; }
.sidebar-collapsed .sidebar-brand .finsacc-brand-logo { display: none; }
.sidebar-collapsed .sidebar-brand .finsacc-brand-mark { display: block; }
.sidebar-collapsed .sidebar-inner { padding-left: 12px; padding-right: 12px; }
.sidebar-collapsed .nav-item { padding: 12px; }
.app-main { grid-column: 2; grid-row: 2; height: 100%; min-height: 0; padding: 25px 28px 35px; background: radial-gradient(ellipse at top right,rgba(234,243,242,.42),transparent 55%),#f7f9fc; overflow: auto; }
.card { padding: 20px; border-radius: 15px; border-color: var(--card-border); box-shadow: var(--card-shadow); }
.card-title { font-size: 17px; font-weight: 700; color: #0d2136; letter-spacing: -.35px; }
.card-head { gap: 12px; }
.card-divider { margin: 16px 0; }
.app-main>.card:first-child:not(.stat-card) { background: transparent; box-shadow: none; border: 0; border-radius: 0; padding: 0 0 13px; }
.app-main>.card:first-child .text-\[18px\] { font-size: 27px; letter-spacing: -.65px; font-weight: 700; }
.app-main .text-xs { font-size: 13px; line-height: 1.5; }
.app-main .text-sm { line-height: 1.55; }
.app-main .font-extrabold { font-weight: 650; }
.app-main :is(.text-blue-600,.text-blue-700,.text-indigo-600) { color: var(--teal-dark); }
.app-main :is(.bg-blue-50,.bg-indigo-50) { background-color: var(--mint); }
.btn-primary { background: linear-gradient(105deg,#008c83,#007c72); border: 1px solid #008b80; border-radius: 9px; font-size: 14px; font-weight: 600; padding: 11px 17px; box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.btn-primary:hover { background: linear-gradient(105deg,#007e76,#006f67); }
.btn-soft { border-radius: 9px; font-size: 14px; font-weight: 550; background-color: #f7f9fb; border-color: #dce4eb; }
.btn-soft:hover { background-color: #edf3f5; border-color: #c5d9dc; }
.btn-primary--sm,.btn-soft--sm { font-size: 13px; padding: 9px 13px; }
.icon-btn,.corner-btn,.pager-btn { border-radius: 8px; }
.range-chip,.tab-chip { border-radius: 7px; font-weight: 600; font-size: 13px; }
:is(.range-chip,.tab-chip,.pager-btn).is-active { background: var(--teal); border-color: var(--teal); color: #fff; }
.dropdown-menu { padding: 7px; border-radius: 12px; border-color: #e0e8ee; box-shadow: 0 12px 32px rgba(16,43,67,.12); }
.dropdown-item { border-radius: 7px; font-size: 14px; font-weight: 500; }
.dropdown-item:hover { background: var(--mint); color: var(--teal-dark); }
.stat-card { padding: 18px; border-left: 1px solid var(--card-border); background: linear-gradient(120deg,rgba(var(--stat-accent),.07),rgba(var(--stat-accent),.025)); }
.stat-label { color: #30475b; font-size: 14px; font-weight: 500; }
.stat-value { font-size: clamp(20px,1.7vw,28px); letter-spacing: -.7px; font-weight: 750; color: #091e34; overflow-wrap: anywhere; }
.stat-sub { font-size: 12px; }
.stats-grid { gap: 16px; }
.content-grid,.col-stack { gap: 20px; }
.content-grid { margin-top: 22px; }
.table-card { padding: 0; overflow: hidden; }
.table-head { padding: 19px 20px; flex-wrap: wrap; }
.table-search { border: 1px solid #dce4eb; border-radius: 9px; background: #f9fbfc; }
.table-search input { font-size: 14px; }
table.data-table thead th { padding: 14px 16px; background: #f6f9fb; font-size: 12px; letter-spacing: .025em; font-weight: 600; }
table.data-table tbody td { padding: 14px 16px; font-size: 14px; border-color: var(--divider); }
table.data-table tbody tr:hover td { background: #f3faf8; }
.table-foot { padding: 16px 20px; }
.badge { padding: 4px 10px; font-size: 12px; font-weight: 600; border-radius: 20px; }
.badge--info { color: #007d75; background: #e5f5f1; border-color: #cae9e3; }
.form-grid { gap: 19px; }
.form-label { font-size: 14px; font-weight: 550; color: #2a4255; }
.form-input,.form-select,.form-textarea { border-radius: 8px; border-color: #d7e1e6; font-size: 14px; font-weight: 400; padding: 12px 13px; color: var(--navy); }
.form-input::placeholder,.form-textarea::placeholder { color: #8c9aa6; opacity: 1; }
.form-select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23647789' stroke-width='1.5'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E"); background-position: right 10px center; background-repeat: no-repeat; background-size: 20px; }
.form-help { font-size: 12px; font-weight: 400; }
.modal-panel { border-radius: 17px; box-shadow: 0 24px 90px rgba(16,43,67,.22); }
.modal-head,.modal-body,.modal-foot,.drawer-body { padding: 20px; }
.drawer-panel { border-radius: 17px 0 0 17px; }
.toast-title { font-weight: 650; }
.toast-msg { font-weight: 400; font-size: 13px; }
/* Dashboard */
.dashboard-welcome { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: -7px 4px 29px; }
.dashboard-greeting { color: #5b6e83; font-size: 16px; font-weight: 550; margin: 0 0 4px; }
.dashboard-welcome h1 { color: #081d33; font-size: clamp(24px,2vw,32px); line-height: 1.3; font-weight: 750; letter-spacing: -.9px; margin: 0; }
.dashboard-welcome p:last-child { margin: 4px 0 0; color: #5e7189; font-size: 14px; }
.dashboard-welcome .dropdown { flex-shrink: 0; }
.dashboard-welcome .btn-primary { min-height: 45px; gap: 12px; }
.dashboard-welcome .btn-primary .ui-icon:last-child { width: 15px; height: 15px; }
.dashboard-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; margin-bottom: 28px; }
.dashboard-stat { display: flex; align-items: center; gap: 15px; min-height: 104px; padding: 18px 16px; position: relative; border: 1px solid #dcefeb; border-radius: 14px; background: linear-gradient(120deg,#f2fcfa,#eaf9f5); box-shadow: var(--card-shadow); transition: box-shadow .18s; }
.dashboard-stat:hover { box-shadow: 0 5px 18px rgba(16,43,67,.08); }
.dashboard-stat .stat-value { font-size: clamp(20px,1.65vw,28px); margin-top: 4px; line-height: 1.25; }
.stat-icon { width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; border-radius: 50%; flex-shrink: 0; color: #009985; background: linear-gradient(#e0fbf5,#cff4e9); }
.stat-icon .ui-icon { width: 32px; height: 32px; stroke-width: 1.8; }
.dashboard-stat--amber { background: linear-gradient(120deg,#fffbf3,#fff7e9); border-color: #f5ebd9; }
.dashboard-stat--amber .stat-icon { color: #ce8500; background: #fff0d2; }
.dashboard-stat--blue { background: linear-gradient(120deg,#f0f8ff,#e4f3ff); border-color: #ddecf9; }
.dashboard-stat--blue .stat-icon { color: #1b62c9; background: #d6edff; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(0,1fr) minmax(0,1fr); gap: 22px 16px; }
.dashboard-grid>.card { min-width: 0; padding: 19px 20px; }
.dashboard-grid .card-title { font-size: 19px; letter-spacing: -.6px; }
.dashboard-grid>.card:nth-child(-n+3) { min-height: 250px; }
.dashboard-grid>.card:nth-child(n+4) { min-height: 263px; }
.dashboard-grid .card-head { margin-bottom: 17px; }
.dashboard-card-link { display: inline-flex; align-items: center; gap: 6px; color: var(--teal-dark); font-size: 14px; font-weight: 600; }
.dashboard-card-link .ui-icon { width: 16px; height: 16px; }
.dashboard-card-icon { color: #6a8298; }
.dashboard-card-icon .ui-icon { width: 18px; height: 18px; }
.chart-ranges { display: inline-flex; padding: 2px; border: 1px solid #e2e9ef; border-radius: 7px; background: #f5f7fa; }
.chart-ranges button { font-size: 12px; font-weight: 600; color: #344a61; border-radius: 5px; padding: 6px 11px; border: 0; background: transparent; }
.chart-ranges button[aria-pressed="true"] { background: linear-gradient(120deg,#009c91,#007d75); color: white; box-shadow: 0 1px 4px #d0e3df; }
.savings-chart { position: relative; height: 172px; margin: 9px -3px -5px; }
.savings-chart svg { width: 100%; height: 100%; overflow: visible; }
.savings-chart text { font: 11px Inter, sans-serif; fill: #4b6178; }
.chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #697e90; }
.chart-empty[hidden] { display: none; }
.summary-list { display: flex; flex-direction: column; }
.summary-row { display: flex; align-items: center; gap: 11px; min-height: 52px; padding: 8px 0; font-size: 14px; color: #102538; border-bottom: 1px solid var(--divider); }
.summary-row:last-child { border-bottom: 0; }
.summary-row>span:nth-child(2) { flex: 1; min-width: 0; }
.summary-row strong { white-space: nowrap; font-size: 14px; font-weight: 700; }
.summary-icon { display: inline-flex; align-items: center; justify-content: center; width: 35px; height: 35px; background: #eafaf1; color: #23b457; border-radius: 50%; flex-shrink: 0; }
.summary-icon--amber { background: #fff6e9; color: #e98c10; }
.summary-icon--navy { background: #f0f6fa; color: #155479; }
.par-content { display: flex; align-items: center; gap: 19px; margin-top: 24px; }
.par-donut { position: relative; width: 138px; height: 138px; flex-shrink: 0; }
.par-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.par-donut circle { fill: none; stroke-width: 12px; }
.par-donut .par-track { stroke: #e9edf2; }
.par-donut .par-progress { stroke: #f0a600; stroke-linecap: round; }
.par-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.par-center strong { font-size: 27px; color: #0b2035; letter-spacing: -.8px; }
.par-center span { font-size: 13px; color: #5b7189; }
.par-legend { min-width: 0; flex: 1; }
.par-legend>div { display: flex; align-items: center; gap: 7px; padding: 12px 0; font-size: 13px; border-bottom: 1px solid var(--divider); white-space: nowrap; }
.par-legend>div:last-child { border: 0; }
.par-legend strong { margin-left: auto; font-weight: 650; padding-left: 6px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: #59ce70; }
.status-dot--amber { background: #ffb100; }
.status-dot--red { background: #f34b60; }
.dashboard-transactions { width: 100%; border-collapse: collapse; font-size: 13px; }
.dashboard-transactions th { text-align: left; padding: 7px 8px 12px; font-weight: 600; color: #425971; border-bottom: 1px solid var(--divider); }
.dashboard-transactions th:last-child,.dashboard-transactions td:last-child { text-align: right; }
.dashboard-transactions td { padding: 12px 8px; border-bottom: 1px solid var(--divider); font-size: 13px; }
.dashboard-transactions td:last-child { white-space: nowrap; font-weight: 600; }
.transactions-scroll { overflow-x: auto; }
.dashboard-empty { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; text-align: center; padding: 21px 8px 10px; }
.dashboard-empty[hidden] { display: none; }
.empty-icon { display: flex; align-items: center; justify-content: center; width: 63px; height: 63px; border-radius: 50%; background: #edf5ff; color: #789fc8; }
.empty-icon .ui-icon { width: 36px; height: 36px; stroke-width: 1.4; }
.dashboard-empty strong { font-size: 15px; font-weight: 600; color: #354e66; }
.dashboard-empty p { font-size: 13px; margin: 0; color: #687d93; }
.task-link { display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 9px 0; border-bottom: 1px solid var(--divider); font-size: 14px; color: #102538; }
.task-link:last-child { border: 0; }
.task-link>.ui-icon { color: #425a71; width: 20px; height: 20px; }
.task-link>span:first-of-type { flex: 1; }
.task-link:hover { color: var(--teal-dark); }
.task-count { background: #e0f5ef; border-radius: 20px; padding: 2px 10px; color: #007d75; font-size: 12px; font-weight: 600; }
.task-link>.ui-icon:last-child { margin-left: 4px; width: 14px; height: 14px; }
.report-link { display: flex; align-items: center; gap: 13px; padding: 10px 14px; margin-top: 7px; background: linear-gradient(100deg,#f4f7fa,#f5f7fa); border-radius: 10px; font-size: 14px; color: #102538; }
.report-link>span { flex: 1; }
.report-link .ui-icon { color: #55738d; width: 18px; height: 18px; }
.report-link .ui-icon:last-child { width: 14px; height: 14px; }
.report-link:hover { background: var(--mint); color: var(--teal-dark); }
.dashboard-notice { display: flex; align-items: center; gap: 12px; border-radius: 10px; background: #fff8e9; border: 1px solid #f0dfb7; color: #775a1c; padding: 12px 16px; margin-bottom: 20px; font-size: 13px; }
.dashboard-notice[hidden] { display: none; }
.dashboard-notice button { margin-left: auto; font-weight: 600; text-decoration: underline; background: none; border: 0; }
/* Authentication */
.auth-page { min-height: 100vh; min-height: 100dvh; background: linear-gradient(125deg,#f7fafb,#eaf3f2); position: relative; isolation: isolate; }
.auth-page::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: url('../auth-background.svg'); background-size: 100% 100%; }
.auth-brand { position: absolute; top: 33px; left: 38px; }
.auth-brand .finsacc-brand-logo { width: 168px; height: 48px; }
.auth-main { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 100px 24px 72px; }
.auth-container { width: 100%; max-width: 430px; }
.auth-card { padding: 36px; background: #fff; border: 1px solid #dfe8eb; border-radius: 18px; box-shadow: 0 12px 42px rgba(16,47,64,.085); }
.auth-lock { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; color: #008f84; background: #e7f5f1; border-radius: 12px; margin-bottom: 25px; }
.auth-lock .ui-icon { width: 25px; height: 25px; }
.auth-card h1 { font-size: 30px; font-weight: 700; letter-spacing: -.8px; margin: 0 0 7px; color: #102b43; line-height: 1.2; }
.auth-subtitle { font-size: 14px; color: #758591; margin: 0 0 29px; }
.auth-form { display: flex; flex-direction: column; gap: 23px; }
.auth-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-label-row a { color: #008a80; font-size: 13px; font-weight: 500; }
.auth-input { position: relative; }
.auth-input>.ui-icon { position: absolute; top: 15px; left: 14px; width: 18px; height: 18px; color: #8b9ba5; pointer-events: none; }
.auth-input .form-input { padding: 13px 42px; min-height: 48px; }
.auth-input .form-input:focus { box-shadow: 0 0 0 3px rgba(0,156,145,.1); }
.password-toggle { position: absolute; right: 8px; top: 6px; width: 36px; height: 36px; border: 0; border-radius: 6px; background: transparent; color: #82939e; display: flex; align-items: center; justify-content: center; }
.password-toggle:hover { background: #f0f7f5; color: #007d75; }
.password-toggle[aria-pressed="true"] { color: var(--teal-dark); background: #eaf3f2; }
.auth-submit { width: 100%; min-height: 49px; margin-top: 0; background: linear-gradient(100deg,#087d7a,#009c91); font-size: 15px; }
.auth-copyright { font-size: 12px; color: #788b95; text-align: center; margin: 24px 0 0; }
.auth-system { position: fixed; right: 32px; bottom: 25px; font-size: 12px; color: #718791; }
.auth-page .card-title { font-size: 26px; }
.auth-page .card-head { margin-bottom: 7px; }
.auth-recovery .auth-subtitle { margin-bottom: 0; }
.auth-recovery .auth-form { gap: 20px; }
.auth-back { text-align: center; font-size: 14px; color: var(--teal-dark); }
@media (min-width:1600px) {
  .dashboard-grid { grid-template-columns: minmax(0,1.7fr) minmax(0,1fr) minmax(0,1fr); }
  .dashboard-grid>.card:nth-child(-n+3) { min-height: 255px; }
  .dashboard-grid>.card:nth-child(n+4) { min-height: 265px; }
  .savings-chart { height: 175px; }
}
@media (max-width:1399px) {
  .app-shell { grid-template-columns: 245px minmax(0,1fr); }
  .app-header { gap: 18px; padding: 0 22px; }
  .header-actions { gap: 10px; }
  .header-period { max-width: 160px; }
  .header-search kbd { display: none; }
  .user-details { max-width: 130px; }
  .app-main { padding: 25px 22px; }
  .sidebar-inner { padding-left: 12px; padding-right: 12px; }
  .nav-item { font-size: 13px; }
  .nav-left { gap: 11px; }
  .sidebar-brand { padding-left: 24px; }
  .dashboard-stat { padding: 17px 13px; gap: 11px; }
  .stat-icon { width: 47px; height: 47px; }
  .stat-icon .ui-icon { width: 27px; height: 27px; }
  .dashboard-stat .stat-label { font-size: 13px; }
  .dashboard-grid { grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 18px; }
  .dashboard-grid .dashboard-transactions-card { grid-column: 1; grid-row: 2; }
  .dashboard-grid .dashboard-par-card { grid-column: 2; grid-row: 2; }
  .dashboard-grid>.card { min-height: 250px; }
}
@media (max-width:1199px) {
  .header-period { display: none; }
  .header-search { min-width: 120px; }
  .dashboard-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
  .dashboard-stat .stat-value { font-size: 25px; }
  .user-details { display: none; }
  .dashboard-welcome { align-items: flex-start; }
  .dashboard-welcome h1 { font-size: 27px; }
}
@media (max-width:1023px) {
  .app-shell,.sidebar-collapsed .app-shell { grid-template-columns: minmax(0,1fr); grid-template-rows: 76px minmax(0,1fr); }
  .app-header { grid-column: 1; height: 76px; gap: 15px; padding: 0 20px; }
  .app-main { grid-column: 1; padding: 25px 22px; }
  .app-sidebar,.sidebar-collapsed .app-sidebar { position: fixed; width: 270px; height: 100vh; height: 100dvh; left: 0; top: 0; z-index: 60; }
  .sidebar-collapsed .sidebar-brand { padding: 0 28px; }
  .sidebar-collapsed .sidebar-brand .finsacc-brand-logo { display: block; }
  .sidebar-collapsed .sidebar-brand .finsacc-brand-mark { display: none; }
  .sidebar-collapsed .nav-left span { display: inline; }
  .sidebar-collapsed .nav-caret { display: inline; }
  .sidebar-collapsed .nav-left { gap: 14px; }
  .sidebar-collapsed .nav-item { justify-content: space-between; }
  .sidebar-collapsed .nav-sub { display: none; }
  .sidebar-collapsed .nav-item--parent[aria-expanded="true"]+.nav-sub { display: flex !important; }
  .sidebar-tool-btn { display: none; }
  .mobile-menu-toggle { display: inline-flex; margin-right: 13px; flex-shrink: 0; }
  .header-search { width: 100%; }
  .header-actions { gap: 12px; }
  .user-btn { padding-left: 12px; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:639px) {
  .app-header { padding: 0 13px; gap: 10px; }
  .header-actions { gap: 7px; }
  .header-search { padding: 8px; min-width: 0; gap: 7px; }
  .header-search input { font-size: 12px; }
  .header-search .ui-icon { width: 18px; height: 18px; }
  .header-branch { padding: 8px; gap: 5px; min-height: 39px; }
  .header-branch>span { max-width: 77px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
  .header-branch>.ui-icon:first-child { display: none; }
  .header-branch .ui-icon:last-child { margin: 0; width: 12px; }
  .header-notifications { display: none; }
  .user-avatar { width: 35px; height: 35px; font-size: 12px; }
  .user-btn { padding-left: 0; border: 0; }
  .user-btn>.ui-icon { display: none; }
  .mobile-menu-toggle { width: 34px; height: 36px; margin-right: 8px; border: 0; }
  .app-main { padding: 22px 15px; }
  .dashboard-welcome { flex-direction: column; gap: 18px; margin: 0 0 23px; }
  .dashboard-welcome h1 { font-size: 25px; }
  .dashboard-welcome p:last-child { font-size: 13px; line-height: 1.6; }
  .dashboard-greeting { font-size: 14px; }
  .dashboard-stats { gap: 11px; margin-bottom: 19px; }
  .dashboard-stat { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px 13px; min-height: 145px; }
  .dashboard-stat .stat-value { font-size: 20px; letter-spacing: -.5px; }
  .dashboard-stat .stat-label { font-size: 12px; }
  .stat-icon { width: 40px; height: 40px; }
  .stat-icon .ui-icon { width: 24px; height: 24px; }
  .dashboard-grid { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .dashboard-grid .dashboard-transactions-card,.dashboard-grid .dashboard-par-card { grid-column: auto; grid-row: auto; }
  .dashboard-grid>.card { padding: 18px; min-height: auto !important; }
  .dashboard-grid .card-title { font-size: 18px; }
  .card-head { flex-wrap: wrap; }
  .app-main>.card:first-child .flex.items-center { flex-wrap: wrap; }
  .chart-ranges button { padding: 6px 8px; font-size: 11px; }
  .savings-chart { height: 185px; }
  .par-content { padding-bottom: 9px; }
  .par-legend>div { font-size: 13px; }
  .dashboard-transactions { min-width: 320px; }
  .dashboard-empty { padding-bottom: 18px; }
  .card { padding: 17px; }
  .table-card { padding: 0; }
  .table-head { padding: 16px; }
  .table-tools,.table-search { width: 100%; }
  .table-foot { flex-wrap: wrap; }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .modal-head,.modal-body,.modal-foot,.drawer-body { padding: 16px; }
  .modal-foot { flex-wrap: wrap; }
  .auth-brand { top: 25px; left: 23px; }
  .auth-brand .finsacc-brand-logo { width: 140px; height: 40px; }
  .auth-main { padding: 112px 20px 68px; }
  .auth-card { padding: 29px 25px; border-radius: 16px; }
  .auth-card h1 { font-size: 28px; }
  .auth-system { position: static; text-align: center; padding-bottom: 22px; margin-top: -35px; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Company-wide square UI: keep every surface and control flat-cornered.
   The sidebar's decorative background curves are the only exception. */
html body,
html body *,
html body *:not(.app-sidebar)::before,
html body *:not(.app-sidebar)::after {
  border-radius: 0 !important;
}
*::-webkit-scrollbar-thumb { border-radius: 0; }
