:root {
  --ink: #16313d;
  --ink-2: #294653;
  --muted: #6e818a;
  --navy: #0f2d3a;
  --navy-2: #173b49;
  --teal: #159b84;
  --teal-dark: #087965;
  --teal-soft: #e3f6f1;
  --blue-soft: #e9f1fb;
  --amber: #bd790e;
  --amber-soft: #fff3d8;
  --red: #c64c4c;
  --red-soft: #ffebeb;
  --green: #168160;
  --green-soft: #e5f5ee;
  --purple: #7455a3;
  --purple-soft: #f0eafa;
  --line: #dfe7ea;
  --line-2: #edf1f3;
  --surface: #ffffff;
  --canvas: #f4f7f8;
  --shadow: 0 14px 40px rgba(20, 45, 56, .08);
  --shadow-sm: 0 5px 18px rgba(20, 45, 56, .07);
  --radius: 16px;
  --radius-sm: 10px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100vh; margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(430px, 1.05fr) minmax(430px, .95fr); background: #fff; }
.login-visual { background: radial-gradient(circle at 20% 10%, rgba(43, 190, 164, .24), transparent 38%), linear-gradient(145deg, #0d2936, #123c48 60%, #0d2c38); color: white; padding: 56px; position: relative; overflow: hidden; }
.login-visual::after { content: ""; position: absolute; right: -150px; bottom: -190px; width: 530px; height: 530px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 145px rgba(255,255,255,.02); }
.visual-content { position: relative; z-index: 1; max-width: 620px; min-height: calc(100vh - 112px); display: flex; flex-direction: column; justify-content: center; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.brand-light { color: #fff; position: absolute; top: 0; }
.brand-mark { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 10px; background: var(--teal); color: white; font-weight: 900; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.login-visual h1 { font-size: clamp(46px, 5vw, 74px); line-height: .98; margin: 18px 0 24px; letter-spacing: -.055em; }
.login-lead { color: rgba(255,255,255,.76); font-size: 19px; line-height: 1.65; max-width: 570px; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .16em; color: #6dd6c2; }
.eyebrow.dark { color: var(--teal-dark); }
.visual-proof { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 70px; gap: 18px; max-width: 580px; }
.visual-proof div { border-top: 1px solid rgba(255,255,255,.22); padding-top: 16px; }
.visual-proof strong { display: block; font-size: 27px; }
.visual-proof span { color: rgba(255,255,255,.64); display: block; font-size: 12px; margin-top: 5px; line-height: 1.4; }
.login-panel { display: grid; place-items: center; padding: 50px; }
.login-card { width: min(430px, 100%); }
.mobile-brand { display: none; }
.login-card h2 { font-size: 34px; letter-spacing: -.04em; margin: 22px 0 8px; }
.login-card > p { color: var(--muted); line-height: 1.6; margin: 0 0 28px; }
.login-card label, .modal-body label, .workspace-selector label, .portal-card label { display: grid; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 18px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; color: var(--ink); background: #fff; outline: none; transition: border-color .18s, box-shadow .18s; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(21,155,132,.12); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 60px; }
.link-button { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--teal-dark); font-weight: 800; font-size: 12px; }
.pill { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 100px; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.pill-soft { background: var(--teal-soft); color: var(--teal-dark); }
.button { border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .15s, opacity .15s, box-shadow .15s; white-space: nowrap; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button-primary { background: var(--teal); color: white; box-shadow: 0 6px 15px rgba(21,155,132,.2); }
.button-primary:hover { background: var(--teal-dark); }
.button-secondary { background: #eaf1f3; color: var(--ink); }
.button-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.button-danger { background: var(--red-soft); color: var(--red); }
.button-sm { padding: 7px 10px; font-size: 11px; border-radius: 8px; }
.button-block { width: 100%; padding: 13px 16px; }
.button-group { display: flex; gap: 10px; flex-wrap: wrap; }
.demo-note { margin-top: 18px; color: var(--muted); font-size: 12px; display: flex; justify-content: center; align-items: center; gap: 7px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.form-error { color: var(--red) !important; background: var(--red-soft); border-radius: 8px; padding: 10px; margin-top: 12px !important; font-size: 12px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 242px; background: var(--navy); color: rgba(255,255,255,.78); padding: 22px 14px 16px; display: flex; flex-direction: column; z-index: 30; }
.sidebar .brand { padding: 0 8px; color: white; }
.sidebar-top { min-height: 45px; display: flex; align-items: center; justify-content: space-between; }
.firm-switcher { margin: 22px 4px 18px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.07); border-radius: 12px; padding: 10px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; }
.firm-avatar { width: 31px; height: 31px; display: grid; place-items: center; background: rgba(87,208,187,.18); color: #80e4d2; border-radius: 9px; font-size: 10px; font-weight: 900; }
.firm-switcher small, .user-card small { display: block; font-size: 9px; color: rgba(255,255,255,.46); margin-bottom: 2px; }
.firm-switcher strong, .user-card strong { display: block; font-size: 11px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { color: rgba(255,255,255,.45); }
.nav-list { display: grid; gap: 3px; }
.nav-item { position: relative; width: 100%; border: 0; background: transparent; color: inherit; display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 9px; text-align: left; font-size: 12px; font-weight: 650; }
.nav-item:hover { background: rgba(255,255,255,.055); color: white; }
.nav-item.active { background: rgba(39, 190, 164, .14); color: #8de4d4; }
.nav-item.active::before { content: ""; position: absolute; left: -14px; width: 3px; height: 21px; background: #39c8ae; border-radius: 0 5px 5px 0; }
.nav-icon { width: 19px; text-align: center; font-size: 16px; color: currentColor; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 100px; background: rgba(86, 211, 190, .2); color: #8de4d4; display: inline-grid; place-items: center; font-size: 9px; font-weight: 900; }
.nav-badge.danger { background: rgba(244, 105, 105, .16); color: #ff9d9d; }
.sidebar-bottom { margin-top: auto; }
.user-card { border-top: 1px solid rgba(255,255,255,.08); padding: 16px 8px 0; margin-top: 8px; display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; }
.user-avatar, .avatar-button { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #dff4ef; color: var(--teal-dark); font-size: 10px; font-weight: 900; }
.more-button { border: 0; background: transparent; color: rgba(255,255,255,.48); }

.main-area { margin-left: 242px; min-height: 100vh; }
.topbar { height: 70px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 30px; position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); }
.topbar-title { display: grid; }
.topbar-title span { font-size: 10px; color: var(--muted); }
.topbar-title strong { font-size: 17px; letter-spacing: -.02em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.period-control { height: 38px; border: 1px solid var(--line); border-radius: 9px; display: flex; align-items: center; gap: 7px; padding: 0 10px; color: var(--muted); font-size: 10px; font-weight: 700; }
.period-control input { border: 0; padding: 0; min-width: 118px; box-shadow: none; font-size: 11px; font-weight: 800; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); background: white; border-radius: 9px; color: var(--ink-2); display: grid; place-items: center; font-size: 18px; }
.avatar-button { border: 0; }
.content-wrap { padding: 28px 30px 48px; max-width: 1540px; margin: 0 auto; }
.view { display: none; }
.active-view { display: block; animation: fadeIn .18s ease-out; }
@keyframes fadeIn { from { opacity: .4; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h1 { font-size: 29px; letter-spacing: -.04em; margin: 4px 0 4px; }
.page-heading p { color: var(--muted); margin: 0; font-size: 13px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { background: white; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; right: -20px; top: -25px; width: 80px; height: 80px; border-radius: 50%; background: var(--teal-soft); opacity: .55; }
.metric-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 700; }
.metric-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; background: var(--teal-soft); color: var(--teal-dark); font-size: 15px; position: relative; z-index: 1; }
.metric-value { font-size: 29px; font-weight: 850; letter-spacing: -.04em; margin: 13px 0 3px; }
.metric-foot { color: var(--muted); font-size: 10px; }
.metric-foot strong { color: var(--green); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .72fr); gap: 18px; align-items: start; }
.panel-card, .dashboard-card, .toolbar-card, .workspace-selector, .integration-card, .notice-card { background: white; border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.dashboard-card { padding: 19px; }
.dashboard-stack { display: grid; gap: 18px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 15px; }
.section-heading.compact { margin-bottom: 12px; }
.section-heading h2 { font-size: 15px; margin: 3px 0 0; letter-spacing: -.02em; }
.section-heading p { color: var(--muted); font-size: 11px; margin: 4px 0 0; }
.text-link { border: 0; background: transparent; color: var(--teal-dark); font-size: 11px; font-weight: 800; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 12px; color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line-2); font-size: 11px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfc; }
.client-cell { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.client-logo { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: #e6f4f1; color: var(--teal-dark); font-size: 10px; font-weight: 900; }
.client-cell strong { display: block; font-size: 11px; }
.client-cell small { color: var(--muted); display: block; margin-top: 2px; font-size: 9px; }
.status-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 100px; font-size: 9px; font-weight: 850; white-space: nowrap; background: #eef2f3; color: var(--muted); }
.status-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-collecting, .status-pending_review, .status-unmatched, .status-pending_download { background: var(--amber-soft); color: var(--amber); }
.status-reconciling, .status-needs_review, .status-not_checked { background: var(--blue-soft); color: #3c6fa6; }
.status-review, .status-amount_mismatch, .status-mismatch { background: var(--purple-soft); color: var(--purple); }
.status-ready, .status-approved, .status-auto_matched, .status-manual_matched, .status-matched, .status-validated, .status-done { background: var(--green-soft); color: var(--green); }
.status-filed { background: var(--teal-soft); color: var(--teal-dark); }
.status-high, .status-sunat_only, .status-not_found { background: var(--red-soft); color: var(--red); }
.status-medium { background: var(--amber-soft); color: var(--amber); }
.status-low { background: #eef2f3; color: var(--muted); }
.progress-inline { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.progress-track { height: 6px; background: #e9eff1; border-radius: 10px; overflow: hidden; flex: 1; }
.progress-track.large { height: 9px; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1cad95, #42cdb5); }
.progress-inline small { color: var(--muted); width: 28px; text-align: right; font-size: 9px; font-weight: 800; }
.count-bubble { display: inline-grid; min-width: 22px; height: 22px; padding: 0 5px; place-items: center; border-radius: 100px; background: var(--red-soft); color: var(--red); font-weight: 900; font-size: 9px; }
.action-menu { border: 0; background: transparent; font-size: 17px; color: var(--muted); }

.attention-list, .activity-list, .exception-list, .portal-document-list { display: grid; gap: 9px; }
.attention-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.attention-item:last-child { border-bottom: 0; }
.attention-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; background: var(--red-soft); color: var(--red); font-weight: 900; }
.attention-item strong { display: block; font-size: 10px; margin-bottom: 3px; }
.attention-item p { color: var(--muted); font-size: 9px; margin: 0; line-height: 1.45; }
.attention-item time { color: var(--muted); font-size: 8px; }
.activity-item { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.activity-dot { width: 8px; height: 8px; background: var(--teal); border-radius: 50%; margin-top: 5px; box-shadow: 0 0 0 4px var(--teal-soft); }
.activity-item p { margin: 0; font-size: 10px; line-height: 1.4; }
.activity-item time { color: var(--muted); font-size: 8px; }
.summary-band { background: linear-gradient(135deg, #123541, #164a55); color: #fff; border-radius: var(--radius); padding: 20px; display: grid; grid-template-columns: 1fr auto; gap: 16px; overflow: hidden; position: relative; }
.summary-band::after { content: ""; position: absolute; right: -40px; top: -70px; width: 180px; height: 180px; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; box-shadow: 0 0 0 35px rgba(255,255,255,.025); }
.summary-band h2 { font-size: 17px; margin: 4px 0 7px; }
.summary-band p { color: rgba(255,255,255,.68); margin: 0; font-size: 10px; max-width: 560px; line-height: 1.6; }
.summary-stat { position: relative; z-index: 1; text-align: right; }
.summary-stat strong { font-size: 28px; display: block; }
.summary-stat span { color: rgba(255,255,255,.65); font-size: 9px; }

.toolbar-card { padding: 11px; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; }
.wrap-toolbar { flex-wrap: wrap; }
.toolbar-card select { width: auto; min-width: 155px; padding: 9px 11px; font-size: 11px; }
.search-box { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 11px; }
.search-box input { border: 0; padding: 9px 0; box-shadow: none; font-size: 11px; }
.search-box span { color: var(--muted); }
.panel-card { overflow: hidden; }
.panel-card > .table-wrap { padding: 4px 8px; }
.workspace-selector { padding: 13px 15px; margin-bottom: 16px; display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.workspace-selector label { margin: 0; min-width: 245px; }
.workspace-selector select { padding: 9px 11px; font-size: 11px; }

.recon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.mini-stat { background: #fff; border: 1px solid var(--line-2); border-radius: 13px; padding: 14px; box-shadow: var(--shadow-sm); }
.mini-stat span { color: var(--muted); font-size: 9px; display: block; }
.mini-stat strong { font-size: 21px; display: block; margin-top: 6px; }
.money-negative { color: var(--red); font-weight: 800; }
.money-positive { color: var(--green); font-weight: 800; }
.document-row-actions { display: flex; gap: 6px; }
.confidence { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.confidence-bar { width: 42px; height: 5px; border-radius: 10px; background: #e8edef; overflow: hidden; }
.confidence-bar span { height: 100%; display: block; background: var(--teal); }

.exception-list { gap: 12px; }
.exception-card { background: white; border: 1px solid var(--line-2); border-left: 4px solid var(--amber); border-radius: 13px; padding: 15px; box-shadow: var(--shadow-sm); display: grid; grid-template-columns: 1fr auto; gap: 14px; }
.exception-card.high { border-left-color: var(--red); }
.exception-card.low { border-left-color: #9aacb4; }
.exception-card h3 { margin: 7px 0 5px; font-size: 13px; }
.exception-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.exception-meta { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.exception-actions { display: flex; align-items: center; gap: 7px; }

.closing-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(270px, .55fr); gap: 16px; align-items: start; }
.checklist-card, .close-sidebar-card { background: white; border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px; }
.checklist { display: grid; gap: 2px; }
.check-item { display: grid; grid-template-columns: auto 1fr auto; gap: 11px; align-items: center; padding: 11px 5px; border-bottom: 1px solid var(--line-2); }
.check-item:last-child { border: 0; }
.check-item input { width: 18px; height: 18px; accent-color: var(--teal); }
.check-item strong { font-size: 11px; display: block; }
.check-item small { color: var(--muted); font-size: 9px; }
.check-item.automatic { background: rgba(230,246,241,.28); }
.check-item.automatic input { cursor: default; opacity: .8; }
.blocker-list { display: grid; gap: 8px; margin-top: 12px; }
.blocker { background: var(--red-soft); border-radius: 9px; padding: 10px; color: #8f3434; font-size: 10px; line-height: 1.45; }
.close-hero { background: linear-gradient(135deg, var(--navy), #17515b); color: #fff; padding: 18px; border-radius: 13px; margin-bottom: 13px; }
.close-hero strong { font-size: 27px; display: block; margin: 8px 0 4px; }
.close-hero small { color: rgba(255,255,255,.65); }

.integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.integration-card { padding: 18px; display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: start; }
.integration-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--teal-soft); color: var(--teal-dark); display: grid; place-items: center; font-weight: 900; }
.integration-card h3 { margin: 2px 0 6px; font-size: 13px; }
.integration-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.security-note { margin-top: 16px; background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 18px; }
.security-note h3 { margin: 0 0 8px; font-size: 13px; }
.security-note p { color: var(--muted); font-size: 10px; line-height: 1.6; margin: 0; }

.modal { width: min(580px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 30px 80px rgba(13,38,49,.28); }
.modal::backdrop { background: rgba(8,27,35,.5); backdrop-filter: blur(3px); }
.modal-shell { margin: 0; }
.modal-header { display: flex; justify-content: space-between; align-items: start; padding: 20px 22px 15px; border-bottom: 1px solid var(--line-2); }
.modal-header h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.03em; }
.modal-body { padding: 19px 22px 8px; max-height: 65vh; overflow-y: auto; }
.modal-body .form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 12px; }
.modal-body .full { grid-column: 1 / -1; }
.modal-body label { margin-bottom: 14px; font-size: 11px; }
.modal-body input, .modal-body select { padding: 9px 11px; font-size: 11px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 22px 20px; }
.file-drop { border: 1.5px dashed #b9c8ce; border-radius: 12px; padding: 20px; text-align: center; background: #fafcfc; }
.file-drop input[type="file"] { display: block; width: 100%; margin: 10px 0 12px; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); font: inherit; }
.file-drop input[type="file"]::file-selector-button { border: 0; border-radius: 8px; padding: 8px 12px; margin-right: 10px; background: var(--teal-soft); color: var(--teal-dark); font: inherit; font-weight: 800; cursor: pointer; }
.file-drop input[type="file"]::-webkit-file-upload-button { border: 0; border-radius: 8px; padding: 8px 12px; margin-right: 10px; background: var(--teal-soft); color: var(--teal-dark); font: inherit; font-weight: 800; cursor: pointer; }
.help-text { color: var(--muted); font-size: 9px; line-height: 1.5; margin-top: -6px; }

.toast-container { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; }
.toast { min-width: 280px; max-width: 390px; background: var(--navy); color: white; padding: 12px 14px; border-radius: 11px; box-shadow: var(--shadow); font-size: 11px; display: flex; align-items: start; gap: 9px; animation: toastIn .2s ease-out; }
.toast.error { background: #833b3b; }
.toast.success { background: #176d5b; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.loading-card { min-height: 280px; display: grid; place-items: center; color: var(--muted); background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); }
.empty-state { padding: 45px 20px; text-align: center; color: var(--muted); }
.empty-state.compact-empty { padding: 24px 10px; line-height: 1.6; }
.empty-state strong { display: block; color: var(--ink); margin-bottom: 6px; }
.muted-copy { color: var(--muted); font-size: 10px; line-height: 1.55; }
.mobile-only { display: none; }
.sidebar-backdrop { display: none; }

.portal-body { background: var(--navy); min-height: 100vh; }
.portal-shell { width: min(650px, 100%); margin: 0 auto; min-height: 100vh; background: var(--canvas); padding-bottom: 30px; }
.portal-header { height: 68px; background: var(--navy); color: white; display: flex; justify-content: space-between; align-items: center; padding: 0 22px; }
.portal-header .brand-light { position: static; }
.secure-label { font-size: 9px; color: rgba(255,255,255,.6); }
.portal-hero { background: linear-gradient(145deg, var(--navy), #17515b); color: #fff; padding: 25px 22px 54px; }
.portal-hero h1 { font-size: 28px; margin: 8px 0 7px; letter-spacing: -.04em; }
.portal-hero p { margin: 0; color: rgba(255,255,255,.7); font-size: 12px; line-height: 1.55; }
.portal-card { background: #fff; border: 1px solid var(--line-2); border-radius: 16px; margin: 14px 14px 0; padding: 18px; box-shadow: var(--shadow-sm); }
.upload-zone-card { margin-top: -31px; position: relative; }
.portal-period { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--muted); margin-bottom: 14px; }
.portal-period strong { color: var(--ink); }
.drop-zone { border: 1.5px dashed #b7c8ce; border-radius: 13px; padding: 23px 14px; text-align: center; background: #f9fbfb; display: grid !important; justify-items: center; gap: 7px !important; cursor: pointer; }
.drop-zone input { display: none; }
.drop-zone strong { font-size: 12px; }
.drop-zone small { color: var(--muted); font-size: 9px; }
.upload-icon { width: 37px; height: 37px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal-dark); border-radius: 11px; font-size: 20px; }
.selected-file { color: var(--teal-dark); font-size: 10px; font-weight: 800; word-break: break-word; }
.portal-result { padding: 12px; border-radius: 10px; background: var(--green-soft); color: var(--green); font-size: 11px; margin-top: 12px; }
.portal-document-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.portal-document-item:last-child { border: 0; }
.document-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-soft); color: #3c6fa6; }
.portal-document-item strong { display: block; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 330px; }
.portal-document-item small { color: var(--muted); font-size: 8px; }
.portal-footer { text-align: center; color: var(--muted); font-size: 9px; margin-top: 24px; }
.skeleton-line { height: 42px; background: linear-gradient(90deg, #edf1f2, #f8fafa, #edf1f2); background-size: 200% 100%; border-radius: 9px; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .closing-layout { grid-template-columns: 1fr; }
}

@media (max-width: 850px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 28px; }
  .mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 35px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(10,31,40,.44); z-index: 25; }
  .sidebar-backdrop.open { display: block; }
  .main-area { margin-left: 0; }
  .mobile-only { display: grid; }
  .topbar { padding: 0 16px; }
  .topbar-title { margin-right: auto; margin-left: 10px; }
  .content-wrap { padding: 22px 16px 40px; }
  .integration-grid { grid-template-columns: 1fr; }
  .recon-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .topbar-title span { display: none; }
  .period-control span { display: none; }
  .period-control input { min-width: 100px; }
  .page-heading { align-items: start; flex-direction: column; }
  .page-heading > .button, .page-heading > .button-group { width: 100%; }
  .page-heading .button-group .button { flex: 1; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { padding: 14px; }
  .metric-value { font-size: 24px; }
  .dashboard-stack { grid-template-columns: 1fr; }
  .summary-band { grid-template-columns: 1fr; }
  .summary-stat { text-align: left; }
  .toolbar-card { align-items: stretch; flex-direction: column; }
  .toolbar-card select { width: 100%; }
  .search-box { min-width: 0; }
  .workspace-selector { align-items: stretch; flex-direction: column; }
  .workspace-selector label { min-width: 0; width: 100%; }
  .workspace-selector .button { width: 100%; }
  .modal-body .form-grid { grid-template-columns: 1fr; }
  .modal-body .full { grid-column: auto; }
  .recon-grid { grid-template-columns: 1fr 1fr; }
  .exception-card { grid-template-columns: 1fr; }
  .exception-actions { justify-content: flex-end; }
  .topbar .icon-button:nth-of-type(2) { display: none; }
}
.firm-switcher > span:nth-child(2), .user-card > span:nth-child(2) { min-width: 0; }

/* Pilot tester release */
.login-helper { margin-top: 14px !important; text-align: center; font-size: 11px; }
.invite-email-box { background: var(--teal-soft); border: 1px solid #c9ebe3; border-radius: 11px; padding: 12px 14px; margin: 0 0 18px; display: grid; gap: 3px; }
.invite-email-box span { color: var(--muted); font-size: 10px; }
.invite-email-box strong { color: var(--teal-dark); font-size: 13px; word-break: break-word; }
.workspace-choice { border: 0; padding: 0; margin: 0 0 17px; display: grid; gap: 8px; }
.workspace-choice legend { font-size: 13px; font-weight: 800; color: var(--ink-2); margin-bottom: 8px; }
.choice-card { border: 1px solid var(--line); border-radius: 11px; padding: 12px !important; display: grid !important; grid-template-columns: auto 1fr; align-items: start; gap: 10px !important; margin: 0 !important; cursor: pointer; }
.choice-card:has(input:checked) { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(21,155,132,.08); background: #fbfefd; }
.choice-card input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--teal); }
.choice-card strong { display: block; font-size: 11px; }
.choice-card small { display: block; color: var(--muted); font-size: 9px; line-height: 1.45; margin-top: 3px; }
.activation-back { width: 100%; margin-top: 13px; border: 0; background: transparent; text-align: center; }

.pilot-safety-banner { margin-left: 0; background: #fff7da; border-bottom: 1px solid #f0df9c; color: #72570a; min-height: 39px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 18px; font-size: 10px; position: sticky; top: 70px; z-index: 19; }
.pilot-safety-banner strong { font-size: 9px; letter-spacing: .12em; }
.feedback-fab { position: fixed; right: 22px; bottom: 22px; z-index: 45; border: 0; border-radius: 999px; background: var(--navy); color: white; padding: 12px 17px; font-weight: 800; font-size: 11px; box-shadow: 0 12px 35px rgba(15,45,58,.25); }
.feedback-fab:hover { transform: translateY(-1px); }

.pilot-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-bottom: 16px; }
.pilot-admin-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 16px; align-items: start; }
.pilot-panel { background: white; border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.pilot-panel-header { padding: 17px 18px; border-bottom: 1px solid var(--line-2); }
.pilot-panel-header h2 { margin: 3px 0 0; font-size: 16px; }
.pilot-panel-body { padding: 0 18px 14px; }
.tester-card { padding: 14px 0; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.tester-card:last-child { border-bottom: 0; }
.tester-card strong { font-size: 11px; display: block; }
.tester-card small { font-size: 9px; color: var(--muted); display: block; margin-top: 3px; line-height: 1.45; }
.tester-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 7px; }
.tester-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.feedback-item { padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.feedback-item:last-child { border-bottom: 0; }
.feedback-item p { margin: 6px 0 0; color: var(--ink-2); font-size: 10px; line-height: 1.55; }
.feedback-stars { color: #b7790b; letter-spacing: 1px; font-size: 11px; }
.copy-link-box { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-top: 9px; }
.copy-link-box input { font-size: 9px; padding: 8px 9px; }
.rating-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rating-choice { border: 1px solid var(--line); border-radius: 9px; padding: 9px 3px; text-align: center; cursor: pointer; font-size: 11px; }
.rating-choice input { display: none; }
.rating-choice:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-dark); font-weight: 900; }

@media (max-width: 1100px) {
  .pilot-admin-grid { grid-template-columns: 1fr; }
  .pilot-summary-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 850px) {
  .pilot-safety-banner { top: 70px; font-size: 9px; text-align: center; flex-direction: column; gap: 2px; }
  .feedback-fab { right: 14px; bottom: 14px; }
}
@media (max-width: 620px) {
  .pilot-summary-grid { grid-template-columns: 1fr 1fr; }
  .tester-card { grid-template-columns: 1fr; }
  .tester-actions { justify-content: flex-start; }
}
.status-activated { background: var(--green-soft); color: var(--green); }
.status-disabled { background: var(--red-soft); color: var(--red); }
.status-expired, .status-pending { background: var(--amber-soft); color: var(--amber); }
.status-superseded { background: #eef2f3; color: var(--muted); }

/* 30-day trial launch */
.trial-price-note { background:#f5faf9; border:1px solid #d7ebe6; border-radius:11px; padding:11px 13px; margin:-2px 0 16px; display:grid; gap:3px; }
.trial-price-note strong { font-size:10px; color:var(--teal-dark); }
.trial-price-note span { font-size:9px; color:var(--muted); line-height:1.45; }
.trial-access-banner { background:#e9f7f3; border-bottom:1px solid #c7e8df; color:#145c52; min-height:44px; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:8px 24px; }
.trial-access-banner > div { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.trial-access-banner strong { font-size:11px; }
.trial-access-banner span { font-size:10px; opacity:.82; }
.trial-access-banner.expired { background:#fff0ef; border-color:#f2cfcb; color:#9f352e; }
.trial-access-banner.paid { background:#eff8ee; border-color:#d2e8d0; color:#356b35; }
.subscription-card { text-align:center; padding:4px 2px 2px; }
.subscription-price { font-size:38px; font-weight:900; letter-spacing:-.05em; color:var(--ink); margin:14px 0 8px; }
.subscription-price small { font-size:12px; font-weight:700; color:var(--muted); letter-spacing:0; }
.subscription-card p { color:var(--muted); font-size:11px; line-height:1.6; max-width:420px; margin:0 auto 14px; }
.subscription-card ul { text-align:left; margin:0 auto; max-width:360px; padding-left:18px; color:var(--ink-2); font-size:10px; line-height:1.8; }
@media (max-width:620px) { .trial-access-banner { align-items:flex-start; flex-direction:column; padding:10px 16px; gap:7px; } .trial-access-banner .button { width:100%; } }

/* Version 7: password recovery + Peru-first localization */
.period-control select {
  border: 0;
  padding: 0 18px 0 0;
  min-width: 118px;
  box-shadow: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.forgot-password-link { justify-self: end; margin: -8px 0 14px; padding: 0; }
.form-success { margin: 16px 0 0 !important; color: var(--teal-dark) !important; background: var(--teal-soft); border: 1px solid #c7e8df; border-radius: 10px; padding: 11px 12px; font-size: 11px; line-height: 1.5; }
.file-field { display: grid; gap: 8px; margin-bottom: 18px; }
.file-field > .field-label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.localized-file-picker { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; align-items: center; gap: 12px; background: #fff; min-height: 52px; }
.localized-file-picker input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.localized-file-button { border: 0; border-radius: 8px; padding: 9px 13px; background: var(--teal-soft); color: var(--teal-dark); font: inherit; font-weight: 800; cursor: pointer; white-space: nowrap; }
.localized-file-name { color: var(--muted); font-size: 11px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-field.file-drop { border: 2px dashed #b9cbd2; border-radius: 14px; padding: 22px 20px; text-align: center; }
.file-field.file-drop .localized-file-picker { text-align: left; }
.file-field.file-drop .help-text { display: block; margin-top: 10px; }
@media (max-width: 620px) {
  .period-control select { min-width: 102px; }
  .localized-file-picker { align-items: stretch; flex-direction: column; }
  .localized-file-button { text-align: center; }
}
