:root {
    --primary: #0e7490;
    --primary-dark: #0b5c73;
    --primary-light: #e0f2fe;
    --bg: #f4f7fa;
    --surface: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Cairo", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Top bar */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 62px;
}

.brand {
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand:hover {
    text-decoration: none;
}

.brand .logo {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), #22d3ee);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav a {
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 500;
    font-size: 14px;
}

.nav a:hover {
    text-decoration: none;
    background: var(--primary-light);
    color: var(--primary-dark);
}

.nav a.btn {
    color: #fff;
}

.nav .user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
    padding-left: 14px;
    border-left: 1px solid var(--border);
    font-size: 13px;
    color: var(--muted);
}

/* Layout */
.wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.card.bordered {
    border-left: 4px solid var(--primary);
}

/* Headings */
h1, h2, h3 {
    margin: 0 0 6px;
    color: #111827;
    font-weight: 700;
}

h1 { font-size: 24px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    background: #e5e7eb;
    color: #111827;
    transition: background 0.12s, opacity 0.12s;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-danger { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-success { background: var(--success); color: #fff; }

.btn-small { padding: 6px 12px; font-size: 13px; }

/* Forms */
label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 5px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
input[type="date"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.15);
}

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

.field { margin-bottom: 16px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-grid .full { grid-column: 1 / -1; }

.error { color: var(--danger); font-size: 13px; margin-top: 5px; }

.invalid { border-color: var(--danger) !important; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-info { background: var(--primary-light); border-color: #bae6fd; color: #075985; }

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.table th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }

.table tr:hover td { background: #fafcfe; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
}

.badge-draft { background: #f3f4f6; color: #4b5563; }
.badge-reviewed { background: var(--primary-light); color: var(--primary-dark); }
.badge-finalized { background: #ecfdf5; color: #047857; }

.badge-processing {
    background: #fffbeb;
    color: var(--warning);
    display: inline-flex;
    align-items: center;
}

.badge-processing::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Steps */
.steps {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.step .dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    color: #4b5563;
    font-size: 12px;
}

.step.active { color: var(--primary-dark); }
.step.active .dot { background: var(--primary); color: #fff; }
.step.done { color: var(--success); }
.step.done .dot { background: var(--success); color: #fff; }

/* List rows */
.list-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.list-row:last-child { border-bottom: none; }

/* Timeline for visit history */
.timeline { position: relative; padding-right: 24px; }

.timeline::before {
    content: "";
    position: absolute;
    right: 7px;
    top: 4px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding: 0 0 22px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    right: -24px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--border);
}

.timeline .meta { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }

/* Answer box */
.answer-box {
    background: var(--primary-light);
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 14px 16px;
    white-space: pre-wrap;
    font-size: 14.5px;
    margin-top: 12px;
}

/* Utility */
.row { display: flex; align-items: center; gap: 10px; }
.spread { justify-content: space-between; }
.flex { display: flex; gap: 14px; }
.flex-1 { flex: 1; }
.mt-0 { margin-top: 0; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.hidden { display: none; }
.text-right { text-align: right; }
.wrap-text { white-space: pre-wrap; }

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Recorder */
.recorder {
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 16px;
    background: #fafcfe;
    margin-bottom: 6px;
}

.rec-order {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    display: inline-block;
}

.rec-status {
    margin-top: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rec-timer {
    font-variant-numeric: tabular-nums;
    font-size: 20px;
    font-weight: 700;
    color: var(--muted);
}

.rec-status.recording .rec-timer {
    color: var(--danger);
}

.rec-status.recording::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    animation: pulse 1s infinite;
}

.rec-preview {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.hidden {
    display: none !important;
}

/* ===== Patient page: main + sticky chat ===== */
.patient-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    align-items: start;
}

.chat-panel {
    position: sticky;
    top: 82px;
    height: calc(100vh - 104px);
    max-height: calc(100vh - 104px);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
}

.chat-head-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.chat-head strong { font-size: 14px; }
.chat-head .muted { color: rgba(255, 255, 255, 0.8); }

.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.25);
    animation: pulse 2s infinite;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f7fafc;
}

.msg {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    animation: riseIn 0.28s ease-out;
}

.msg.user { align-items: flex-end; }

.bubble {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.6;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    white-space: pre-wrap;
    word-break: break-word;
}

.msg.user .bubble {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    border-bottom-left-radius: 4px;
}

.msg.ai .bubble {
    background: var(--surface);
    border-bottom-right-radius: 4px;
}

.bubble.typing {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    padding: 13px 16px;
}

.bubble.typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    animation: bounce 1.2s infinite;
}

.bubble.typing span:nth-child(2) { animation-delay: 0.15s; }
.bubble.typing span:nth-child(3) { animation-delay: 0.3s; }

.chat-suggestions {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    background: var(--surface);
}

.chat-suggestions button {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--primary-dark);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.chat-suggestions button:hover {
    background: var(--primary-light);
}

.chat-input {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.chat-input textarea {
    flex: 1;
    resize: none;
    min-height: 46px;
    max-height: 120px;
}

/* ===== AI thinking spinner (draft visit page) ===== */
.ai-thinking {
    display: inline-flex;
    gap: 8px;
}

.ai-thinking span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    animation: bounce 1.2s infinite;
}

.ai-thinking span:nth-child(2) { animation-delay: 0.15s; }
.ai-thinking span:nth-child(3) { animation-delay: 0.3s; }

/* ===== Realtime note toast ===== */
.realtime-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 14px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

.realtime-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    animation: pulse 1s infinite;
}

/* ===== Keyframes ===== */
@keyframes riseIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* ===== Visit management ===== */
.manage-visit {
    border-top: 3px solid var(--primary);
}

.manage-row {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    flex-wrap: wrap;
}

.status-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.status-form label {
    margin: 0;
}

.status-form select {
    min-width: 190px;
    width: auto;
}

@media (max-width: 960px) {
    .patient-layout { grid-template-columns: 1fr; }
    .chat-panel {
        position: static;
        height: 70vh;
        max-height: 70vh;
    }
}

@media (max-width: 720px) {
    .form-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .topbar-inner { height: auto; flex-direction: column; gap: 10px; padding: 12px 20px; }
}

/* =========================================================
   General UI/UX polish
   ========================================================= */

/* Focus visibility (accessibility) */
:focus-visible {
    outline: 3px solid rgba(14, 116, 144, 0.35);
    outline-offset: 1px;
    border-radius: 8px;
}

/* Buttons: consistent hover/active/disabled + loading spinner */
.btn {
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 16px rgba(14, 116, 144, 0.25); }
.btn-success:hover:not(:disabled) { box-shadow: 0 6px 16px rgba(22, 163, 74, 0.25); }

.btn-loading { pointer-events: none; }

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Nav active state + user name */
.nav a.active {
    background: var(--primary-light);
    color: var(--primary-dark);
}
.nav .user-name {
    font-weight: 600;
    color: var(--text);
}

/* Cards: gentle interactive feel */
.card {
    transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.card.hoverable:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-lg);
}

/* Inputs: consistent height */
input[type="text"], input[type="datetime-local"], input[type="date"], input[type="file"], select, textarea {
    min-height: 42px;
}
textarea { min-height: 90px; }

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--primary-dark); text-decoration: none; }
.breadcrumbs .sep { color: #cbd5e1; }

/* Page header: tighter, aligned */
.page-head { gap: 14px; }

/* ===== Stat cards (dashboard) ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: var(--primary-light);
    color: var(--primary-dark);
}
.stat-icon.green { background: #ecfdf5; color: #047857; }
.stat-icon.amber { background: #fffbeb; color: var(--warning); }
.stat-icon.violet { background: #f5f3ff; color: #6d28d9; }

.stat-body { min-width: 0; }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1.1; color: #111827; }
.stat-label { font-size: 13px; color: var(--muted); }

/* ===== Patient avatar (initials) ===== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), #22d3ee);
}
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-row { display: flex; align-items: center; gap: 12px; }
.avatar-row .avatar-meta { min-width: 0; }
.avatar-row .avatar-name { font-weight: 600; color: var(--text); }
.avatar-row .avatar-sub { font-size: 12.5px; color: var(--muted); }

/* ===== Empty states ===== */
.empty-state {
    text-align: center;
    padding: 44px 20px;
    color: var(--muted);
}
.empty-state .empty-emoji {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
    opacity: 0.7;
}
.empty-state .empty-title { font-weight: 700; color: var(--text); font-size: 15px; }
.empty-state p { margin: 6px 0 0; font-size: 13.5px; }

/* ===== Toasts ===== */
.toast-stack {
    position: fixed;
    top: 78px;
    inset-inline-end: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    width: calc(100% - 40px);
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease-out;
    font-size: 14px;
}

.toast.leaving { animation: toastOut 0.35s ease-in forwards; }

.toast-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-success { border-inline-start: 4px solid var(--success); }
.toast-success .toast-icon { background: #ecfdf5; color: var(--success); }
.toast-error { border-inline-start: 4px solid var(--danger); }
.toast-error .toast-icon { background: #fef2f2; color: var(--danger); }

.toast-text { flex: 1; line-height: 1.55; }
.toast-text ul { margin: 6px 0 0; padding-inline-start: 18px; }

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 0 2px;
}
.toast-close:hover { color: var(--text); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateY(-12px); }
}

/* ===== Footer ===== */
.footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    margin-top: 30px;
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
}
.footer-inner > span:first-child { font-weight: 700; color: var(--text); }

/* ===== Table polish ===== */
.table tbody tr { transition: background 0.12s ease; }
.table tbody tr:hover td { background: #f6fafd; }
.table th { font-weight: 600; }
.table-scroll { overflow-x: auto; }
.search-wrap { flex: 1; min-width: 220px; }

/* ===== Recent list rows ===== */
.list-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    color: var(--text);
    transition: background 0.12s ease;
}
.list-link:hover { background: #f6fafd; text-decoration: none; }
.list-link + .list-link { border-top: 1px solid var(--border); }
.list-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.list-title { font-weight: 600; }
.list-arrow { color: var(--muted); font-size: 16px; }

/* Pagination (Laravel tailwind view) */
nav[aria-label="Pagination Navigation"] ul,
nav[role="navigation"] ul,
ul.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}
nav[aria-label="Pagination Navigation"] a,
nav[aria-label="Pagination Navigation"] span,
ul.pagination li a,
ul.pagination li span,
ul.pagination li button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    font-size: 13.5px;
    background: var(--surface);
}
nav[aria-label="Pagination Navigation"] span[aria-current="page"],
ul.pagination li span[aria-current="page"] {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 700;
}
nav[aria-label="Pagination Navigation"] a:hover,
ul.pagination li a:hover {
    background: var(--primary-light);
    text-decoration: none;
}
nav[aria-label="Pagination Navigation"] svg,
ul.pagination svg { display: none; }

/* Responsive: stats + toasts */
@media (max-width: 960px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
    .stats-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; text-align: center; }
}
