/* ── Base Reset & Typography ──────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* Light theme: white and warm sand surfaces, red-ochre accent, eucalyptus green. */
    --bg: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #fbf7f2;
    --bg-input: #ffffff;
    --surface: #f7f1ea;
    --border: #e7ded3;
    --border-light: #d9ccbd;
    --heading: #1f1a17;
    --text: #2b2420;
    --text-muted: #6b5e54;
    --text-dim: #8a7d72;
    --accent: #b4532a;
    --accent-hover: #943f1d;
    --accent-glow: rgba(180, 83, 42, 0.18);
    --teal: #1f7a6e;
    --teal-glow: rgba(31, 122, 110, 0.15);
    --purple: #6a4c93;
    --purple-glow: rgba(106, 76, 147, 0.2);
    --gold: #a86f00;
    --gold-glow: rgba(201, 133, 0, 0.18);
    --sky: #2a78d6;
    --success: #1e8e5a;
    --danger: #c0392b;
    --warning: #c98500;
    --info: #2a78d6;
    --radius: 12px;
    --shadow: 0 6px 24px rgba(60, 40, 20, 0.08);
    --shadow-sm: 0 2px 8px rgba(60, 40, 20, 0.06);
    --shadow-glow: 0 8px 24px rgba(180, 83, 42, 0.12);
    --transition: all 0.25s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); text-decoration: none; }

h1, h2, h3, h4 { color: var(--heading); line-height: 1.3; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; margin-bottom: 12px; }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.nav-brand {
    color: var(--heading);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-brand::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-glow);
}
.nav-brand:hover { color: var(--accent); }

.nav-links {
    list-style: none;
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.88rem;
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--transition);
}
.nav-links a:hover {
    color: var(--accent);
    background: rgba(180, 83, 42, 0.08);
}

/* ── Container ───────────────────────────────────────────── */
.container {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 0;
    flex: 1;
}

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.alert-success { background: #eaf6ef; color: #17663f; border-color: #b9e0c9; }
.alert-error { background: #fbecea; color: #9b2c20; border-color: #f0c2bc; }
.alert-warning { background: #fdf3e1; color: #7a5200; border-color: #f1d9a6; }
.alert-info { background: #eaf2fc; color: #1d5aa6; border-color: #bcd5f3; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 11px 26px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    color: #fff;
    transition: var(--transition);
    letter-spacing: 0.3px;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--accent);
    box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 25px var(--accent-glow);
}
.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--text-muted); }
.btn-danger {
    background: var(--danger);
    box-shadow: 0 4px 15px rgba(239,68,68,0.3);
}
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

/* ── Hero Section ────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 70px 30px;
    background: var(--surface);
    border-radius: var(--radius);
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
}
.hero::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    border-radius: 50%;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, var(--teal-glow) 0%, transparent 70%);
    border-radius: 50%;
}
.hero h1 {
    font-size: 2.4rem;
    margin-bottom: 16px;
    font-weight: 800;
    position: relative;
    z-index: 1;
    color: var(--heading);
}
.hero-subtitle {
    font-size: 1.15rem;
    margin-bottom: 16px;
    color: var(--text-muted);
    font-weight: 400;
    position: relative;
    z-index: 1;
}
.hero-context {
    font-size: 0.92rem;
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.8;
    position: relative;
    z-index: 1;
}
.hero .btn { position: relative; z-index: 1; }

/* ── Stats Grid ──────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 28px 0;
}

.stat-card {
    background: var(--bg-card);
    padding: 28px 20px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
}
.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-light);
    box-shadow: var(--shadow-glow);
}

.stat-card-warning::before {
    background: linear-gradient(90deg, var(--danger), var(--warning));
}

.stat-number {
    display: block;
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--heading), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card-warning .stat-number {
    background: linear-gradient(135deg, var(--heading), var(--danger));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* ── CTA Section ─────────────────────────────────────────── */
.cta-section {
    text-align: center;
    padding: 44px 30px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.cta-section h2 { margin-bottom: 10px; }
.cta-section p { color: var(--text-muted); margin-bottom: 8px; }
.cta-buttons { margin-top: 22px; display: flex; gap: 14px; justify-content: center; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 28px;
    transition: var(--transition);
}
.card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 10px; color: var(--accent); }
.card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* ── Forms ────────────────────────────────────────────────── */
.form-page {
    max-width: 580px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.form-page h2 {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-input);
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea { resize: vertical; min-height: 100px; }
.form-group select option { background: var(--bg-card); color: var(--text); }

.password-wrapper {
    position: relative;
    display: block;
}
.password-wrapper input {
    padding-right: 42px;
}
.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 6px 8px;
    color: #333;
    opacity: 0.85;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji',
        'Segoe UI Symbol', sans-serif;
}
.password-toggle:hover,
.password-toggle:focus {
    opacity: 1;
    outline: none;
}

