/* ═══════════════════════════════════════════════════════════════
   AMC · HABARI — Components
   All reusable UI primitives. No layout logic (that's in layout.css).
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   1. BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    height: 40px;
    padding: 0 var(--sp-5);
    border-radius: var(--r-md);
    font-family: var(--font-ui);
    font-size: var(--t-body);
    font-weight: 600;
    line-height: 1;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
    transition:
        background var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--dur-fast) var(--ease-spring),
        border-color var(--transition-fast),
        color var(--transition-fast);
}

.btn:active {
    transform: scale(.97);
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--glow-blue);
}

/* Primary */
.btn-primary {
    background: linear-gradient(135deg, var(--c-primary) 0%, #1d4ed8 100%);
    color: #fff;

    box-shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 0 0 0 var(--c-primary-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6 0%, var(--c-primary) 100%);
    box-shadow: var(--shadow-md), 0 0 20px var(--c-primary-glow);
    transform: translateY(-1px);
}

/* Secondary */
.btn-secondary {
    background: var(--c-surface-2);
    color: var(--c-text);
    border: 1px solid var(--c-border-hi);
}

.btn-secondary:hover {
    background: var(--c-surface-3);
    border: 1px solid var(--c-border-hi);
}

/* Ghost */
.btn-ghost {
    background: transparent;
    color: var(--c-text-muted);

}

.btn-ghost:hover {
    background: var(--c-surface-2);
    color: var(--c-text);
}

/* Teal (action) */
.btn-teal {
    background: linear-gradient(135deg, var(--c-teal) 0%, var(--c-teal-d) 100%);
    color: #fff;

    box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}

.btn-teal:hover {
    box-shadow: var(--shadow-md), 0 0 20px var(--c-teal-glow);
    transform: translateY(-1px);
}

/* Danger */
.btn-danger {
    background: var(--c-red-soft);
    color: var(--c-red);
    border: 1px solid rgba(220, 38, 38, .25);
}

.btn-danger:hover {
    background: rgba(220, 38, 38, .22);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .15);
}

/* Dose void action (vaccination record) */
.void-btn {
    color: var(--c-danger);
    border: 1px solid rgba(220, 38, 38, .25);
    background: rgba(220, 38, 38, .10);
}

.void-btn:hover {
    color: var(--c-danger);
    background: rgba(220, 38, 38, .18);
    border-color: rgba(220, 38, 38, .35);
}

.void-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .25);
}

/* Sizes */
.btn-sm {
    height: 34px;
    padding: 0 var(--sp-4);
    font-size: var(--t-sm);
    border-radius: var(--r-sm);
}

.btn-lg {
    height: 52px;
    padding: 0 var(--sp-8);
    font-size: var(--t-sub);
    border-radius: var(--r-lg);
}

.btn-xl {
    height: 60px;
    padding: 0 var(--sp-10);
    font-size: 1.05rem;
    border-radius: var(--r-lg);
}

/* Full width */
.btn-block {
    width: 100%;
}

/* Icon-only button */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--r-md);
    flex-shrink: 0;
}

/* Loading state */
.btn[data-loading] {
    pointer-events: none;
    opacity: .7;
}

/* ═══════════════════════════════════════════════════════════════
   2. CARDS
   ═══════════════════════════════════════════════════════════════ */

.card {
    background: var(--bg-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-xl);
    padding: var(--sp-5);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
    border-color: var(--c-border-hi);
    box-shadow: var(--shadow-md);
}

/* Card with accent top bar */
.card-accent-bar {
    position: relative;
    overflow: hidden;
}

.card-accent-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-accent, var(--c-primary));
    border-radius: var(--r-xl) var(--r-xl) 0 0;
}

/* Card header layout */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}

.card-title {
    font-weight: 700;
    font-size: var(--t-sub);
    letter-spacing: -.01em;
}

.card-subtitle {
    font-size: var(--t-caption);
    color: var(--c-text-muted);
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   3. STAT / METRIC CARDS
   ═══════════════════════════════════════════════════════════════ */

.stat-card {
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--c-border);
    border-radius: var(--r-xl);
    padding: var(--sp-5);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--dur-base) var(--ease-out);
}

