/* IDEA Weekly Report — stylesheet
 * Ported from ../../../ideamasterreport/weekly-view-mockup.html
 * Same design language as IPS Weekly Report, adapted for TX Bond Program.
 */

/* ---------- Base ---------- */
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;font-size:14px;color:#1a1a1a;background:#eef0f4;padding:2rem}
.wrap{max-width:1150px;margin:0 auto;background:#fff;border-radius:12px;overflow:hidden;box-shadow:0 2px 12px rgba(0,0,0,.10)}

/* ---------- Loading ---------- */
.loading{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:60vh;gap:1rem;color:#64748b}
.loading-spinner{width:40px;height:40px;border:3px solid #e5e7eb;border-top-color:#1e3a5f;border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* ---------- Header ---------- */
.report-header{background:#1e3a5f;padding:1.5rem 2rem 1.25rem;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px}
.report-header h1{font-size:18px;font-weight:600;color:#fff;margin-bottom:4px}
.report-header .doc-meta{font-size:12px;color:rgba(255,255,255,.65)}
.header-actions{display:flex;gap:8px;align-items:center}
.header-btn{padding:6px 14px;border:1px solid rgba(255,255,255,.4);border-radius:6px;background:transparent;color:#fff;font-size:12px;font-weight:500;cursor:pointer;font-family:inherit}
.header-btn:hover{background:rgba(255,255,255,.1)}
.inner{padding:1.5rem 2rem 2rem}

/* ---------- Tabs ---------- */
.tab-bar{display:flex;gap:4px;border-bottom:1.5px solid #e0e0e0;margin-bottom:1.5rem;flex-wrap:wrap}
.tab-btn{padding:8px 18px;border:none;background:transparent;cursor:pointer;font-size:13px;font-weight:500;color:#888;border-bottom:2.5px solid transparent;margin-bottom:-1.5px;font-family:inherit}
.tab-btn.active{color:#1e3a5f;border-bottom-color:#1e3a5f}
.tab-btn:hover:not(.active){color:#1e3a5f}
.proj{display:none}
.proj.active{display:block}
.proj-header{padding:12px 0 10px;border-bottom:2px solid #e8e8e8;margin-bottom:1.25rem}
.proj-name{font-size:22px;font-weight:700;color:#1e3a5f}
.proj-meta{font-size:12px;color:#888;margin-top:3px}

/* ---------- KPI cards ---------- */
.kpi-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:10px;margin-bottom:1.5rem}
.kpi{background:#f4f6fa;border-radius:8px;padding:12px 14px;border-left:3px solid #cbd5e1}
.kpi-label{font-size:11px;color:#64748b;text-transform:uppercase;letter-spacing:.04em;margin-bottom:4px}
.kpi-val{font-size:18px;font-weight:600;color:#1a1a1a}
.kpi-sub{font-size:11px;color:#999;margin-top:2px}
.kpi.surplus{border-left-color:#1a7a4a}
.kpi.surplus .kpi-val{color:#1a7a4a}
.kpi.warning{border-left-color:#d97706}
.kpi.warning .kpi-val{color:#92400e}
.kpi.navy{border-left-color:#1e3a5f}
.kpi.red{border-left-color:#b91c1c}
.kpi.red .kpi-val{color:#b91c1c}
.prog-bar{height:4px;background:#e0e0e0;border-radius:2px;margin-top:6px;overflow:hidden}
.prog-fill{height:100%;background:#1a7a4a;border-radius:2px}
.prog-fill.info{background:#1e3a5f}

/* ---------- Section titles ---------- */
.sec-title{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:#1e3a5f;margin:1.5rem 0 .75rem;padding-bottom:6px;border-bottom:2px solid #1e3a5f}
.sec-title span{font-weight:400;text-transform:none;letter-spacing:0;color:#64748b;font-size:11px}
.sec-note{font-size:11px;color:#555;margin-bottom:.75rem;padding:8px 10px;background:#f4f6fa;border-radius:6px;line-height:1.5}

/* ---------- Tables ---------- */
table{width:100%;border-collapse:collapse;font-size:13px}
th{font-size:11px;font-weight:600;color:#fff;text-align:right;padding:7px 8px;background:#1e3a5f;white-space:nowrap}
th:first-child{text-align:left}
td{padding:7px 8px;border-bottom:1px solid #f0f0f0;text-align:right;color:#1a1a1a;vertical-align:middle}
td:first-child{text-align:left}
tr:nth-child(even) td{background:#fafbfc}
tr.total-row td{font-weight:600;background:#eef2f7;border-top:1.5px solid #cbd5e1;border-bottom:none}
.neg{color:#b91c1c}
.pos{color:#1a7a4a}
.muted{color:#999}
.note-cell{color:#999;font-style:italic;font-size:12px}

/* Uncommitted column highlight (project summary tables) */
.tbl-projects th:nth-child(7){background:#b45309;color:#fff;border-bottom:2px solid #92400e}
.tbl-projects td:nth-child(7){background:#fff7ed;color:#92400e;font-weight:600;border-left:2px solid #f59e0b;border-right:2px solid #f59e0b}
.tbl-projects tr:nth-child(even) td:nth-child(7){background:#ffedd5}
.tbl-projects td:nth-child(7).muted{color:#c8a888;font-weight:500}

/* ---------- Recon waterfall table (Bond tab Section 1) ---------- */
/* Inherits base table/th/td from the common rules above — only the wrapper
   background, radius, and the start/final row emphasis are new. */
.wf-table{background:#f4f6fa;border-radius:8px;overflow:hidden;margin-bottom:1rem}
.wf-table td{border-bottom-color:#e8ecf0}
.wf-table tr.wf-start td{font-weight:600;border-bottom:1.5px solid #cbd5e1;background:#eef2f7}
.wf-table tr.wf-final td{font-weight:600;border-top:1.5px solid #cbd5e1;border-bottom:none;background:#eef2f7}

/* ---------- Health dots ---------- */
.health{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:500}
.health-dot{width:8px;height:8px;border-radius:50%;display:inline-block}
.health-green .health-dot{background:#1a7a4a}
.health-amber .health-dot{background:#d97706}
.health-red .health-dot{background:#b91c1c}
.health-green{color:#1a7a4a}
.health-amber{color:#92400e}
.health-red{color:#b91c1c}

/* ---------- Type badges ---------- */
.type-badge{font-size:11px;padding:2px 7px;border-radius:10px;white-space:nowrap;display:inline-block;font-weight:500}
.badge-timing{background:#fef3c7;color:#854d0e}
.badge-program{background:#dbeafe;color:#1e40af}
.badge-cash{background:#dcfce7;color:#166534}

/* ---------- Meeting notes panel ---------- */
.meeting-panel{background:#1e3a5f;border-radius:10px;padding:16px 18px;margin-top:1.5rem;margin-bottom:.5rem}
.meeting-panel-title{font-size:13px;font-weight:700;color:#fff;letter-spacing:.03em;margin-bottom:10px}
.meeting-panel-sub{font-size:11px;color:rgba(255,255,255,.6);margin-top:2px}
.meeting-textarea{width:100%;min-height:100px;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.2);border-radius:6px;color:#fff;font-size:13px;font-family:inherit;padding:10px 12px;resize:vertical;line-height:1.6}
.meeting-textarea::placeholder{color:rgba(255,255,255,.35)}

/* ---------- IRS Spend Pace cards ---------- */
.pace-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:1.5rem}
.pace-card{background:#f4f6fa;border-radius:10px;padding:16px 18px;border-left:4px solid #1e3a5f}
.pace-card.met{border-left-color:#1a7a4a;background:#f0fdf4}
.pace-card.behind{border-left-color:#b91c1c;background:#fef2f2}
.pace-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px;gap:10px}
.pace-title{font-size:14px;font-weight:700;color:#1e3a5f}
.pace-status{font-size:10px;font-weight:700;padding:4px 10px;border-radius:12px;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap}
.pace-status.ok{background:#dcfce7;color:#166534;border:1px solid #86efac}
.pace-status.bad{background:#fee2e2;color:#991b1b;border:1px solid #fca5a5}
.pace-subtitle{font-size:11px;color:#64748b;margin-bottom:12px}
.pace-bar-wrap{margin-bottom:12px}
.pace-bar{height:14px;background:#e5e7eb;border-radius:7px;overflow:hidden;position:relative}
.pace-bar-fill{height:100%;border-radius:7px;display:flex;align-items:center;justify-content:flex-end;padding-right:6px;font-size:10px;font-weight:700;color:#fff}
.pace-bar-fill.met{background:#1a7a4a}
.pace-bar-fill.behind{background:#d97706}
.pace-bar-labels{display:flex;justify-content:space-between;font-size:10px;color:#64748b;margin-top:4px}
.pace-metrics{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.pace-metric{background:rgba(255,255,255,.7);padding:8px 10px;border-radius:6px;border:1px solid #e5e7eb}
.pace-metric-label{font-size:10px;color:#64748b;text-transform:uppercase;letter-spacing:.04em}
.pace-metric-val{font-size:14px;font-weight:700;color:#1a1a1a;margin-top:2px}
.pace-metric-sub{font-size:10px;color:#888;margin-top:1px}
.pace-metric.good .pace-metric-val{color:#1a7a4a}
.pace-metric.warn .pace-metric-val{color:#b45309}
.pace-metric.bad .pace-metric-val{color:#b91c1c}

/* ---------- Regional rollup ---------- */
.region-wrap{margin-bottom:1.5rem}
.tbl-region{width:100%;border-collapse:collapse;font-size:13px;margin-bottom:1rem}
.tbl-region th{font-size:11px;font-weight:600;color:#fff;text-align:right;padding:7px 8px;background:#1e3a5f;white-space:nowrap}
.tbl-region th:first-child{text-align:left}
.tbl-region td{padding:7px 8px;border-bottom:1px solid #f0f0f0;text-align:right;color:#1a1a1a}
.tbl-region td:first-child{text-align:left;font-weight:500}
.tbl-region tr:nth-child(even) td{background:#fafbfc}
.tbl-region tr.total-row td{font-weight:600;background:#eef2f7;border-top:1.5px solid #cbd5e1;border-bottom:none}
.tbl-region th:nth-child(5),.tbl-region td:nth-child(5){background:#fff7ed;color:#92400e;font-weight:600;border-left:2px solid #f59e0b;border-right:2px solid #f59e0b}
.tbl-region th:nth-child(5){background:#b45309;color:#fff}
.tbl-region tr:nth-child(even) td:nth-child(5){background:#ffedd5}
.tbl-region tr.total-row td:nth-child(5){background:#fed7aa}
.region-bar-cell{display:flex;align-items:center;gap:8px;justify-content:flex-end}
.mini-bar{width:60px;height:8px;background:#e5e7eb;border-radius:4px;overflow:hidden;flex-shrink:0}
.mini-bar-fill{height:100%;background:#1e3a5f;border-radius:4px}
.region-sub-label{font-size:11px;color:#64748b;margin-bottom:6px;padding:6px 10px;background:#f4f6fa;border-radius:6px;display:inline-block}

/* ---------- Funding Sources ---------- */
.fs-headline{display:flex;align-items:baseline;gap:12px;margin-bottom:10px;flex-wrap:wrap}
.fs-total{font-size:22px;font-weight:700;color:#1e3a5f}
.fs-total-label{font-size:11px;color:#64748b;text-transform:uppercase;letter-spacing:.05em}
.fs-split{font-size:11px;color:#64748b}
.fs-split b{color:#1e3a5f;font-weight:600}
.fs-stacked{display:flex;height:26px;border-radius:6px;overflow:hidden;margin:6px 0 10px;border:1px solid #d1d5db}
.fs-stacked > div{display:flex;align-items:center;justify-content:center;color:#fff;font-size:10px;font-weight:700;min-width:20px;overflow:hidden;white-space:nowrap;border-right:1px solid rgba(255,255,255,.25)}
.fs-stacked > div:last-child{border-right:none}
.fs-c-2024{background:#1e3a5f}
.fs-c-2025{background:#3b82f6}
.fs-c-prior{background:#64748b}
.fs-c-rloc{background:#b45309}
.fs-c-safety{background:#dc2626}
.fs-c-grant{background:#7c3aed}
.fs-c-cash{background:#059669}
.fs-legend{display:flex;gap:14px;flex-wrap:wrap;margin-bottom:12px;font-size:11px;color:#475569}
.fs-legend-item{display:flex;align-items:center;gap:6px}
.fs-legend-dot{width:11px;height:11px;border-radius:2px;flex-shrink:0}
.tbl-funding{width:100%;border-collapse:collapse;font-size:13px;margin-bottom:8px}
.tbl-funding th{font-size:11px;font-weight:600;color:#fff;text-align:right;padding:7px 8px;background:#1e3a5f;white-space:nowrap}
.tbl-funding th:first-child{text-align:left}
.tbl-funding td{padding:7px 8px;border-bottom:1px solid #f0f0f0;text-align:right}
.tbl-funding td:first-child{text-align:left}
.tbl-funding tr.group-row td{background:#eef2f7;font-size:10px;font-weight:700;color:#1e3a5f;text-transform:uppercase;letter-spacing:.06em;padding:6px 8px;text-align:left;border-bottom:1px solid #cbd5e1}
.tbl-funding tr.subtotal-row td{font-weight:600;background:#f8fafc;color:#475569;font-size:12px;font-style:italic;border-bottom:1.5px solid #cbd5e1}
.tbl-funding tr.total-row td{font-weight:700;background:#eef2f7;border-top:2px solid #1e3a5f;border-bottom:none;color:#1e3a5f}
.fs-dot{display:inline-block;width:11px;height:11px;border-radius:2px;margin-right:8px;vertical-align:middle;flex-shrink:0}
.fs-note{font-size:11px;color:#64748b;margin-top:6px;padding:9px 12px;background:#f4f6fa;border-radius:6px;line-height:1.55}

/* ---------- Two-column layout ---------- */
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem}

/* ---------- Attention items ---------- */
.attn-list{list-style:none;padding:0;margin:0}
.attn-list li{padding:8px 10px;border-bottom:1px solid #f0f0f0;font-size:13px;display:flex;gap:8px;align-items:flex-start}
.attn-list li:last-child{border-bottom:none}
.attn-icon{font-size:14px;flex-shrink:0;margin-top:1px}
.attn-text{line-height:1.5}
.attn-label{font-weight:600;color:#1e3a5f}

/* ---------- Login page ---------- */
.login-page{display:flex;align-items:center;justify-content:center;min-height:100vh;background:#eef0f4;padding:2rem}
.login-card{background:#fff;padding:2rem;border-radius:12px;box-shadow:0 4px 24px rgba(0,0,0,.08);width:360px}
.login-card h1{margin:0 0 .25rem;font-size:1.5rem;color:#1e3a5f}
.login-card .sub{color:#64748b;margin:0 0 1.5rem;font-size:13px}
.login-card label{display:block;margin-bottom:1rem;font-size:13px;font-weight:500}
.login-card input{width:100%;padding:10px 12px;border:1px solid #e0e0e0;border-radius:6px;font-size:14px;margin-top:4px;font-family:inherit}
.login-card button{width:100%;padding:12px;background:#1e3a5f;color:#fff;border:none;border-radius:6px;font-size:14px;font-weight:600;cursor:pointer;font-family:inherit}
.login-card button:hover{background:#162a45}
.error-msg{margin-top:12px;padding:8px 12px;background:#fef2f2;border:1px solid #fecaca;color:#b91c1c;border-radius:6px;font-size:13px}
.login-card .hint{margin-top:1.5rem;font-size:12px;color:#64748b;text-align:center}

/* ---------- Error page ---------- */
.err-page{padding:3rem 2rem;text-align:center;color:#b91c1c}
.err-page h2{margin-bottom:.5rem}
.err-page p{color:#64748b}

/* ---------- Admin panel ---------- */
.admin-page{background:#f1f5f9}
#admin{max-width:1200px;margin:0 auto;padding:1.5rem}
.admin-header{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:1.5rem;padding-bottom:1rem;border-bottom:2px solid #e2e8f0}
.admin-header h1{margin:0;color:#1e3a5f}
.admin-header .sub{color:#64748b;font-size:13px;margin-top:.25rem}
.admin-actions{display:flex;gap:.75rem;align-items:center}
.btn-link{color:#1e3a5f;text-decoration:none;font-size:14px;font-weight:500}
.btn-link:hover{text-decoration:underline}
.btn-secondary{padding:8px 14px;background:#fff;color:#1e3a5f;border:1px solid #cbd5e1;border-radius:6px;cursor:pointer;font-family:inherit;font-size:13px}
.btn-secondary:hover{background:#f8fafc}
.admin-section{background:#fff;border:1px solid #e2e8f0;border-radius:8px;padding:1.25rem 1.5rem;margin-bottom:1.25rem}
.admin-section h2{margin:0 0 1rem;font-size:16px;color:#1e3a5f;border-bottom:1px solid #e2e8f0;padding-bottom:.5rem}
.admin-section .hint{margin:.5rem 0 0;font-size:12px;color:#64748b}
.form-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.75rem 1rem;margin-bottom:1rem}
.form-grid label,.inline-form label{display:flex;flex-direction:column;font-size:12px;color:#475569;gap:.25rem}
.form-grid label.checkbox,.inline-form label.checkbox{flex-direction:row;align-items:center;gap:.35rem;font-size:13px}
.form-grid input,.form-grid select,.inline-form input,.inline-form select,.admin-table input,.admin-table select{padding:6px 8px;border:1px solid #cbd5e1;border-radius:4px;font-family:inherit;font-size:13px;background:#fff}
.form-grid input:focus,.admin-table input:focus{outline:2px solid #1e3a5f;outline-offset:-1px;border-color:#1e3a5f}
.inline-form{display:flex;flex-wrap:wrap;gap:.75rem;align-items:flex-end}
.admin-section button[type=submit],.admin-section .btn-save{padding:8px 16px;background:#1e3a5f;color:#fff;border:none;border-radius:6px;cursor:pointer;font-family:inherit;font-size:13px;font-weight:500}
.admin-section button[type=submit]:hover,.admin-section .btn-save:hover{background:#162a45}
.btn-delete{padding:8px 12px;background:#fff;color:#b91c1c;border:1px solid #fecaca;border-radius:6px;cursor:pointer;font-family:inherit;font-size:13px;margin-left:.25rem}
.btn-delete:hover{background:#fef2f2}
.admin-table{width:100%;border-collapse:collapse;margin-bottom:1rem}
.admin-table th{text-align:left;padding:8px;background:#f8fafc;border-bottom:1px solid #e2e8f0;font-size:12px;color:#475569;font-weight:600}
.admin-table td{padding:6px 8px;border-bottom:1px solid #f1f5f9;vertical-align:middle}
.admin-table input[name=description]{min-width:220px}
.admin-table input[type=number]{width:120px}
.error-box{padding:1rem;background:#fef2f2;border:1px solid #fecaca;color:#b91c1c;border-radius:6px;margin:2rem auto;max-width:600px;text-align:center}
.admin-toast{position:fixed;bottom:1.5rem;right:1.5rem;padding:10px 16px;background:#1e3a5f;color:#fff;border-radius:6px;font-size:13px;box-shadow:0 4px 12px rgba(0,0,0,.15);z-index:1000;animation:toastIn .2s ease-out}
.admin-toast.err{background:#b91c1c}
@keyframes toastIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* ---------- Projects tab ---------- */
.project-filters{display:flex;gap:10px;align-items:center;margin-bottom:1.25rem;flex-wrap:wrap}
.project-search{flex:1;min-width:220px;padding:8px 12px;border:1px solid #e2e8f0;border-radius:6px;font-size:13px;font-family:inherit;background:#f8fafc}
.project-search:focus{outline:none;background:#fff;border-color:#1e3a5f}
.project-bond-filter{padding:8px 12px;border:1px solid #e2e8f0;border-radius:6px;font-size:13px;font-family:inherit;background:#f8fafc;cursor:pointer}
.project-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:1rem}
.project-card{background:#fff;border:1px solid #e2e8f0;border-radius:8px;overflow:hidden;cursor:pointer;transition:transform .12s ease,box-shadow .12s ease;display:flex;flex-direction:column}
.project-card:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(0,0,0,.08)}
.project-card-head{padding:12px 14px;display:flex;align-items:flex-start;justify-content:space-between;gap:8px;color:#fff}
.pj-head-2024{background:#2d5a8e}
.pj-head-2025{background:#1a5c4d}
.pj-head-other{background:#4a5568}
.project-card-name{font-size:14px;font-weight:700;color:#fff;line-height:1.25}
.project-card-region{font-size:11px;color:rgba(255,255,255,.7);margin-top:2px}
.project-card-badge{font-size:10px;font-weight:600;padding:3px 8px;border-radius:4px;background:rgba(255,255,255,.2);color:#fff;white-space:nowrap;flex-shrink:0}
.project-card-kpis{display:grid;grid-template-columns:repeat(3,1fr);border-bottom:1px solid #e2e8f0}
.pj-kpi{padding:8px 6px;text-align:center;border-right:1px solid #e2e8f0}
.pj-kpi:last-child{border-right:none}
.pj-kpi-label{font-size:9px;text-transform:uppercase;letter-spacing:.04em;font-weight:600}
.pj-kpi-val{font-size:13px;font-weight:700;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;margin-top:2px}
.pj-kpi-budget{background:#ebf4ff}
.pj-kpi-budget .pj-kpi-label{color:#2b6cb0}
.pj-kpi-budget .pj-kpi-val{color:#1a365d}
.pj-kpi-spent{background:#fff5f5}
.pj-kpi-spent .pj-kpi-label{color:#c53030}
.pj-kpi-spent .pj-kpi-val{color:#c53030}
.pj-kpi-uncommit{background:#fefcbf}
.pj-kpi-uncommit .pj-kpi-label{color:#975a16}
.pj-kpi-uncommit .pj-kpi-val{color:#975a16}
.project-card-rows{padding:8px 14px;display:flex;flex-direction:column;gap:4px;font-size:12px;border-bottom:1px solid #e2e8f0}
.pj-row{display:flex;justify-content:space-between}
.pj-row span:first-child{color:#64748b}
.pj-row span:last-child{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:500}
.project-card-progress{padding:8px 14px 12px;margin-top:auto}
.pj-progress-labels{display:flex;justify-content:space-between;font-size:10px;font-weight:600;margin-bottom:4px}
.pj-progress-labels .pos{color:#10b981}
.pj-progress-labels .warn{color:#f59e0b}
.pj-progress-labels .neg{color:#ef4444}
.pj-progress-labels .muted{color:#9ca3af}
.project-card-progress .prog-bar{height:6px;position:relative;background:#e5e7eb}
.prog-fill-contracted{position:absolute;inset:0 auto 0 0;background:#f59e0b;opacity:.35;border-radius:2px}
.prog-fill-spent{position:absolute;inset:0 auto 0 0;background:#10b981;border-radius:2px}
.back-btn{background:transparent;border:none;color:#1e3a5f;font-size:12px;font-weight:500;cursor:pointer;padding:0;margin-bottom:6px;font-family:inherit}
.back-btn:hover{text-decoration:underline}
.cat-row td{background:#f8fafc;font-weight:600}
.line-row td{color:#475569}
.line-row td.indent{padding-left:2rem;color:#64748b}

/* ---------- Bond year switcher (Reallocations / Ledger tabs) ---------- */
.bond-switcher{display:flex;gap:6px;margin-bottom:1rem}
.bond-switch-btn{padding:6px 14px;border:1px solid #e2e8f0;background:#f8fafc;color:#475569;border-radius:6px;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit}
.bond-switch-btn.active{background:#1e3a5f;color:#fff;border-color:#1e3a5f}
.bond-switch-btn:hover:not(.active){background:#f1f5f9}

/* ---------- Ledger table ---------- */
.ledger-wrap{overflow-x:auto}
.ledger-tbl{width:100%;font-size:12px}
.ledger-tbl th{position:sticky;top:0;background:#f8fafc;z-index:1}
.ledger-tbl td.ledger-desc{max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ---------- Paperclip attachments ---------- */
.paperclip-btn{display:inline-flex;align-items:center;gap:3px;border:none;background:transparent;cursor:pointer;padding:2px 5px;border-radius:4px;color:#64748b;font-size:13px;font-family:inherit;vertical-align:middle}
.paperclip-btn:hover{background:#eef2f7;color:#1e3a5f}
.paperclip-count{display:inline-block;min-width:15px;padding:0 4px;background:#1e3a5f;color:#fff;border-radius:8px;font-size:10px;font-weight:700;line-height:15px;text-align:center}
.paperclip-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center}
.paperclip-modal[hidden]{display:none}
.paperclip-modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.5)}
.paperclip-modal-box{position:relative;background:#fff;border-radius:10px;width:min(92vw,540px);max-height:85vh;display:flex;flex-direction:column;box-shadow:0 12px 40px rgba(0,0,0,.25)}
.paperclip-modal-head{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid #e5e7eb}
.paperclip-modal-title{font-size:14px;font-weight:600;color:#1e3a5f}
.paperclip-modal-close{background:transparent;border:none;font-size:22px;line-height:1;color:#64748b;cursor:pointer;padding:0 4px;font-family:inherit}
.paperclip-modal-close:hover{color:#1e3a5f}
.paperclip-modal-body{padding:12px 18px 18px;overflow-y:auto}
.paperclip-loading,.paperclip-empty{color:#64748b;font-size:13px;padding:12px 0;text-align:center}
.paperclip-error{color:#b91c1c;font-size:13px;padding:12px 0}
.paperclip-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid #f0f0f0}
.paperclip-row:last-of-type{border-bottom:none}
.paperclip-row-main{flex:1;min-width:0}
.paperclip-dl{color:#1e3a5f;font-weight:500;text-decoration:none;font-size:13px;word-break:break-all}
.paperclip-dl:hover{text-decoration:underline}
.paperclip-row-label{font-size:11px;color:#64748b;margin-top:2px}
.paperclip-row-meta{display:flex;align-items:center;gap:8px;font-size:11px;color:#94a3b8;white-space:nowrap}
.paperclip-del{background:transparent;border:1px solid #e5e7eb;color:#94a3b8;width:22px;height:22px;border-radius:4px;cursor:pointer;font-size:14px;line-height:1;font-family:inherit}
.paperclip-del:hover{color:#b91c1c;border-color:#fca5a5;background:#fef2f2}
.paperclip-upload{margin-top:14px;padding-top:14px;border-top:1px solid #e5e7eb;display:flex;flex-direction:column;gap:8px}
.paperclip-upload input[type=file]{font-size:12px}
.paperclip-upload input[type=text]{padding:6px 8px;border:1px solid #e5e7eb;border-radius:4px;font-size:12px;font-family:inherit}
.paperclip-upload button{padding:7px 14px;background:#1e3a5f;color:#fff;border:none;border-radius:4px;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;align-self:flex-start}
.paperclip-upload button:hover{background:#2c4e7a}
.paperclip-upload-status{font-size:11px;color:#64748b;min-height:14px}

/* ---------- Responsive ---------- */
@media(max-width:640px){
  body{padding:1rem}
  .two-col{grid-template-columns:1fr}
  .inner{padding:1rem}
  .pace-grid{grid-template-columns:1fr}
  .form-grid{grid-template-columns:1fr}
  .admin-header{flex-direction:column;align-items:flex-start;gap:.75rem}
}
