/* TCH Placements — Main Stylesheet
   Brand colours from Tuniti Care Hero CI:
   Teal:           #10B2B4
   Charcoal:       #3A3839
   Dark Charcoal:  #242424
   Tuniti Yellow:  #E9EB01
   White:          #FFFFFF
*/

/* ── Reset & Base ──────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #3A3839;
    background: #FFFFFF;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #10B2B4;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #0D8E90;
}

img {
    max-width: 100%;
    height: auto;
}

/* ── Typography ────────────────────────────────── */

h1, h2, h3, h4 {
    color: #242424;
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 2.75rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.35rem; }

/* ── Layout ────────────────────────────────────── */

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Navbar ────────────────────────────────────── */

.navbar {
    background: #FFFFFF;
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: #242424;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand .brand-tch {
    color: #10B2B4;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.navbar-nav a {
    color: #3A3839;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.navbar-nav a:hover {
    color: #10B2B4;
}

/* ── Buttons ───────────────────────────────────── */

.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: #10B2B4;
    color: #FFFFFF;
    border-color: #10B2B4;
}

.btn-primary:hover {
    background: #0D8E90;
    border-color: #0D8E90;
    color: #FFFFFF;
}

.btn-outline {
    background: transparent;
    color: #10B2B4;
    border-color: #10B2B4;
}

.btn-outline:hover {
    background: #10B2B4;
    color: #FFFFFF;
}

.btn-dark {
    background: #242424;
    color: #FFFFFF;
    border-color: #242424;
}

.btn-dark:hover {
    background: #3A3839;
    border-color: #3A3839;
    color: #FFFFFF;
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
}

/* ── Hero Section ──────────────────────────────── */

