:root {
  --bg: #f4efe6;
  --fg: #1f2937;
  --muted: #64748b;
  --card: rgba(255, 255, 255, 0.88);
  --border: rgba(148, 163, 184, 0.24);
  --brand: #0f766e;
  --brand-dark: #115e59;
  --ink-soft: #0f172a;
  --surface: rgba(255, 255, 255, 0.96);
  --danger: #b91c1c;
}
* { box-sizing: border-box; }
body.is-page-loading { cursor:progress; }
body { margin:0; min-height:100vh; background:radial-gradient(circle at top left, rgba(245,158,11,.16), transparent 28%), radial-gradient(circle at top right, rgba(15,118,110,.18), transparent 25%), linear-gradient(180deg, #fbf7f0 0%, var(--bg) 48%, #efe8da 100%); color:var(--fg); font-family:"Avenir Next","Segoe UI",sans-serif; }
a { color:inherit; text-decoration:none; }
.container { width:min(1180px, calc(100% - 2rem)); margin:0 auto; padding:1.5rem 0 3rem; }
.card { background:var(--card); border:1px solid var(--border); border-radius:28px; box-shadow:0 22px 50px rgba(15,23,42,.08); backdrop-filter:blur(16px); }
.hero { padding:3.5rem; display:grid; gap:2rem; justify-items:center; align-content:center; min-height:620px; }
.grid { display:grid; gap:1.5rem; }
.grid-2 { grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); }
.badge { display:inline-flex; align-items:center; padding:.55rem .95rem; border-radius:999px; font-size:.82rem; font-weight:700; letter-spacing:.01em; background:rgba(15,118,110,.12); color:var(--brand-dark); }
.badge-success { background:rgba(34,197,94,.12); color:#15803d; }
.badge-warning { background:rgba(245,158,11,.16); color:#b45309; }
.badge-muted { background:rgba(148,163,184,.16); color:#475569; }
.badge-file-receipt_invoice { background:rgba(37,99,235,.14); color:#1d4ed8; }
.badge-file-declaration { background:rgba(124,58,237,.14); color:#6d28d9; }
.badge-file-bank_statement { background:rgba(5,150,105,.14); color:#047857; }
.badge-file-credit_card_statement { background:rgba(217,119,6,.14); color:#b45309; }
.badge-file-unclassified { background:rgba(148,163,184,.16); color:#475569; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:.5rem; border:0; border-radius:999px; padding:.95rem 1.35rem; font-weight:700; cursor:pointer; white-space:nowrap; transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease; }
.btn:disabled { cursor:wait; }
.btn-primary { background:linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); color:#fff; }
.btn-primary:hover,.btn-secondary:hover,.link-chip:hover { transform:translateY(-1px); }
.btn.is-loading { opacity:.92; pointer-events:none; }
.btn-spinner { width:1rem; height:1rem; border-radius:999px; border:2px solid rgba(255,255,255,.35); border-top-color:#fff; animation:spin .7s linear infinite; }
.btn-secondary { background:#fff; border:1px solid rgba(148,163,184,.3); }
.btn-danger { border-color:rgba(185,28,28,.16); color:#991b1b; background:rgba(254,242,242,.96); }
.btn-secondary .btn-spinner,
.btn-danger .btn-spinner { border-color:rgba(15,23,42,.16); border-top-color:currentColor; }
.input,.textarea,.file { width:100%; border:1px solid rgba(148,163,184,.35); border-radius:18px; padding:.95rem 1rem; background:rgba(255,255,255,.94); font:inherit; }
.input-compact { width:auto; min-width:150px; padding:.7rem .85rem; border-radius:14px; }
.textarea { min-height:120px; resize:vertical; }
.stack > * + * { margin-top:1rem; }
.nav { display:flex; flex-wrap:wrap; gap:2rem; justify-content:space-between; align-items:center; margin-bottom:1.5rem; }
.nav-copy { flex:1 1 320px; min-width:0; max-width:540px; }
.actions { display:flex; gap:.85rem; flex-wrap:wrap; align-items:center; justify-content:flex-end; margin-left:auto; }
.link-chip { display:inline-flex; align-items:center; justify-content:center; min-height:56px; padding:.95rem 1.35rem; border-radius:999px; background:rgba(255,255,255,.92); border:1px solid rgba(148,163,184,.22); font-weight:700; color:#1e293b; }
.link-chip.active { background:#0f172a; border-color:#0f172a; color:#fff; box-shadow:0 16px 30px rgba(15,23,42,.14); }
.nav-dropdown { position:relative; }
.nav-dropdown summary { list-style:none; cursor:pointer; }
.nav-dropdown summary::-webkit-details-marker { display:none; }
.dropdown-caret { width:.6rem; height:.6rem; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg) translateY(-1px); margin-left:.25rem; transition:transform .18s ease; }
.nav-dropdown[open] .dropdown-caret { transform:rotate(-135deg) translateY(-1px); }
.dropdown-menu { position:absolute; top:calc(100% + .6rem); left:0; min-width:240px; display:grid; gap:.35rem; padding:.6rem; border:1px solid rgba(148,163,184,.18); border-radius:20px; background:rgba(255,255,255,.98); box-shadow:0 24px 50px rgba(15,23,42,.14); z-index:30; }
.dropdown-menu-right { left:auto; right:0; }
.dropdown-item { display:flex; align-items:center; min-height:46px; padding:.8rem 1rem; border-radius:14px; font-weight:700; color:#334155; transition:background .18s ease, color .18s ease; }
.dropdown-menu form { margin:0; }
.dropdown-menu .dropdown-item { width:100%; border:0; background:transparent; cursor:pointer; font:inherit; text-align:left; }
.dropdown-item:hover,
.dropdown-item.active { background:rgba(15,118,110,.1); color:var(--brand-dark); }
.dropdown-item-danger { color:#991b1b; }
.dropdown-item-danger:hover { background:rgba(254,242,242,.96); color:#991b1b; }
.flash-stack { position:fixed; top:1.2rem; right:1.2rem; width:min(420px, calc(100vw - 2rem)); display:grid; gap:.75rem; z-index:1100; }
.notice { border-radius:18px; padding:.95rem 1rem; font-weight:600; margin-bottom:0; box-shadow:0 20px 45px rgba(15,23,42,.12); border:1px solid rgba(148,163,184,.18); backdrop-filter:blur(14px); }
.notice.is-hiding { opacity:0; transform:translateY(-6px); transition:opacity .25s ease, transform .25s ease; }
.notice.error { background:#fef2f2; color:var(--danger); }
.notice.success { background:#ecfdf5; color:#047857; }
.panel,.stat { padding:1.75rem; }
.panel { background:var(--surface); }
.item { display:block; width:100%; border:1px solid rgba(255,255,255,.68); background:rgba(255,255,255,.88); border-radius:22px; padding:1.05rem 1.15rem; box-shadow:inset 0 1px 0 rgba(255,255,255,.7); transition:border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.item:hover { transform:translateY(-1px); border-color:rgba(15,118,110,.22); box-shadow:0 16px 30px rgba(15,23,42,.06); }
.item strong { display:block; margin-bottom:.35rem; }
.item-meta,.subheading,.muted { color:var(--muted); }
.heading { font-size:clamp(2rem, 4vw, 3.8rem); font-weight:800; line-height:1.1; margin:0; }
.landing-copy { width:min(100%, 860px); margin:0 auto; align-items:center; text-align:center; display: flex; flex-direction: column; gap: 15px;}
.landing-copy .subheading { max-width:42rem; }
.landing-copy .row { justify-content:center; }
.row { display:flex; gap:.75rem; flex-wrap:wrap; }
.split { display:grid; gap:1.5rem; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); }
.toolbar-form { display:grid; grid-template-columns:minmax(0, 1fr) 180px 180px 180px 160px auto; gap:1rem; align-items:end; }
.toolbar-search,
.toolbar-select,
.toolbar-date { display:grid; gap:.45rem; }
.toolbar-label { font-size:.9rem; font-weight:700; color:var(--muted); }
.toolbar-actions { display:flex; gap:.75rem; align-items:end; flex-wrap:wrap; }
.document-title { margin:0 0 .45rem; font-size:1.2rem; line-height:1.3; color:var(--ink-soft); }
.list-shell { display:grid; gap:1rem; }
.list-row { display:flex; align-items:center; justify-content:space-between; gap:1.25rem; }
.list-main { display:grid; gap:.9rem; min-width:0; }
.list-actions { display:flex; align-items:center; justify-content:flex-end; flex-shrink:0; }
.client-row { color:inherit; }
.client-inline-meta { display:flex; flex-wrap:wrap; gap:.55rem 1rem; color:var(--muted); font-size:.97rem; }
.client-inline-meta span::after { content:"•"; margin-left:1rem; color:rgba(100,116,139,.45); }
.client-inline-meta span:last-child::after { content:""; margin:0; }
.client-list-stats { gap:.65rem; flex-wrap:wrap; }
.status-badges { display:flex; gap:.55rem; flex-wrap:wrap; }
.pagination-shell { display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.pagination-meta { color:var(--muted); font-weight:600; }
.pagination-disabled { opacity:.5; pointer-events:none; }
.section-title { margin:1rem 0 .75rem; font-size:clamp(2rem, 3vw, 3rem); line-height:1.05; letter-spacing:-.03em; }
.subheading { margin:0; max-width:30ch; font-size:1.05rem; line-height:1.7; }
.stat { display:flex; flex-direction:column; justify-content:space-between; min-height:132px; background:linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.88)); }
.stat-label { font-size:1rem; font-weight:600; line-height:1.4; }
.stat strong { display:block; margin-top:1rem; font-size:clamp(2.15rem, 4vw, 3rem); line-height:1; color:var(--ink-soft); letter-spacing:-.04em; }
.page-loader { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(251,247,240,.74); backdrop-filter:blur(10px); z-index:1250; }
.page-loader[hidden] { display:none !important; }
.page-loader-inner { display:grid; justify-items:center; gap:1.15rem; padding:2rem 2.4rem; border-radius:32px; background:rgba(255,255,255,.84); border:1px solid rgba(148,163,184,.18); box-shadow:0 30px 80px rgba(15,23,42,.12); }
.page-loader-text { margin:0; font-weight:700; color:var(--muted); letter-spacing:.01em; }
.file-orbit { position:relative; width:116px; height:116px; animation:orbit-spin 6s linear infinite; }
.file-glyph { position:absolute; top:50%; left:50%; width:34px; height:42px; margin:-21px 0 0 -17px; border-radius:10px; background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(240,247,246,.98)); border:2px solid rgba(15,118,110,.18); box-shadow:0 10px 22px rgba(15,23,42,.08); }
.file-glyph::before { content:""; position:absolute; top:7px; right:7px; width:9px; height:9px; background:rgba(15,118,110,.14); clip-path:polygon(0 0, 100% 0, 100% 100%); }
.file-glyph::after { content:""; position:absolute; left:7px; right:7px; bottom:9px; height:2px; background:rgba(15,118,110,.22); box-shadow:0 -7px 0 rgba(15,118,110,.18), 0 -14px 0 rgba(15,118,110,.12); }
.file-glyph-a { transform:translate(0, -40px) rotate(-6deg); }
.file-glyph-b { transform:translate(34px, 21px) rotate(8deg); }
.file-glyph-c { transform:translate(-34px, 21px) rotate(-8deg); }
.modal-backdrop { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; padding:1.25rem; background:rgba(15,23,42,.42); backdrop-filter:blur(8px); z-index:1000; }
.modal-backdrop[hidden] { display:none !important; }
.modal-card { width:min(100%, 460px); background:rgba(255,255,255,.97); border:1px solid rgba(148,163,184,.2); border-radius:28px; box-shadow:0 30px 80px rgba(15,23,42,.24); padding:1.5rem; }
.modal-copy { display:grid; gap:.65rem; }
.modal-title { margin:0; font-size:1.45rem; line-height:1.1; color:var(--ink-soft); }
.modal-text { margin:0; color:var(--muted); line-height:1.7; }
.modal-actions { display:flex; gap:.75rem; justify-content:flex-end; margin-top:1.4rem; }

@keyframes spin {
  to { transform:rotate(360deg); }
}

@keyframes orbit-spin {
  to { transform:rotate(360deg); }
}

@media (max-width: 900px) {
  .nav { align-items:flex-start; }
  .actions { justify-content:flex-start; }
  .link-chip,
  .btn { min-height:52px; }
  .dropdown-menu { position:static; min-width:100%; margin-top:.5rem; }
}

@media (min-width: 901px) {
  .nav { display:grid; grid-template-columns:minmax(0, 1fr) auto; align-items:center; }
  .actions { max-width:720px; }
}

@media (max-width: 640px) {
  .container { width:min(100% - 1.2rem, 1180px); padding:1rem 0 2rem; }
  .panel,.stat,.hero { padding:1.25rem; }
  .actions { width:100%; }
  .actions form { width:100%; }
  .actions .btn,
  .actions .link-chip,
  .actions form .btn { width:100%; }
  .toolbar-form { grid-template-columns:1fr; }
  .toolbar-actions { width:100%; }
  .toolbar-actions .btn { width:100%; }
  .list-row { flex-direction:column; align-items:flex-start; }
  .list-actions { width:100%; }
  .list-actions .btn { width:100%; }
  .client-inline-meta { display:grid; gap:.35rem; }
  .client-inline-meta span::after { content:""; margin:0; }
  .subheading { max-width:none; }
  .hero { min-height:auto; }
  .modal-actions { flex-direction:column-reverse; }
  .modal-actions .btn { width:100%; }
  .flash-stack { top:1rem; right:1rem; left:1rem; width:auto; }
}

/* 2026 portal visual system */
:root { --bg:#f5f7fb; --fg:#182230; --muted:#667085; --card:#fff; --border:#e4e7ec; --brand:#465fff; --brand-dark:#2e3cc8; --ink-soft:#101828; --surface:#fff; --danger:#d92d20; }
body { background:linear-gradient(135deg,#f8faff 0%,#f5f7fb 48%,#eef1ff 100%); font-family:Inter,"Avenir Next","Segoe UI",sans-serif; letter-spacing:-.01em; }
body::before { content:""; position:fixed; inset:0; pointer-events:none; opacity:.7; background:radial-gradient(circle at 8% 5%,rgba(70,95,255,.12),transparent 24%),radial-gradient(circle at 92% 14%,rgba(20,184,166,.1),transparent 22%); }
.container { position:relative; width:min(1280px,calc(100% - 3rem)); padding:2rem 0 4rem; }
.card { border-radius:18px; border-color:var(--border); box-shadow:0 8px 24px rgba(16,24,40,.06); backdrop-filter:none; }
.panel { padding:1.5rem; }
.hero { min-height:580px; padding:4rem; background:linear-gradient(145deg,#101828,#26376d); color:#fff; overflow:hidden; position:relative; }
.hero::after { content:""; position:absolute; width:430px; height:430px; right:-140px; top:-150px; border:1px solid rgba(255,255,255,.17); border-radius:50%; box-shadow:0 0 0 55px rgba(255,255,255,.04),0 0 0 110px rgba(255,255,255,.03); }
.hero .landing-copy { position:relative; z-index:1; }.hero .heading { max-width:780px; font-size:clamp(2.6rem,6vw,5.25rem); letter-spacing:-.055em; }.hero .subheading { color:#d0d5dd; font-size:1.12rem; }.hero .badge { background:rgba(255,255,255,.13); color:#fff; border:1px solid rgba(255,255,255,.2); }
.badge { padding:.38rem .7rem; border-radius:7px; font-size:.73rem; text-transform:uppercase; letter-spacing:.055em; background:#eef2ff; color:#3949ab; }.badge-success { background:#ecfdf3; color:#067647; }.badge-warning { background:#fffaeb; color:#b54708; }
.btn { min-height:44px; padding:.7rem 1.05rem; border-radius:9px; font-size:.92rem; box-shadow:none; }.btn-primary { background:linear-gradient(135deg,#5268ff,#3546d3); box-shadow:0 5px 12px rgba(70,95,255,.22); }.btn-primary:hover { box-shadow:0 8px 16px rgba(70,95,255,.28); }.btn-secondary { border-color:#d0d5dd; color:#344054; }.btn-danger { color:#b42318; }
.input,.textarea,.file { border-radius:9px; border-color:#d0d5dd; padding:.78rem .9rem; transition:border-color .18s,box-shadow .18s; }.input:focus,.textarea:focus,.file:focus { outline:none; border-color:#7182ff; box-shadow:0 0 0 4px rgba(70,95,255,.12); }.textarea { min-height:110px; }
.nav { margin-bottom:1.25rem; gap:1.25rem; }.nav-copy .badge { margin-bottom:.2rem; }.section-title { margin:.35rem 0 .45rem; font-size:clamp(1.8rem,3vw,2.6rem); letter-spacing:-.045em; }.subheading { font-size:.98rem; line-height:1.55; }
.actions { gap:.5rem; }.link-chip { min-height:42px; padding:.65rem .9rem; border-radius:9px; background:transparent; border-color:transparent; color:#475467; font-size:.9rem; }.link-chip:hover { background:#f2f4f7; transform:none; }.link-chip.active { background:#101828; box-shadow:none; }
.dropdown-menu { border-radius:12px; padding:.45rem; box-shadow:0 12px 28px rgba(16,24,40,.14); }.dropdown-item { min-height:40px; border-radius:8px; font-size:.9rem; }
.stat { min-height:145px; border-top:3px solid #7484ff; background:#fff; }.stat:nth-child(2) { border-top-color:#14b8a6; }.stat:nth-child(3) { border-top-color:#f79009; }.stat strong { font-size:2.75rem; }
.item { border-color:#eaecf0; border-radius:12px; padding:1rem; background:#fff; box-shadow:none; }.item:hover { border-color:#b9c2ff; box-shadow:0 8px 18px rgba(16,24,40,.06); }.list-shell { gap:.75rem; }.list-row { border-radius:14px; }.document-title { font-size:1.05rem; }.toolbar-form { padding:.25rem; }.pagination-shell { border-radius:14px; }
.notice { border-radius:12px; box-shadow:0 12px 28px rgba(16,24,40,.14); }.modal-card { border-radius:18px; }.page-loader-inner { border-radius:20px; }
@media (max-width:640px) { .container { width:min(100% - 1.5rem,1280px); padding:1rem 0 2rem; }.hero { padding:2.5rem 1.25rem; min-height:500px; }.panel,.stat { padding:1.15rem; }.link-chip { width:100%; }.hero .heading { font-size:2.65rem; } }

/* Responsive portal safeguards */
html { overflow-x:hidden; }
input, select, textarea, button { max-width:100%; }
.password-tools { display:flex; flex-wrap:wrap; gap:.65rem; }
.item-meta, .client-inline-meta, .document-title { overflow-wrap:anywhere; }

@media (max-width: 1080px) {
  .toolbar-form { grid-template-columns:repeat(3, minmax(0, 1fr)); }
  .toolbar-form .toolbar-actions { grid-column:1 / -1; justify-content:flex-start; }
}

@media (max-width: 760px) {
  .container { width:min(100% - 1.25rem, 1280px); }
  .nav { display:block; }
  .nav-copy { max-width:none; }
  .actions { width:100%; margin:1rem 0 0; display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .link-chip, .actions .nav-dropdown { width:100%; }
  .nav-dropdown summary { width:100%; }
  .dropdown-menu, .dropdown-menu-right { position:static; width:100%; margin-top:.45rem; }
  .toolbar-form { grid-template-columns:1fr; padding:0; }
  .toolbar-form .toolbar-actions { grid-column:auto; width:100%; display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .toolbar-actions .btn { width:100%; }
  .list-row { align-items:stretch; }
  .list-actions { justify-content:flex-start; }
  .list-actions .btn { width:100%; }
  .pagination-shell { align-items:stretch; }
  .pagination-shell .row { width:100%; }
  .pagination-shell .btn { flex:1; }
}

@media (max-width: 480px) {
  .container { width:min(100% - 1rem, 1280px); padding-top:.5rem; }
  .card { border-radius:14px; }
  .panel, .stat { padding:1rem; }
  .section-title { font-size:1.65rem; }
  .actions, .toolbar-form .toolbar-actions { grid-template-columns:1fr; }
  .password-tools { display:grid; grid-template-columns:1fr; }
  .password-tools .btn { width:100%; }
  .row > .input { min-width:100%; }
  .client-list-stats { width:100%; display:grid; grid-template-columns:1fr 1fr; }
  .client-list-stats .badge { justify-content:center; }
}
