/* ==========================================================================
   InspectMatch. Light theme stylesheet
   Mobile-first. System fonts. Subtle blue/green accents.
   ========================================================================== */

:root {
    --bg:        #ffffff;
    --surface:   #f7f8fa;
    --surface-2: #eef0f4;
    --border:    #e5e7eb;
    --border-2:  #d1d5db;

    --text:      #111827;
    --text-2:    #374151;
    --muted:     #6b7280;
    --muted-2:   #9ca3af;

    --primary:        #2563eb;
    --primary-hover:  #1d4ed8;
    --primary-soft:   #eff6ff;
    --accent:         #10b981;
    --accent-hover:   #059669;
    --accent-soft:    #ecfdf5;

    --warn:    #f59e0b;
    --warn-soft: #fffbeb;
    --danger:  #ef4444;
    --danger-soft: #fef2f2;
    --success: #10b981;
    --success-soft: #ecfdf5;

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 2px rgba(17, 24, 39, .04), 0 1px 1px rgba(17, 24, 39, .03);
    --shadow:    0 1px 3px rgba(17, 24, 39, .06), 0 4px 12px rgba(17, 24, 39, .04);
    --shadow-lg: 0 4px 16px rgba(17, 24, 39, .08), 0 12px 32px rgba(17, 24, 39, .06);

    --container: 1100px;
    --container-narrow: 720px;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
                 Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* -------------------------------------------------------------------------
   Reset
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color .15s ease;
}
a:hover { color: var(--primary-hover); text-decoration: underline; }

h1, h2, h3, h4 {
    line-height: 1.25;
    margin: 0 0 .75rem;
    color: var(--text);
    font-weight: 650;
    letter-spacing: -0.01em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

p { margin: 0 0 1rem; }

code, pre {
    font-family: var(--font-mono);
    font-size: .9em;
    background: var(--surface);
    padding: .15rem .4rem;
    border-radius: 4px;
}

/* -------------------------------------------------------------------------
   Layout
   ------------------------------------------------------------------------- */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1rem;
}
.container.narrow,
.section.narrow > .container,
section.section.narrow {
    max-width: var(--container-narrow);
}
.section { padding: 2.5rem 0; }
.section-alt { background: var(--surface); }
.text-center { text-align: center; }
.align-center { align-items: center; }
.center { justify-content: center; }
.inline { display: inline-block; }
.mt-xl { margin-top: 2rem; }
.m-0 { margin: 0; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }

.page-header {
    margin-bottom: 1.75rem;
}
.page-header h1 { margin-bottom: .25rem; }
.lede { font-size: 1.1rem; color: var(--text-2); }

.site-main { min-height: 60vh; }

/* -------------------------------------------------------------------------
   Header / Nav
   ------------------------------------------------------------------------- */
.site-header {
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    gap: 1rem;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.nav-links a {
    color: var(--text-2);
    text-decoration: none;
    font-size: .95rem;
    padding: .25rem 0;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--primary); }
