﻿/* ============================================================
   ARC Pin Program CSR Tool - site.css
   Design: Clean internal tool. ARC red (#B22222) as the single
   accent. Neutral off-whites and warm grays. Inter for UI,
   system monospace for IDs and codes.
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --red: #E21224;
    --red-dark: #b30e1c;
    --red-light: #F9ECEC;
    --white: #FFFFFF;
    --bg: #F5F4F1;
    --surface: #FFFFFF;
    --border: #E2DDD6;
    --border-dark: #C8C2B8;
    --text: #1A1A1A;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;
    --blue: #1D4ED8;
    --blue-light: #EFF6FF;
    --green: #15803D;
    --green-light: #F0FDF4;
    --amber: #B45309;
    --amber-light: #FFFBEB;
    --gray-light: #F3F4F6;
    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow: 0 2px 8px rgba(0,0,0,.10);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Consolas', 'SF Mono', monospace;
    --nav-h: 56px;
}

html {
    font-size: 14px;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--red);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

img, svg {
    display: block;
}

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 1.5rem;
}

h2 {
    font-size: 1.2rem;
}

h3 {
    font-size: 1rem;
}

/* ── Layout ───────────────────────────────────────────────── */
.site-main {
    min-height: calc(100vh - var(--nav-h) - 40px);
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    padding: 12px 24px;
    font-size: .8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* ── Header / Nav ─────────────────────────────────────────── */
.site-header {
    background: var(--red);
    height: var(--nav-h);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-logo {
    height: 58px;
    flex-shrink: 0;
}

.header-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.header-sub {
    font-weight: 400;
    opacity: .8;
    font-size: .85rem;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.nav-link {
    color: rgba(255,255,255,.85);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 500;
    transition: background .15s, color .15s;
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

    .nav-link:hover, .nav-link.active {
        background: rgba(255,255,255,.15);
        color: #fff;
        text-decoration: none;
    }

.caret {
    font-size: .65rem;
    opacity: .7;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 4px;
    z-index: 200;
}

/* The user menu sits at the header's far-right edge, unlike the
   left-aligned Reports dropdown - left:0 there would push this one
   off the right side of the viewport. */
.nav-dropdown-menu-right {
    left: auto;
    right: 0;
}

.nav-dropdown-menu.open {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 8px 12px;
    color: var(--text);
    font-size: .875rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
}

    .nav-dropdown-menu a:hover {
        background: var(--bg);
    }

.nav-dropdown-menu-item-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    color: var(--text);
    font-size: .875rem;
    font-family: var(--font);
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    cursor: pointer;
}

    .nav-dropdown-menu-item-btn:hover {
        background: var(--bg);
    }

.menu-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-left: auto;
}

.header-username {
    color: rgba(255,255,255,.9);
    font-size: .8rem;
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    padding: 4px 6px;
    border-radius: var(--radius-sm);
}

    .header-username:hover {
        background: rgba(255,255,255,.1);
    }

    .header-username .caret {
        color: rgba(255,255,255,.7);
    }

.user-icon {
    width: 16px;
    height: 16px;
    opacity: .8;
}

.btn-logout {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    cursor: pointer;
    font-family: var(--font);
    transition: background .15s;
}

    .btn-logout:hover {
        background: rgba(255,255,255,.25);
    }

.session-warning {
    background: #FEF3C7;
    border-bottom: 1px solid #F59E0B;
    color: #92400E;
    padding: 8px 24px;
    font-size: .8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-extend {
    margin-left: auto;
    background: #F59E0B;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: .8rem;
    font-family: var(--font);
}

/* ── Flash messages ───────────────────────────────────────── */
.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    font-size: .875rem;
    font-weight: 500;
}

    .flash svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

.flash-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    opacity: .6;
}

    .flash-close:hover {
        opacity: 1;
    }

.flash-success {
    background: var(--green-light);
    color: var(--green);
    border-bottom: 1px solid #BBF7D0;
}

.flash-error {
    background: #FEF2F2;
    color: #991B1B;
    border-bottom: 1px solid #FECACA;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .15s, border-color .15s, box-shadow .15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

    .btn-primary:hover {
        background: var(--red-dark);
        border-color: var(--red-dark);
        text-decoration: none;
        color: #fff;
    }

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border-dark);
}

    .btn-ghost:hover {
        background: var(--bg);
        text-decoration: none;
    }

