/* Desktop-only savings workspace. The mobile view and source ledger are unchanged. */
.desktop-savings-view{display:none}
@media(min-width:1024px){
 #savings{--desktop-saving-edge:#e1e7e8}
 #savings>.head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}
 #savings>.head h1{font-size:22px;margin:0}
 #savings>.head p{margin:3px 0 0;font-size:12px;color:var(--muted)}
 #savings>.head [data-modal="program"]{min-height:34px;padding:5px 13px;font-size:12px;border-radius:9px}
 #savings #savingsAccountButtons{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 11px}
 #savings #savingsAccountButtons .savings-account-button{min-width:0!important;max-width:240px;min-height:34px!important;padding:7px 12px!important;line-height:1.35!important;border-radius:9px!important;font-size:12px}
 #savings #savingsAccountDetails{margin:0 0 10px!important;padding:6px 10px!important;border-radius:9px;font-size:12px}
 #savings #savingsLedgerStats{display:grid!important;grid-template-columns:minmax(0,1.15fr) minmax(280px,1fr)!important;grid-template-rows:repeat(3,minmax(0,1fr))!important;grid-auto-flow:row;gap:0 12px!important;margin:0 0 10px!important;max-width:100%;min-height:141px}
 #savings #savingsLedgerStats>.stat{box-sizing:border-box;min-width:0;min-height:0!important;max-height:none!important;height:auto!important;padding:7px 12px!important;margin:0!important;display:flex;align-items:center;justify-content:space-between;gap:8px;box-shadow:none!important;border-radius:0!important;border:1px solid var(--desktop-saving-edge);background:var(--card)}
 #savings #savingsLedgerStats>.stat:nth-child(1){grid-column:2;grid-row:1;border-radius:12px 12px 0 0!important;border-bottom:0}
 #savings #savingsLedgerStats>.stat:nth-child(2){grid-column:2;grid-row:2;border-bottom:0}
 #savings #savingsLedgerStats>.stat:nth-child(3){grid-column:2;grid-row:3;border-radius:0 0 12px 12px!important}
 #savings #savingsLedgerStats>.stat:nth-child(4){grid-column:1;grid-row:1/span 3;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding:18px 22px!important;background:var(--navy)!important;color:#fff!important;border:0!important;border-radius:13px!important}
 #savings #savingsLedgerStats>.stat>span{min-width:0;font-size:12px!important;color:var(--muted)}
 #savings #savingsLedgerStats>.stat>b{font-size:18px!important;margin:0!important;font-variant-numeric:tabular-nums}
 #savings #savingsLedgerStats>.stat>small{font-size:10px!important;margin:0!important;white-space:nowrap}
 #savings #savingsLedgerStats>.stat:nth-child(4)>span{color:#dce6ea!important;font-size:12px!important}
 #savings #savingsLedgerStats>.stat:nth-child(4)>b{font-size:clamp(27px,3vw,38px)!important;line-height:1.3!important;color:#fff!important}
 #savings #savingsLedgerStats>.stat:nth-child(4)>small{color:#dce6ea!important;font-size:12px!important}
 #savings>.savings-operations{display:flex;flex-wrap:nowrap;align-items:center;gap:7px!important;width:100%;box-sizing:border-box;margin:0 0 11px!important;padding:9px 11px;border-radius:12px;background:var(--bluebg);border:1px solid var(--desktop-saving-edge)}
 #savings>.savings-operations button{min-height:34px;height:34px;padding:5px 13px;border-radius:8px;font-size:12px;white-space:nowrap}
 #savings #schoolSavingsHub{margin:4px 0 11px}
 #savings #savingsLedger>.savings-statement-heading,
 #savings #savingsLedger>.savings-statement-scroll,
 #savings #savingsLedger>.savings-move-toolbar,
 #savings #savingsLedger>.ledger-sort-note{display:none!important}
 #savings .desktop-savings-view{display:block;margin-top:6px;max-width:100%;min-width:0}
 #savings .desktop-savings-statement-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;background:var(--bluebg);border:1px solid var(--desktop-saving-edge);border-radius:12px 12px 0 0;padding:10px 12px}
 #savings .desktop-savings-statement-head>strong{font-size:16px;color:var(--navy)}
 #savings .desktop-savings-tools{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:6px}
 #savings .desktop-savings-tools button,#savings .desktop-savings-tools select{box-sizing:border-box;min-height:34px;height:34px;border:1px solid var(--border);border-radius:8px;padding:5px 9px;font-size:12px;background:var(--card);color:var(--navy)}
 #savings .desktop-savings-tools button[data-desktop-export]{display:inline-grid;place-items:center;min-width:34px;width:34px;padding:0}
 #savings .desktop-savings-tools button[hidden]{display:none!important}
 #savings .desktop-saving-search{display:flex;align-items:center;gap:5px;background:var(--card);border:1px solid var(--border);border-radius:8px;padding:0 8px;height:34px}
 #savings .desktop-saving-search input{border:0!important;background:transparent!important;box-shadow:none!important;outline-offset:1px;width:150px;min-width:0;min-height:30px;height:30px;padding:4px 1px;font-size:12px}
 #savings .desktop-savings-table-wrap{overflow-x:auto;border:1px solid var(--desktop-saving-edge);border-top:0;border-radius:0 0 12px 12px;background:var(--card)}
 #savings .desktop-savings-table{width:100%;border-collapse:collapse;table-layout:fixed;font-variant-numeric:tabular-nums}
 #savings .desktop-savings-table th{background:#f4f6f5;padding:9px 11px;border-bottom:1px solid var(--border);font-size:12px;text-align:right;color:var(--muted);font-weight:800}
 #savings .desktop-savings-table td{padding:9px 11px;border-bottom:1px solid var(--border);vertical-align:middle;font-size:13px;line-height:1.4}
 #savings .desktop-savings-table tr:nth-child(even){background:#fafbf9}
 #savings .desktop-savings-table tr:last-child{background:var(--greenbg)}
 #savings .desktop-savings-table tr[hidden]{display:none!important}
 #savings .desktop-savings-table th:nth-child(1){width:13%}
 #savings .desktop-savings-table th:nth-child(2){width:39%}
 #savings .desktop-savings-table th:nth-child(3){width:15%}
 #savings .desktop-savings-table th:nth-child(4){width:19%}
 #savings .desktop-savings-table th:nth-child(5){width:14%;text-align:center}
 #savings .desktop-savings-table td:nth-child(1){white-space:nowrap}
 #savings .desktop-savings-table .desktop-saving-description{overflow-wrap:anywhere}
 #savings .desktop-savings-table .desktop-saving-description strong{font-weight:700}
 #savings .desktop-savings-table .ledger-note{display:block;margin-top:2px;font-size:11px;color:var(--muted)}
 #savings .desktop-savings-table .desktop-saving-amount,#savings .desktop-savings-table .desktop-saving-balance{text-align:right;white-space:nowrap;font-weight:750}
 #savings .desktop-savings-table .desktop-saving-amount.deposit{color:var(--green)}
 #savings .desktop-savings-table .desktop-saving-amount.withdraw{color:var(--red)}
 #savings .desktop-savings-table .desktop-saving-balance{color:var(--navy)}
 #savings .desktop-saving-row-actions{text-align:center;white-space:nowrap}
 #savings .desktop-saving-row-actions button{display:inline-grid;place-items:center;min-width:32px;width:32px;min-height:30px;height:30px;padding:0;border-radius:8px;color:var(--navy);background:var(--card);border:1px solid var(--border)}
 #savings .desktop-saving-row-select{display:inline-flex;vertical-align:middle;align-items:center;margin-inline-end:8px}
 #savings .desktop-saving-row-select[hidden]{display:none!important}
 #savings .desktop-saving-row-select input{width:17px;height:17px;min-height:17px;margin:0}
 #savings .desktop-savings-footnote{margin:6px 2px 0;font-size:11px;color:var(--muted)}
 .desktop-saving-detail-dialog{box-sizing:border-box;width:min(560px,calc(100% - 40px));max-height:85dvh;overflow-y:auto;padding:18px;border:1px solid var(--border);border-radius:14px;background:var(--card);color:var(--text)}
 .desktop-saving-detail-dialog::backdrop{background:#182c3b88}
 .desktop-saving-detail-dialog .modalhead{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}
 .desktop-saving-detail-dialog h2{margin:0;font-size:18px}
 .desktop-saving-detail-dialog .modalhead button{min-width:32px;min-height:32px;padding:0;font-size:22px}
 .desktop-saving-detail-dialog dl{margin:0}
 .desktop-saving-detail-dialog dl>div{display:grid;grid-template-columns:150px minmax(0,1fr);align-items:start;gap:8px;border-bottom:1px solid var(--border);padding:9px 0}
 .desktop-saving-detail-dialog dt{font-size:12px;color:var(--muted)}
 .desktop-saving-detail-dialog dd{margin:0;overflow-wrap:anywhere;font-size:13px}
 .desktop-saving-dialog-actions{display:flex;flex-wrap:wrap;gap:7px;padding-top:14px}
 .desktop-saving-dialog-actions button{min-height:34px;border-radius:8px;padding:6px 12px;font-size:12px}
}

/* Compact desktop savings: show the statement above secondary school details. */
@media(min-width:1024px){
 #savings.page.active{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:0!important}
 #savings>.head{order:0!important;min-height:0!important;margin:0 0 6px!important;padding:0!important}
 #savings>.head h1{font-size:19px!important;line-height:1.25!important}
 #savings>.head p{font-size:11px!important;margin:2px 0 0!important}
 #savings>#savingsAccountButtons{order:1!important;gap:5px!important;margin:0 0 6px!important}
 #savings #savingsAccountButtons .savings-account-button{min-height:30px!important;height:auto!important;padding:5px 10px!important;line-height:1.3!important}
 #savings>#savingsAccountDetails{order:2!important;min-height:0!important;margin:0 0 6px!important;padding:4px 10px!important}
 #savings>#savingsLedgerStats{order:3!important;min-height:102px!important;height:102px!important;max-height:102px!important;margin:0 0 6px!important;grid-template-rows:repeat(3,minmax(0,1fr))!important}
 #savings #savingsLedgerStats>.stat{min-height:0!important;max-height:none!important;height:auto!important;padding:4px 10px!important}
 #savings #savingsLedgerStats>.stat>span{font-size:11px!important}
 #savings #savingsLedgerStats>.stat>b{font-size:15px!important;line-height:1.3!important}
 #savings #savingsLedgerStats>.stat:nth-child(4){padding:11px 17px!important}
 #savings #savingsLedgerStats>.stat:nth-child(4)>b{font-size:29px!important;line-height:1.15!important}
 #savings>.savings-operations{order:4!important;margin:0 0 6px!important;padding:5px 9px!important;gap:5px!important;min-height:0!important}
 #savings>.savings-operations button{height:30px!important;min-height:30px!important;padding:3px 10px!important}
 #savings>#savingsImportNotice{order:5!important}
 #savings>#savingsLedger{order:6!important;min-width:0!important;margin:0!important}
 #savings .desktop-savings-view{margin-top:0!important}
 #savings .desktop-savings-statement-head{padding:6px 10px!important}
 #savings .desktop-savings-tools button,#savings .desktop-savings-tools select{height:30px!important;min-height:30px!important}
 #savings .desktop-saving-search{height:30px!important}
 #savings .desktop-saving-search input{height:27px!important;min-height:27px!important}
 #savings>#schoolSavingsHub{order:7!important;margin:13px 0 8px!important}
}

/* Approved compact desktop overview: all four balances aligned above the statement. */
@media(min-width:1024px){
 #savings>#savingsLedgerStats{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-template-rows:minmax(87px,auto)!important;
  min-height:87px!important;height:auto!important;max-height:none!important;
  align-items:stretch!important;gap:8px!important;margin:0 0 7px!important
 }
 #savings #savingsLedgerStats>.stat{
  grid-row:1!important;min-width:0!important;min-height:87px!important;
  display:flex!important;flex-direction:column!important;align-items:flex-start!important;
  justify-content:center!important;gap:4px!important;box-sizing:border-box!important;
  border:1px solid var(--desktop-saving-edge)!important;border-radius:12px!important;
  padding:10px 13px!important;background:var(--card)!important
 }
 #savings #savingsLedgerStats>.stat:nth-child(4){
  grid-column:1!important;background:var(--navy)!important;color:#fff!important;
  align-items:flex-start!important;padding:10px 17px!important;border-color:var(--navy)!important
 }
 #savings #savingsLedgerStats>.stat:nth-child(1){grid-column:2!important}
 #savings #savingsLedgerStats>.stat:nth-child(2){grid-column:3!important}
 #savings #savingsLedgerStats>.stat:nth-child(3){grid-column:4!important}
 #savings #savingsLedgerStats>.stat>span{font-size:11px!important;line-height:1.3!important}
 #savings #savingsLedgerStats>.stat>b{
  font-size:clamp(18px,1.7vw,26px)!important;line-height:1.2!important;
  white-space:nowrap!important;max-width:100%!important;overflow:visible!important
 }
 #savings #savingsLedgerStats>.stat:nth-child(4)>b{font-size:clamp(21px,2vw,30px)!important}
 #savings #savingsLedgerStats>.stat>small{font-size:10px!important;line-height:1!important}
 #savings>.savings-operations{justify-content:flex-start!important;min-height:0!important;padding:5px 8px!important;gap:7px!important}
 #savings>.savings-operations button{min-height:32px!important;height:32px!important;padding:5px 11px!important}
 #savings .desktop-savings-statement-head{
  flex-wrap:nowrap!important;min-height:46px!important;
  padding:6px 12px!important;gap:14px!important
 }
 #savings .desktop-savings-statement-head>strong{flex:none!important;font-size:15px!important}
 #savings .desktop-savings-tools{flex:1 1 auto!important;min-width:0!important;flex-wrap:nowrap!important;gap:7px!important}
 #savings .desktop-saving-search{margin-inline-start:auto!important;flex:0 1 210px!important;min-width:120px!important}
 #savings .desktop-saving-search input{width:100%!important;min-width:0!important}
 #savings .desktop-savings-tools select{max-width:155px!important;min-width:110px!important;flex:0 0 140px!important}
 #savings .desktop-savings-tools [data-desktop-export]{flex:none!important}
 #savings .desktop-savings-tools [data-desktop-select-mode]{white-space:nowrap!important;flex:none!important}
 #savings .desktop-savings-table th{padding:7px 10px!important}
 #savings .desktop-savings-table td{padding:7px 10px!important}
}
@media(min-width:1024px) and (max-width:1199px){
 #savings #savingsLedgerStats>.stat>b{font-size:18px!important}
 #savings #savingsLedgerStats>.stat:nth-child(4)>b{font-size:22px!important}
 #savings .desktop-saving-search{flex-basis:145px!important}
 #savings .desktop-savings-tools select{flex-basis:120px!important}
}