.nav-user .small { white-space: nowrap; }
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .5rem .6rem;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    margin: 3px 0;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .nav-toggle { display: inline-block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: .5rem 1rem 1rem;
        box-shadow: var(--shadow);
    }
    .nav-links.open { display: flex; }
    .nav-links a, .nav-links form, .nav-links span {
        padding: .65rem 0;
        border-bottom: 1px solid var(--border);
    }
    .nav-links form, .nav-links span { border-bottom: 0; }
}

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */
.hero {
    background: linear-gradient(180deg, #fff 0%, var(--primary-soft) 100%);
    padding: 3rem 0 4rem;
    border-bottom: 1px solid var(--border);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 2.5rem;
    align-items: center;
}
@media (max-width: 880px) {
    .hero-grid { grid-template-columns: 1fr; }
}
.hero h1 { font-size: clamp(1.85rem, 4vw, 2.75rem); margin-bottom: .75rem; }
.hero .lede { font-size: 1.15rem; max-width: 540px; }
.hero-illustration {
    background: #fff;
    box-shadow: var(--shadow-lg);
}
.rec-stub h3 { margin-top: .5rem; }
.cta-row {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin: 1.25rem 0;
}
.cta-row.center { justify-content: center; }
.trust-strip {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: .9rem;
    flex-wrap: wrap;
}
.trust-strip li::before { content: "✓"; color: var(--accent); margin-right: .35rem; font-weight: 700; }

.section-title { text-align: center; margin-bottom: 2rem; }

/* -------------------------------------------------------------------------
   Cards & grids
   ------------------------------------------------------------------------- */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.card h3 { margin-top: 0; }
.highlight-card {
    background: linear-gradient(180deg, var(--primary-soft), #fff);
    border-color: #c9def7;
}
.warn-card {
    background: var(--warn-soft);
    border-color: #fde68a;
}

.grid-2, .grid-3, .grid-4 {
    display: grid;
    gap: 1.25rem;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.small-grid { gap: 1rem; }
.grid-span-2 { grid-column: span 2; }

@media (max-width: 880px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .grid-span-2 { grid-column: span 1; }
}

.step-card .step-num {
    display: inline-flex;
    width: 32px; height: 32px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: .5rem;
}

.check-list { list-style: none; padding: 0; margin: .5rem 0 1rem; }
.check-list li {
    padding: .35rem 0 .35rem 1.5rem;
    position: relative;
}
.check-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}
.ordered { padding-left: 1.25rem; margin: 0 0 1rem; }
.ordered li { padding: .25rem 0; }

.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.link-list li:last-child { border-bottom: 0; }

/* -------------------------------------------------------------------------
   Stats & key-value lists
   ------------------------------------------------------------------------- */
.stat {
    text-align: left;
    padding: 1rem 1.25rem;
}
.stat-label {
    display: block;
    color: var(--muted);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .35rem;
}
.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.kv-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .35rem 1rem;
    margin: .5rem 0;
}
.kv-list dt { color: var(--muted); font-weight: 500; }
.kv-list dd { margin: 0; }

.kv-stat {
    list-style: none;
    padding: 0;
    margin: 0;
}
.kv-stat li {
    display: flex;
    justify-content: space-between;
    padding: .4rem 0;
    border-bottom: 1px dashed var(--border);
}
.kv-stat li:last-child { border-bottom: 0; }

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .6rem 1.1rem;
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    font-size: .95rem;
    font-weight: 550;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, transform .05s;
    line-height: 1.2;
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-secondary {
    background: #fff;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-secondary:hover { background: var(--primary-soft); color: var(--primary); }
.btn-ghost {
    background: transparent;
    color: var(--text-2);
    border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }
.btn-danger-ghost {
    color: var(--danger);
    border-color: var(--border);
}
.btn-danger-ghost:hover { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* -------------------------------------------------------------------------
   Forms
   ------------------------------------------------------------------------- */
.form-card { padding: 2rem; }
.form h3 {
    margin: 1.5rem 0 .75rem;
    padding-bottom: .35rem;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: .04em;
}
.form h3:first-of-type { margin-top: 0; }
.field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: 1rem;
}
.field label {
    font-size: .9rem;
    font-weight: 550;
    color: var(--text-2);
}
.field small { color: var(--muted); }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="url"], input[type="number"], input[type="date"], input[type="time"],
input[type="search"], input[type="file"], textarea, select {
    width: 100%;
    padding: .6rem .75rem;
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
input.required-empty { border-color: var(--danger); }

textarea { resize: vertical; min-height: 80px; }

.form-actions {
    display: flex;
    gap: .75rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}
.checkbox-inline {
    display: inline-flex !important;
    align-items: center;
    gap: .4rem;
    font-weight: 500 !important;
    margin-top: 1.5rem;
}

.role-fieldset {
    border: 0;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.role-fieldset legend {
    font-size: .9rem;
    font-weight: 550;
    color: var(--text-2);
    margin-bottom: .35rem;
    padding: 0;
}
.role-fieldset {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}
.role-fieldset legend { width: 100%; }

/* Pill-style radios / checkboxes (for questionnaire) */
.option-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}
.radio-pill, .check-pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .9rem;
    border: 1px solid var(--border-2);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
    font-size: .95rem;
}
.radio-pill:hover, .check-pill:hover {
    background: var(--surface);
}
.radio-pill input, .check-pill input {
    accent-color: var(--primary);
    margin: 0;
    width: auto;
}
.radio-pill:has(input:checked), .check-pill:has(input:checked) {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}

.filter-bar { padding: 1rem 1.25rem; margin-bottom: 1rem; }

/* Questionnaire layout */
.questionnaire .question {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}
.questionnaire .question:first-of-type { padding-top: 0; }
.questionnaire .question:last-of-type { border-bottom: 0; }
.questionnaire .question h3 { margin-bottom: 1rem; line-height: 1.5; }

/* -------------------------------------------------------------------------
   Tables
   ------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}
.data-table th, .data-table td {
    padding: .65rem .75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}
.data-table th {
    background: var(--surface);
    font-weight: 600;
    color: var(--text-2);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    position: sticky;
    top: 0;
}
.data-table tbody tr:nth-child(even) { background: rgba(247, 248, 250, .5); }
.data-table tbody tr:hover { background: var(--surface); }
.data-table.compact th, .data-table.compact td { padding: .45rem .55rem; font-size: .88rem; }
.action-cell { white-space: nowrap; display: flex; gap: .35rem; flex-wrap: wrap; }

/* -------------------------------------------------------------------------
   Badges
   ------------------------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    background: var(--surface-2);
    color: var(--text-2);
    text-transform: capitalize;
    line-height: 1.5;
    vertical-align: middle;
}
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: var(--success-soft); color: var(--accent-hover); }
.badge-warn    { background: var(--warn-soft); color: #b45309; }
.badge-danger  { background: var(--danger-soft); color: #b91c1c; }
.badge-cat     { background: var(--accent-soft); color: var(--accent-hover); text-transform: capitalize; }

/* Inspector approval status colors */
.badge-approved { background: var(--success-soft); color: var(--accent-hover); }
.badge-pending  { background: var(--warn-soft); color: #b45309; }
.badge-rejected { background: var(--danger-soft); color: #b91c1c; }

/* Booking status colors */
.badge-status.badge-requested { background: var(--primary-soft); color: var(--primary); }
.badge-status.badge-accepted  { background: var(--success-soft); color: var(--accent-hover); }
.badge-status.badge-declined  { background: var(--danger-soft); color: #b91c1c; }
.badge-status.badge-completed { background: #ecfeff; color: #0e7490; }
.badge-status.badge-cancelled { background: var(--surface-2); color: var(--muted); }

/* User status */
.badge-status.badge-active    { background: var(--success-soft); color: var(--accent-hover); }
.badge-status.badge-suspended { background: var(--danger-soft); color: #b91c1c; }

.badge-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .35rem; }

/* Stars */
.stars { color: var(--warn); letter-spacing: 1px; font-size: .95rem; }

/* -------------------------------------------------------------------------
   Match cards
   ------------------------------------------------------------------------- */
.match-list { display: flex; flex-direction: column; gap: 1rem; }
.match-card { padding: 1.25rem 1.5rem; }
.match-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: .5rem;
}
.match-score {
    text-align: center;
    background: var(--primary-soft);
    color: var(--primary);
    padding: .4rem .75rem;
    border-radius: var(--radius);
    min-width: 64px;
}
.score-num { display: block; font-size: 1.4rem; font-weight: 700; line-height: 1; }
.score-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }

.match-breakdown {
    list-style: none;
    padding: 0;
    margin: .75rem 0 1rem;
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    font-size: .8rem;
    color: var(--muted);
}
.match-breakdown li {
    background: var(--surface);
    padding: .25rem .65rem;
    border-radius: 999px;
}
.match-breakdown li strong { color: var(--text); margin-left: .15rem; }

.inspector-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

/* -------------------------------------------------------------------------
   Messages thread
   ------------------------------------------------------------------------- */
.message-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.message {
    padding: .75rem 1rem;
    background: var(--surface);
    border-left: 3px solid var(--border-2);
    border-radius: var(--radius);
}
.message-inspector { border-left-color: var(--primary); background: var(--primary-soft); }
.message-buyer    { border-left-color: var(--accent); background: var(--accent-soft); }
.message-realtor  { border-left-color: var(--accent); background: var(--accent-soft); }
.message-admin    { border-left-color: var(--warn); background: var(--warn-soft); }
.message-head { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-bottom: .25rem; }
.message-body { white-space: pre-wrap; }

/* -------------------------------------------------------------------------
   Reviews
   ------------------------------------------------------------------------- */
.review-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1rem; }
.review {
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
}
.review-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .35rem; }

/* -------------------------------------------------------------------------
   Approval cards (admin)
   ------------------------------------------------------------------------- */
.approval-stack { display: flex; flex-direction: column; gap: 1rem; }
.approval-card {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}
.approval-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* -------------------------------------------------------------------------
   Bar chart (analytics)
   ------------------------------------------------------------------------- */
.bar-chart { display: flex; flex-direction: column; gap: .35rem; margin-top: .75rem; }
.bar-row {
    display: grid;
    grid-template-columns: 110px 1fr 40px;
    align-items: center;
    gap: .75rem;
    font-size: .85rem;
}
.bar-label { color: var(--muted); }
.bar-track {
    background: var(--surface-2);
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 999px;
    transition: width .3s ease;
    min-width: 2px;
}
.bar-value { font-weight: 600; color: var(--text); text-align: right; }

/* -------------------------------------------------------------------------
   Pagination
   ------------------------------------------------------------------------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* -------------------------------------------------------------------------
   Flash messages
   ------------------------------------------------------------------------- */
.flash-stack { padding-top: 1rem; }
.flash {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: .5rem;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
    animation: flashIn .25s ease-out;
}
@keyframes flashIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.flash-success { background: var(--success-soft); border-color: #a7f3d0; color: #065f46; }
.flash-error,
.flash-danger  { background: var(--danger-soft);  border-color: #fecaca; color: #991b1b; }
.flash-warn    { background: var(--warn-soft);    border-color: #fde68a; color: #92400e; }
.flash-info    { background: var(--primary-soft); border-color: #bfdbfe; color: #1e40af; }
.flash-close {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    padding: 0 .25rem;
    opacity: .7;
}
.flash-close:hover { opacity: 1; }

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.site-footer {
    margin-top: 4rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2.5rem 0 1rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}
.footer-grid h4 { color: var(--text); text-transform: none; letter-spacing: 0; font-weight: 600; font-size: .95rem; margin-bottom: .5rem; }
.footer-grid a {
    display: block;
    color: var(--muted);
    text-decoration: none;
    padding: .25rem 0;
    font-size: .9rem;
}
.footer-grid a:hover { color: var(--primary); }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}
@media (max-width: 700px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
    .footer-grid { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------------------
   Misc utilities
   ------------------------------------------------------------------------- */
form.inline { display: inline-block; }
form.inline + form.inline { margin-left: .25rem; }

/* =========================================================================
   Modern admin tables. compact rows, inline actions, avatar cells
   ========================================================================= */

/* Card with no internal padding (table flush to card edges) */
.card.no-pad { padding: 0; overflow: hidden; }
.card.no-pad .table-wrap { overflow-x: auto; }

/* Modern table variant. tighter, single-line rows */
.data-table-modern {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}
.data-table-modern th,
.data-table-modern td {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;     /* keep all cell content aligned on one line */
    white-space: nowrap;        /* default: prevent wrapping */
}
.data-table-modern th {
    background: var(--surface);
    color: var(--muted);
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}
.data-table-modern tbody tr {
    transition: background .12s ease;
}
.data-table-modern tbody tr:hover {
    background: var(--surface);
}
.data-table-modern tbody tr:nth-child(even) {
    background: rgba(247, 248, 250, .35);
}
.data-table-modern tbody tr:nth-child(even):hover {
    background: var(--surface);
}
.data-table-modern tbody tr:last-child td {
    border-bottom: 0;
}

/* Allow specific cells to wrap (e.g. long bios, addresses) */
.data-table-modern td.wrap,
.data-table-modern .user-meta {
    white-space: normal;
}

/* Column sizing helpers */
.data-table-modern .col-id     { width: 1%;  color: var(--muted); }
.data-table-modern .col-action { width: 1%; text-align: right; }

/* Empty-state row */
.data-table-modern .empty-cell {
    text-align: center;
    color: var(--muted);
    padding: 2rem 1rem;
    font-style: italic;
}

/* -------------------------------------------------------------------------
   User cell (avatar + name + email)
   ------------------------------------------------------------------------- */
.user-cell {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 220px;
}
.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}
.user-meta strong {
    color: var(--text);
    font-weight: 600;
}
.user-meta .small {
    font-size: .8rem;
}

.avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .02em;
    background: var(--surface-2);
    color: var(--text);
    user-select: none;
}

/* -------------------------------------------------------------------------
   Inline action form (select + button on one line)
   ------------------------------------------------------------------------- */
.action-inline {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
    white-space: nowrap;
}
.action-inline > * { margin: 0; }

/* Compact select for inline use inside table rows */
.select-sm {
    padding: .35rem 1.75rem .35rem .6rem !important;
    font-size: .85rem !important;
    height: 32px;
    width: auto !important;
    min-width: 100px;
    background-position: right .5rem center;
    background-size: .8em;
    border-radius: 8px !important;
}

/* Match button height to select */
.action-inline .btn-sm {
    height: 32px;
    padding: 0 .9rem;
    font-size: .82rem;
}

/* -------------------------------------------------------------------------
   Role-tinted badges (subtle distinction without screaming)
   ------------------------------------------------------------------------- */
.badge-role {
    background: var(--surface-2);
    color: var(--text-2);
}
.badge-role-admin     { background: #ede9fe; color: #5b21b6; }
.badge-role-inspector { background: var(--primary-soft); color: var(--primary); }
.badge-role-buyer     { background: var(--accent-soft); color: var(--accent-hover); }
.badge-role-realtor   { background: #fef3c7; color: #92400e; }

/* Mobile fallback for modern tables */
@media (max-width: 700px) {
    .data-table-modern .col-id { display: none; }
    .data-table-modern th,
    .data-table-modern td { padding: .65rem .6rem; }
    .user-cell { min-width: 0; gap: .5rem; }
    .avatar { width: 30px; height: 30px; font-size: .7rem; }
}

/* Extra utilities for modernized admin pages
   ------------------------------------------------------------ */

/* "Card head". for no-pad cards that still want a titled header strip */
.card.no-pad .card-head {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.card.no-pad .card-head h3 { margin: 0; }
.card.no-pad .padded { padding: 1.5rem 1.25rem; margin: 0; }

/* Wide column. wrap, allow longer text without crushing other cells */
.data-table-modern .col-wide { min-width: 200px; }
.data-table-modern .col-wide,
.data-table-modern .col-wide * { white-space: normal; }

/* Status dots (compact on/off indicator for table cells) */
.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--border-2);
    vertical-align: middle;
}
.dot-on  { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dot-off { background: var(--border-2); }

/* Compact inputs for use inline within table rows */
.input-sm,
input[type="text"].input-sm,
input[type="number"].input-sm {
    padding: .35rem .55rem !important;
    font-size: .85rem !important;
    height: 32px;
    border-radius: 8px !important;
}
.data-table-modern td .input-sm { width: 100%; min-width: 90px; }

/* Card footer (matches card-head pattern) */
.card.no-pad .card-foot {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    background: var(--surface);
}

/* =========================================================================
   Reports & documents (Phase 1)
   ========================================================================= */

/* Status badge color for report_uploaded */
.badge-status.badge-report_uploaded {
    background: #ecfeff;
    color: #0e7490;
}

/* File row inside .report-card. icon + meta + download CTA */
.report-card { padding: 1.5rem; }
.report-card hr { margin: 1.5rem 0; }
.file-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.file-icon {
    flex-shrink: 0;
    width: 48px; height: 48px;
    border-radius: 8px;
    background: var(--danger-soft);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    letter-spacing: .04em;
}
.file-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.4;
    min-width: 0;
}
.file-meta strong { color: var(--text); }

@media (max-width: 580px) {
    .file-row { flex-wrap: wrap; }
    .file-row .btn { width: 100%; justify-content: center; }
}

/* =========================================================================
   Phase 2. Notifications, plans, CRM, audit
   ========================================================================= */

/* Nav notification bell */
.nav-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    margin-right: .5rem;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1rem;
    background: var(--surface);
    transition: background .15s;
}
.nav-bell:hover { background: var(--border); }
.nav-bell-badge {
    position: absolute;
    top: -2px; right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger, #e11d48);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--bg, #fff);
}

/* Notification list */
.notif-list { list-style: none; padding: 0; margin: 0; }
.notif {
    border-bottom: 1px solid var(--border);
}
.notif:last-child { border-bottom: none; }
.notif-form { margin: 0; }
.notif-btn {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: start;
    width: 100%;
    padding: 1rem 1.25rem;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
}
.notif-btn:hover { background: var(--surface); }
.notif--unread .notif-btn { background: rgba(59, 130, 246, .04); }
.notif--unread .notif-body strong::before {
    content: '';
    display: inline-block;
    width: 8px; height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--primary, #3b82f6);
    vertical-align: middle;
}
.notif-type {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
}
.notif-time { white-space: nowrap; }

/* Subscription plan cards */
.plan-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    text-align: left;
    border: 1px solid var(--border);
}
.plan-card--current { border-color: var(--primary, #3b82f6); border-width: 2px; }
.plan-head h3 { margin: 0; }
.plan-price { display: flex; align-items: baseline; gap: .35rem; }
.plan-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .35rem; }
.plan-features li { font-size: .9rem; }
.check-list li { color: var(--text); }

/* Compact selects for inline forms (admin tables) */
.select-sm {
    padding: .35rem .55rem !important;
    font-size: .85rem !important;
    height: 32px;
    border-radius: 8px !important;
}

/* CRM tasks/notes lists */
.task-list, .note-list { list-style: none; padding: 0; margin: 0; }
.task {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: .75rem;
    align-items: start;
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
}
.task:last-child { border-bottom: none; }
.task--done .task-body strong { text-decoration: line-through; color: var(--muted); }
.task--overdue .task-body strong { color: var(--danger, #e11d48); }
.task-toggle {
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    padding: 0;
    width: 28px;
    color: var(--text);
}
.note {
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
}
.note:last-child { border-bottom: none; }
.note-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: .35rem;
}

/* Page-header layout helper for action rows */
.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    flex-wrap: wrap;
}
.action-row { display: flex; gap: .5rem; align-items: center; }
.filter-bar {
    display: flex;
    gap: .5rem;
    align-items: center;
    padding: 1rem;
}
.filter-bar .field { flex: 1; }

.text-danger { color: var(--danger, #e11d48); }
.text-right { text-align: right; }
.align-center { align-items: center; }

/* =========================================================================
   Phase 2. Report summary + buyer report dashboard
   ========================================================================= */

/* Severity badges + dots. calm light-theme palette */
.badge.sev-safety,
.severity-card--safety .card-head { background: #fef2f2; color: #b91c1c; }
.badge.sev-urgent,
.severity-card--urgent .card-head { background: #fff7ed; color: #c2410c; }
.badge.sev-repair_soon,
.severity-card--repair_soon .card-head { background: #fefce8; color: #a16207; }
.badge.sev-maintenance,
.severity-card--maintenance .card-head { background: #eff6ff; color: #1d4ed8; }
.badge.sev-monitor,
.severity-card--monitor .card-head { background: #f3f4f6; color: #374151; }

.severity-card .card-head { font-weight: 600; }
.severity-card .card-head h3 {
    display: flex; align-items: center; gap: .5rem;
    margin: 0;
}
.sev-dot {
    display: inline-block;
    width: 12px; height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sev-dot.sev-safety       { background: #dc2626; }
.sev-dot.sev-urgent       { background: #ea580c; }
.sev-dot.sev-repair_soon  { background: #ca8a04; }
.sev-dot.sev-maintenance  { background: #2563eb; }
.sev-dot.sev-monitor      { background: #6b7280; }

.severity-key {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: .35rem;
    font-size: .9rem;
}
.severity-key li { display: flex; align-items: center; gap: .5rem; }

/* Findings list */
.finding-list { list-style: none; padding: 0 1.25rem; margin: 0; }
.finding {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.finding:last-child { border-bottom: none; }
.finding-head {
    display: flex; flex-wrap: wrap;
    gap: .5rem; align-items: center;
}
.finding-est {
    margin-left: auto;
    font-weight: 600;
    color: var(--text);
}
.finding-body {
    margin: .35rem 0 .5rem;
    font-size: .9rem;
}
.finding-action summary { padding: .35rem 0; }

/* Summary card (buyer view) */
.summary-card .summary-prose {
    line-height: 1.6;
    font-size: 1rem;
    margin: 0;
}

/* Booking-thread summary affordances */
.summary-affordances {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* =========================================================================
   Phase 2. Realtor pipeline
   ========================================================================= */

/* Stage badges. distinct from severity colors. Lead → Closed = cool→green, Dropped = gray. */
.badge.stage-lead                 { background: #f3f4f6; color: #374151; }
.badge.stage-active               { background: #eff6ff; color: #1d4ed8; }
.badge.stage-under_contract       { background: #ecfeff; color: #0e7490; }
.badge.stage-inspection_scheduled { background: #fefce8; color: #854d0e; }
.badge.stage-report_review        { background: #fff7ed; color: #c2410c; }
.badge.stage-negotiating          { background: #fdf4ff; color: #86198f; }
.badge.stage-closed               { background: #ecfdf5; color: #047857; }
.badge.stage-dropped              { background: #f3f4f6; color: #9ca3af; }

/* Pipeline list (dashboard tile) */
.pipeline-list { list-style: none; padding: 0; margin: 0; }
.pipeline-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .55rem .85rem;
    border-radius: 8px;
    margin-bottom: .25rem;
    border-left: 4px solid var(--border);
    background: var(--surface);
}
.pipeline-row a { color: var(--text); text-decoration: none; }
.pipeline-row a:hover { text-decoration: underline; }
.pipeline-row .pipeline-count {
    font-weight: 600;
    background: var(--bg);
    padding: 1px 8px;
    border-radius: 999px;
    font-size: .85rem;
    color: var(--text);
}
.pipeline-lead                 { border-left-color: #9ca3af; }
.pipeline-active               { border-left-color: #3b82f6; }
.pipeline-under_contract       { border-left-color: #06b6d4; }
.pipeline-inspection_scheduled { border-left-color: #ca8a04; }
.pipeline-report_review        { border-left-color: #ea580c; }
.pipeline-negotiating          { border-left-color: #c026d3; }
.pipeline-closed               { border-left-color: #059669; }
.pipeline-dropped              { border-left-color: #d1d5db; opacity: .7; }

/* Stage radio picker (client detail) */
.stage-pick {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .5rem;
    margin-bottom: 1rem;
}
.stage-radio {
    display: block;
    padding: .55rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: var(--surface);
    font-size: .9rem;
    transition: all .15s;
}
.stage-radio input { margin-right: .35rem; }
.stage-radio:has(input:checked) {
    background: var(--bg);
    border-color: var(--text);
    border-width: 2px;
    padding: calc(.55rem - 1px) calc(.75rem - 1px);
    font-weight: 600;
}

/* Repair-rollup inline status row */
.status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: baseline;
}
.status-row span { font-size: 1rem; }

/* Filter bar (clients page) */
.filter-bar {
    display: flex; flex-wrap: wrap;
    gap: .35rem;
    padding: .85rem 1rem;
    align-items: center;
}

/* =========================================================================
   Phase 2. Schedule + Routes
   ========================================================================= */

/* Compact inputs used in schedule/route tables */
.input-sm,
input.input-sm,
select.input-sm {
    padding: .35rem .5rem;
    font-size: .85rem;
    height: 32px;
    border-radius: 8px;
    width: 100px;
}

/* Color-coded badges for route status */
.badge.badge-status { background: var(--surface); color: var(--text); }

/* Schedule page. calendar sync card spacing */
.card h4.m-0 + form,
.card h4.m-0 + p { margin-top: .5rem; }

/* Routes index. make the date "Today" highlight visible */
.badge.badge-primary { background: #dbeafe; color: #1e40af; }

/* Padded form-actions inside no-pad cards (e.g. routes table footer) */
.form-actions.padded { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }

/* =========================================================================
   Phase 3. Contractors + Add-ons
   ========================================================================= */

/* Contractor card on directory */
.contractor-card { display: block; text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
.contractor-card:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.contractor-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }

/* Trade pill row */
.trade-pills { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
.trade-pill {
  display: inline-block; padding: .3rem .7rem; border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: .85rem;
  text-decoration: none; border: 1px solid var(--border);
}
.trade-pill.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Trade pick-list (contractor profile editor) */
.trade-pick {
  display: flex; gap: .6rem; padding: .55rem .75rem;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface);
}
.trade-pick-body { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.primary-radio { display: inline-flex; align-items: center; gap: .35rem; }

/* Add-on cards on booking form */
.addon-card {
  display: flex; gap: .6rem; padding: .65rem .75rem;
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
}
.addon-card input[type="checkbox"] { margin-top: .15rem; }
.addon-card-body { display: block; flex: 1; }
.addon-price { float: right; color: var(--accent); font-weight: 600; }

/* Inspector add-on opt-in row */
.addon-offer {
  border: 1px solid var(--border); border-radius: 10px; padding: .85rem 1rem;
  background: var(--surface);
}
.addon-offer-toggle { display: flex; gap: .55rem; align-items: flex-start; }
.addon-offer-price { display: flex; align-items: center; gap: .5rem; margin: .5rem 0 .25rem; }
.addon-offer-price input { width: 110px; padding: .35rem .55rem; }

/* Booking-thread add-on list */
.addon-list { list-style: none; padding: 0; margin: 0; }
.addon-row {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  padding: .55rem 0; border-bottom: 1px solid var(--border);
}
.addon-row:last-child { border-bottom: none; }
.addon-row-body { flex: 1; }
.addon-row .action-inline { display: flex; gap: .35rem; }

/* Add-on status badges */
.addon-status-requested { background: #eef2ff; color: #3730a3; }
.addon-status-accepted  { background: #dcfce7; color: #166534; }
.addon-status-declined  { background: #fee2e2; color: #991b1b; }
.addon-status-completed { background: #ccfbf1; color: #115e59; }

/* Status band on contractor dashboard */
.status-band {
  padding: .65rem 1rem; border-radius: 10px; margin-top: 1rem;
  border: 1px solid var(--border); background: var(--surface);
}
.status-band-pending  { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.status-band-rejected { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.status-band-approved { background: #dcfce7; border-color: #bbf7d0; color: #166534; }

/* Approval-status badges (table) */
.badge.status-pending  { background: #fef3c7; color: #92400e; }
.badge.status-approved { background: #dcfce7; color: #166534; }
.badge.status-rejected { background: #fee2e2; color: #991b1b; }

/* Featured badge */
.badge.badge-featured { background: #fde68a; color: #78350f; }

/* Inline action dropdowns (admin contractor table) */
.inline-actions { position: relative; display: inline-block; }
.inline-actions[open] > summary ~ form {
  position: absolute; right: 0; z-index: 50; background: #fff;
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08); padding: 0;
}

/* =========================================================================
   Phase 3 slice 2. Repair workflow + Disputes + Flags
   ========================================================================= */

/* Filter row (trade pills wrapper that needs spacing) */
.filter-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1rem; margin-bottom: .5rem; }

/* Info band. used for finding context, dispute target context */
.info-band {
  background: #fef3c7; border: 1px solid #fde68a; color: #78350f;
  border-radius: 10px; padding: .65rem 1rem; margin: 1rem 0;
}
.info-band .badge { margin: 0 .25rem; }

/* Request-a-quote CTA card on contractor profile */
.request-quote-cta { background: linear-gradient(180deg, #f0fdf4, #fff); border-color: #86efac; }
.request-quote-cta h3 { margin-top: 0; }

/* Quote list (buyer-side detail page) */
.quote-list { display: flex; flex-direction: column; gap: .85rem; }
.quote-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 1rem;
  background: #fff;
}
.quote-card.status-accepted { border-color: #16a34a; background: #f0fdf4; }
.quote-card.status-declined { border-color: #ef4444; background: #fef2f2; opacity: .85; }
.quote-card.status-withdrawn,
.quote-card.status-expired   { opacity: .6; }
.quote-card-head { display: flex; gap: .5rem; align-items: center; margin-bottom: .35rem; }
.quote-amount { font-size: 1.2rem; margin: .25rem 0 .5rem; }
.quote-amount strong { color: var(--accent); }

/* Finding "Get repair quotes" link, sits next to existing repair-request details */
.finding-quote-link { margin-left: .5rem; }

/* Lead/quote/job/dispute status badges */
.badge.status-requested,
.badge.status-open,
.badge.status-draft        { background: #e0e7ff; color: #3730a3; }
.badge.status-viewed,
.badge.status-investigating { background: #fef3c7; color: #92400e; }
.badge.status-quoted,
.badge.status-sent,
.badge.status-scheduled    { background: #dbeafe; color: #1e40af; }
.badge.status-accepted,
.badge.status-in_progress  { background: #dcfce7; color: #166534; }
.badge.status-completed,
.badge.status-resolved     { background: #ccfbf1; color: #115e59; }
.badge.status-declined,
.badge.status-cancelled,
.badge.status-withdrawn,
.badge.status-dismissed,
.badge.status-expired      { background: #f1f5f9; color: #475569; }
.badge.status-disputed,
.badge.status-escalated    { background: #fee2e2; color: #991b1b; }

/* Severity badges for findings (minor/maintenance/major/severe). used in info-bands */
.badge.badge-minor       { background: #dbeafe; color: #1e40af; }
.badge.badge-maintenance { background: #f1f5f9; color: #475569; }
.badge.badge-major       { background: #fef3c7; color: #92400e; }
.badge.badge-severe      { background: #fee2e2; color: #991b1b; }

/* Account flag badges */
.badge.flag-warning    { background: #fef3c7; color: #92400e; }
.badge.flag-probation  { background: #fed7aa; color: #9a3412; }
.badge.flag-restricted { background: #fecaca; color: #991b1b; }
.badge.flag-banned     { background: #1f2937; color: #fee2e2; }

/* =========================================================================
   Phase 2.5. Native inspection report builder
   ========================================================================= */

/* Sticky report-builder header for fast access during long edits */
.sticky-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg, #fff);
  padding: .75rem 0;
  margin: 0 -1rem 0 -1rem;
  padding-left: 1rem; padding-right: 1rem;
  border-bottom: 1px solid var(--border);
}
.report-builder .action-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* Section accordion cards */
.section-card {
  border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: .75rem; background: #fff;
}
.section-card > summary {
  list-style: none; cursor: pointer;
  padding: .85rem 1rem; display: flex; justify-content: space-between;
  align-items: center; gap: .5rem;
}
.section-card > summary::-webkit-details-marker { display: none; }
.section-card > summary::before {
  content: '▸'; display: inline-block; transition: transform .12s; color: var(--muted, #6b7280);
  margin-right: .5rem;
}
.section-card[open] > summary::before { transform: rotate(90deg); }
.section-card[open] > summary { border-bottom: 1px solid var(--border); }
.section-title { font-weight: 600; font-size: 1rem; }
.section-meta { display: flex; gap: .35rem; align-items: center; }
.section-form { padding: 1rem; border-bottom: 1px solid var(--border); }

/* Add-finding details */
.add-finding { margin: .75rem 1rem; }
.add-finding > summary { list-style: none; cursor: pointer; }
.add-finding > summary::-webkit-details-marker { display: none; }

/* Finding cards (inspector + buyer). color-coded by severity */
.finding-list { display: flex; flex-direction: column; gap: .65rem; padding: .5rem 1rem 1rem; }
.finding-card {
  border: 1px solid var(--border); border-radius: 10px;
  padding: .85rem 1rem; background: #fff;
  border-left: 4px solid #cbd5e1;
}
.finding-card-head { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-bottom: .35rem; }
.finding-card.sev-safety_hazard { border-left-color: #b91c1c; background: #fef2f2; }
.finding-card.sev-major_defect  { border-left-color: #ea580c; background: #fff7ed; }
.finding-card.sev-minor_defect  { border-left-color: #ca8a04; background: #fefce8; }
.finding-card.sev-maintenance   { border-left-color: #475569; }
.finding-card.sev-informational { border-left-color: #94a3b8; }
.finding-card > summary { list-style: none; cursor: pointer; display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.finding-card > summary::-webkit-details-marker { display: none; }

/* Severity badges. used in counts row, finding heads, buyer dashboard */
.badge.sev-safety_hazard,
.badge.sev-card-safety_hazard { background: #fee2e2; color: #991b1b; }
.badge.sev-major_defect,
.badge.sev-card-major_defect  { background: #fed7aa; color: #9a3412; }
.badge.sev-minor_defect,
.badge.sev-card-minor_defect  { background: #fef3c7; color: #92400e; }
.badge.sev-maintenance        { background: #f1f5f9; color: #475569; }
.badge.sev-informational      { background: #dbeafe; color: #1e40af; }

/* Severity-tinted metric cards (buyer report-v2 at-a-glance) */
.metric-card.sev-card-safety_hazard { border-left: 4px solid #b91c1c; }
.metric-card.sev-card-major_defect  { border-left: 4px solid #ea580c; }
.metric-card.sev-card-minor_defect  { border-left: 4px solid #ca8a04; }

/* Condition badges for sections */
.badge.cond-satisfactory  { background: #dcfce7; color: #166534; }
.badge.cond-marginal      { background: #fef3c7; color: #92400e; }
.badge.cond-deficient     { background: #fed7aa; color: #9a3412; }
.badge.cond-unsafe        { background: #fee2e2; color: #991b1b; }
.badge.cond-not_present   { background: #f1f5f9; color: #475569; }
.badge.cond-not_inspected { background: #e0e7ff; color: #3730a3; }

/* Status badges for native report status enum */
.badge.status-draft           { background: #e0e7ff; color: #3730a3; }
.badge.status-in_progress     { background: #dbeafe; color: #1e40af; }
.badge.status-review_required { background: #fef3c7; color: #92400e; }
.badge.status-finalized       { background: #ccfbf1; color: #115e59; }
.badge.status-delivered       { background: #dcfce7; color: #166534; }
.badge.status-revised         { background: #fed7aa; color: #9a3412; }

/* Native-report card on booking thread */
.native-report-card { border: 1px solid #93c5fd; background: #f0f9ff; }

/* =========================================================================
   Phase 2.5 slice 2. photos, comment library, office, revisions
   ========================================================================= */

/* Photo gallery */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .5rem;
  margin: .75rem 1rem;
}
.photo-tile {
  margin: 0; padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  position: relative;
}
.photo-tile img {
  width: 100%; height: 110px;
  object-fit: cover;
  display: block;
}
.photo-tile figcaption {
  padding: .35rem .5rem;
  font-size: .75rem;
  display: flex; gap: .5rem; align-items: center; justify-content: space-between;
}

/* Add-photos disclosure */
.add-photos { margin: .25rem 1rem .75rem; }
.add-photos > summary { list-style: none; cursor: pointer; }
.add-photos > summary::-webkit-details-marker { display: none; }

/* Tiny button variant for inline photo + revision controls */
.btn.btn-tiny {
  font-size: .7rem;
  padding: .15rem .45rem;
  line-height: 1.4;
}

/* Comment library affordance */
.comment-library-link { margin-left: .5rem; text-decoration: underline; }
.callout-card { background: #ecfeff; border: 1px solid #67e8f9; }

/* Revision history list */
.revision-log > summary { list-style: none; cursor: pointer; }
.revision-log > summary::-webkit-details-marker { display: none; }
.revision-log > summary::before { content: '▸'; margin-right: .5rem; transition: transform .12s; }
.revision-log[open] > summary::before { transform: rotate(90deg); }
.revision-list { list-style: none; padding: 0; margin: .5rem 0 0 0; }
.revision-list li {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  padding: .35rem 0; border-bottom: 1px dashed var(--border);
}
.revision-list li:last-child { border-bottom: none; }

/* Category list on comment library */
.cat-list { list-style: none; padding: 0; margin: .5rem 0; display: flex; flex-direction: column; gap: .25rem; }
.cat-list li { display: flex; gap: .5rem; align-items: center; padding: .35rem 0; }

/* Padded row helper for cards with explicit header */
.padded-row { padding: 1rem 1rem 0; }
.no-pad > .padded-row { margin: 0; }

/* Section narrow layout (used by edit forms) */
.container.section.narrow { max-width: 720px; }

/* =========================================================================
   Phase 2.5 slice 3. quote requests, message threads, repair completion,
   realtor amendments
   ========================================================================= */

/* Quote rows on the buyer's request show page */
.quote-row { transition: border-color .15s; }
.quote-row.is-awarded {
  border-color: #10b981;
  background: #ecfdf5;
}
.quote-row-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .5rem;
  gap: .75rem;
}
.quote-amount {
  font-size: 1.1rem;
  margin: .25rem 0;
}
.quote-thread > summary { list-style: none; cursor: pointer; }
.quote-thread > summary::-webkit-details-marker { display: none; }

/* Message bubbles */
.message-list {
  display: flex; flex-direction: column; gap: .5rem;
  margin: .5rem 0;
}
.message-bubble {
  border-radius: 10px;
  padding: .5rem .75rem;
  max-width: 85%;
  border: 1px solid var(--border);
  background: #f9fafb;
}
.message-bubble.msg-buyer    { align-self: flex-end;   background: #ecfeff; border-color: #67e8f9; }
.message-bubble.msg-contractor { align-self: flex-start; background: #f9fafb; border-color: #cbd5e1; }
.message-bubble.msg-realtor  { align-self: flex-start; background: #faf5ff; border-color: #d8b4fe; }
.message-bubble.msg-admin    { align-self: flex-start; background: #fef3c7; border-color: #fcd34d; }

/* Realtor finding picker */
.finding-pick {
  display: flex; gap: .75rem; align-items: flex-start;
  cursor: pointer;
}
.finding-pick input[type="checkbox"] {
  margin-top: .35rem;
  flex: 0 0 auto;
}
.finding-pick > div { flex: 1; }

/* Resolved finding card on buyer report */
.finding-card.is-resolved {
  border-color: #10b981;
  background: #f0fdf4;
  opacity: .85;
}

/* Generic info badge */
.badge-info { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.badge-success { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }

/* =========================================================================
   Phase 2.5 slice 4. Home Health Score widget, section picker, PDF helpers
   ========================================================================= */

/* Buyer-facing Health Score card (a smaller version of the PDF version) */
.health-card {
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  margin: 1rem 0;
}
.health-card .health-num {
  flex: 0 0 130px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff;
  padding: 1rem;
  text-align: center;
}
.health-card .health-num .num {
  font-size: 2.4rem; font-weight: 800; line-height: 1;
}
.health-card .health-num .den {
  font-size: .7rem; opacity: .85; letter-spacing: .1em;
}
.health-card .health-num .lbl {
  font-size: .7rem; letter-spacing: .14em; margin-top: .35rem; font-weight: 700;
}
.health-card .health-body {
  padding: 1rem 1.25rem;
  flex: 1;
}
.health-card .health-body p { margin: .25rem 0; }

.health-card.health-excellent .health-num { background: #059669; }
.health-card.health-good      .health-num { background: #16a34a; }
.health-card.health-fair      .health-num { background: #ca8a04; }
.health-card.health-poor      .health-num { background: #ea580c; }
.health-card.health-critical  .health-num { background: #dc2626; }

/* Admin template section picker */
.section-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .35rem;
  margin: .5rem 0;
}
.section-pick {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  background: #f9fafb;
  font-size: .9rem;
}
.section-pick:hover { background: #f3f4f6; }
.section-pick input[type="checkbox"] { margin: 0; }

/* =========================================================================
   Phase 3 slice 3. home dashboard, maintenance tasks, partner cards
   ========================================================================= */

/* Score breakdown row inside health-card */
.score-breakdown {
  display: flex; flex-wrap: wrap; gap: .75rem;
  margin: .35rem 0;
  font-size: .85rem;
}
.score-breakdown span { color: #4b5563; }

/* Compact home card on /home index */
.home-card .health-card { margin: .75rem 0; border-width: 1px; }

/* Plain task list */
.task-list { list-style: none; padding: 0; margin: .5rem 0; }
.task-list li {
  padding: .35rem 0;
  border-bottom: 1px dashed var(--border);
}
.task-list li:last-child { border-bottom: none; }
.is-overdue { color: #dc2626; font-weight: 600; }

/* Maintenance task table-as-list */
.task-table { list-style: none; padding: 0; margin: 0; }
.task-table li {
  display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.task-table li:last-child { border-bottom: none; }
.task-main { flex: 1; }
.task-actions { display: flex; gap: .35rem; flex-wrap: wrap; }

.badge-overdue { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* Recent score events styling */
.event-positive { color: #059669; font-weight: 700; }
.event-negative { color: #dc2626; font-weight: 700; }

/* Partner offer cards */
.offer-card { display: flex; flex-direction: column; gap: .5rem; }
.offer-card h3, .offer-card h4 { margin: .25rem 0; }

/* =========================================================================
   Phase 3 slice 4. KPI tiles, bar charts, analytics dashboard
   ========================================================================= */

/* KPI grid (auto-fit so it flows nicely on narrow viewports) */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin: .5rem 0;
}
.kpi-tile {
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .75rem 1rem;
  min-width: 0;
}
.kpi-label {
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6b7280;
  font-weight: 600;
}
.kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #111;
  margin-top: .15rem;
  line-height: 1.1;
}
/* The revenue tile. a little flair */
.kpi-tile.kpi-revenue {
  background: #ecfdf5;
  border-color: #6ee7b7;
}
.kpi-tile.kpi-revenue .kpi-value { color: #059669; }

/* Inline bar chart cells in tables */
.bar-cell {
  width: 30%;
  min-width: 100px;
  vertical-align: middle;
}
.bar-track {
  display: block;
  width: 100%;
  height: 8px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  transition: width .25s ease;
}

/* Compact data-table variant for dashboards */
.data-table-modern.compact th,
.data-table-modern.compact td {
  padding: .35rem .55rem;
  font-size: .9rem;
}

/* Right-align utility */
.text-right { text-align: right; }

/* Funnel-specific table styling */
.funnel-table tr td:first-child { width: 30%; }
.funnel-table .bar-cell { width: 40%; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    text-decoration: none;
    font-weight: 700;
    color: var(--text);
    font-size: 1.15rem;
    line-height: 1;
}
.brand:hover { text-decoration: none; color: var(--text); }

.brand-logo {
    display: block;
    height: 44px;
    width: 44px;          /* square icon. adjust if aspect ratio differs */
    object-fit: contain;
    flex: 0 0 auto;
}

.brand-name {
    white-space: nowrap;
}

/* Footer mark slightly larger */
.site-footer .brand-logo {
    height: 48px;
    width: 48px;
}
.site-footer .brand-name {
    font-size: 1.2rem;
}

@media (max-width: 480px) {
    .brand-logo {
        height: 38px;
        width: 38px;
    }
    .brand { font-size: 1.05rem; }
}

/* =========================================================================
   Legal documents (Terms, Privacy, Cookies, Your Privacy Choices).
   Append to public_html/assets/css/style.css.
   ========================================================================= */

.legal-doc {
    max-width: 760px;
    margin: 0 auto;
}

.legal-doc h2 {
    margin-top: 2.5rem;
    margin-bottom: .75rem;
    font-size: 1.35rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.legal-doc h2:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 1.75rem;
}

.legal-doc h3 {
    margin-top: 1.5rem;
    margin-bottom: .5rem;
    font-size: 1.1rem;
}

.legal-doc p, .legal-doc li {
    line-height: 1.65;
}

.legal-doc ul {
    margin: .5rem 0 1rem 1.25rem;
}

.legal-doc ul li {
    margin-bottom: .35rem;
}

.legal-doc .lede {
    margin-bottom: 1.5rem;
}

.legal-doc .warn-card {
    margin: 1rem 0 2rem;
}

/* =========================================================================
   Cookie consent banner.
   Sticks to the bottom of the viewport on first visit.
   ========================================================================= */

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 24px rgba(15, 23, 42, .08);
    padding: 1rem 0;
}

.cookie-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.cookie-banner-copy {
    flex: 1 1 360px;
    min-width: 0;
}

.cookie-banner-copy strong {
    display: block;
    margin-bottom: .15rem;
}

.cookie-banner-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

@media (max-width: 640px) {
    .cookie-banner-actions {
        width: 100%;
    }
    .cookie-banner-actions .btn {
        flex: 1 1 auto;
    }
}

/* =========================================================================
   Cookie preferences modal.
   ========================================================================= */

.cookie-modal:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cookie-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .45);
}

.cookie-modal-card {
    position: relative;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
}

.cookie-modal-close {
    position: absolute;
    top: .5rem;
    right: .75rem;
    background: transparent;
    border: 0;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
}

.cookie-modal-card h2 {
    margin-top: 0;
    margin-bottom: .25rem;
}

.cookie-cat {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 8px);
    padding: .85rem 1rem;
    margin-top: .75rem;
    cursor: pointer;
}

label.cookie-cat {
    cursor: pointer;
}

.cookie-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .35rem;
}

.cookie-cat input[type="checkbox"] {
    transform: scale(1.2);
    accent-color: var(--primary);
}

.cookie-modal-card .form-actions {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

/* =========================================================================
   Admin sidebar shell.
   Append to public_html/assets/css/style.css.
   Active when body has .admin-shell (set in header.php for /admin URLs).
   ========================================================================= */

body.admin-shell {
    background: #f7f8fb;
}

body.admin-shell .site-main {
    /* Defensive: if any view is rendered without the admin-content wrapper,
       reset the spacing so it does not collide with the topbar. */
    padding: 0;
}

.admin-layout {
    display: grid;
    grid-template-columns: 248px 1fr;
    min-height: 100vh;
}

/* =========================================================================
   Sidebar
   ========================================================================= */

.admin-sidebar {
    background: #fff;
    border-right: 1px solid var(--border, #e5e7eb);
    padding: 1rem 0 2rem;
    overflow-y: auto;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 30;
}

.admin-sidebar .brand {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: 0 1rem 1rem;
    margin-bottom: .5rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
    text-decoration: none;
    color: var(--text, #111827);
    font-weight: 700;
}

.admin-sidebar .brand-logo {
    height: 36px;
    width: 36px;
    object-fit: contain;
}

.admin-sidebar .brand-name {
    font-size: 1.05rem;
    line-height: 1;
}

/* =========================================================================
   Sidebar nav items
   ========================================================================= */

.admin-nav {
    display: flex;
    flex-direction: column;
    padding: 0 .5rem;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .75rem;
    border-radius: 8px;
    color: var(--text, #111827);
    text-decoration: none;
    font-size: .92rem;
    line-height: 1.2;
    margin: 1px 0;
}

.admin-nav-item:hover {
    background: #f3f4f6;
    text-decoration: none;
}

.admin-nav-item.is-active {
    background: var(--primary-soft, #eef2ff);
    color: var(--primary, #4f46e5);
    font-weight: 600;
}

.admin-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    text-align: center;
    color: var(--muted, #6b7280);
    flex-shrink: 0;
}

.admin-nav-item.is-active .admin-nav-icon {
    color: var(--primary, #4f46e5);
}

/* =========================================================================
   Collapsible groups
   ========================================================================= */

.admin-nav-group {
    margin-top: .5rem;
}

.admin-nav-group-header {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    padding: .55rem .75rem;
    border-radius: 8px;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted, #6b7280);
    text-align: left;
}

.admin-nav-group-header:hover {
    background: #f3f4f6;
    color: var(--text, #111827);
}

.admin-nav-group-label {
    flex: 1;
}

.admin-nav-chevron {
    font-size: .8rem;
    transition: transform .15s ease;
    color: var(--muted, #6b7280);
}

.admin-nav-group.is-open .admin-nav-chevron {
    transform: rotate(180deg);
}

/* The items wrapper is hidden by default and revealed when the group is open.
   max-height transition gives a smooth open/close without measuring contents. */
.admin-nav-group-items {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 0;
    transition: max-height .18s ease;
    padding: 0;
}

.admin-nav-group.is-open .admin-nav-group-items {
    max-height: 600px;
    padding: .15rem 0 .35rem;
}

.admin-nav-subitem {
    padding-left: 2.4rem;
    font-size: .88rem;
}

/* If the group itself contains the active item, slightly tint the header so
   the user can still see where they are even when the group is collapsed. */
.admin-nav-group.is-current > .admin-nav-group-header {
    color: var(--text, #111827);
}

.admin-nav-divider {
    height: 1px;
    background: var(--border, #e5e7eb);
    margin: 1rem .75rem;
}

.admin-nav-secondary {
    color: var(--muted, #6b7280);
    font-size: .85rem;
}

/* =========================================================================
   Topbar + content
   ========================================================================= */

.admin-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--border, #e5e7eb);
    position: sticky;
    top: 0;
    z-index: 20;
}

.admin-topbar-spacer {
    flex: 1;
}

.admin-topbar-bell {
    position: relative;
    text-decoration: none;
    font-size: 1.1rem;
    line-height: 1;
    padding: .25rem;
}

.admin-topbar-bell .nav-bell-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: var(--danger, #ef4444);
    color: #fff;
    border-radius: 999px;
    padding: 1px 6px;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1.4;
}

.admin-topbar-user {
    font-size: .9rem;
    color: var(--text, #111827);
}

.admin-content {
    flex: 1;
    padding: 0;
}

/* The .container the views render usually has its own max-width and padding.
   Inside the admin shell, expand to a wider rail since we already lost width
   to the sidebar. The view's own .container will still cap at this. */
body.admin-shell .container {
    max-width: 1200px;
}

/* =========================================================================
   Mobile drawer (< 900px)
   ========================================================================= */

.admin-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0;
}

.admin-menu-toggle span {
    display: block;
    height: 2px;
    background: var(--text, #111827);
    border-radius: 1px;
}

.admin-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 25;
    display: none;
}

.admin-backdrop.is-open {
    display: block;
}

@media (max-width: 900px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        width: 248px;
        height: 100vh;
        transition: left .2s ease;
        box-shadow: 4px 0 24px rgba(15, 23, 42, .08);
    }

    .admin-sidebar.is-open {
        left: 0;
    }

    .admin-menu-toggle {
        display: inline-flex;
    }

    .admin-topbar-user {
        display: none;
    }
}

@media (max-width: 480px) {
    .admin-topbar {
        padding: .65rem .9rem;
    }
}

