/* Westeros Bank & Trust - Wealth Online (demo) */
:root {
  --navy: #0E2A47; --navy-2: #16395E; --gold: #C9A227; --gold-soft: #F6F1DF;
  --ink: #16202C; --muted: #5A6B80; --line: #E3E8EF; --bg: #F5F7FA; --card: #fff;
  --pos: #1F7A4D; --neg: #B4533C; --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 32, 52, .05), 0 4px 16px rgba(16, 32, 52, .05);
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
a { color: var(--navy-2); }
h1, h2 { margin: 0; }
h1 { font-family: var(--serif); font-size: 28px; color: var(--navy); font-weight: 700; }
h2 { font-size: 15px; font-weight: 600; color: var(--navy); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.r { text-align: right; } .c { text-align: center; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
[hidden] { display: none !important; }

.demo-ribbon { background: #FFF6D6; color: #6B5300; text-align: center; font-size: 12px; padding: 5px 12px; border-bottom: 1px solid #F0E2A8; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; padding: 10px 16px; font: 600 14px var(--sans); border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-outline { background: #fff; color: var(--navy); border-color: #C9D2DC; }
.btn-outline:hover { border-color: var(--navy); }
.btn-ghost { background: transparent; color: inherit; border-color: rgba(255, 255, 255, .25); }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.link-btn { background: none; border: 0; color: var(--navy-2); font: 500 13px var(--sans); cursor: pointer; text-decoration: underline; padding: 0; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 17px; letter-spacing: .2px; line-height: 1.1; }
.brand-sub { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; opacity: .75; }
.brand-lg .brand-name { font-size: 24px; }

/* ---------- login ---------- */
.login-page { background: var(--bg); min-height: 100vh; }
.login-wrap { display: grid; grid-template-columns: 1.1fr 1fr; min-height: calc(100vh - 29px); }
.login-hero { background: radial-gradient(1200px 600px at 10% 110%, rgba(201, 162, 39, .28), transparent 60%), linear-gradient(160deg, #0E2A47 0%, #12345A 55%, #0B2038 100%); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-hero::after { content: ''; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border: 1px solid rgba(201, 162, 39, .25); border-radius: 50%; }
.hero-copy h1 { color: #fff; font-size: 44px; line-height: 1.1; margin-bottom: 16px; max-width: 12ch; }
.hero-copy p { font-size: 16px; color: rgba(255, 255, 255, .82); max-width: 44ch; }
.hero-points { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.hero-points li { padding-left: 26px; position: relative; color: rgba(255, 255, 255, .9); }
.hero-points li::before { content: ''; position: absolute; left: 0; top: 6px; width: 12px; height: 12px; border-radius: 3px; background: var(--gold); }
.hero-foot { font-size: 12px; color: rgba(255, 255, 255, .55); }
.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); }
.login-card h2 { font-family: var(--serif); font-size: 24px; margin-bottom: 4px; }
.login-card .muted { margin: 0 0 20px; }
.login-card label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; }
.login-card input[type=text], .login-card input:not([type]), .login-card input[type=password] { width: 100%; padding: 11px 12px; border: 1px solid #C9D2DC; border-radius: 8px; font: 15px var(--sans); }
.login-card input:focus { outline: 2px solid rgba(201, 162, 39, .55); outline-offset: 1px; border-color: var(--gold); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px !important; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--navy-2); font: 600 12px var(--sans); cursor: pointer; padding: 6px 8px; }
.login-row { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 20px; font-size: 13px; gap: 8px; flex-wrap: wrap; }
.login-card label.check { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.secure-note { display: flex; gap: 8px; align-items: center; margin-top: 16px; font-size: 12px; color: var(--muted); }
.login-help { color: var(--muted); font-size: 13px; margin-top: 16px; }
.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 4px; }
.alert-error { background: #FBEDEA; color: #8A2E1C; border: 1px solid #F2CFC6; }
.alert-ok { background: #EAF5EF; color: #1F5E3D; border: 1px solid #CBE6D6; }

/* ---------- app shell ---------- */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; border-bottom: 3px solid var(--gold); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 32px; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs a { color: rgba(255, 255, 255, .78); text-decoration: none; padding: 8px 14px; border-radius: 8px; font-weight: 500; }
.tabs a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.tabs a.active { color: #fff; background: rgba(255, 255, 255, .14); box-shadow: inset 0 -2px 0 var(--gold); }
.user { display: flex; align-items: center; gap: 10px; }
.user-meta { line-height: 1.2; font-weight: 600; }
.user-meta .muted { color: rgba(255, 255, 255, .65); font-weight: 400; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; background: var(--navy); color: #fff; }
.container { max-width: 1280px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 8px 0 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.acct-chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.acct-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pos); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; }
.grid .card { margin-bottom: 0; }
.grid + .grid, .grid + .card { margin-top: 20px; }
.g-2-1 { grid-template-columns: 2fr 1fr; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi:first-child { background: linear-gradient(150deg, var(--navy), var(--navy-2)); color: #fff; border: 0; }
.kpi:first-child .kpi-label, .kpi:first-child .kpi-sub { color: rgba(255, 255, 255, .75); }
.kpi:first-child .kpi-sub .pos { color: #9BE0BB; } .kpi:first-child .kpi-sub .neg { color: #F5B5A6; }
.kpi-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.kpi-value { font-size: 28px; font-weight: 700; margin: 6px 0 2px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 13px; color: var(--muted); }

.chart-box { position: relative; height: 340px; }
.advisor-card .chart-box, .card .chart-donut { height: 190px; }
.chart-donut { height: 190px; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 8px; vertical-align: -1px; }
td .sw { margin-left: 0; }
.sw-navy { background: var(--navy); } .sw-gold { background: var(--gold); } .sw-grey { background: #C9D2DC; }

table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.mini { margin-top: 14px; font-size: 13px; }
table.mini th { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; padding: 4px 0; }
table.mini td { padding: 5px 0; border-top: 1px solid var(--line); }
.table-scroll { overflow-x: auto; }
table.data th { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; text-align: left; padding: 10px 12px; background: #F7F9FB; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th.r { text-align: right; } table.data th.c { text-align: center; }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; transition: background .12s; }
tr.clickable:hover, tr.clickable:focus { background: var(--gold-soft); outline: none; }
tr.clickable:focus-visible { box-shadow: inset 3px 0 0 var(--gold); }
.doc-link { display: inline-flex; align-items: center; gap: 4px; color: var(--navy-2); font-weight: 600; }
tr.clickable:hover .doc-link { text-decoration: underline; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-weight: 600; font-size: 12px; background: #EEF1F5; }
.pill.pos { background: #E6F3EC; } .pill.neg { background: #FBEDEA; }
.table-hint { margin: -6px 0 10px; }

.box-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); background: #F2F6FB; border: 1px solid #DCE6F2; padding: 5px 10px; border-radius: 999px; }
.box-logo { background: #0061D5; color: #fff; font-weight: 700; font-size: 11px; padding: 1px 6px; border-radius: 4px; letter-spacing: .3px; }

.advisor-card blockquote { margin: 14px 0 6px; padding: 12px 14px; background: var(--gold-soft); border-left: 3px solid var(--gold); border-radius: 6px; font-size: 14px; }
.advisor { display: flex; gap: 12px; align-items: center; }
.adv-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ---------- statements ---------- */
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg-btn { border: 0; background: none; padding: 7px 14px; border-radius: 8px; font: 500 13px var(--sans); color: var(--muted); cursor: pointer; }
.seg-btn.active { background: var(--navy); color: #fff; }
.source-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.sec-panel { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 10px; padding: 14px 18px; margin-bottom: 16px; }
.sec-panel dl { display: grid; grid-template-columns: 220px 1fr; gap: 6px 16px; margin: 0; font-size: 13px; }
.sec-panel dt { color: var(--muted); font-weight: 600; }
.sec-panel dd { margin: 0; overflow-wrap: anywhere; }
.st-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.st-list { padding: 10px; max-height: 760px; overflow: auto; margin: 0; }
.st-year { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; padding: 10px 10px 6px; }
.st-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 10px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--navy); }
.st-item:hover { background: #F2F5F9; }
.st-item.active { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold); }
.st-main { display: flex; flex-direction: column; flex: 1; line-height: 1.3; color: var(--ink); }
.st-viewer { margin: 0; padding: 0; overflow: hidden; }
.viewer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.viewer-actions { display: flex; gap: 8px; }
.preview-host { height: 720px; position: relative; background: #EEF1F5; }
.preview-host .be { height: 100%; }
.explorer-host { height: 640px; }
.explorer-host .be { height: 100%; }
.pdf-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.note { position: absolute; top: 0; left: 0; right: 0; background: #FFF6D6; color: #6B5300; font-size: 12px; padding: 6px 12px; z-index: 1; }
.note + .pdf-frame { padding-top: 28px; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(9, 20, 34, .55); z-index: 50; display: grid; place-items: center; padding: 24px; }
.modal-card { background: #fff; border-radius: 14px; width: min(1100px, 100%); height: min(90vh, 900px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.modal-card .preview-host { flex: 1; height: auto; }

.footer { border-top: 1px solid var(--line); background: #fff; margin-top: 24px; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--muted); flex-wrap: wrap; padding-top: 16px; padding-bottom: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .g-2-1 { grid-template-columns: 1fr; }
  .st-layout { grid-template-columns: 1fr; }
  .st-list { max-height: 280px; }
}
@media (max-width: 820px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { padding: 28px 20px; gap: 20px; }
  .hero-copy h1 { font-size: 30px; }
  .hero-points, .hero-foot { display: none; }
  .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .tabs { order: 3; flex-basis: 100%; }
  .user-meta { display: none; }
  .container { padding: 16px; }
  .preview-host { height: 70vh; }
  .sec-panel dl { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr; }
  .kpi-value { font-size: 24px; }
  h1 { font-size: 24px; }
  .brand-name { font-size: 15px; }
  .modal { padding: 0; }
  .modal-card { height: 100vh; border-radius: 0; }
}