/* Financial semantic colors: expense red, deposits/income blue, savings green. Desktop only. */
@media(min-width:1024px){
 #savings #savingsLedgerStats>.stat:nth-child(4){
  background:#17674f!important;border-color:#17674f!important;color:#fff!important
 }
 #savings #savingsLedgerStats>.stat:nth-child(4)>span,
 #savings #savingsLedgerStats>.stat:nth-child(4)>b,
 #savings #savingsLedgerStats>.stat:nth-child(4)>small{color:#fff!important}
 #savings #savingsLedgerStats>.stat:nth-child(2){background:#edf4fc!important;border-color:#d6e5f5!important}
 #savings #savingsLedgerStats>.stat:nth-child(2)>b{color:#205b9b!important}
 #savings #savingsLedgerStats>.stat:nth-child(3){background:#fff0f0!important;border-color:#f3dede!important}
 #savings #savingsLedgerStats>.stat:nth-child(3)>b{color:#a62e38!important}
 #savings .desktop-savings-table .desktop-saving-amount.deposit{color:#205b9b!important}
 #savings .desktop-savings-table .desktop-saving-amount.withdraw{color:#a62e38!important}
}

/* Savings account statement: date, credit, debit, balance, details. */
@media(min-width:1024px){
 #savings .desktop-savings-table th:nth-child(1){width:13%}
 #savings .desktop-savings-table th:nth-child(2){width:15%}
 #savings .desktop-savings-table th:nth-child(3){width:15%}
 #savings .desktop-savings-table th:nth-child(4){width:17%}
 #savings .desktop-savings-table th:nth-child(5){width:40%;text-align:right}
 #savings .desktop-savings-table .desktop-saving-deposit,
 #savings .desktop-savings-table .desktop-saving-withdrawal,
 #savings .desktop-savings-table .desktop-saving-balance{
  text-align:right;white-space:nowrap;font-weight:750;
 }
 #savings .desktop-savings-table .desktop-saving-deposit{color:var(--green)}
 #savings .desktop-savings-table .desktop-saving-withdrawal{color:var(--red)}
 #savings .desktop-savings-table .desktop-saving-description{
  display:table-cell;vertical-align:middle;overflow-wrap:anywhere;
 }
 #savings .desktop-saving-description .desktop-saving-detail-text{display:inline-block;vertical-align:middle;max-width:calc(100% - 42px)}
 #savings .desktop-saving-description .desktop-saving-row-actions{display:inline-flex;float:left;align-items:center;gap:4px}
 #savings .desktop-savings-table td{padding-block:7px}
}

