:root {
  color-scheme: light;
  --navy-950: #050d18;
  --navy-900: #071426;
  --navy-800: #0c2038;
  --navy-700: #13314f;
  --gold-600: #ad8129;
  --gold-500: #d5ad4a;
  --gold-300: #f1d98f;
  --ink: #112033;
  --muted: #657286;
  --soft: #f3f5f8;
  --line: #dfe4eb;
  --white: #fff;
  --green: #14805e;
  --red: #b64747;
  --amber: #9b6716;
  --shadow: 0 15px 42px rgba(17, 32, 51, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif; color: var(--ink); background: var(--soft); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select, input[type="file"] { touch-action: manipulation; }
a { color: inherit; }
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; z-index: 1000; top: 8px; left: 8px; transform: translateY(-140%); padding: 10px 14px; border-radius: 8px; background: #fff; color: #071426; box-shadow: var(--shadow); }
.skip-link:focus { transform: translateY(0); }

.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 0.86rem; letter-spacing: 0.09em; white-space: nowrap; }
.brand-lockup small { display: block; margin-top: 3px; font-size: 0.68rem; letter-spacing: 0.11em; opacity: 0.63; text-transform: uppercase; }
.brand-lockup-light { color: #fff; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border: 1px solid rgba(241, 217, 143, 0.45); border-radius: 14px; color: var(--gold-500); background: rgba(213, 173, 74, 0.08); font-family: Georgia, serif; font-size: 1.75rem; line-height: 1; }

/* Connexion */
.login-body { min-height: 100dvh; display: grid; place-items: center; padding: 28px; background: var(--navy-950); }
.login-body::before, .login-body::after { content: ""; position: fixed; width: 34rem; height: 34rem; border-radius: 999px; pointer-events: none; filter: blur(2px); }
.login-body::before { left: -20rem; top: -22rem; background: radial-gradient(circle, rgba(213, 173, 74, 0.19), transparent 67%); }
.login-body::after { right: -18rem; bottom: -23rem; background: radial-gradient(circle, rgba(48, 94, 140, 0.25), transparent 68%); }
.login-shell { position: relative; width: min(1020px, 100%); min-height: 620px; display: grid; grid-template-columns: 1.08fr 0.92fr; overflow: hidden; border: 1px solid rgba(255,255,255,0.14); border-radius: 28px; background: #fff; box-shadow: 0 38px 100px rgba(0,0,0,0.4); }
.login-brand { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; overflow: hidden; color: #fff; background: linear-gradient(145deg, #071426, #0b1e34 62%, #173a5a); }
.login-brand::after { content: ""; position: absolute; z-index: -1; width: 420px; height: 420px; right: -215px; top: 95px; border: 1px solid rgba(213,173,74,0.15); border-radius: 50%; box-shadow: 0 0 0 55px rgba(213,173,74,0.035), 0 0 0 110px rgba(213,173,74,0.022); }
.login-pitch { max-width: 410px; }
.eyebrow { margin: 0 0 14px; color: var(--gold-300); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.17em; }
.login-pitch h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.5rem, 5vw, 4.25rem); font-weight: 500; line-height: 1.01; letter-spacing: -0.045em; }
.login-pitch p:last-child { max-width: 380px; margin: 22px 0 0; color: rgba(255,255,255,0.67); line-height: 1.7; }
.security-pills { display: flex; flex-wrap: wrap; gap: 9px; }
.security-pills span { padding: 8px 11px; border: 1px solid rgba(255,255,255,0.13); border-radius: 999px; background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.72); font-size: 0.75rem; }
.security-pills span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--gold-500); box-shadow: 0 0 0 3px rgba(213,173,74,0.12); vertical-align: 1px; }
.login-panel { display: flex; align-items: center; padding: 48px; }
.login-form { width: 100%; max-width: 360px; margin: auto; }
.secure-label { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 24px; padding: 7px 10px; border: 1px solid #e9dbb6; border-radius: 999px; background: #fff9e9; color: #7c5b1d; font-size: 0.75rem; font-weight: 750; }
.login-form h2 { margin: 0 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 2rem; font-weight: 600; }
.muted { margin: 0 0 28px; color: var(--muted); line-height: 1.55; }
label { display: grid; gap: 7px; color: #33445a; font-size: 0.84rem; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cfd7e2; border-radius: 12px; background: #fbfcfd; color: var(--ink); outline: none; transition: border-color 0.18s, box-shadow 0.18s, background 0.18s; }
input, select { min-height: 47px; padding: 0 13px; }
textarea { padding: 12px 13px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--gold-600); background: #fff; box-shadow: 0 0 0 4px rgba(213,173,74,0.14); }
label small { color: var(--muted); font-size: 0.74rem; font-weight: 500; line-height: 1.4; }
.login-form > label, .login-form > .password-field, #totp-group { margin-top: 17px; }
.password-field, .money-field { position: relative; }
.password-field input { padding-right: 84px; }
.text-button { position: absolute; top: 6px; right: 6px; height: 35px; padding: 0 10px; border: 0; border-radius: 8px; background: #eef1f5; color: #4a5b70; font-size: 0.75rem; font-weight: 750; cursor: pointer; }
.login-form .button-large { width: 100%; margin-top: 24px; }
.login-foot { margin: 22px 0 0; color: #8b95a3; font-size: 0.7rem; line-height: 1.5; text-align: center; }
.alert { padding: 11px 13px; border-radius: 11px; font-size: 0.82rem; line-height: 1.45; }
.alert-danger { border: 1px solid #edc7c7; background: #fff2f2; color: #943a3a; }

/* Application */
.app-body { min-height: 100dvh; overflow-x: hidden; }
.app-shell { min-height: 100dvh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 248px; display: flex; flex-direction: column; padding: 24px 16px 18px; color: #fff; background: linear-gradient(180deg, var(--navy-900), var(--navy-950)); }
.sidebar::after { content: ""; position: absolute; inset: auto 0 0; height: 180px; pointer-events: none; background: radial-gradient(circle at 15% 100%, rgba(213,173,74,0.11), transparent 68%); }
.sidebar-brand { position: relative; z-index: 1; padding: 3px 8px 27px; border-bottom: 1px solid rgba(255,255,255,0.09); }
.main-nav { position: relative; z-index: 1; display: grid; gap: 6px; padding-top: 25px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 9px 12px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: rgba(255,255,255,0.63); font-size: 0.86rem; font-weight: 650; text-align: left; cursor: pointer; transition: 0.18s; }
.nav-item:hover { background: rgba(255,255,255,0.055); color: #fff; }
.nav-item.active { border-color: rgba(213,173,74,0.19); background: linear-gradient(100deg, rgba(213,173,74,0.17), rgba(213,173,74,0.05)); color: #f6df9d; }
.nav-icon { display: grid; place-items: center; width: 26px; height: 26px; color: currentColor; font-family: Georgia, serif; font-size: 1.15rem; }
.sidebar-bottom { position: relative; z-index: 1; display: grid; gap: 17px; margin-top: auto; }
.sidebar-security { display: flex; align-items: center; gap: 10px; margin: 0 9px; padding-top: 17px; border-top: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.54); font-size: 0.74rem; line-height: 1.4; }
.sidebar-security small { color: rgba(255,255,255,0.31); }
.status-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #45c796; box-shadow: 0 0 0 4px rgba(69,199,150,0.1); }
.workspace { grid-column: 2; min-width: 0; }
.topbar { position: sticky; z-index: 15; top: 0; min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px clamp(22px, 3.2vw, 48px); border-bottom: 1px solid rgba(205,213,224,0.72); background: rgba(243,245,248,0.92); backdrop-filter: blur(15px); }
.topbar-kicker { margin: 0 0 3px; color: var(--muted); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }
.topbar h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.55rem, 2.3vw, 2.05rem); font-weight: 600; letter-spacing: -0.025em; }
.mobile-brand { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.year-picker { display: flex; align-items: center; gap: 8px; min-height: 43px; padding: 0 5px 0 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--muted); font-size: 0.73rem; }
.year-picker select { width: auto; min-height: 33px; padding: 0 25px 0 7px; border: 0; background: #f5f6f8; font-size: 0.8rem; font-weight: 750; box-shadow: none; }
.account-button { width: 43px; height: 43px; border: 1px solid #c9aa61; border-radius: 13px; background: var(--navy-900); color: var(--gold-300); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; cursor: pointer; }
.content { width: min(1460px, 100%); margin: 0 auto; padding: 30px clamp(18px, 3.2vw, 48px) 64px; }
.page { display: none; animation: page-in 0.22s ease-out; }
.page.active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.button { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border: 1px solid transparent; border-radius: 11px; font-size: 0.81rem; font-weight: 780; cursor: pointer; transition: transform 0.16s, box-shadow 0.16s, background 0.16s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: 0.52; cursor: not-allowed; transform: none; }
.button-primary { border-color: #192d46; background: linear-gradient(110deg, var(--navy-900), var(--navy-700)); color: #fff; box-shadow: 0 8px 20px rgba(7,20,38,0.14); }
.button-primary:hover { box-shadow: 0 11px 25px rgba(7,20,38,0.2); }
.button-secondary { border-color: #ccd4df; background: #fff; color: #263a52; }
.button-secondary:hover { background: #f8fafc; }
.button-light { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.13); color: #fff; }
.button-gold { border-color: #edcf7b; background: linear-gradient(110deg, #e7c466, var(--gold-500)); color: #1b2636; box-shadow: 0 9px 22px rgba(213,173,74,0.18); }
.button-ghost { background: transparent; color: var(--muted); }
.button-danger { background: #a83d3d; color: #fff; }
.text-link { padding: 4px; border: 0; background: transparent; color: #815f20; font-size: 0.78rem; font-weight: 780; cursor: pointer; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #f8f9fb; color: #55647a; font-size: 1.5rem; line-height: 1; cursor: pointer; }

.setup-banner { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 14px; margin-bottom: 22px; padding: 17px 18px; border: 1px solid rgba(213,173,74,0.34); border-radius: 15px; background: linear-gradient(100deg, #fff8e7, #fffdf8); box-shadow: 0 7px 24px rgba(116,78,10,0.05); }
.setup-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--gold-500); color: #172134; font-weight: 900; }
.setup-banner strong { font-family: Georgia, serif; font-size: 1rem; }
.setup-banner p { margin: 4px 0 0; color: #796b4d; font-size: 0.79rem; }
.setup-banner .button { border-color: #dec57d; background: #fff; color: #72551e; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; }
.metric-card { min-height: 139px; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 7px 25px rgba(17,32,51,0.045); }
.metric-card.metric-primary { position: relative; overflow: hidden; border-color: #152a43; background: linear-gradient(140deg, var(--navy-900), #102c49); color: #fff; }
.metric-card.metric-primary::after { content: ""; position: absolute; width: 170px; height: 170px; right: -92px; bottom: -110px; border: 1px solid rgba(213,173,74,0.18); border-radius: 50%; box-shadow: 0 0 0 28px rgba(213,173,74,0.035); }
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 0.75rem; font-weight: 690; }
.metric-primary .metric-head { color: rgba(255,255,255,0.63); }
.metric-icon { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; background: #f2f4f7; color: #506176; font-family: Georgia, serif; }
.metric-primary .metric-icon { background: rgba(213,173,74,0.12); color: var(--gold-300); }
.metric-card > strong { position: relative; z-index: 1; display: block; margin-top: 17px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.55rem, 2.4vw, 2rem); font-weight: 600; letter-spacing: -0.035em; }
.metric-card > small { position: relative; z-index: 1; display: block; margin-top: 6px; color: #8994a3; font-size: 0.7rem; }
.metric-primary > small { color: rgba(255,255,255,0.47); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(340px,0.65fr); gap: 18px; margin-top: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 8px 30px rgba(17,32,51,0.045); }
.chart-panel, .action-panel { min-height: 332px; padding: 22px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel h3 { margin: 4px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.12rem; font-weight: 600; }
.panel-head p:not(.eyebrow-dark) { margin: 5px 0 0; color: var(--muted); font-size: 0.76rem; }
.eyebrow-dark, .eyebrow-light { margin: 0; color: var(--gold-600); font-size: 0.66rem; font-weight: 850; letter-spacing: 0.14em; }
.eyebrow-light { color: var(--gold-300); }
.chart-legend { display: flex; gap: 13px; color: var(--muted); font-size: 0.7rem; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 3px; }
.legend-income { background: var(--gold-500); }
.legend-expense { background: #9aa8ba; }
.monthly-chart { height: 230px; display: grid; grid-template-columns: repeat(12,minmax(20px,1fr)); align-items: end; gap: clamp(5px, 1vw, 12px); padding-top: 31px; }
.month-column { height: 188px; display: grid; grid-template-rows: 1fr 20px; align-items: end; gap: 8px; }
.bars { height: 100%; display: flex; align-items: end; justify-content: center; gap: 3px; border-bottom: 1px solid #e6eaf0; }
.bar { width: min(11px,42%); min-height: 2px; border-radius: 5px 5px 1px 1px; transition: height 0.35s ease; }
.bar.income { background: linear-gradient(#ead17f, var(--gold-500)); }
.bar.expense { background: #a9b4c2; }
.bar[data-level="0"] { height: 2px; opacity: 0.45; }.bar[data-level="1"] { height: 10%; }.bar[data-level="2"] { height: 20%; }.bar[data-level="3"] { height: 30%; }.bar[data-level="4"] { height: 40%; }.bar[data-level="5"] { height: 50%; }.bar[data-level="6"] { height: 60%; }.bar[data-level="7"] { height: 70%; }.bar[data-level="8"] { height: 80%; }.bar[data-level="9"] { height: 90%; }.bar[data-level="10"] { height: 100%; }
.month-column > small { color: #8a96a5; font-size: 0.61rem; font-weight: 700; text-align: center; text-transform: uppercase; }
.quick-grid { display: grid; gap: 8px; margin-top: 19px; }
.quick-grid > button { min-height: 57px; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border: 1px solid #e1e6ed; border-radius: 12px; background: #fbfcfd; text-align: left; cursor: pointer; transition: 0.16s; }
.quick-grid > button:hover { border-color: #d4ba7b; background: #fffdf8; transform: translateX(2px); }
.quick-symbol { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 36px; border-radius: 10px; font-family: Georgia, serif; font-size: 1.2rem; }
.quick-symbol.income { background: #eaf7f2; color: var(--green); }.quick-symbol.expense { background: #fff0ef; color: var(--red); }.quick-symbol.invoice { background: #fff7df; color: #8c671f; }.quick-symbol.bank { background: #ecf2f8; color: #345878; }
.quick-grid strong { display: block; color: #20344b; font-size: 0.78rem; }
.quick-grid small { display: block; margin-top: 3px; color: #8a95a3; font-size: 0.66rem; }
.table-panel { margin-top: 18px; padding: 21px; overflow: hidden; }
.transaction-list { display: grid; margin-top: 13px; }
.transaction-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 60px; padding: 8px 3px; border-top: 1px solid #edf0f3; }
.transaction-row:first-child { border-top: 0; }
.transaction-badge { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; font-family: Georgia,serif; font-weight: 700; }
.transaction-badge.INCOME { background: #eaf7f2; color: var(--green); }.transaction-badge.EXPENSE { background: #fff0ef; color: var(--red); }
.transaction-copy { min-width: 0; }
.transaction-copy strong { display: block; overflow: hidden; color: #26394f; font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.transaction-copy small { display: block; margin-top: 4px; color: #8a95a3; font-size: 0.67rem; }
.transaction-amount { font-family: Georgia, serif; font-size: 0.9rem; font-weight: 700; white-space: nowrap; }
.transaction-amount.INCOME { color: var(--green); }.transaction-amount.EXPENSE { color: var(--red); }
.empty-state { display: grid; place-items: center; min-height: 190px; padding: 30px; color: var(--muted); text-align: center; }
.empty-state span { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 10px; border-radius: 15px; background: #f0f3f7; color: #8090a4; font-family: Georgia, serif; font-size: 1.4rem; }
.empty-state strong { color: #405269; font-family: Georgia, serif; }
.empty-state p { max-width: 360px; margin: 6px 0 0; font-size: 0.78rem; line-height: 1.5; }

.page-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.page-toolbar h2 { margin: 5px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.5rem,2.4vw,2rem); font-weight: 600; }
.page-toolbar p:not(.eyebrow-dark) { margin: 7px 0 0; color: var(--muted); font-size: 0.82rem; line-height: 1.5; }
.toolbar-actions { display: flex; gap: 9px; }
.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.filter-pill { min-height: 37px; padding: 0 13px; border: 1px solid #d4dae3; border-radius: 999px; background: #fff; color: #667489; font-size: 0.75rem; font-weight: 700; cursor: pointer; }
.filter-pill.active { border-color: #1d354f; background: var(--navy-900); color: #fff; }
.search-field { position: relative; display: block; min-width: min(320px,100%); margin-left: auto; }
.search-field > span { position: absolute; z-index: 1; left: 13px; top: 10px; color: #7d8a9b; font-size: 1rem; }
.search-field input { min-height: 39px; padding-left: 36px; border-radius: 999px; font-size: 0.77rem; font-weight: 500; }
.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.76rem; }
.data-table th { padding: 10px 11px; border-bottom: 1px solid #dfe4ea; color: #7b8797; font-size: 0.65rem; font-weight: 820; letter-spacing: 0.07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 13px 11px; border-bottom: 1px solid #edf0f3; color: #35485f; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .amount { font-family: Georgia,serif; font-size: 0.84rem; font-weight: 700; text-align: right; white-space: nowrap; }
.data-table .amount.INCOME { color: var(--green); }.data-table .amount.EXPENSE { color: var(--red); }
.data-table .cell-main { min-width: 180px; font-weight: 700; }
.data-table .cell-main small { display: block; max-width: 300px; margin-top: 3px; overflow: hidden; color: #8a95a4; font-size: 0.66rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.status-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; background: #edf1f5; color: #5d6b7e; font-size: 0.63rem; font-weight: 800; white-space: nowrap; }
.status-badge.PAID, .status-badge.VALIDATED { background: #e6f5ef; color: #187151; }.status-badge.ISSUED { background: #eef3f9; color: #3e6487; }.status-badge.DRAFT, .status-badge.TO_REVIEW { background: #fff5da; color: #896318; }.status-badge.OVERDUE { background: #fff0ef; color: #a44040; }.status-badge.REVERSED { background: #f0f1f3; color: #737d8a; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.row-action { min-height: 31px; padding: 0 9px; border: 1px solid #d7dde5; border-radius: 8px; background: #fff; color: #42566e; font-size: 0.67rem; font-weight: 750; cursor: pointer; white-space: nowrap; }
.row-action:hover { border-color: #c2a765; background: #fffaf0; }
.mini-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.mini-metric { padding: 15px 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.mini-metric span { color: var(--muted); font-size: 0.7rem; }.mini-metric strong { display: block; margin-top: 7px; font-family: Georgia,serif; font-size: 1.25rem; }
.contacts-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.contact-card { min-height: 150px; padding: 17px; border: 1px solid #e2e6ec; border-radius: 14px; background: #fbfcfd; }
.contact-card-head { display: flex; align-items: center; gap: 11px; }
.contact-avatar { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 40px; border-radius: 12px; background: var(--navy-900); color: var(--gold-300); font-family: Georgia,serif; font-weight: 700; }
.contact-card h3 { margin: 0; font-size: 0.91rem; }
.contact-card .status-badge { margin-top: 5px; }
.contact-card p { margin: 13px 0 0; color: #69768a; font-size: 0.72rem; line-height: 1.55; }

.bank-grid { display: grid; grid-template-columns: 1.2fr 0.8fr 0.8fr; gap: 15px; }
.bank-card, .import-card, .manual-card { min-height: 285px; padding: 24px; }
.bank-featured { position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 17px; border-color: #1a3452; background: linear-gradient(145deg, #081629, #123352); color: #fff; }
.bank-featured::after { content: ""; position: absolute; width: 260px; height: 260px; right: -140px; bottom: -170px; border: 1px solid rgba(213,173,74,0.15); border-radius: 50%; box-shadow: 0 0 0 40px rgba(213,173,74,0.035); }
.bank-featured h3 { margin: 8px 0 8px; font-size: 1.45rem; }
.bank-featured p:not(.eyebrow-light) { max-width: 460px; margin: 0 0 18px; color: rgba(255,255,255,0.62); font-size: 0.78rem; line-height: 1.6; }
.bank-featured .button { position: relative; z-index: 1; }
.bank-monogram { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid rgba(213,173,74,0.35); border-radius: 14px; background: rgba(213,173,74,0.1); color: var(--gold-300); font-family: Georgia,serif; font-size: 1.5rem; }
.bank-accounts { display: grid; gap: 7px; margin-bottom: 15px; }
.bank-account { padding: 8px 10px; border: 1px solid rgba(255,255,255,0.12); border-radius: 9px; background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.78); font-size: 0.69rem; }
.bank-account small { display: block; margin-top: 3px; color: rgba(255,255,255,0.42); }
.import-card, .manual-card { display: flex; flex-direction: column; align-items: flex-start; }
.import-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: #f2f4f7; color: #62738a; font-family: Georgia,serif; font-size: 1.25rem; }
.import-card h3, .manual-card h3 { margin-top: 18px; }
.import-card p, .manual-card p { margin: 9px 0 18px; color: var(--muted); font-size: 0.77rem; line-height: 1.58; }
.import-card .button, .manual-card .button { margin-top: auto; }
.small-note { margin: 9px 0 0 !important; color: var(--green) !important; font-size: 0.68rem !important; }
.info-panel { margin-top: 15px; padding: 18px 20px; border-left: 4px solid var(--gold-500); }
.info-panel strong { font-family: Georgia,serif; }
.info-panel p { margin: 6px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.6; }

.settings-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(300px,0.65fr); gap: 17px; }
.settings-card { padding: 22px; }
.settings-card > p, .settings-card .panel-head p { color: var(--muted); font-size: 0.76rem; line-height: 1.55; }
.settings-side { display: grid; align-content: start; gap: 14px; }
.security-card { display: flex; align-items: flex-start; gap: 13px; background: linear-gradient(145deg,#08172b,#102d49); color: #fff; }
.security-card h3 { margin-top: 1px; }.security-card p { color: rgba(255,255,255,0.58); }
.security-shield { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px; border-radius: 11px; background: rgba(213,173,74,0.12); color: var(--gold-300); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; margin-top: 20px; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.settings-card > label { margin: 15px 0; }

/* Dialogues */
.modal { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 22px; border: 0; background: transparent; }
.modal::backdrop { background: rgba(3,11,22,0.66); backdrop-filter: blur(5px); }
.modal[open] { display: grid; place-items: center; }
.modal-card { width: min(720px,100%); max-height: calc(100dvh - 44px); overflow-y: auto; padding: 25px; border: 1px solid #d8dee7; border-radius: 22px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,0.3); }
.modal-small { width: min(590px,100%); }.modal-wide { width: min(900px,100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 17px; border-bottom: 1px solid #e7eaf0; }
.modal-head h2, .modal-confirm h2 { margin: 5px 0 0; font-family: Georgia,serif; font-size: 1.55rem; font-weight: 600; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 23px; padding-top: 17px; border-top: 1px solid #e7eaf0; }
.direction-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 19px; }
.direction-choice label { cursor: pointer; }
.direction-choice input { position: absolute; opacity: 0; pointer-events: none; }
.direction-choice span { min-height: 47px; display: grid; place-items: center; border: 1px solid #d6dce5; border-radius: 12px; background: #fafbfc; color: #617086; font-size: 0.79rem; font-weight: 800; }
.direction-choice input:checked + span { border-color: #1a334f; background: var(--navy-900); color: #fff; box-shadow: 0 0 0 3px rgba(17,42,70,0.09); }
.money-field input { padding-right: 38px; }.money-field > span { position: absolute; right: 13px; top: 14px; color: #6d7a8c; font-weight: 700; }
.invoice-top-fields { margin-bottom: 20px; }
.invoice-lines-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 8px; font-size: 0.82rem; }
.invoice-lines { display: grid; gap: 9px; }
.invoice-line { display: grid; grid-template-columns: minmax(180px,2fr) 80px 120px 160px 34px; align-items: end; gap: 8px; padding: 11px; border: 1px solid #e2e6ec; border-radius: 13px; background: #fafbfc; }
.invoice-line label { font-size: 0.7rem; }
.invoice-line input, .invoice-line select { min-height: 41px; font-size: 0.75rem; }
.remove-line { width: 34px; height: 41px; border: 1px solid #e1d0d0; border-radius: 9px; background: #fff6f6; color: #a14747; cursor: pointer; }
.invoice-live-total { display: flex; align-items: baseline; justify-content: flex-end; gap: 20px; margin-top: 17px; padding: 15px; border-radius: 12px; background: #f4f6f8; }
.invoice-live-total span { color: var(--muted); font-size: 0.76rem; }.invoice-live-total strong { font-family: Georgia,serif; font-size: 1.35rem; }
.setup-steps { margin: 19px 0; padding-left: 22px; color: #56657a; font-size: 0.8rem; line-height: 1.8; }
.secret-box { display: grid; gap: 7px; margin: 16px 0; padding: 14px; border: 1px dashed #c9a95d; border-radius: 11px; background: #fffaf0; }
.secret-box span { color: #806326; font-size: 0.7rem; font-weight: 780; }.secret-box code { overflow-wrap: anywhere; color: #26374e; font-size: 0.92rem; letter-spacing: 0.11em; }
.modal-confirm { width: min(460px,100%); }.modal-confirm p { color: var(--muted); line-height: 1.6; }
.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 22px; display: grid; gap: 8px; width: min(380px,calc(100% - 40px)); }
.toast { padding: 13px 15px; border: 1px solid #273f5c; border-radius: 12px; background: #0b1e34; color: #fff; box-shadow: 0 15px 40px rgba(0,0,0,0.25); font-size: 0.78rem; line-height: 1.45; animation: toast-in 0.22s ease-out; }
.toast.error { border-color: #a44545; background: #7e3030; }.toast.success { border-color: #2e8c6b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mobile-nav { display: none; }

@media (max-width: 1120px) {
  .metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .action-panel { min-height: auto; }.quick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .bank-grid { grid-template-columns: 1fr 1fr; }.bank-featured { grid-column: span 2; }
  .contacts-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .settings-grid { grid-template-columns: 1fr; }.settings-side { grid-template-columns: repeat(2,minmax(0,1fr)); }.security-card { grid-column: span 2; }
}

@media (max-width: 820px) {
  .login-body { display: block; padding: 0; background: #fff; }
  .login-shell { width: 100%; min-height: 100dvh; grid-template-columns: 1fr; border: 0; border-radius: 0; box-shadow: none; }
  .login-brand { min-height: 270px; padding: 25px 22px 30px; justify-content: flex-start; gap: 36px; }
  .login-pitch h1 { font-size: 2.35rem; }.login-pitch p:last-child { margin-top: 13px; font-size: 0.83rem; line-height: 1.5; }.security-pills { display: none; }
  .login-panel { align-items: flex-start; padding: 30px 22px 50px; }.login-form { max-width: none; }
  .app-shell { display: block; }.sidebar { display: none; }.workspace { min-height: 100dvh; }
  .topbar { min-height: 79px; padding: 12px 17px; }.topbar-kicker { display: none; }.mobile-brand { display: block; margin: 0 0 2px; color: var(--gold-600); font-family: Georgia,serif; font-size: 0.69rem; font-weight: 800; letter-spacing: 0.08em; }
  .topbar h1 { font-size: 1.35rem; }.year-picker span { display: none; }.year-picker { padding-left: 5px; }.topbar #quick-add { display: none; }
  .content { padding: 20px 14px 100px; }
  .mobile-nav { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; min-height: 72px; display: grid; grid-template-columns: repeat(5,1fr); align-items: end; padding: 8px max(7px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left)); border-top: 1px solid #d9dee6; background: rgba(255,255,255,0.95); box-shadow: 0 -8px 28px rgba(17,32,51,0.08); backdrop-filter: blur(16px); }
  .mobile-nav button { min-height: 52px; display: grid; place-items: center; align-content: center; gap: 3px; border: 0; background: transparent; color: #788597; cursor: pointer; }.mobile-nav button > span { font-family: Georgia,serif; font-size: 1.18rem; }.mobile-nav button small { font-size: 0.58rem; font-weight: 700; }.mobile-nav button.active { color: var(--navy-900); }
  .mobile-nav .mobile-add { width: 58px; height: 58px; min-height: 58px; align-self: start; justify-self: center; margin-top: -22px; border: 4px solid #fff; border-radius: 18px; background: var(--navy-900); color: var(--gold-300); box-shadow: 0 8px 23px rgba(7,20,38,0.25); }.mobile-nav .mobile-add > span { font-family: inherit; font-size: 1.35rem; }.mobile-nav .mobile-add small { color: #fff; }
  .setup-banner { grid-template-columns: auto minmax(0,1fr); }.setup-banner .button { grid-column: 2; justify-self: start; }
  .metrics-grid { gap: 10px; }.metric-card { min-height: 125px; padding: 15px; }.metric-card > strong { font-size: 1.45rem; }.metric-head { font-size: 0.68rem; }
  .chart-panel, .action-panel, .table-panel { padding: 16px; }.chart-panel { min-height: 300px; }.monthly-chart { gap: 4px; }.chart-legend { display: none; }
  .page-toolbar { align-items: flex-start; }.page-toolbar .button { flex: 0 0 auto; }.page-toolbar p:not(.eyebrow-dark) { max-width: 420px; }
  .toolbar-actions { flex-wrap: wrap; justify-content: flex-end; }.search-field { order: 10; width: 100%; margin: 4px 0 0; }
  .bank-grid { grid-template-columns: 1fr; }.bank-featured { grid-column: auto; }.bank-card, .import-card, .manual-card { min-height: 240px; padding: 19px; }
  .contacts-grid { grid-template-columns: 1fr; }.settings-side { grid-template-columns: 1fr; }.security-card { grid-column: auto; }
  .invoice-line { grid-template-columns: minmax(0,1fr) 74px 100px 34px; }.invoice-line .vat-field { grid-column: span 3; }.invoice-line .remove-line { grid-column: 4; grid-row: 1; }
  .modal { padding: 12px; }.modal-card { max-height: calc(100dvh - 24px); padding: 20px 16px; border-radius: 18px; }
}

@media (max-width: 560px) {
  .metrics-grid { grid-template-columns: 1fr 1fr; }.metric-card { min-height: 119px; }.metric-head { align-items: flex-start; }.metric-icon { display: none; }.metric-card > strong { margin-top: 14px; font-size: 1.32rem; }
  .quick-grid { grid-template-columns: 1fr; }.monthly-chart { overflow-x: auto; grid-template-columns: repeat(12,30px); justify-content: start; }
  .page-toolbar { display: grid; }.page-toolbar > .button, .toolbar-actions { justify-self: stretch; }.toolbar-actions .button { flex: 1; }
  .mini-metrics { grid-template-columns: 1fr; }.form-grid { grid-template-columns: 1fr; gap: 12px; }.span-2 { grid-column: auto; }
  .account-button { width: 39px; height: 39px; }.year-picker { min-height: 39px; }.year-picker select { min-height: 31px; }
  .invoice-line { grid-template-columns: 1fr 78px 34px; }.invoice-line .description-field { grid-column: span 2; }.invoice-line .vat-field { grid-column: span 2; }.invoice-line .price-field { grid-column: span 2; }.invoice-line .remove-line { grid-column: 3; grid-row: 1; }
  .modal-actions .button { flex: 1; }.setup-banner { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