.stat-card:hover {
    border-color: var(--c-border-hi);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}



.stat-card-icon {
    display: flex;
    align-items: center;
    margin-bottom: var(--sp-3);
    position: relative;
    z-index: 1;
}

.stat-card-value {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.04em;
    margin-bottom: var(--sp-1);
}

.stat-card-label {
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--c-text-muted);
    margin-bottom: var(--sp-2);
}

.stat-card-delta {
    font-size: var(--t-caption);
    color: var(--c-text-muted);
}

.delta-up {
    color: var(--c-green) !important;
}

.delta-down {
    color: var(--c-red) !important;
}

.delta-warn {
    color: var(--c-amber) !important;
}

/* ═══════════════════════════════════════════════════════════════
   4. BADGES
   ═══════════════════════════════════════════════════════════════ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: var(--t-caption);
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.badge-no-dot {
    padding: 3px 10px;
}

.badge-no-dot::before {
    display: none;
}

/* Semantic */
.badge-active,
.badge-success {
    background: var(--c-green-soft);
    color: var(--c-green);
}

.badge-inactive,
.badge-muted {
    background: var(--c-surface-3);
    color: var(--c-text-muted);
}

.badge-danger,
.badge-denied {
    background: var(--c-red-soft);
    color: var(--c-red);
}

.badge-warn,
.badge-amber {
    background: var(--c-amber-soft);
    color: var(--c-amber);
}

.badge-info,
.badge-blue {
    background: var(--c-blue-soft);
    color: var(--c-blue);
}

.badge-teal {
    background: var(--c-teal-glow);
    color: var(--c-teal);
}

.badge-violet {
    background: var(--c-violet-glow);
    color: var(--c-violet);
}

.badge-pending {
    background: var(--c-surface-3);
    color: var(--c-text-muted);
}

/* Source */
.badge-amc {
    background: var(--badge-amc-bg);
    color: var(--badge-amc-text);
    border: 1px solid var(--badge-amc-border);
}

.badge-habari {
    background: var(--badge-habari-bg);
    color: var(--badge-habari-text);
    border: 1px solid var(--badge-habari-border);
}

.badge-global {
    background: var(--badge-global-bg);
    color: var(--badge-global-text);
    border: 1px solid var(--badge-global-border);
}

/* Dose status */
.dose-taken {
    background: var(--c-green-soft);
    color: var(--c-green);
    border-radius: var(--r-full);
    padding: 2px 10px;
    font-size: var(--t-caption);
    font-weight: 700;
}

.dose-voided {
    background: var(--c-red-soft);
    color: var(--c-red);
    border-radius: var(--r-full);
    padding: 2px 10px;
    font-size: var(--t-caption);
    font-weight: 700;
}

.dose-pending {
    background: var(--c-surface-3);
    color: var(--c-text-muted);
    border-radius: var(--r-full);
    padding: 2px 10px;
    font-size: var(--t-caption);
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   5. FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════ */

/* Form group */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.form-label {
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--c-text-muted);
}

.form-label .required {
    color: var(--c-red);
    margin-left: 3px;
}

/* Input */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    height: 42px;
    padding: 0 var(--sp-4);
    background: var(--c-surface-2);
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-md);
    color: var(--c-text);
    font-size: var(--t-body);
    font-family: var(--font-ui);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

.form-textarea {
    height: auto;
    min-height: 96px;
    padding: var(--sp-3) var(--sp-4);
    resize: vertical;
}

.form-input::placeholder,
.form-select::placeholder,
.form-textarea::placeholder {
    color: var(--c-text-muted);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--c-border-hi);
    background: var(--c-surface-3);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--c-primary);
    background: var(--c-surface-3);
    box-shadow: var(--glow-blue);
}

/* Input states */
.form-input.is-error,
.form-select.is-error,
.form-textarea.is-error,
.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
    border-color: var(--c-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .15);
}

