html, body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---- App shell ---------------------------------------------------------- */

.page {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 15rem;
    flex-shrink: 0;
    background: #1f2937;
    color: #e5e7eb;
}

.sidebar .nav-brand {
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.sidebar .nav-link {
    color: #cbd5e1;
    border-radius: .375rem;
    padding: .4rem .75rem;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

/* Zero-state count. Legible against the dark sidebar but deliberately quiet, so a non-zero
   warning badge is what draws the eye. */
.sidebar .nav-count-zero {
    background: rgba(255, 255, 255, .13);
    color: #cbd5e1;
    font-weight: 500;
}

main {
    flex: 1;
    min-width: 0;
}

.top-row {
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.content {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

/* ---- Chrome-free pages (sign-in, customer connect) ---------------------- */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    padding: 1.5rem;
}

.auth-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .75rem;
    padding: 2rem;
    width: 100%;
    max-width: 24rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

/* Wider variant for the customer-facing connect page, which carries explanatory copy. */
.auth-card--wide {
    max-width: 34rem;
}

/* ---- Per-firm branding on the customer-facing connect page --------------- */
/* --brand / --brand-accent are set inline from the firm's record, after being validated as literal
   hex. The fallbacks keep an unbranded firm looking deliberate rather than broken. */

.brand-header {
    border-bottom: 3px solid var(--brand, #1f2937);
    padding-bottom: .75rem;
}

.brand-logo {
    max-height: 3rem;
    max-width: 100%;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--brand, #1f2937);
}

.brand-btn {
    background: var(--brand, #1f2937);
    border-color: var(--brand, #1f2937);
    color: #fff;
}

.brand-btn:hover:not(:disabled),
.brand-btn:focus {
    background: var(--brand-accent, var(--brand, #111827));
    border-color: var(--brand-accent, var(--brand, #111827));
    color: #fff;
}

.brand-btn:disabled {
    opacity: .55;
}

/* The reassurance block on the connect page. Visually distinct from body copy because it answers
   the questions a customer actually has before granting bank access. */
.reassure {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    padding: 1rem 1.15rem;
}

.reassure-item {
    font-size: .9rem;
    color: #374151;
}

.reassure-item + .reassure-item {
    margin-top: .7rem;
}

/* Brand color swatch on the admin firms list. */
.color-chip {
    display: inline-block;
    width: .75rem;
    height: .75rem;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, .15);
    vertical-align: -1px;
    margin: 0 .25rem 0 .5rem;
}