.btn-link-inline {
    background: none;
    border: none;
    padding: 0;
    margin-left: 6px;
    color: var(--red);
    font-size: .8rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

    .btn-link-inline:hover {
        color: var(--red-dark);
    }

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 5px 10px;
    font-size: .8rem;
}

/* ── Forms ────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}

.form-group-half {
    width: 50%;
}

.form-group-grow {
    flex: 1;
}

.form-group-state {
    width: 72px;
}

.form-group-zip {
    width: 100px;
}

.form-group-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* form-group's own margin-bottom (for normal stacked fields) doesn't
   belong here - form-group-inline is specifically for fields sitting
   inline in a horizontal row (like Reports.aspx's filter bar), where
   that extra margin would throw off vertical centering against
   neighboring buttons with no margin of their own. */
.form-group.form-group-inline {
    margin-bottom: 0;
}

.form-group-inline .form-label {
    margin-bottom: 0;
}

.form-row {
    display: flex;
    gap: 12px;
}

/* Opt-in only - .form-row's default (stretch) already makes every
   form-group the same height, but a shorter label still sits at the
   top of that space while a longer, wrapped label pushes its input
   down further. Adding this class makes each form-group a flex column
   with its label pinned to the bottom of that shared height instead,
   so every input in the row starts at the same position regardless of
   how many lines its own label wraps to. */
.form-row-bottom-align > .form-group {
    display: flex;
    flex-direction: column;
}

    .form-row-bottom-align > .form-group > .form-label {
        margin-top: auto;
    }

.form-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 6px;
}

.form-label-link {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-size: .8rem;
}

.form-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    font-size: .875rem;
    font-family: var(--font);
    color: var(--text);
    background: var(--white);
    transition: border-color .15s, box-shadow .15s;
    display: block;
}

    .form-input:focus {
        outline: none;
        border-color: var(--red);
        box-shadow: 0 0 0 3px rgba(178,34,34,.12);
    }

.form-input-code {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    letter-spacing: .2em;
    text-align: center;
    padding: 12px;
}

.form-input-date {
    width: auto;
    height: 39px;
    padding: 0 12px;
}

.field-error {
    color: #DC2626;
    font-size: .78rem;
    margin-top: 4px;
    display: block;
}

.field-hint {
    color: var(--text-muted);
    font-size: .78rem;
    margin-top: 4px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check-label {
    font-size: .875rem;
    font-weight: 400;
    color: var(--text);
    cursor: pointer;
}

.input-reveal {
    position: relative;
}

    .input-reveal .form-input {
        padding-right: 40px;
    }

.btn-reveal {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
}

    .btn-reveal:hover {
        color: var(--text);
    }

.icon-eye {
    width: 18px;
    height: 18px;
}

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: .875rem;
    margin-bottom: 16px;
    display: block;
}

.alert-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-warn {
    background: var(--amber-light);
    color: var(--amber);
    border: 1px solid #FDE68A;
}

.alert-info {
    background: var(--blue-light);
    color: var(--blue);
    border: 1px solid #BFDBFE;
}

.alert-success {
    background: var(--green-light);
    color: var(--green);
    border: 1px solid #BBF7D0;
}

.msg-success {
    background: var(--green-light);
    color: var(--green);
    border: 1px solid #BBF7D0;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.badge-blue {
    background: var(--blue-light);
    color: var(--blue);
}

.badge-green {
    background: var(--green-light);
    color: var(--green);
}

.badge-amber {
    background: var(--amber-light);
    color: var(--amber);
}

.badge-red {
    background: #FEF2F2;
    color: #991B1B;
}

.badge-gray {
    background: var(--gray-light);
    color: var(--text-muted);
}

.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 99px;
    font-size: .7rem;
    font-weight: 600;
}