.form-input.is-success,
.form-select.is-success {
    border-color: var(--c-green);
    box-shadow: var(--glow-green);
}

/* Input with icon */
.input-wrap {
    position: relative;
}

.input-wrap .form-input,
.input-wrap .form-select {
    padding-left: 40px;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-text-faint);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.input-wrap .input-suffix {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-text-faint);
    pointer-events: none;
    display: flex;
    align-items: center;
}

/* Form row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 768px) {
    .form-row-3 {
        grid-template-columns: 1fr;
    }
}

/* Helper text */
.form-help {
    font-size: var(--t-caption);
    color: var(--c-text-faint);
}

.form-error {
    font-size: var(--t-caption);
    color: var(--c-red);
}

/* Checkbox */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.form-check input[type=checkbox] {
    width: 16px;
    height: 16px;
    accent-color: var(--c-primary);
    flex-shrink: 0;
    cursor: pointer;
}

/* Segmented control */
.segmented {
    display: inline-flex;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 3px;
    gap: 2px;
}

.segmented-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: calc(var(--r-md) - 2px);
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--c-text-muted);
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: inherit;
    transition: background var(--transition), color var(--transition);
    -webkit-user-select: none;
    user-select: none;
    white-space: nowrap;
    min-height: 36px;
}

.segmented-item:hover:not(.active) {
    color: var(--c-text);
    background: var(--c-surface-3);
}

.segmented-item.active {
    background: var(--c-surface-4);
    color: var(--c-text);
    box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════════════════════════
   6. SEARCH BAR
   ═══════════════════════════════════════════════════════════════ */

.search-bar {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex-wrap: wrap;
}

.search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-wrap .form-input {
    padding-left: 40px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-text-faint);
    pointer-events: none;
    display: flex;
    align-items: center;
}

/* Filter chips row */
.filter-chips {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 var(--sp-3);
    border-radius: var(--r-full);
    font-size: var(--t-caption);
    font-weight: 600;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    color: var(--c-text-muted);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}

.filter-chip:hover {
    background: var(--c-surface-3);
    color: var(--c-text);
}

.filter-chip.active {
    background: var(--c-primary-soft);
    border-color: rgba(37, 99, 235, .35);
    color: var(--c-primary);
}

/* ═══════════════════════════════════════════════════════════════
   7. DATA TABLES
   ═══════════════════════════════════════════════════════════════ */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--r-lg);
    border: 1px solid var(--c-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--t-body);
}

thead tr {
    background: var(--c-surface-2);
    border-bottom: 1px solid var(--c-border);
}

thead th {
    padding: var(--sp-3) var(--sp-4);
    text-align: left;
    font-size: var(--t-caption);
    font-weight: 700;
    color: var(--c-text-faint);
    text-transform: uppercase;
    letter-spacing: .07em;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--c-border-soft);
    transition: background var(--transition-fast);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr.clickable:hover {
    background: var(--c-surface-2);
    cursor: pointer;
}

tbody td {
    padding: var(--sp-3) var(--sp-4);
    color: var(--c-text);
    vertical-align: middle;
}

tbody td.muted {
    color: var(--c-text-muted);
    font-size: var(--t-sm);
}

/* Compact variant */
.table-compact thead th,
.table-compact tbody td {
    padding: var(--sp-2) var(--sp-3);
}

/* ═══════════════════════════════════════════════════════════════
   8. AVATAR
   ═══════════════════════════════════════════════════════════════ */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-full);
    font-weight: 700;
    font-size: .7rem;
    color: #fff;
    letter-spacing: .03em;
    flex-shrink: 0;
}

.avatar-sm {
    width: 28px;
    height: 28px;
    font-size: .62rem;
}

.avatar-md {
    width: 36px;
    height: 36px;
    font-size: .72rem;
}

.avatar-lg {
    width: 52px;
    height: 52px;
    font-size: .95rem;
}

.avatar-xl {
    width: 68px;
    height: 68px;
    font-size: 1.2rem;
}

/* ═══════════════════════════════════════════════════════════════
   9. TIMELINE
   ═══════════════════════════════════════════════════════════════ */

