@font-face {
  font-family: "Inter";
  src: url("/inter.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #10132a;
  --muted: #5d6178;
  --line: rgb(16 19 42 / 12%);
  --line-strong: rgb(16 19 42 / 22%);
  --background: #f3f3f6;
  --surface: #fff;
  --navy: #1b2f56;
  --accent: #6b4fb6;
  --accent-bg: #eeebf9;
  --well: #ececf2;
  --green: #157a4a;
  --green-bg: #e7f5ed;
  --red: #b4232a;
  --red-bg: #fcecf0;
  --amber: #82521b;
  --amber-bg: #fff2db;
  --action: #6b4fb6;
  --action-hover: #1b2f56;
  --series-in: #6b4fb6;
  --series-out: #426d8f;
  --shadow: 0 10px 30px rgb(16 19 42 / 14%);
  font: 15px/1.5 "Inter", "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f1f1f7;
  --muted: #b3b7cf;
  --line: rgb(206 209 240 / 16%);
  --line-strong: rgb(206 209 240 / 35%);
  --background: #0c0f22;
  --surface: #161a33;
  --well: #222747;
  --accent: #beb1ff;
  --accent-bg: #2c254e;
  --green: #7de5a9;
  --green-bg: #153a33;
  --red: #ff9da9;
  --red-bg: #442634;
  --amber: #f3c582;
  --amber-bg: #453522;
  --action-hover: #59419c;
  --series-in: #b9a6ff;
  --series-out: #83bed9;
  --shadow: 0 12px 32px rgb(0 0 0 / 36%);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); display: grid; grid-template-columns: 226px minmax(0, 1fr); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip { position: fixed; z-index: 5; top: -100px; left: 12px; padding: 10px; background: var(--surface); }
.skip:focus { top: 10px; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); height: 100vh; position: sticky; top: 0; padding: 31px 17px 20px; display: flex; flex-direction: column; }
.brand { display: block; align-self: flex-start; padding: 0 8px; margin-bottom: 42px; }
.brand img { display: block; object-fit: contain; }
[data-theme="dark"] .brand img { filter: invert(1); }
.brand small, .local small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.nav-label { color: var(--muted); font-weight: 700; font-size: 10px; letter-spacing: .11em; margin: 0 8px 10px; }
.nav-link { display: flex; align-items: center; gap: 11px; color: var(--muted); border-radius: 9999px; padding: 11px 12px; margin-bottom: 3px; font-weight: 600; }
.nav-link:hover { background: var(--background); color: var(--ink); }
.nav-link[aria-current="page"] { color: var(--accent); background: var(--accent-bg); }
.icon { width: 19px; height: 19px; flex: 0 0 auto; vertical-align: middle; }
.theme-toggle { margin-top: auto; display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: transparent; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.theme-toggle:hover, .theme-toggle[aria-pressed="true"] { background: var(--accent-bg); color: var(--accent); }
.local { margin-top: 15px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; padding: 17px 7px 0; font-size: 13px; font-weight: 600; }
.local span, .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; flex: 0 0 8px; }
main { min-width: 0; width: min(100%, 1560px); margin-inline: auto; padding: 33px clamp(20px, 3.4vw, 58px) 45px; }
.page-header, .section-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; margin-bottom: 22px; }
.page-actions { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px; }
.page-header p, .section-head p { margin: 5px 0 0; color: var(--muted); }
.eyebrow { display: block; color: var(--accent); font-size: 11px; letter-spacing: .105em; font-weight: 750; margin-bottom: 4px; }
h1, h2, h3 { margin: 0; font-weight: 650; line-height: 1.2; letter-spacing: -.025em; }
h1 { font-size: clamp(28px, 3vw, 42px); }
h2 { font-size: 21px; }
h3 { font-size: 16px; }
.hero { display: grid; grid-template-columns: minmax(215px, .82fr) minmax(0, 1.85fr); gap: 16px; margin-bottom: 27px; }
.total { position: relative; overflow: hidden; isolation: isolate; background: linear-gradient(110deg, #10132a, var(--navy) 56%, var(--action)); color: white; border-radius: 24px; padding: 22px 23px; }
.total::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 118px; z-index: -1; opacity: .4; background: radial-gradient(circle, #fff 1px, transparent 1.2px) 0 0 / 4px 4px; mask: url("/ciotech-mark.png") center / 188px no-repeat; }
.total .caption { color: #e5e0f9; }
.total .number { font-size: clamp(29px, 3.2vw, 44px); font-weight: 650; margin: 7px 0 9px; letter-spacing: -.04em; }
.total .hero-note { font-size: 12px; color: #f1effb; display: flex; align-items: center; gap: 8px; }
.total .live-dot { background: #c5bafa; }
.accounts-panel { border: 1px solid var(--line); border-radius: 24px; background: var(--surface); padding: 15px 17px; }
.accounts-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(119px,1fr)); gap: 8px; }
.account { background: var(--background); border-radius: 12px; padding: 10px 11px; min-width: 0; }
.account button { border: 0; padding: 0; background: transparent; color: var(--muted); text-align: left; font-size: 13px; font-weight: 650; }
.account button:hover { text-decoration: underline; }
.account strong { display: block; font-size: 19px; margin-top: 2px; }
.caption { font-size: 12px; font-weight: 700; color: var(--muted); }
.number, .amount { font-variant-numeric: tabular-nums; }
.amount { white-space: nowrap; font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(147px, 1fr)); gap: 12px; margin-bottom: 20px; }
.metric, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.metric { padding: 15px 16px; }
.metric .number { display: block; font-size: clamp(19px, 2.1vw, 29px); font-weight: 750; letter-spacing: -.035em; margin-top: 3px; }
.metric small { color: var(--muted); display: block; font-size: 11px; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.panel { padding: 19px; margin-bottom: 19px; }
.panel.table-panel { padding: 0; overflow: hidden; }
.panel-title { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-title p { color: var(--muted); margin: 4px 0 0; }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 15px; }
.filters label, .month-control { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 650; }
.filters .search { flex: 1; min-width: min(100%, 220px); }
input, textarea, select { width: 100%; color: var(--ink); border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); padding: 8px 10px; min-height: 38px; }
input[type="month"] { min-width: 162px; }
textarea { min-height: 76px; resize: vertical; }
.button { color: var(--ink); border: 1px solid var(--line-strong); background: var(--surface); border-radius: 9999px; padding: 8px 14px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; min-height: 37px; font-size: 13px; }
.button:hover { background: var(--accent-bg); }
.button.primary { color: white; background: var(--action); border-color: var(--action); }
.button.primary:hover { background: var(--action-hover); border-color: var(--action-hover); }
.button.danger-outline { color: var(--red); }
.button.danger { color: white; background: #b4232a; border-color: #b4232a; }
.button.danger:hover { background: #921c23; border-color: #921c23; }
.button.small { padding: 4px 9px; min-height: 31px; font-size: 12px; }
.button.quiet { border-color: transparent; color: var(--accent); }
.button svg { width: 15px; height: 15px; }
.export-menu { position: relative; }
.export-menu summary { cursor: pointer; list-style: none; }
.export-menu summary::-webkit-details-marker { display: none; }
.export-options { position: absolute; z-index: 2; top: calc(100% + 6px); inset-inline-start: 0; min-width: 192px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.export-options a { display: block; padding: 8px 10px; border-radius: 7px; font-size: 13px; white-space: nowrap; }
.export-options a:hover { background: var(--accent-bg); color: var(--accent); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { color: var(--muted); background: var(--background); text-align: left; }
th { font-size: 11px; letter-spacing: .025em; white-space: nowrap; }
th, td { padding: 11px 13px; border-top: 1px solid var(--line); }
td { vertical-align: middle; }
td small { display: block; color: var(--muted); margin-top: 2px; white-space: pre-line; }
td b { font-weight: 650; }
.right { text-align: right; }
.actions { display: flex; gap: 5px; justify-content: flex-end; flex-wrap: wrap; }
.tag { display: inline-block; border-radius: 20px; color: var(--muted); background: var(--well); padding: 3px 8px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.tag.green { color: var(--green); background: var(--green-bg); }
.tag.red { color: var(--red); background: var(--red-bg); }
.tag.amber { color: var(--amber); background: var(--amber-bg); }
.empty { padding: 30px 16px; text-align: center; color: var(--muted); }
.note { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,325px),1fr)); gap: 16px; }
.project-card { display: block; padding: 18px; }
.project-card:hover { border-color: var(--accent); }
.project-card p { margin: 5px 0 14px; color: var(--muted); font-size: 13px; }
.project-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.project-totals strong { display: block; }
.breadcrumbs { display: inline-block; font-size: 13px; color: var(--accent); font-weight: 700; margin-bottom: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.legend span::before { content: ""; width: 16px; height: 3px; border-radius: 3px; background: var(--series-in); display: inline-block; vertical-align: middle; margin-right: 5px; }
.legend span + span::before { background: repeating-linear-gradient(90deg,var(--series-out) 0 4px,transparent 4px 6px); }
.trend-panel .section-head { margin-bottom: 14px; }
.trend-readout { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 9px 14px; background: var(--background); border-radius: 10px; }
.trend-period { color: var(--ink); font-size: 13px; font-weight: 650; }
.trend-readout div { display: grid; }
.trend-readout small { color: var(--muted); font-size: 11px; }
.trend-readout strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.chart { width: 100%; height: auto; display: block; min-height: 90px; }
.chart text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-gridline { stroke: var(--line); vector-effect: non-scaling-stroke; }
.chart .area-start { stop-color: var(--series-in); stop-opacity: .23; }
.chart .area-end { stop-color: var(--series-in); stop-opacity: .02; }
.chart .income { stroke: var(--series-in); }
.chart .outflow { stroke: var(--series-out); }
.chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-line.outflow { stroke-dasharray: 5 4; }
.chart-guide { stroke: var(--line-strong); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; visibility: hidden; }
.chart circle { fill: var(--surface); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.chart .active circle { r: 5.5; stroke-width: 2.5; }
.chart .active .chart-guide { visibility: visible; }
.chart-hit { fill: transparent; cursor: pointer; }
.trend-months { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-left: 4.8%; }
.trend-months button { justify-self: center; min-height: 34px; border: 0; border-radius: 8px; padding: 5px 8px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 600; }
.trend-months button:hover, .trend-months button[aria-pressed="true"] { color: var(--accent); background: var(--accent-bg); }
dialog { width: min(600px, calc(100vw - 24px)); max-height: calc(100vh - 32px); border: 1px solid var(--line); border-radius: 24px; padding: 0; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(16 19 42 / 52%); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 17px 20px 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; align-content: start; gap: 4px; font-size: 13px; font-weight: 650; }
.full { grid-column: 1 / -1; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.form-error { color: var(--red); font-size: 13px; margin: 8px 0 0; }
.form-error:empty { display: none; }
.detail-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.detail-list dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.detail-list dd { margin: 3px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.movement-history { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.movement-history h3 { margin-bottom: 10px; }
.movement-history article { margin: 8px 0; padding: 10px 12px; border-radius: 8px; background: var(--background); font-size: 13px; overflow-wrap: anywhere; }
.history-heading { display: flex; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; }
.history-heading span, .movement-history p { color: var(--muted); }
.movement-history p, .movement-history ul { margin: 7px 0 0; }
.movement-history ul { padding-left: 17px; }
.movement-history li b { display: block; }
#toast { position: fixed; right: 20px; bottom: 20px; background: #10132a; color: white; border-radius: 12px; z-index: 2; }
#toast:not(:empty) { padding: 10px 15px; }
.loading { color: var(--muted); }
[hidden] { display: none !important; }
@media (max-width: 960px) {
  body { grid-template-columns: 174px minmax(0,1fr); }
  .sidebar { padding-inline: 11px; }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  body { display: block; }
  .sidebar { position: relative; height: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .theme-toggle { position: absolute; top: 16px; right: 12px; }
  .brand { margin: 0 0 10px; }
  .brand img { width: 108px; height: 31px; }
  .nav-label, .local { display: none; }
  #nav { display: flex; overflow-x: auto; }
  .nav-link { padding: 7px 9px; font-size: 13px; white-space: nowrap; margin: 0; }
  main { padding: 21px 13px 30px; }
  .page-header, .section-head { align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
  .trend-readout { gap: 6px 14px; }
  .trend-period { width: 100%; }
  .chart text { font-size: 17px; }
  .trend-months button { padding-inline: 4px; }
  .form-grid { grid-template-columns: 1fr; }
}
.login-page { display: grid; grid-template-columns: 1fr; place-items: center; padding: 18px; }
.login-page .login-card { width: min(100%, 420px); margin: 0; padding: clamp(20px, 5vw, 36px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.login-card img { display: block; object-fit: contain; margin-bottom: 22px; }
[data-theme="dark"] .login-card img { filter: invert(1); }
.login-card h1 { font-size: 27px; }
.login-card > p { margin: 6px 0 18px; color: var(--muted); }
.login-card form { display: grid; gap: 12px; }
.login-card .button { width: 100%; }
.session-panel { display: grid; gap: 6px; margin-top: 12px; }
.session-panel span { padding-inline: 8px; overflow-wrap: anywhere; font-size: 12px; color: var(--muted); }
.session-panel .button { justify-self: start; }
@media (max-width: 680px) {
  .session-panel { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 650; }
.pagination-buttons { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pagination-current { padding: 0 6px; color: var(--ink); white-space: nowrap; }
.pagination .button:disabled { opacity: .45; cursor: default; background: var(--surface); }
@media (max-width: 640px) { .pagination { justify-content: center; } .pagination-buttons .button:first-child, .pagination-buttons .button:last-child { display: none; } }
