/* Codway Cloud: shared presentation tokens. Operational state and actions are unchanged. */
:root {
    color-scheme: light;
    --ink: #182338;
    --muted: #536278;
    --line: #dbe3ee;
    --paper: #f2f5fa;
    --white: #fff;
    --surface: #fff;
    --subtle: #f6f8fc;
    --input: #fff;
    --input-line: #a8b8cc;
    --green: #245ccc;
    --accent: #245ccc;
    --accent-soft: #e9f0ff;
    --accent-line: #b7cdf4;
    --nav: #0c172b;
    --mint: #dbeafe;
    --code: #eaf0f8;
    --success-bg: #e7f5ec;
    --success-ink: #196138;
    --success-line: #a9d9b9;
    --warning-bg: #fff4d8;
    --warning-ink: #79500a;
    --danger-bg: #fff0ed;
    --danger-ink: #9c2b25;
    --danger-line: #ecc1b9;
    --purple-bg: #eeeafa;
    --purple-ink: #6c4792;
    --shadow: 0 4px 18px #18233805;
}
html[data-theme="dark"] {
    color-scheme: dark;
    --ink: #eaf0f8;
    --muted: #acbcd0;
    --line: #2b3c54;
    --paper: #0b1220;
    --white: #111d30;
    --surface: #111d30;
    --subtle: #15243a;
    --input: #0e192b;
    --input-line: #4c607d;
    --green: #9dc0ff;
    --accent: #9dc0ff;
    --accent-soft: #203856;
    --accent-line: #426694;
    --code: #25364e;
    --success-bg: #193b2c;
    --success-ink: #a3e5bb;
    --success-line: #386d50;
    --warning-bg: #40331e;
    --warning-ink: #f4cf85;
    --danger-bg: #452725;
    --danger-ink: #ffb5ac;
    --danger-line: #835149;
    --purple-bg: #352b49;
    --purple-ink: #d8baff;
    --shadow: 0 4px 18px #00000012;
}
@media (prefers-color-scheme: dark) {
    html:not([data-theme]) {
        color-scheme: dark;
        --ink: #eaf0f8; --muted: #acbcd0; --line: #2b3c54; --paper: #0b1220;
        --white: #111d30; --surface: #111d30; --subtle: #15243a; --input: #0e192b; --input-line: #4c607d;
        --green: #9dc0ff; --accent: #9dc0ff; --accent-soft: #203856; --accent-line: #426694; --code: #25364e;
        --success-bg: #193b2c; --success-ink: #a3e5bb; --success-line: #386d50;
        --warning-bg: #40331e; --warning-ink: #f4cf85; --danger-bg: #452725; --danger-ink: #ffb5ac; --danger-line: #835149;
        --purple-bg: #352b49; --purple-ink: #d8baff; --shadow: 0 4px 18px #00000012;
    }
}
html { scrollbar-color: var(--input-line) var(--paper); }
body { font-size: 15px; line-height: 1.6; }
[hidden] { display: none !important; }
h1 { font-size: 40px; font-weight: 650; letter-spacing: -1.3px; }
h2 { font-weight: 650; }
p { overflow-wrap: anywhere; }
.eyebrow { color: var(--accent); font-size: 11px; letter-spacing: 1.6px; }
.muted, dt, td small, .field-help, .small-copy { color: var(--muted); }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
:where(input, select, textarea):focus { outline: 2px solid var(--accent-line); border-color: var(--accent); }
input, select, textarea { background: var(--input); border-color: var(--input-line); color: var(--ink); font-size: 14px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:disabled, select:disabled, textarea:disabled { background: var(--subtle); opacity: .7; cursor: not-allowed; }
label { font-size: 13px; line-height: 1.6; }
code, .mono { font: 12px/1.65 Consolas, 'Cascadia Code', monospace; overflow-wrap: anywhere; }
code { background: var(--code); padding: 2px 5px; border-radius: 4px; }
.button { min-height: 44px; font-size: 13px; gap: 12px; border-radius: 9px; }
.button.primary { background: #245bd0; border-color: #245bd0; color: #fff; }
.button.primary:hover { background: #194bb5; color: #fff; }
.button.secondary { background: var(--surface); border-color: var(--input-line); color: var(--ink); }
.button.secondary:hover { background: var(--subtle); }
button:disabled { cursor: not-allowed; }
.button:hover { transform: none; }
.text-link { font-size: 13px; color: var(--accent); }
.skip-link { position: fixed; z-index: 50; top: 12px; left: 12px; padding: 10px 18px; border-radius: 8px; background: var(--surface); color: var(--ink); transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Navigation keeps the official white artwork on Codway's dark blue. */
.sidebar { width: 248px; padding: 30px 18px 18px; border-right: 1px solid #25354d; overflow-y: auto; scrollbar-width: thin; }
.brand { margin: 0 12px; flex-shrink: 0; }
.brand > small { letter-spacing: 2.2px; color: #b2c3dc; }
.nav-caption { margin: 35px 14px 12px; font-size: 10px; color: #99acc7; }
.sidebar nav { gap: 5px; padding-bottom: 18px; }
.sidebar nav a { font-size: 13px; min-height: 44px; padding: 11px 13px; color: #c4d0e2; }
.sidebar nav a:hover { background: #1a2b46; }
.sidebar nav a.active { background: #234e8b; color: #fff; box-shadow: inset 3px 0 #8bbcff; }
.nav-icon { width: 20px; font-size: 19px; color: #90afd9; flex-shrink: 0; }
.sidebar nav a.active .nav-icon { color: #d4e6ff; }
.phase-label { padding: 16px 12px; color: #c4d0e2; font-size: 12px; }
.phase-label small { color: #99acc7; font-size: 11px; line-height: 1.6; }
.user-line { font-size: 12px; }
.user-line small, .signout { font-size: 11px; color: #afc0d9; }
.main-shell { margin-left: 248px; }
.topbar { min-height: 76px; height: auto; gap: 20px; padding: 16px 38px; background: var(--surface); font-size: 12px; }
.topbar strong { color: var(--ink); font-weight: 600; }
.breadcrumb { min-width: 0; overflow-wrap: anywhere; }
.slash { margin: 0 10px; color: var(--muted); }
.topbar-tools { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-shrink: 0; }
.top-tag { background: var(--subtle); border-color: var(--line); color: var(--muted); font-size: 11px; padding: 7px 12px; }
.theme-picker { display: inline-flex; align-items: center; gap: 4px; padding: 0 7px 0 12px; margin: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; color: var(--muted); }
.theme-picker select { width: auto; min-width: 100px; min-height: 42px; margin: 0; border: 0; padding: 8px 5px; background: transparent; font-size: 12px; cursor: pointer; }
.theme-picker:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-picker select:focus { outline: none; }
.access-theme { position: absolute; z-index: 2; right: 28px; top: 24px; }
.main-shell main { padding: 34px 38px 52px; }
.page-heading { margin-bottom: 28px; }
.page-heading.compact h1 { font-size: 36px; }
.page-heading .muted { font-size: 14px; margin-top: 12px; max-width: 85ch; }
.main-footer { padding: 20px 38px; font-size: 11px; color: var(--muted); gap: 16px; }

/* Consistent surfaces and readable administrative data in both themes. */
.panel, .stat-card, .wallet-metrics article, .finance-filters, .wallet-management { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.panel { border-radius: 14px; }
.panel-heading { padding: 23px 26px 20px; }
.panel-heading h2 { font-size: 20px; }
.panel-heading .eyebrow { color: var(--accent); font-size: 10px; }
.panel-heading > .muted { font-size: 12px; }
.stat-card.featured { background: var(--accent-soft); border-color: var(--accent-line); }
.stat-label { font-size: 12px; }
.stat-foot, .stat-foot span { font-size: 11px; color: var(--muted); }
.metric-icon { color: var(--muted); }
.client-row, .wallet-line, .tenant-bottom, dl > div, td { border-color: var(--line); }
.client-monogram, .empty-symbol { background: var(--subtle); color: var(--muted); border-color: var(--line); }
.client-info h3 { font-size: 14px; }
.client-info > span, .client-balance small, .tenant-heading .muted, .tenant-bottom a { font-size: 12px; color: var(--muted); }
.panel-note { color: var(--muted); background: var(--subtle); border-color: var(--line); font-size: 12px; }
.empty-state p, .account-panel > p:not(.eyebrow), .small-copy, .field-help, .form-explainer p, .form-explainer li p, .access-note { font-size: 12px !important; color: var(--muted); }
.empty-state .button { font-size: 12px; min-height: 42px; }
.account-panel .eyebrow, .form-explainer .eyebrow, .form-explainer li::marker { color: var(--muted); font-size: 11px; }
.form-explainer li, .form-explainer li strong { font-size: 13px; }
.tenant-heading h2 { font-size: 19px; }
.wallet-line, dl > div { font-size: 13px; }
.tenant-bottom a { color: var(--accent); }
.checkbox-row { background: var(--subtle); color: var(--ink); border: 1px solid var(--line); font-size: 13px; align-items: flex-start; }
.checkbox-row input { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; accent-color: #245bd0; }
.table-scroll { scrollbar-width: thin; }
table { font-size: 13px; line-height: 1.65; }
th { background: var(--subtle); color: var(--muted); font-size: 11px; font-weight: 650; padding: 14px 22px; letter-spacing: .35px; }
td { padding: 18px 22px; vertical-align: top; }
td small { font-size: 11px; }
tbody tr:hover { background: var(--subtle); }
td a:not(.button) { color: var(--accent); }
td .button { white-space: nowrap; }
.badge { font-size: 11px; font-weight: 600; padding: 5px 9px; background: var(--subtle); color: var(--muted); border: 1px solid transparent; }
.badge.online, .badge.accepted, .badge.paid, .badge.succeeded { background: var(--success-bg); color: var(--success-ink); }
.badge.pending, .badge.creating, .badge.uncertain, .badge.stale, .badge.neverseen, .badge.approved, .badge.leased, .badge.running, .badge.indeterminate, .wpp-page .badge.indeterminate { background: var(--warning-bg); color: var(--warning-ink); }
.badge.review, .badge.revoked, .badge.conflict, .badge.cancelled, .badge.expired, .badge.failed, .badge.rejected, .badge.failed_before_effect, .wpp-page .badge.failed, .wpp-page .badge.rejected { background: var(--danger-bg); color: var(--danger-ink); }
.badge.refunded, .badge.partial_refund { background: var(--purple-bg); color: var(--purple-ink); }
.notice { font-size: 13px; line-height: 1.75; }
.notice.success { background: var(--success-bg); border-color: var(--success-line); color: var(--success-ink); }
.notice.error { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger-ink); }
.notice .mono { background: var(--surface); border-color: var(--line); }
.login-form-zone { background: var(--paper); }
.login-form .eyebrow { color: var(--accent); font-size: 11px; }
.login-form label, .login-form > .muted { font-size: 13px; }
.login-form .button { min-height: 48px; }
.login-story > .brand { margin: 0; }

/* WPP evidence remains complete, with a comfortable line length and distinct sections. */
.wpp-page .main-shell main { max-width: 1260px; }
.wpp-panel { padding: 26px 28px; margin-bottom: 22px; }
.wpp-panel .panel-heading { padding: 0 0 16px; gap: 12px; }
.wpp-panel .panel-heading h2 { font-size: 22px; }
.wpp-panel > p, .wpp-panel .wpp-copy { font-size: 14px; line-height: 1.75; max-width: 90ch; }
.wpp-panel > p:not(:last-child) { margin-bottom: 18px; }
.wpp-panel > h3, .wpp-form > h3 { margin-top: 8px; font-size: 18px; }
.wpp-form { background: var(--subtle); border-color: var(--line); padding: 22px; }
.wpp-form label { font-size: 13px; }
.wpp-form select { font-size: 14px; max-width: 100%; }
.wpp-form .checkbox-row { background: var(--surface); font-size: 13px; }
.wpp-properties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; border-bottom: 0; margin: 0 0 20px; }
.wpp-properties > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); border-top: 0; }
.wpp-properties dt { font-size: 13px; }
.wpp-properties dd { max-width: none; min-width: 0; font-size: 13px; color: var(--ink); }
.wpp-status { background: var(--subtle); border-color: var(--line); border-left: 4px solid var(--accent); padding: 22px; }
.wpp-status .panel-heading h3 { font-size: 18px; }
.wpp-status .badge { white-space: normal; max-width: 100%; }
.wpp-status p { font-size: 13px; line-height: 1.8; }
.wpp-status h4 { font-size: 14px; }
.wpp-status code { font-size: 12px; color: var(--ink); background: var(--code); }
.wpp-status a, .wpp-panel > p a, .wpp-history a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.wpp-history { font-size: 13px; }
.wpp-history summary { min-height: 32px; }
.wpp-history ul { list-style: none; padding: 0; }
.wpp-history li { padding: 9px 0; border-top: 1px solid var(--line); }
.wpp-history li + li { margin: 0; }
.wpp-metadata { font-size: 12px; color: var(--muted); padding-top: 15px; border-top: 1px solid var(--line); }
.wpp-sessions li { background: var(--subtle); font-size: 13px; }

@media (max-width: 1150px) {
    .sidebar { width: 224px; padding: 26px 14px 18px; }
    .main-shell { margin-left: 224px; }
    .main-shell main { padding: 28px 26px 42px; }
    .topbar { padding: 14px 26px; }
    .top-tag { display: none; }
    .wpp-properties { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    .sidebar { position: static; width: auto; padding: 20px 18px 0; overflow: visible; }
    .sidebar .brand { margin: 0 4px; gap: 16px; }
    .sidebar nav { margin-top: 20px; padding-bottom: 14px; }
    .sidebar nav a, .mobile-nav button { min-height: 44px; font-size: 12px; padding: 11px 13px; }
    .main-shell { margin: 0; }
    .topbar { min-height: 66px; padding: 12px 18px; gap: 12px; font-size: 11px; flex-wrap: wrap; }
    .breadcrumb { flex: 1 1 150px; }
    .slash { margin: 0 5px; }
    .theme-picker { padding-left: 8px; }
    .theme-picker select { min-width: 83px; }
    .main-shell main { padding: 25px 16px 34px; }
    .page-heading.compact h1 { font-size: 30px; }
    .page-heading .muted { font-size: 13px; }
    .main-footer { padding: 18px; flex-wrap: wrap; font-size: 11px; }
    .stat-label, .stat-foot { font-size: 11px; }
    th, td { padding: 14px 16px; }
    .panel-heading h2 { font-size: 19px; }
    .wpp-panel { padding: 21px 18px; margin-bottom: 18px; }
    .wpp-panel .panel-heading h2 { font-size: 20px; }
    .wpp-form, .wpp-status { padding: 16px; }
    .wpp-properties > div { gap: 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
    .wpp-properties dd { max-width: none; }
    .wpp-status .panel-heading { align-items: flex-start; }
    .wpp-status .badge { font-size: 11px; }
    .wpp-history li { font-size: 12px; }
    .access-theme { position: static; display: flex; justify-content: flex-end; padding: 12px 18px; background: var(--nav); }
}
@media (prefers-reduced-motion: reduce) {
    .button, .skip-link { transition: none; }
}

/* Per-session observation, shared light/dark palette. */
.wpp-session-summary { margin: 0 0 18px; color: var(--muted); }
.wpp-session-summary strong { color: var(--ink); font-size: 22px; }
.wpp-session-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.wpp-session-card { border:1px solid var(--line); border-radius:12px; padding:20px; background:var(--subtle); min-width:0; }
.wpp-session-card header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.wpp-session-card h3 { font-size:18px; margin:4px 0 16px; }
.wpp-session-card .badge { white-space:normal; }
.wpp-session-card dl { margin:0; font-size:12px; }
.wpp-session-card dl>div { display:flex; justify-content:space-between; flex-wrap:wrap; gap:4px 16px; margin:8px 0; }
.wpp-session-card dd { margin:0; font-variant-numeric:tabular-nums; }
.wpp-session-notice { color:var(--warning-ink); background:var(--warning-bg); padding:12px; border-radius:8px; font-size:13px; margin:14px 0 0; }
.wpp-session-card .badge.warning { color:var(--warning-ink); background:var(--warning-bg); }
.wpp-refresh-failed .badge { color:var(--muted); background:var(--code); }
.wpp-policy-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.wpp-policy-fields label, .wpp-policy-fields small { display:block; }
.wpp-policy-fields small { margin-top:8px; color:var(--muted); }
@media(max-width:700px) { .wpp-policy-fields { grid-template-columns:1fr; } }
@media(max-width:900px) { .wpp-session-grid { grid-template-columns:1fr; } }