.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.timeline-item {
    display: flex;
    gap: var(--sp-4);
    position: relative;
    padding-bottom: var(--sp-5);
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 38px;
    bottom: 0;
    width: 2px;
    background: var(--c-border);
}

.timeline-dot {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 700;
    border: 2px solid var(--c-border);
    z-index: 1;
    position: relative;
    background: var(--c-surface-2);
    transition: box-shadow var(--transition);
}

.timeline-dot.taken {
    background: var(--c-green-soft);
    color: var(--c-green);
    border-color: var(--c-green);
}

.timeline-dot.pending {
    background: rgba(37, 99, 235, .12);
    color: var(--c-primary);
    border-color: var(--c-primary);
}

.timeline-dot.overdue {
    background: var(--c-red-soft);
    color: var(--c-red);
    border-color: var(--c-red);
}

.timeline-dot.warn {
    background: var(--c-amber-soft);
    color: var(--c-amber);
    border-color: var(--c-amber);
}

.timeline-item:hover .timeline-dot {
    box-shadow: 0 0 0 4px var(--c-border-hi);
}

.timeline-content {
    flex: 1;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-xl);
    padding: var(--sp-4);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.timeline-item:hover .timeline-content {
    border-color: var(--c-border-hi);
    box-shadow: var(--shadow-sm);
}

.timeline-vaccine {
    font-weight: 700;
    font-size: var(--t-sub);
    margin-bottom: 6px;
}

.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    font-size: var(--t-sm);
    color: var(--c-text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   10. SKELETON LOADERS
   ═══════════════════════════════════════════════════════════════ */

@keyframes shimmer {
    0% {
        background-position: -400px 0;
    }

    100% {
        background-position: 400px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            var(--c-surface-2) 25%,
            var(--c-surface-3) 37%,
            var(--c-surface-2) 63%);
    background-size: 400px 100%;
    animation: shimmer 1.4s ease infinite;
    border-radius: var(--r-sm);
}

.skeleton-text {
    height: 14px;
    border-radius: var(--r-full);
}

.skeleton-title {
    height: 20px;
    border-radius: var(--r-full);
}

.skeleton-avatar {
    border-radius: 50%;
}

.skeleton-card {
    height: 120px;
    border-radius: var(--r-xl);
}

/* ═══════════════════════════════════════════════════════════════
   11. TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */

#toast-container {
    position: fixed;
    top: var(--sp-5);
    right: var(--sp-5);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--c-surface-3);
    border: 1px solid var(--c-border-hi);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    font-size: var(--t-sm);
    font-weight: 500;
    color: var(--c-text);
    min-width: 260px;
    max-width: 360px;
    pointer-events: all;
    animation: toast-in var(--dur-base) var(--ease-out);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.toast.toast-out {
    animation: toast-out var(--dur-base) var(--ease-in-out) forwards;
}

.toast-icon {
    flex-shrink: 0;
    display: flex;
}

.toast.success .toast-icon {
    color: var(--c-green);
}

.toast.error .toast-icon {
    color: var(--c-red);
}

.toast.warn .toast-icon {
    color: var(--c-amber);
}

.toast.info .toast-icon {
    color: var(--c-blue);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(24px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(24px);
    }
}