.field-error {
    display: block;
    color: var(--danger);
    font-size: 0.83rem;
    margin-top: 6px;
}

.help-text { color: var(--text-muted); font-size: 0.83rem; margin-top: 4px; }

.form-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.filter-form {
    margin-bottom: 24px;
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.filter-row {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.filter-row .form-group { flex: 1; min-width: 160px; margin-bottom: 0; }
.filter-row .btn { height: 46px; }

/* ── Data Tables ─────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.data-table th {
    background: var(--surface);
    color: var(--text-muted);
    padding: 14px 18px;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text);
}

.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: var(--bg-card-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td a { font-weight: 600; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-pending { background: var(--warning); color: #000; }
.status-review { background: var(--info); }
.status-progress { background: var(--purple); box-shadow: 0 0 12px var(--purple-glow); }
.status-completed { background: var(--success); }
.status-cancelled { background: #4b5563; }

.priority-low { background: #4b5563; }
.priority-medium { background: var(--warning); color: #000; }
.priority-high { background: var(--danger); }
.priority-emergency {
    background: #991b1b;
    box-shadow: 0 0 15px rgba(239,68,68,0.4);
    animation: emergencyPulse 1.5s infinite;
}
@keyframes emergencyPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(239,68,68,0.4); }
    50% { box-shadow: 0 0 25px rgba(239,68,68,0.7); }
}

/* ── Detail Pages ────────────────────────────────────────── */
.detail-page {
    background: var(--bg-card);
    padding: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.detail-page h2 { font-size: 1.6rem; margin-bottom: 4px; }

.detail-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 14px 0 24px;
    flex-wrap: wrap;
}
.detail-meta span:last-child { color: var(--text-muted); font-size: 0.85rem; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 28px;
    margin-bottom: 24px;
    padding: 24px;
    background: var(--surface);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.detail-item { font-size: 0.92rem; }
.detail-item strong {
    color: var(--text-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.detail-description {
    margin: 24px 0;
    padding: 20px;
    background: var(--surface);
    border-radius: 10px;
    border-left: 3px solid var(--accent);
}
.detail-description h3 { margin-bottom: 8px; }
.detail-description p { color: var(--text-muted); }

.detail-image { margin: 20px 0; }
.detail-image img {
    max-width: 100%;
    max-height: 450px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.detail-actions { margin: 24px 0; display: flex; gap: 12px; }

/* ── Staff Actions ───────────────────────────────────────── */
.staff-actions {
    margin-top: 28px;
    padding: 24px;
    background: #fdf8ee;
    border-radius: var(--radius);
    border: 1px solid #f1e2c0;
}
.staff-actions h3 { color: var(--gold); }

.form-inline {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.form-inline .form-group { flex: 1; min-width: 180px; }

/* ── Maintenance Log ─────────────────────────────────────── */
.maintenance-log {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.maintenance-log h3 { font-size: 1.15rem; margin-bottom: 16px; }

.log-entry {
    background: var(--surface);
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 12px;
    border-left: 3px solid var(--accent);
    transition: var(--transition);
}
.log-entry:hover { border-left-color: var(--accent-hover); }

.log-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.83rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.log-header strong { color: var(--text); }
.log-entry p { margin-top: 6px; color: var(--text-muted); }

/* ── Dashboard ───────────────────────────────────────────── */
.dashboard h2 { margin-bottom: 6px; font-size: 1.6rem; }
.dashboard h3 {
    margin: 30px 0 14px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}
.dashboard-actions { margin: 24px 0; display: flex; gap: 12px; }
.dwelling-info { color: var(--text-muted); margin-bottom: 16px; font-size: 0.95rem; }
.dwelling-info a { font-weight: 600; }

/* ── List Page ───────────────────────────────────────────── */
.list-page h2 { margin-bottom: 20px; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: center;
    margin: 28px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 24px 20px;
    margin-top: auto;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .nav-container { flex-direction: column; gap: 12px; }
    .nav-links { flex-wrap: wrap; justify-content: center; gap: 4px; }
    .hero { padding: 44px 20px; }
    .hero h1 { font-size: 1.6rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
    .filter-row { flex-direction: column; }
    .form-page { padding: 24px 20px; }
    .detail-page { padding: 24px 20px; }
    .form-inline { flex-direction: column; }
    .cta-buttons { flex-direction: column; align-items: center; }
    .data-table th, .data-table td { padding: 10px 12px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .dashboard-actions { flex-direction: column; }
    .detail-actions { flex-direction: column; }
}

/* ── Nav Logout Button ──────────────────────────────────── */
.nav-logout-form { display: inline; }
.nav-link-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.88rem;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}
.nav-link-btn:hover {
    color: var(--accent);
    background: rgba(180, 83, 42, 0.08);
}

/* ── Notification Badge ─────────────────────────────────── */
.notification-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    margin-left: 4px;
    line-height: 1.2;
    vertical-align: middle;
}

/* ── Notification Feed ──────────────────────────────────── */
.notification-actions { margin-bottom: 16px; }

.notification-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification-item {
    display: block;
    background: var(--bg-card);
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
    color: var(--text);
    text-decoration: none;
}
.notification-item:hover {
    border-color: var(--border-light);
    color: var(--text);
}

.notification-unread {
    border-left: 3px solid var(--accent);
    background: #fdf6f1;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.notification-header strong { color: var(--heading); font-size: 0.95rem; }
.notification-time { color: var(--text-muted); font-size: 0.78rem; }
.notification-item p { color: var(--text-muted); font-size: 0.88rem; margin: 0; }
.notification-type {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Feedback Section ───────────────────────────────────── */
.feedback-section {
    margin-top: 24px;
    padding: 20px;
    background: #eef6f4;
    border-radius: var(--radius);
    border: 1px solid #c4e0da;
}
.feedback-section h3 { color: var(--teal); }

.feedback-card {
    margin-top: 10px;
}
.feedback-rating {
    display: inline-block;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gold);
}
.feedback-card p {
    margin-top: 8px;
    color: var(--text-muted);
}
.feedback-date {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.form-subtitle {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ── Error Pages ────────────────────────────────────────── */
.error-page {
    text-align: center;
    padding: 80px 20px;
}
.error-page h1 {
    font-size: 5rem;
    color: var(--accent);
    margin-bottom: 0;
}
.error-page h2 {
    margin: 10px 0;
}
.error-page p {
    color: var(--text-muted);
    margin-bottom: 24px;
}
.error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    min-height: 70vh;
    padding: 40px;
    background-color: #f4f6f8;
}

/* LEFT SIDE */
.error-left {
    flex: 1;
    text-align: center;
}

.error-illustration {
    font-size: 120px;
    background: #e9ecef;
    padding: 40px;
    border-radius: 12px;
    display: inline-block;
}

/* RIGHT SIDE */
.error-right {
    flex: 1;
}

.error-right h1 {
    font-size: 36px;
    margin-bottom: 15px;
    color: #333;
}

.error-right p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* BUTTONS */
.error-buttons {
    display: flex;
    gap: 15px;
}

/* Outline button 404.html css-btnoutline instead of error class */
.btn-outline {
    border: 2px solid var(--accent);
    color: var(--accent);
    padding: 10px 15px;
    border-radius: 9px;
    text-decoration: none;
}

.btn-outline:hover {
    background: var(--accent);
    color: white;
}

/* Responsive */
@media (max-width: 769px) {
    .error-container {
        flex-direction: column;
        text-align: center;
    }
}
/* image 404.html */
.error-illustration img {
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
}

/* ANALYTICS CHARTS */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 18px 20px 22px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* The monthly trend chart spans the full width of the grid. */
.chart-card-wide {
    grid-column: 1 / -1;
}

.chart-card h4 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: #333;
}

/* Chart.js needs a sized container when maintainAspectRatio is false. */
.chart-canvas-wrap {
    position: relative;
    height: 260px;
}

@media (max-width: 600px) {
    .chart-canvas-wrap {
        height: 220px;
    }
}
/* ── Status badges used by SLA + triage ─────────────────────── */
.badge-success { background: #e1f2e8; color: #17663f; }
.badge-warning { background: #fbefd5; color: #7a5200; }
.badge-danger  { background: #f8e0dc; color: #9b2c20; }

/* ── AI triage ──────────────────────────────────────────────── */
.triage-equity { margin: 1rem 0; }
.triage-steps { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.triage-table td { vertical-align: top; }
.triage-life-safety td:first-child { border-left: 4px solid var(--accent); }
.triage-detail-row td { padding-top: 0; }
.triage-detail-row summary { cursor: pointer; color: var(--text-muted); }
.triage-factors { margin: 0.5rem 0 0.75rem 1.25rem; line-height: 1.6; }
.triage-panel { margin: 1.5rem 0; }
.triage-conf { font-size: 0.8rem; padding: 0.1rem 0.5rem; border-radius: 999px; text-transform: uppercase; }
.triage-conf-high { background: #e1f2e8; color: #17663f; }
.triage-conf-medium { background: #fbefd5; color: #7a5200; }
.triage-conf-low { background: #f8e0dc; color: #9b2c20; }
.triage-page .form-inline select, .triage-page .form-inline input[type=text],
.triage-decide select, .triage-decide input[type=text] { width: auto; }
.triage-decide { margin: 0.75rem 0; align-items: center; }

.ai-notes { margin: 0.75rem 0; padding: 0.75rem 1rem; border: 1px solid var(--border-light); border-radius: var(--radius); background: var(--surface); }
.ai-notes h4 { margin-bottom: 0.4rem; }

/* ── Ticket timeline ─────────────────────────────────────── */
.badge-stage { background: #ece6f4; color: #4f3878; }
.ticket-timeline { margin: 1.5rem 0; }
.timeline { list-style: none; margin: 0.75rem 0 1rem; padding-left: 1rem; border-left: 2px solid var(--border-light); }
.timeline-item { position: relative; margin: 0 0 0.9rem 0.75rem; }
.timeline-item::before { content: ''; position: absolute; left: -1.27rem; top: 0.45rem; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.timeline-item .help-text { margin-left: 0.5rem; }

/* ── Picture-led reporting ───────────────────────────────── */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
        min-height: 140px; padding: 1rem; border-radius: var(--radius); background: var(--bg-card);
        border: 2px solid var(--border-light); color: var(--text); text-decoration: none; text-align: center; transition: var(--transition); }
.tile:hover, .tile:focus { border-color: var(--teal); transform: translateY(-2px); }
.tile-danger { border-color: rgba(192, 57, 43, 0.5); }
.tile-icon { font-size: 3rem; line-height: 1; }
.tile-label { font-weight: 600; font-size: 1.05rem; }
.report-alt { margin-top: 1.5rem; }
.report-form .question { margin: 1rem 0; padding: 1rem 1.25rem; border: 1px solid var(--border-light); }
.report-form legend { font-weight: 600; font-size: 1.1rem; padding: 0 0.25rem; }
.answer-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.75rem 0; }
.answer input { position: absolute; opacity: 0; }
.answer span { display: inline-block; min-width: 110px; padding: 0.8rem 1.1rem; border-radius: var(--radius);
               border: 2px solid var(--border-light); background: var(--bg-input); font-size: 1.05rem; text-align: center; cursor: pointer; }
.answer input:checked + span { border-color: var(--teal); background: #dcefeb; }
.answer input:focus-visible + span { outline: 2px solid var(--accent); }
.photo-input { display: block; margin-top: 0.5rem; color: var(--text-muted); }
.photo-input input { display: block; margin-top: 0.35rem; }
.household-fields { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; }
.btn-big { font-size: 1.15rem; padding: 0.9rem 1.6rem; margin: 1rem 0 2rem; }
.safety-first { font-size: 1.05rem; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
.photo-grid img { width: 100%; height: 140px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border-light); }
.photo-grid figcaption { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }

.alert-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
a.stat-card { text-decoration: none; color: inherit; }

/* ── Before / after and receipts ─────────────────────────── */
.before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.before-after h4 { color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; }
.receipts { margin: 1.5rem 0; }
.receipt { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.receipt:last-of-type { border-bottom: none; }
.receipt-thumb img { width: 120px; height: 160px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-light); }
.receipt-body { flex: 1; min-width: 0; }
.receipt-body p { margin: 0.2rem 0; }
.receipt-lines { margin: 0.5rem 0; font-size: 0.85rem; }
.receipt-lines td, .receipt-lines th { padding: 6px 10px; }
.receipts .ok { color: var(--success); font-weight: 600; }
.receipts .bad { color: var(--danger); font-weight: 600; }
.receipt-edit { margin-top: 0.75rem; }
.receipt-edit summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.receipt-edit input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; width: 100%; }
.receipt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.5rem; margin: 0.75rem 0; }
.receipt-grid label { font-size: 0.8rem; color: var(--text-muted); }
.receipt-line { display: grid; grid-template-columns: 3fr 1fr 1fr; gap: 0.5rem; margin-bottom: 0.4rem; }
@media (max-width: 600px) { .before-after { grid-template-columns: 1fr; } .receipt { flex-direction: column; } }