.hero {
    background: linear-gradient(135deg, #242424 0%, #3A3839 100%);
    color: #FFFFFF;
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(16, 178, 180, 0.08);
}

.hero h1 {
    color: #FFFFFF;
    font-size: 3rem;
    margin-bottom: 1.25rem;
    max-width: 600px;
}

.hero h1 .highlight {
    color: #10B2B4;
}

.hero p {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 540px;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ── Services / Features Grid ──────────────────── */

.section {
    padding: 5rem 0;
}

.section-alt {
    background: #F7F8F9;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header p {
    color: #666;
    margin-top: 0.75rem;
    font-size: 1.05rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.card {
    background: #FFFFFF;
    border-radius: 10px;
    padding: 2rem;
    border: 1px solid #eee;
    transition: box-shadow 0.25s, transform 0.25s;
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: rgba(16, 178, 180, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: #10B2B4;
    font-size: 1.4rem;
}

.card h3 {
    margin-bottom: 0.75rem;
}

.card p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ── CTA Sections ──────────────────────────────── */

.cta-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 300px;
}

.cta-block {
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cta-block h2 {
    margin-bottom: 1rem;
}

.cta-block p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.cta-caregivers {
    background: #10B2B4;
    color: #FFFFFF;
}

.cta-caregivers h2 {
    color: #FFFFFF;
}

.cta-clients {
    background: #242424;
    color: #FFFFFF;
}

.cta-clients h2 {
    color: #FFFFFF;
}

.cta-clients .btn-outline {
    color: #FFFFFF;
    border-color: #FFFFFF;
}

.cta-clients .btn-outline:hover {
    background: #FFFFFF;
    color: #242424;
}

.cta-caregivers .btn {
    background: #FFFFFF;
    color: #10B2B4;
    border-color: #FFFFFF;
}

.cta-caregivers .btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #0D8E90;
}

/* ── Stats Bar ─────────────────────────────────── */

.stats-bar {
    background: #10B2B4;
    padding: 3rem 0;
    color: #FFFFFF;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item h3 {
    font-size: 2.5rem;
    color: #FFFFFF;
    margin-bottom: 0.25rem;
}

.stat-item p {
    font-size: 0.95rem;
    opacity: 0.85;
}

/* ── Footer ────────────────────────────────────── */

.footer {
    background: #242424;
    color: rgba(255, 255, 255, 0.7);
    padding: 3rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer h4 {
    color: #FFFFFF;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer p {
    font-size: 0.9rem;
    line-height: 1.7;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #10B2B4;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

/* ── Auth / Login ──────────────────────────────── */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F7F8F9;
}

.auth-card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.auth-card h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-card .subtitle {
    color: #666;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: #3A3839;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #FFFFFF;
}

.form-control:focus {
    outline: none;
    border-color: #10B2B4;
    box-shadow: 0 0 0 3px rgba(16, 178, 180, 0.15);
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-success {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

/* ── Admin Layout ──────────────────────────────── */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: #242424;
    color: #FFFFFF;
    padding: 1.5rem 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.admin-sidebar-brand {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.admin-sidebar-brand h2 {
    color: #FFFFFF;
    font-size: 1.2rem;
}

.admin-sidebar-brand .brand-tch {
    color: #10B2B4;
}

.admin-sidebar-brand small {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
}

.admin-nav {
    list-style: none;
}

.admin-nav li a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.admin-nav li a:hover,
.admin-nav li a.active {
    background: rgba(16, 178, 180, 0.15);
    color: #10B2B4;
}

.admin-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
    background: #F7F8F9;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-header h1 {
    font-size: 1.75rem;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #666;
    font-size: 0.9rem;
}

.admin-user-avatar {
    width: 36px;
    height: 36px;
    background: #10B2B4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Dashboard cards */
.dash-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dash-card {
    background: #FFFFFF;
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid #eee;
}

.dash-card-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.dash-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #242424;
}

.dash-card-sub {
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.25rem;
}

.dash-card.accent {
    border-left: 4px solid #10B2B4;
}

/* ── Sidebar nav headings & separators ─────────── */

.admin-nav .nav-heading {
    padding: 0.85rem 1rem 0.3rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 600;
}

.admin-nav .nav-separator {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.5rem;
}

/* ── Report filters ────────────────────────────── */

.report-filters {
    background: #FFFFFF;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    border: 1px solid #eee;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.report-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.report-filters label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.report-filters select,
.report-filters input[type="month"],
.report-filters input[type="text"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.875rem;
    font-family: inherit;
    min-width: 160px;
    background: #fff;
}

.report-filters select:focus,
.report-filters input:focus {
    outline: none;
    border-color: #10B2B4;
}

.report-filters .btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
}

/* ── Report tables ─────────────────────────────── */

.report-table-wrap {
    background: #FFFFFF;
    border-radius: 10px;
    border: 1px solid #eee;
    /* overflow removed — would break position:sticky on thead */
}

/* Sticky thead — page-level. Works because .report-table now uses
   border-collapse: separate (collapse breaks sticky in Chrome/Edge). */
.report-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #F7F8F9;
    box-shadow: inset 0 -2px 0 #eee;  /* replaces the collapsed border below */
}
/* tbody needs an explicit top-border since we lost border-collapse */
.report-table tbody td {
    border-top: 1px solid #f0f0f0;
}

/* Optional scroll-within-container wrapper (rarely needed now that sticky
   is handled page-level). */
.report-table-scroll {
    max-height: calc(100vh - 220px);
    overflow: auto;
    background: #FFFFFF;
    border-radius: 10px;
    border: 1px solid #eee;
}

/* Totals row */
.report-table tfoot td,
.report-table tr.totals-row td {
    font-weight: 700;
    background: #F1F3F5;
    border-top: 2px solid #ddd;
    color: #1f2937;
}

/* Pagination control */
.tch-paging {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-top: 1px solid #eee;
    background: #fff;
    font-size: 0.85rem;
    color: #495057;
}
.tch-paging .pages a, .tch-paging .pages span {
    padding: 0.2rem 0.55rem;
    margin: 0 0.1rem;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    color: #495057;
    text-decoration: none;
    background: #fff;
}
.tch-paging .pages a:hover { background: #f0f0f0; }
.tch-paging .pages .current {
    background: #10B2B4; color: #fff; border-color: #10B2B4;
}
.tch-paging .pages .disabled {
    opacity: 0.4; pointer-events: none;
}

.report-table {
    width: 100%;
    border-collapse: separate;  /* separate (not collapse) — required for position:sticky th */
    border-spacing: 0;
    font-size: 0.9rem;
}

.report-table th {
    background: #F7F8F9;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
    border-bottom: 2px solid #eee;
    white-space: nowrap;
}

.report-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    color: #3A3839;
}

.report-table tr:last-child td {
    border-bottom: none;
}

.report-table tr:hover td {
    background: #FAFBFC;
}

.report-table .number,
.tch-data-table .number,
.name-table .number {
    text-align: right;
    font-variant-numeric: tabular-nums;
    padding-right: 1.25rem;
}

/* Centre-align for fixed-width / short-string columns — TCH IDs, dates,
   yes/no flags, phone numbers, short codes. Apply class="center" to the
   <th> and matching <td>s. */
.report-table .center,
.tch-data-table .center,
.name-table .center {
    text-align: center;
}

.report-table .total-row td {
    font-weight: 700;
    background: #F7F8F9;
    border-top: 2px solid #ddd;
}

.report-table .drill-toggle {
    cursor: pointer;
    user-select: none;
}

.report-table .drill-toggle:hover td {
    background: #EFF9F9;
}

.report-table .drill-toggle td:first-child::before {
    content: '\25B6';
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.7rem;
    color: #10B2B4;
    transition: transform 0.2s;
}

.report-table .drill-toggle.open td:first-child::before {
    transform: rotate(90deg);
}

.report-table .drill-row {
    display: none;
}

.report-table .drill-row.show {
    display: table-row;
}

.report-table .drill-row td {
    background: #FAFBFC;
    padding-left: 2.5rem;
    font-size: 0.85rem;
    color: #666;
}

.report-table .drill-row:hover td {
    background: #F0F4F4;
}

/* ── Name reconciliation ───────────────────────── */

.name-card {
    background: #FFFFFF;
    border-radius: 10px;
    border: 1px solid #eee;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.name-card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.name-card-header h3 {
    font-size: 1rem;
    margin: 0;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-muted {
    background: #F3F4F6;
    color: #6B7280;
}

.name-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.name-table th {
    background: #F7F8F9;
    padding: 0.6rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
    border-bottom: 1px solid #eee;
}

.name-table td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.name-table tr:hover td {
    background: #FAFBFC;
}

.name-table select {
    padding: 0.35rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
    width: 100%;
}

.name-table .score {
    font-size: 0.8rem;
    font-weight: 600;
}

.name-table .score-high { color: #059669; }
.name-table .score-med  { color: #D97706; }
.name-table .score-low  { color: #DC2626; }

.name-actions {
    display: flex;
    gap: 0.5rem;
}

.name-actions .btn {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

/* ── 404 Page ──────────────────────────────────── */

.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #F7F8F9;
}

.error-page h1 {
    font-size: 6rem;
    color: #10B2B4;
    margin-bottom: 0.5rem;
}

.error-page p {
    color: #666;
    margin-bottom: 2rem;
}

/* ── Mobile hamburger menu ─────────────────────── */

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 0.75rem;
    right: 1rem;
    z-index: 999;
    background: #10B2B4;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    line-height: 1;
}

.sidebar-overlay {
    display: none;
}

/* ── Responsive ────────────────────────────────── */

@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    .hero { padding: 4rem 0; }

    .cta-split {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 149;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s;
    }

    .admin-sidebar {
        position: fixed;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 150;
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-sidebar.open + .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .admin-content {
        margin-left: 0;
        padding-top: 4rem;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .report-filters {
        flex-direction: column;
    }

    .report-filters select,
    .report-filters input {
        min-width: auto;
        width: 100%;
    }

    .report-table-wrap {
        overflow-x: auto;
    }

    .stat-item h3 {
        font-size: 2rem;
    }

    .dash-cards {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================================
   Person Review — card view styled to mirror the Tuniti
   intake PDF layout (photo top-left, two-column field block,
   NoK, attachments, import notes, action buttons).
   ============================================================ */
.person-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.person-card-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}
.person-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f3f4f6;
}
.person-photo-placeholder {
    background: #f3f4f6;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}
.person-card-title h2 {
    margin: 0 0 0.25rem 0;
    color: #6b7280;
    font-size: 1.85rem;
    font-weight: 700;
}
.person-card-tch-id {
    font-size: 1.25rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-family: monospace;
}
.person-card-meta {
    color: #6b7280;
    font-size: 0.9rem;
}
.person-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}
.person-card-section h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}
.person-card-section dl {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 0.5rem 1rem;
    margin: 0;
}
.person-card-section dt {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}
.person-card-section dd {
    margin: 0;
    color: #111827;
    font-size: 0.9rem;
    word-break: break-word;
}
.attachment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.attachment-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
}
.attachment-list li:last-child {
    border-bottom: none;
}
.import-notes {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1rem;
    border-radius: 4px;
    white-space: pre-wrap;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    color: #78350f;
    overflow-x: auto;
}
.person-card-actions {
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
}
.btn-danger {
    background: #DC2626;
    color: #fff;
    border: 1px solid #DC2626;
}
.btn-danger:hover {
    background: #B91C1C;
    border-color: #B91C1C;
}

@media (max-width: 768px) {
    .person-card-grid {
        grid-template-columns: 1fr;
    }
    .person-card-header {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================================
   Public homepage — care services, why-TCH, trust block,
   enquiry form, contact grid.
   ============================================================ */

/* Hero with background image. The image itself goes in
   public/assets/img/site/hero-care.jpg — until that file exists,
   the gradient overlay alone is enough to be presentable. */
.hero.hero-image {
    position: relative;
    background:
        linear-gradient(135deg, rgba(16, 178, 180, 0.92) 0%, rgba(7, 89, 91, 0.92) 100%),
        url('../img/site/hero-care.jpg') center/cover no-repeat;
    color: #fff;
    padding: 6rem 0 5rem;
}
.hero.hero-image h1 {
    font-size: 3rem;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    max-width: 850px;
}
.hero.hero-image p {
    font-size: 1.15rem;
    line-height: 1.6;
    max-width: 720px;
    margin-bottom: 2rem;
}
.hero.hero-image .highlight {
    color: #FFE66D;
}
.btn-lg {
    padding: 0.95rem 2rem;
    font-size: 1.05rem;
}

/* Service cards */
.services-grid .service-card {
    padding: 2rem 1.75rem;
    text-align: left;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.services-grid .service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.service-icon {
    font-size: 2rem;
    color: #10B2B4;
    margin-bottom: 1rem;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(16, 178, 180, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}
.service-card h3 {
    font-size: 1.25rem;
    margin: 0 0 0.75rem 0;
    color: #07595B;
}
.service-card p {
    color: #4b5563;
    line-height: 1.55;
    margin-bottom: 1.25rem;
}
.service-card-highlight {
    background: linear-gradient(135deg, #07595B 0%, #10B2B4 100%);
    color: #fff;
}
.service-card-highlight h3,
.service-card-highlight p {
    color: #fff;
}
.service-card-highlight .service-icon {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* Why-TCH grid */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}
.why-card {
    padding: 1.75rem 1.5rem;
    text-align: left;
}
.why-icon {
    font-size: 1.75rem;
    color: #10B2B4;
    margin-bottom: 0.75rem;
}
.why-card h3 {
    font-size: 1.1rem;
    color: #07595B;
    margin: 0 0 0.5rem 0;
}
.why-card p {
    color: #4b5563;
    font-size: 0.92rem;
    line-height: 1.55;
}

/* How-it-works step circles */
.how-card {
    text-align: center;
    padding: 2rem 1.5rem;
}
.how-step {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #10B2B4;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

/* Trust block — wide gradient panel */
.section-trust {
    background: linear-gradient(135deg, #07595B 0%, #10B2B4 100%);
    color: #fff;
    padding: 5rem 0;
}
.trust-block {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}
.trust-block h2 {
    font-size: 2.25rem;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    color: #fff;
}
.trust-block .highlight {
    color: #FFE66D;
}
.trust-block p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: #e6f7f7;
}

/* Enquiry form */
.enquiry-form {
    max-width: 760px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.enquiry-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.enquiry-form .form-group {
    margin-bottom: 1rem;
}
.enquiry-form label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
    font-size: 0.92rem;
}
.enquiry-form input[type=text],
.enquiry-form input[type=email],
.enquiry-form input[type=tel],
.enquiry-form select,
.enquiry-form textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
}
.enquiry-form input:focus,
.enquiry-form select:focus,
.enquiry-form textarea:focus {
    outline: none;
    border-color: #10B2B4;
    box-shadow: 0 0 0 3px rgba(16, 178, 180, 0.15);
}
.enquiry-form .req {
    color: #DC2626;
}
.enquiry-form .form-checkbox label {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    font-weight: 400;
    font-size: 0.88rem;
    color: #4b5563;
    line-height: 1.5;
}
.enquiry-form .form-checkbox input[type=checkbox] {
    margin-top: 0.2rem;
    flex-shrink: 0;
}
.enquiry-form .form-actions {
    text-align: center;
    margin-top: 1.5rem;
}
.enquiry-form .form-note {
    margin-top: 1rem;
    color: #6b7280;
    font-size: 0.85rem;
}

/* Alerts */
.alert {
    max-width: 760px;
    margin: 0 auto 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
}
.alert-success {
    background: #d1fae5;
    border: 1px solid #10b981;
    color: #065f46;
}
.alert-error {
    background: #fee2e2;
    border: 1px solid #DC2626;
    color: #7f1d1d;
}

/* Contact grid */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    text-align: center;
}
.contact-grid h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 0.75rem;
}
.contact-big {
    font-size: 1.4rem;
    font-weight: 700;
    color: #07595B;
    margin: 0 0 0.5rem;
}
.contact-big a {
    color: #07595B;
    text-decoration: none;
}
.contact-big a:hover {
    color: #10B2B4;
}
.muted {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Mobile */
@media (max-width: 900px) {
    .grid-4 {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 768px) {
    .hero.hero-image h1 {
        font-size: 2rem;
    }
    .hero.hero-image p {
        font-size: 1rem;
    }
    .grid-4 {
        grid-template-columns: 1fr;
    }
    .enquiry-form .form-row {
        grid-template-columns: 1fr;
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }
    .trust-block h2 {
        font-size: 1.6rem;
    }
}

/* ============================================================
   Public navbar — mobile hamburger menu
   Hamburger sits fixed top-left. Clicking it slides a left
   drawer in over the page. Click overlay or any nav link to close.
   ============================================================ */
.public-menu-toggle {
    display: none;
}
.public-menu-overlay {
    display: none;
}

@media (max-width: 768px) {
    .public-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0.85rem;
        left: 1rem;
        z-index: 201;
        background: #10B2B4;
        color: #fff;
        border: none;
        border-radius: 8px;
        width: 46px;
        height: 46px;
        font-size: 1.55rem;
        cursor: pointer;
        box-shadow: 0 2px 12px rgba(0,0,0,0.25);
        line-height: 1;
    }
    .public-menu-toggle:hover,
    .public-menu-toggle:focus {
        background: #0D8E90;
        outline: none;
    }

    /* On mobile, push the brand right so it doesn't sit under
       the fixed hamburger button. */
    .navbar .container {
        justify-content: flex-end;
    }
    .navbar-brand {
        font-size: 1.2rem;
    }

    /* Drawer: navbar-nav becomes a left-edge slide-in panel */
    .navbar-nav {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 82%;
        max-width: 320px;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        padding: 5rem 1.5rem 2rem;
        gap: 0;
        margin: 0;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 200;
        box-shadow: 2px 0 18px rgba(0,0,0,0.18);
        overflow-y: auto;
    }
    .navbar-nav li {
        width: 100%;
        border-bottom: 1px solid #f3f4f6;
        list-style: none;
    }
    .navbar-nav li:last-child {
        border-bottom: none;
        margin-top: 1rem;
    }
    .navbar-nav a {
        display: block;
        padding: 1rem 0;
        font-size: 1.05rem;
        color: #07595B;
    }
    .navbar-nav a.btn {
        display: block;
        text-align: center;
        padding: 0.85rem 1rem;
    }

    /* The drawer is DOM-nested inside <nav class="navbar">, which is
       position:sticky with z-index:100. That sticky container creates
       a stacking context, capping the drawer's z-index:200 to within
       the navbar's z-100 globally. The overlay at root-level z-199
       would then sit ABOVE the drawer, intercepting every tap and
       closing the drawer before the link click resolves.

       Fix: raise the navbar's stacking context above the overlay while
       the drawer is open, so the drawer (at z-200 within navbar) ends
       up above the overlay (at root z-199). */
    body.public-menu-open .navbar {
        z-index: 250;
    }

    body.public-menu-open .navbar-nav {
        transform: translateX(0);
    }

    /* Backdrop overlay shown when drawer is open */
    .public-menu-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 199;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }
    body.public-menu-open .public-menu-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    /* Lock background scroll while drawer is open */
    body.public-menu-open {
        overflow: hidden;
    }
}

/* ============================================================
   User management additions (v0.8.0 — Session B)
   ============================================================ */

/* Persistent impersonation banner — appears at the very top of admin
   pages whenever a Super Admin is impersonating another user. */
.impersonation-banner {
    background: #DC2626;
    color: #fff;
    padding: 0.6rem 1rem;
    text-align: center;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.impersonation-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
}
.impersonation-stop {
    color: #fff;
    text-decoration: underline;
    margin-left: 1rem;
    font-weight: 600;
}
.impersonation-stop:hover {
    color: #FEE2E2;
}

/* Additional badge variant for failed states */
.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

/* Info-style alert (used on dev fallback link blocks etc.) */
.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* -------------------------------------------------------------------------
 * Activity log field-level diff rendering
 *
 * Used inline on the activity log list view (collapsible per row) and in
 * the Was/Now columns on the detail page. Red strikethrough = old value,
 * green = new value — matches the Nexus CRM convention.
 * ------------------------------------------------------------------------- */
.activity-inline-diff {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: #555;
}

.activity-inline-diff > summary {
    cursor: pointer;
    color: #666;
    list-style: disclosure-closed;
    user-select: none;
    padding: 0.15rem 0;
}

.activity-inline-diff[open] > summary {
    list-style: disclosure-open;
    color: #333;
    margin-bottom: 0.25rem;
}

.activity-inline-diff .diff-row {
    padding: 0.15rem 0 0.15rem 1rem;
    line-height: 1.4;
    word-break: break-word;
}

.diff-was {
    color: #C0392B;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.diff-now {
    color: #1E8449;
    text-decoration: none;
    font-weight: 500;
}

.diff-arrow {
    color: #999;
    margin: 0 0.15rem;
}

/* Detail page Was/Now table cells use the same palette */
.name-table td.diff-was-cell { color: #C0392B; }
.name-table td.diff-now-cell { color: #1E8449; font-weight: 500; }

/* -------------------------------------------------------------------------
 * Shared sortable + filterable table component (tch-data-table)
 *
 * Opt-in by adding class="tch-data-table" to any <table>. The JS at
 * public/assets/js/tch-table.js will:
 *   - Make every column header clickable (toggles asc → desc → off)
 *   - Insert a filter input row below the header with one text input
 *     per non-excluded column
 *
 * Columns with data-sortable="false" or data-filterable="false" / data-no-filter
 * opt out of sort or filter respectively. Drill-down rows (tch-drill-row or
 * legacy drill-row) inherit their parent row's visibility during filtering.
 * ------------------------------------------------------------------------- */

/* Base layout inherits from .report-table / .name-table — this component
   adds behaviour, not layout. Put class="tch-data-table" ALONGSIDE the
   existing .report-table or .name-table class. */

table.tch-data-table th.tch-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.4rem;
}

table.tch-data-table th.tch-sortable:hover {
    background: #F0FDFA;
    color: #0D8E90;
}

table.tch-data-table th.tch-sortable .tch-sort-arrow {
    display: inline-block;
    min-width: 1rem;
    color: #9CA3AF;
    font-size: 0.85em;
    margin-left: 0.25rem;
    vertical-align: middle;
    transition: color 0.15s ease;
    /* Arrow glyph is set directly by JS as textContent. No ::after or
       color:transparent trickery — glyph is always visible in the state
       set by data-sort-state. Defensive against page-level CSS overrides. */
}
table.tch-data-table th.tch-sortable .tch-sort-arrow[data-sort-state="asc"],
table.tch-data-table th.tch-sortable .tch-sort-arrow[data-sort-state="desc"] {
    color: #10B2B4;
    font-weight: bold;
}

/* Filter row — sits below the header row, inside thead */
table.tch-data-table tr.tch-filter-row th {
    padding: 0.35rem 0.5rem;
    background: #FAFBFC;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 400;
    cursor: default;
}

table.tch-data-table tr.tch-filter-row th:hover {
    background: #FAFBFC;
    color: inherit;
}

table.tch-data-table input.tch-filter-input {
    width: 100%;
    max-width: 180px;
    padding: 0.3rem 0.5rem;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: inherit;
    color: #242424;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

table.tch-data-table input.tch-filter-input::placeholder {
    color: #B0B5BB;
    font-style: italic;
}

table.tch-data-table input.tch-filter-input:focus {
    outline: none;
    border-color: #10B2B4;
    box-shadow: 0 0 0 2px rgba(16, 178, 180, 0.15);
}