/* ═══════════════════════════════════════════════════════════════
   12. EMPTY STATES
   ═══════════════════════════════════════════════════════════════ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--sp-12) var(--sp-8);
    text-align: center;
    color: var(--c-text-muted);
    gap: var(--sp-3);
}

.empty-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--r-xl);
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text-faint);
    margin-bottom: var(--sp-2);
}

.empty-title {
    font-size: var(--t-sub);
    font-weight: 700;
    color: var(--c-text);
}

.empty-desc {
    font-size: var(--t-sm);
    color: var(--c-text-muted);
    max-width: 320px;
}

/* ═══════════════════════════════════════════════════════════════
   13. MODAL
   ═══════════════════════════════════════════════════════════════ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-5);
    background: rgba(0, 0, 0, .60);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    overflow-y: auto;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .60);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-5);
    animation: fade-in var(--dur-base) var(--ease-out);
}

.modal {
    width: 100%;
    max-width: 560px;
    margin: auto;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border-hi);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-xl);
    animation: modal-in var(--dur-base) var(--ease-out);
    max-height: calc(100dvh - (var(--sp-5) * 2));
    overflow-y: auto;
}

.modal-lg {
    max-width: 840px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-5) var(--sp-6) var(--sp-4);
    border-bottom: 1px solid var(--c-border);
}

.modal-title {
    font-size: var(--t-sub);
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.modal-close:hover {
    background: var(--c-surface-4);
    color: var(--c-text);
}

.modal-body {
    padding: var(--sp-5) var(--sp-6);
}

.modal-footer {
    padding: var(--sp-4) var(--sp-6) var(--sp-5);
    border-top: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--sp-3);
    flex-wrap: wrap;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(.96) translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ═══════════════════════════════════════════════════════════════
   14. PATIENT LIST ROWS
   ═══════════════════════════════════════════════════════════════ */

.patient-card-row {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-4);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform var(--dur-fast) var(--ease-out);
    text-decoration: none;
    color: inherit;
    min-height: 72px;
}

.patient-card-row:hover {
    background: var(--c-surface-2);
    border-color: var(--c-border-hi);
    transform: translateX(3px);
}

.patient-card-avatar {
    flex-shrink: 0;
}

.patient-card-main {
    flex: 1;
    min-width: 0;
}

.patient-card-name {
    font-weight: 700;
    font-size: var(--t-body);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.patient-card-sub {
    font-size: var(--t-caption);
    color: var(--c-text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.patient-card-arrow {
    color: var(--c-text-faint);
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: color var(--transition), transform var(--transition);
}

.patient-card-row:hover .patient-card-arrow {
    color: var(--c-primary);
    transform: translateX(3px);
}

/* ═══════════════════════════════════════════════════════════════
   15. VERIFICATION RESULT
   ═══════════════════════════════════════════════════════════════ */

.verify-result-card {
    border-radius: var(--r-xl);
    overflow: hidden;
    border: 1px solid var(--c-border);
    box-shadow: var(--shadow-md);
    animation: modal-in var(--dur-slow) var(--ease-out);
}

.verify-result-stamp {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-5) var(--sp-6);
}

.verify-result-stamp.found {
    background: var(--c-green-soft);
}

.verify-result-stamp.not-found {
    background: var(--c-red-soft);
}

.verify-stamp-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

.verify-result-stamp.found .verify-stamp-icon {
    background: var(--c-green);
    color: #fff;
}

.verify-result-stamp.not-found .verify-stamp-icon {
    background: var(--c-red);
    color: #fff;
}

.verify-stamp-label {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: .04em;
}

.verify-stamp-label.found {
    color: var(--c-green);
}

.verify-stamp-label.not-found {
    color: var(--c-red);
}

.verify-result-body {
    padding: var(--sp-5) var(--sp-6);
    background: var(--c-surface-2);
}

/* ═══════════════════════════════════════════════════════════════
   16. MISC UTILITIES
   ═══════════════════════════════════════════════════════════════ */

/* Filters bar */
.filters-bar {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
    flex-wrap: wrap;
}

/* Access denied */
.access-denied {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: var(--sp-8);
    gap: var(--sp-4);
}

.access-denied-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--r-xl);
    background: var(--c-red-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-red);
}

/* Topbar source badge */
.topbar-source-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--r-full);
    font-size: var(--t-caption);
    font-weight: 700;
    letter-spacing: .04em;
}

/* ── Mobile Accordions (Desktop view by default) ── */
.mobile-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--c-border);
    padding-bottom: 12px;
    margin-bottom: var(--sp-4);
}

.mobile-accordion-title {
    font-size: var(--t-sub);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--c-text);
    margin: 0;
}

.accordion-icon {
    display: none;
    color: var(--c-text-muted);
}

.mobile-accordion-content {
    display: block;
}