/* Tablet: show the same five columns, scroll the table within its container. */
@media(min-width:721px) and (max-width:1023px){
 #savings #savingsLedger>.savings-statement-heading,
 #savings #savingsLedger>.savings-statement-scroll,
 #savings #savingsLedger>.savings-move-toolbar,
 #savings #savingsLedger>.ledger-sort-note{display:none!important}
 #savings .desktop-savings-view{display:block;max-width:100%;min-width:0}
 #savings .desktop-savings-statement-head{
  display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:7px;
  border:1px solid var(--border);border-radius:10px 10px 0 0;padding:8px;background:var(--bluebg)
 }
 #savings .desktop-savings-tools{display:flex;align-items:center;flex-wrap:wrap;gap:5px}
 #savings .desktop-savings-tools button,
 #savings .desktop-savings-tools select{min-height:30px;padding:4px 7px;font-size:11px}
 #savings .desktop-saving-search{display:flex;align-items:center;gap:4px}
 #savings .desktop-saving-search input{width:135px;min-height:30px;font-size:12px}
 #savings .desktop-savings-table-wrap{max-width:100%;overflow-x:auto;border:1px solid var(--border);border-top:0;border-radius:0 0 10px 10px}
 #savings .desktop-savings-table{width:100%;min-width:675px;border-collapse:collapse;table-layout:fixed}
 #savings .desktop-savings-table th,
 #savings .desktop-savings-table td{padding:7px 8px;border-bottom:1px solid var(--border);font-size:11px;text-align:right;vertical-align:middle}
 #savings .desktop-savings-table th{background:var(--bg);font-weight:800}
 #savings .desktop-savings-table th:nth-child(1){width:15%}
 #savings .desktop-savings-table th:nth-child(2),
 #savings .desktop-savings-table th:nth-child(3){width:15%}
 #savings .desktop-savings-table th:nth-child(4){width:19%}
 #savings .desktop-savings-table th:nth-child(5){width:36%}
 #savings .desktop-savings-table td:nth-child(-n+4){white-space:nowrap;font-variant-numeric:tabular-nums}
 #savings .desktop-savings-table .desktop-saving-deposit{color:var(--green)}
 #savings .desktop-savings-table .desktop-saving-withdrawal{color:var(--red)}
 #savings .desktop-savings-table .desktop-saving-description{overflow-wrap:anywhere}
 #savings .desktop-saving-description .desktop-saving-detail-text{display:inline-block;vertical-align:middle;max-width:calc(100% - 36px)}
 #savings .desktop-saving-description .desktop-saving-row-actions{display:inline-flex;float:left;align-items:center;gap:4px}
 #savings .desktop-saving-row-actions button{width:28px;min-width:28px;min-height:28px;padding:1px}
 #savings .desktop-saving-row-select[hidden]{display:none!important}
 #savings .desktop-savings-table tr[hidden]{display:none!important}
 #savings .desktop-savings-footnote{font-size:10px;color:var(--muted);margin-top:5px}
}

/* Savings statement: exactly one line per movement, no secondary explanations. */
@media(min-width:721px){
 #savings .desktop-savings-table tbody tr{height:34px}
 #savings .desktop-savings-table tbody td{height:34px;padding-block:4px;line-height:1.2}
 #savings .desktop-savings-table .desktop-saving-description{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #savings .desktop-savings-table .desktop-saving-description .desktop-saving-detail-text{
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 42px);
 }
 #savings .desktop-savings-table .desktop-saving-description small,
 #savings .desktop-savings-table .desktop-saving-description .ledger-note{display:none!important}
 #savings .desktop-savings-table .desktop-saving-description strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
 #savings .desktop-savings-table .desktop-saving-row-actions button{width:29px;min-width:29px;min-height:26px;height:26px}
}