.upload-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 99px;
    font-size: .7rem;
    font-weight: 600;
    margin-left: 6px;
    background: #EFF6FF;
    color: #1D4ED8;
}

.role-source4admin {
    background: #F5F3FF;
    color: #6D28D9;
}

.role-admin {
    background: var(--red-light);
    color: var(--red);
}

.role-standarduser {
    background: var(--gray-light);
    color: var(--text-muted);
}

.role-source4user {
    background: #ECFDF5;
    color: #047857;
}

/* ── Auth pages ───────────────────────────────────────────── */
.auth-body {
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-card-wide {
    max-width: 680px;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
}

.auth-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}

.auth-sub {
    color: var(--text-muted);
    font-size: .85rem;
    margin-top: 4px;
}

.auth-back {
    text-align: center;
    margin-top: 20px;
    font-size: .85rem;
    color: var(--text-muted);
}

.auth-disclaimer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: .75rem;
    color: var(--text-light);
    text-align: center;
}

.mfa-setup-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.setup-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-title {
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.step-body {
    font-size: .875rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.step-note {
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: 10px;
}

.qr-wrapper {
    display: flex;
    justify-content: center;
    padding: 12px 0;
}

.qr-code {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
}

.secret-key {
    font-family: var(--font-mono);
    background: var(--bg);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    letter-spacing: .1em;
    word-break: break-all;
}

/* ── Dashboard ────────────────────────────────────────────── */
.page-header {
    margin-bottom: 24px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
}

.page-sub {
    color: var(--text-muted);
    font-size: .875rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .stat-icon svg {
        width: 22px;
        height: 22px;
    }

.stat-icon-blue {
    background: var(--blue-light);
    color: var(--blue);
}

.stat-icon-green {
    background: var(--green-light);
    color: var(--green);
}

.stat-icon-amber {
    background: var(--amber-light);
    color: var(--amber);
}

.stat-icon-red {
    background: var(--red-light);
    color: var(--red);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.dash-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}

    .action-btn:hover {
        background: var(--red-light);
        border-color: var(--red);
        color: var(--red);
        text-decoration: none;
    }

    .action-btn svg {
        width: 18px;
        height: 18px;
        opacity: .6;
        flex-shrink: 0;
    }

.activity-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.activity-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: .8rem;
}

    .activity-item:last-child {
        border-bottom: none;
    }

.activity-event {
    font-family: var(--font-mono);
    font-size: .7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.activity-desc {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-time {
    color: var(--text-light);
    white-space: nowrap;
}

.empty-state {
    color: var(--text-muted);
    font-size: .875rem;
    padding: 12px 0;
}

/* ── Donor Lookup ─────────────────────────────────────────── */
.lookup-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 16px;
    height: calc(100vh - var(--nav-h) - 80px);
}

.lookup-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

.search-bar-wrap {
    flex-shrink: 0;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 36px 10px 40px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    font-size: .9rem;
    font-family: var(--font);
    background: var(--white);
    transition: border-color .15s, box-shadow .15s;
}

    .search-input:focus {
        outline: none;
        border-color: var(--red);
        box-shadow: 0 0 0 3px rgba(178,34,34,.12);
    }

.search-clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.search-meta {
    font-size: .75rem;
    color: var(--text-muted);
    padding: 4px 2px 0;
    min-height: 18px;
}

.search-results {
    flex: 1;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.search-empty, .search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    color: var(--text-muted);
    font-size: .875rem;
    text-align: center;
}

.empty-icon {
    width: 48px;
    height: 48px;
    color: var(--border-dark);
}

.results-list {
    list-style: none;
}

.result-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .1s;
}

    .result-item:last-child {
        border-bottom: none;
    }

    .result-item:hover {
        background: var(--bg);
    }

    .result-item.active {
        background: var(--red-light);
        border-left: 3px solid var(--red);
    }

.result-name {
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: 3px;
}

.result-meta {
    font-size: .78rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.result-badges {
    display: flex;
    gap: 4px;
}

.lookup-right {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-y: auto;
    padding: 24px;
}

.detail-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px;
    color: var(--text-muted);
}

.detail-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.detail-name-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.detail-name {
    font-size: 1.3rem;
    font-weight: 700;
}

.detail-id {
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 99px;
}

.detail-meta-row {
    display: flex;
    gap: 6px;
}

.meta-chip {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 2px 8px;
    font-size: .75rem;
    color: var(--text-muted);
}

.meta-chip-purl {
    font-family: var(--font-mono);
}

.detail-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

    .detail-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

.detail-section-sm {
    margin-bottom: 12px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-title {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.field-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-light);
    font-weight: 600;
}

.field-val {
    font-size: .875rem;
    color: var(--text);
}

.pin-record {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 8px;
}

    .pin-record:last-child {
        margin-bottom: 0;
    }

.pin-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.pin-tier {
    font-weight: 700;
    font-size: .95rem;
}

.pin-type {
    font-size: .75rem;
    color: var(--text-muted);
    margin-left: auto;
}

.pin-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: .78rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.pin-status-eligible {
    border-left: 3px solid var(--blue);
}

.pin-status-requested {
    border-left: 3px solid var(--amber);
}

.pin-status-mailed {
    border-left: 3px solid var(--green);
}

.pin-status-cancelled {
    border-left: 3px solid var(--border-dark);
}

.card-record {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 8px;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.card-date {
    font-size: .78rem;
    color: var(--text-muted);
}

/* ── Modals ───────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 24px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
}

.modal-box {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-box-sm {
    max-width: 380px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
}

    .modal-close:hover {
        color: var(--text);
    }

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.modal-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 10px;
}

.confirm-summary {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 16px;
    font-size: .875rem;
}

/* ── Toast ────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-width: 360px;
}

.toast-success {
    background: var(--green);
}

.toast-error {
    background: #DC2626;
}

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

    /* Round only the outer corner cells directly - avoids overflow:hidden
   on .table-wrap, which would otherwise clip the action dropdown menu. */
    .data-table thead tr:first-child th:first-child {
        border-top-left-radius: var(--radius-lg);
    }

    .data-table thead tr:first-child th:last-child {
        border-top-right-radius: var(--radius-lg);
    }

    .data-table tbody tr:last-child td:first-child {
        border-bottom-left-radius: var(--radius-lg);
    }

    .data-table tbody tr:last-child td:last-child {
        border-bottom-right-radius: var(--radius-lg);
    }

    .data-table th {
        background: var(--bg);
        padding: 10px 16px;
        text-align: left;
        font-size: .72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .06em;
        color: var(--text-muted);
        border-bottom: 1px solid var(--border);
        white-space: nowrap;
    }

    .data-table td {
        padding: 10px 16px;
        border-bottom: 1px solid var(--border);
        vertical-align: middle;
    }

    .data-table tr:last-child td {
        border-bottom: none;
    }

    .data-table tr:hover td {
        background: var(--bg);
    }

.row-inactive {
    opacity: .5;
}

.empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 32px;
}

.actions-cell {
    white-space: nowrap;
}

.action-menu {
    position: relative;
    display: inline-block;
}

.action-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
}

    .action-toggle:hover {
        background: var(--bg);
    }

.action-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    padding: 4px;
    z-index: 200;
}

    .action-dropdown.open {
        display: block;
    }

.action-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    text-align: left;
    background: none;
    border: none;
    font-family: var(--font);
    font-size: .875rem;
    color: var(--text);
    cursor: pointer;
    border-radius: var(--radius-sm);
    text-decoration: none;
}

    .action-item:hover {
        background: var(--bg);
        text-decoration: none;
    }

.action-danger {
    color: #DC2626;
}

    .action-danger:hover {
        background: #FEF2F2;
    }

/* ── Reports ──────────────────────────────────────────────── */
.report-filters {
    margin-bottom: 20px;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.report-meta {
    margin-top: 12px;
    font-size: .8rem;
    color: var(--text-muted);
}

.report-table {
    font-size: .8rem;
}

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 99px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted);
    }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .lookup-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .lookup-right {
        min-height: 400px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .site-main {
        padding: 12px;
    }

    .auth-card {
        padding: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .header-nav {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
