/* ═══════════════════════════════════════════════════════════════════════════
   Inner Strength Wellness — Mobile-First Stylesheet
   Colors: Charcoal bg, Beige fg, Forest Green accent
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-primary: #2C2C2C;
    --bg-secondary: #383838;
    --bg-card: #3E3E3E;
    --bg-input: #4A4A4A;
    --fg-primary: #E8DCC8;
    --fg-secondary: #C4B69C;
    --fg-muted: #9A8E7A;
    --accent: #2E7D32;
    --accent-light: #4CAF50;
    --accent-dark: #1B5E20;
    --accent-subtle: rgba(46, 125, 50, 0.15);
    --danger: #C62828;
    --danger-light: #EF5350;
    --warning: #F9A825;
    --info: #1565C0;
    --success: #2E7D32;
    --border: #555;
    --shadow: rgba(0,0,0,0.3);
    --shadow-lg: rgba(0,0,0,0.45);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.18), 0 1px 3px rgba(0,0,0,0.12);
    --shadow-card-hover: 0 6px 20px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.15);
    --shadow-elevated: 0 8px 32px rgba(0,0,0,0.35);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Spacing scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--fg-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

::selection {
    background: var(--accent);
    color: var(--fg-primary);
}

/* ─── Typography ───────────────────────────────────────────────────────────── */
h1 {
    font-size: 1.625rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
    line-height: 1.35;
}

h3 {
    font-size: 1.075rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.text-muted { color: var(--fg-muted); }
.text-accent { color: var(--accent-light); }
.text-danger { color: var(--danger-light); }
.text-small { font-size: 0.85rem; }

/* ─── Layout ───────────────────────────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1[tabindex], h2[tabindex], h3[tabindex] { outline: none; }
.app-header *:focus { outline: none; }

/* ─── Header ───────────────────────────────────────────────────────────────── */
.app-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    transition: transform 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.app-header.header-hidden {
    transform: translateY(-100%);
}

.app-header .logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.app-header .logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--fg-primary);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

.app-header .logo-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--fg-primary);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.app-header .logo-text small {
    font-size: 0.7rem;
    color: var(--fg-muted);
    font-weight: 400;
    display: block;
    letter-spacing: 0.02em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-bell {
    position: relative;
    background: none;
    border: none;
    color: var(--fg-primary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.notification-bell:hover {
    background: rgba(255,255,255,0.06);
}

.notification-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid var(--bg-secondary);
    animation: badgePop 0.3s ease;
}

@keyframes badgePop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.user-menu-btn {
    background: var(--accent);
    border: none;
    color: var(--fg-primary);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all var(--transition);
}

.user-menu-btn:hover {
    background: var(--accent-light);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

/* ─── Bottom Nav (Mobile) ──────────────────────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.25);
    display: flex;
    justify-content: space-around;
    padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom, 0px));
    z-index: 100;
    transition: transform 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.bottom-nav.nav-hidden {
    transform: translateY(100%);
}

.bottom-nav button {
    background: none;
    border: none;
    color: var(--fg-muted);
    font-size: 0.7rem;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    min-width: 52px;
    position: relative;
}

.bottom-nav button .nav-icon {
    font-size: 1.3rem;
    transition: transform var(--transition);
}

.bottom-nav button.active .nav-icon {
    transform: scale(1.1);
}

.bottom-nav button.active,
.bottom-nav button:hover {
    color: var(--accent-light);
}

.bottom-nav button.active::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent-light);
    border-radius: 0 0 2px 2px;
}

/* ─── Main Content ─────────────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    padding: var(--space-lg) var(--space-md);
    padding-bottom: 5rem; /* space for bottom nav */
}

/* ─── Cards ────────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition), transform var(--transition);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ─── Stat Cards ───────────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: var(--space-md);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: var(--space-md);
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: var(--shadow-card);
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
}

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

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-light);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--fg-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

/* ─── Forms ────────────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--fg-secondary);
    margin-bottom: 0.35rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.form-control {
    width: 100%;
    padding: 0.7rem 0.85rem;
    background: var(--bg-input);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    color: var(--fg-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-control::placeholder {
    color: var(--fg-muted);
    opacity: 0.7;
}

.form-control:hover {
    border-color: rgba(255,255,255,0.15);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 3px var(--accent-subtle);
    background: rgba(74, 74, 74, 0.8);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23C4B69C' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.25rem;
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* Custom checkbox styling */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--bg-input);
    cursor: pointer;
    vertical-align: middle;
    position: relative;
    flex-shrink: 0;
    transition: all var(--transition);
}

input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="checkbox"]:focus-visible {
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.form-group label:has(input[type="checkbox"]) {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background var(--transition);
}

.btn:active::after {
    background: rgba(255,255,255,0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--fg-primary);
    box-shadow: 0 2px 6px rgba(46, 125, 50, 0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.35);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(46, 125, 50, 0.2);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--fg-primary);
    border: 1px solid rgba(255,255,255,0.1);
}
.btn-secondary:hover {
    background: var(--border);
    border-color: rgba(255,255,255,0.15);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #B71C1C);
    color: #fff;
    box-shadow: 0 2px 6px rgba(198, 40, 40, 0.25);
}
.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-light), var(--danger));
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.35);
    transform: translateY(-1px);
}
.btn-danger:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.btn-block {
    width: 100%;
}

.btn-google {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.btn-google:hover {
    background: #f8f8f8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-group .btn {
    min-width: 0;
    padding-left: 1rem;
    padding-right: 1rem;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    filter: grayscale(0.3);
}

.btn:disabled::after {
    display: none;
}

/* ─── Status Badges ────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.badge-pending { background: rgba(249, 168, 37, 0.2); color: var(--warning); border: 1px solid rgba(249, 168, 37, 0.3); }
.badge-confirmed { background: rgba(46, 125, 50, 0.2); color: var(--accent-light); border: 1px solid rgba(46, 125, 50, 0.3); }
.badge-completed { background: rgba(21, 101, 192, 0.2); color: #64B5F6; border: 1px solid rgba(21, 101, 192, 0.3); }
.badge-cancelled { background: rgba(85, 85, 85, 0.3); color: var(--fg-muted); border: 1px solid rgba(85, 85, 85, 0.3); }
.badge-alternate { background: rgba(245, 124, 0, 0.2); color: #FFB74D; border: 1px solid rgba(245, 124, 0, 0.3); }
.badge-paid { background: rgba(46, 125, 50, 0.2); color: var(--accent-light); border: 1px solid rgba(46, 125, 50, 0.3); }
.badge-overdue { background: rgba(198, 40, 40, 0.2); color: var(--danger-light); border: 1px solid rgba(198, 40, 40, 0.3); }
.badge-waived { background: rgba(85, 85, 85, 0.3); color: var(--fg-muted); border: 1px solid rgba(85, 85, 85, 0.3); }
.badge-muted { background: rgba(74, 74, 74, 0.5); color: var(--fg-muted); border: 1px solid rgba(85, 85, 85, 0.2); }
.opacity-muted { opacity: 0.6; }

/* ─── Tables (scrollable on mobile) ────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.05);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table th, .table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.table th {
    color: var(--fg-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    background: rgba(0,0,0,0.15);
}

.table tbody tr {
    transition: background var(--transition);
}

.table tbody tr:hover td {
    background: var(--accent-subtle);
}

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

/* ─── Lists ────────────────────────────────────────────────────────────────── */
.list-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background var(--transition);
}

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

.list-item-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--accent-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--accent-light);
    flex-shrink: 0;
}

.list-item-content { flex: 1; min-width: 0; }
.list-item-title { font-weight: 600; font-size: 0.9rem; }
.list-item-sub { font-size: 0.8rem; color: var(--fg-muted); margin-top: 0.15rem; }
.list-item-actions { flex-shrink: 0; }

/* ─── Client Cards ────────────────────────────────────────────────────────── */
.client-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background var(--transition);
}
.client-card:last-child { border-bottom: none; }

.client-card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--accent-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--accent-light);
    flex-shrink: 0;
}

.client-card-body { flex: 1; min-width: 0; }
.client-card-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.25rem; }
.client-card-detail {
    font-size: 0.8rem;
    color: var(--fg-muted);
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.client-card-label { margin-right: 0.25rem; }

.client-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.client-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--fg-muted);
    white-space: nowrap;
}
.client-badge.badge-ok { background: rgba(46,93,58,0.25); color: var(--accent-light); }
.client-badge.badge-warn { background: rgba(200,80,60,0.2); color: #e8a090; }

/* ─── Login Page ───────────────────────────────────────────────────────────── */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    background:
        radial-gradient(ellipse at 20% 50%, rgba(46, 125, 50, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(46, 125, 50, 0.05) 0%, transparent 40%),
        var(--bg-primary);
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl) var(--space-lg);
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: var(--shadow-elevated);
    animation: loginSlideUp 0.4s ease;
}

@keyframes loginSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-card .logo-area {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.login-card .logo-area .logo-circle {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 0.85rem;
    box-shadow: 0 4px 16px rgba(46, 125, 50, 0.3);
}

.login-card .logo-area h1 {
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.login-card .logo-area p {
    font-size: 0.85rem;
    color: var(--fg-muted);
}

.divider {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 1.5rem 0;
    color: var(--fg-muted);
    font-size: 0.8rem;
    font-weight: 500;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.08);
}

.login-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(255,255,255,0.06);
}

.login-tabs button {
    flex: 1;
    background: none;
    border: none;
    color: var(--fg-muted);
    padding: 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
}

.login-tabs button:hover {
    color: var(--fg-secondary);
}

.login-tabs button.active {
    color: var(--accent-light);
    border-bottom-color: var(--accent-light);
}

.error-msg {
    background: rgba(198, 40, 40, 0.12);
    color: var(--danger-light);
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
    display: none;
    border: 1px solid rgba(198, 40, 40, 0.2);
    animation: shakeIn 0.3s ease;
}

@keyframes shakeIn {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.error-msg.show { display: block; }

.success-msg {
    background: rgba(46, 125, 50, 0.12);
    color: var(--accent-light);
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
    display: none;
    border: 1px solid rgba(46, 125, 50, 0.2);
}

.success-msg.show { display: block; }

/* ─── Modal ────────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    animation: fadeIn 0.2s ease;
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
    animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.modal-header h2 { margin: 0; font-size: 1.15rem; }

.modal-close {
    background: rgba(255,255,255,0.06);
    border: none;
    color: var(--fg-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.modal-close:hover {
    background: rgba(255,255,255,0.12);
    color: var(--fg-primary);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    padding: 0.85rem var(--space-lg);
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ─── PHI Warning ─────────────────────────────────────────────────────────── */
.phi-warning-list {
    background: rgba(200, 60, 60, 0.1);
    border: 1px solid rgba(200, 60, 60, 0.25);
    border-radius: var(--radius);
    padding: 0.85rem var(--space-md);
    margin-top: 0.75rem;
    font-size: 0.9rem;
}
.phi-warning-list .phi-item {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    padding: 0.25rem 0;
}
.phi-warning-list .phi-item .phi-label {
    font-weight: 600;
    color: #e8a0a0;
    white-space: nowrap;
    min-width: 6rem;
}
.phi-warning-list .phi-item .phi-value {
    color: var(--fg-primary);
    word-break: break-all;
}
#phi-warning-title {
    color: #e8a0a0;
}

/* ─── Notification Panel ───────────────────────────────────────────────────── */
.notif-panel {
    position: fixed;
    top: 0;
    right: -340px;
    width: 340px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid rgba(255,255,255,0.06);
    box-shadow: -8px 0 32px rgba(0,0,0,0.35);
    z-index: 150;
    transition: right var(--transition-slow);
    display: flex;
    flex-direction: column;
}

.notif-panel.open { right: 0; }

.notif-panel-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.notif-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm);
}

.notif-item {
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
    cursor: pointer;
    transition: background var(--transition);
}

.notif-item:hover { background: var(--bg-card); }

.notif-item.unread {
    border-left: 3px solid var(--accent-light);
    background: rgba(46, 125, 50, 0.06);
}

.notif-item .notif-title { font-weight: 600; font-size: 0.85rem; }
.notif-item .notif-msg { font-size: 0.8rem; color: var(--fg-muted); margin-top: 0.15rem; line-height: 1.4; }
.notif-item .notif-time { font-size: 0.7rem; color: var(--fg-muted); margin-top: 0.35rem; }

/* ─── Sidebar (Admin Desktop) ──────────────────────────────────────────────── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    display: none; /* hidden on mobile, shown via bottom nav */
    width: 250px;
    background: var(--bg-secondary);
    border-right: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.sidebar-nav { padding: 0.5rem 0.65rem; }

.sidebar-nav button {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--fg-secondary);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.15rem;
    transition: all var(--transition);
    font-weight: 500;
    position: relative;
}

.sidebar-nav button:hover {
    background: rgba(255,255,255,0.04);
    color: var(--fg-primary);
}

.sidebar-nav button.active {
    background: var(--accent-subtle);
    color: var(--accent-light);
}

.sidebar-nav button:focus { outline: none; }
.bottom-nav button:focus { outline: none; }

.sidebar-nav button.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-light);
    border-radius: 0 3px 3px 0;
}

/* ─── Waiver Banner ────────────────────────────────────────────────────────── */
.alert-banner {
    padding: 0.85rem var(--space-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-warning {
    background: rgba(249, 168, 37, 0.1);
    border: 1px solid rgba(249, 168, 37, 0.25);
    color: var(--warning);
}

.alert-info {
    background: rgba(21, 101, 192, 0.1);
    border: 1px solid rgba(21, 101, 192, 0.25);
    color: #64B5F6;
}

.alert-success {
    background: rgba(46, 125, 50, 0.1);
    border: 1px solid rgba(46, 125, 50, 0.25);
    color: var(--accent-light);
}

/* ─── Service Cards ────────────────────────────────────────────────────────── */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-card);
    position: relative;
}

.service-card:hover {
    border-color: rgba(76, 175, 80, 0.3);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.service-card.selected {
    border-color: var(--accent-light);
    background: var(--accent-subtle);
    box-shadow: 0 0 0 1px var(--accent-light), var(--shadow-card);
}

.service-card .service-name { font-weight: 600; font-size: 1rem; }
.service-card .service-desc { font-size: 0.85rem; color: var(--fg-muted); margin-top: 0.35rem; line-height: 1.5; }
.service-card .service-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 0.65rem;
    font-size: 0.85rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.service-card .service-price { color: var(--accent-light); font-weight: 700; }
.service-card .service-duration { color: var(--fg-muted); }

/* ─── Time Slot Grid ───────────────────────────────────────────────────────── */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.slot-btn {
    background: var(--bg-input);
    border: 1.5px solid rgba(255,255,255,0.08);
    color: var(--fg-primary);
    padding: 0.6rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition);
}

.slot-btn:hover {
    border-color: var(--accent-light);
    background: rgba(46, 125, 50, 0.08);
}

.slot-btn.selected {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

.slot-btn .slot-tech { font-size: 0.7rem; color: var(--fg-muted); margin-top: 0.15rem; }
.slot-btn.selected .slot-tech { color: rgba(255,255,255,0.8); }

/* ─── Calendar-style date picker ───────────────────────────────────────────── */
.date-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.date-nav button {
    background: var(--bg-input);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--fg-primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.date-nav button:hover {
    background: var(--accent-subtle);
    border-color: var(--accent-light);
}

.date-chips {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
}

.date-chip {
    background: var(--bg-input);
    border: 1.5px solid rgba(255,255,255,0.08);
    color: var(--fg-primary);
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    min-width: 54px;
    flex-shrink: 0;
    transition: all var(--transition);
}

.date-chip .day-name { font-size: 0.65rem; color: var(--fg-muted); text-transform: uppercase; font-weight: 600; letter-spacing: 0.04em; }
.date-chip .day-num { font-size: 1rem; font-weight: 700; }
.date-chip:hover { border-color: var(--accent-light); }
.date-chip.selected {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}
.date-chip.selected .day-name { color: rgba(255,255,255,0.8); }
.date-chip.disabled { opacity: 0.3; pointer-events: none; }

/* ─── Notes ────────────────────────────────────────────────────────────────── */
.note-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--accent);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.note-meta {
    font-size: 0.75rem;
    color: var(--fg-muted);
    margin-bottom: 0.4rem;
}

.note-text {
    font-size: 0.9rem;
    white-space: pre-wrap;
    line-height: 1.5;
}

/* ─── Pain Scale ───────────────────────────────────────────────────────── */
.pain-scale-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--accent);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pain-scale-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.pain-scale-row {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

/* Segmented pain bar */
.seg-bar {
    display: flex;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    margin-top: 0.25rem;
}

.seg-btn {
    flex: 1;
    padding: 0.35rem 0;
    border: none;
    border-right: 1px solid rgba(255,255,255,0.06);
    background: var(--bg-secondary);
    color: var(--fg-muted);
    font-size: 0.7rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.seg-btn:last-child {
    border-right: none;
}

.seg-btn:hover:not(.selected) {
    background: rgba(255,255,255,0.06);
}

.seg-btn.selected {
    background: var(--accent);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 6px rgba(46, 93, 58, 0.4);
}

/* Locked state */
.seg-bar.is-locked .seg-btn {
    cursor: default;
    pointer-events: none;
    opacity: 0.5;
}

.seg-bar.is-locked .seg-btn.selected {
    opacity: 1;
}

.pain-progress {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.pain-progress-positive {
    color: var(--accent-light);
}

.pain-progress-negative {
    color: var(--danger-light);
}

.pain-progress-neutral {
    color: var(--fg-muted);
    font-weight: 500;
}

.pain-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.pain-actions .btn {
    flex: 1;
    min-width: 0;
}

.pain-recall-ref {
    font-size: 0.75rem;
    color: var(--fg-muted);
    background: rgba(46, 93, 58, 0.08);
    border-left: 2px solid var(--accent);
    padding: 0.3rem 0.5rem;
    margin: 0.35rem 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.pain-lock-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.4rem;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.pain-lock-btn:hover {
    background: rgba(255,255,255,0.06);
}

.pain-lock-btn.is-locked {
    opacity: 0.6;
}

/* ─── Session Timer ────────────────────────────────────────────────────── */
.session-timer-bar {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 0.85rem;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: var(--shadow-card);
}

.session-timer-bar.warning {
    border-color: rgba(230, 168, 23, 0.4);
    box-shadow: 0 0 0 1px rgba(230, 168, 23, 0.15), var(--shadow-card);
}

.session-timer-bar.overtime {
    border-color: rgba(220, 53, 69, 0.4);
    box-shadow: 0 0 0 1px rgba(220, 53, 69, 0.15), var(--shadow-card);
    animation: pulse-border 1.5s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: rgba(220, 53, 69, 0.4); }
    50% { border-color: rgba(220, 53, 69, 0.15); }
}

.session-timer-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.session-timer-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.session-progress-track {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}

.session-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-dark), var(--accent-light));
    border-radius: 3px;
    transition: width 1s linear;
}

.session-progress-fill.warning {
    background: linear-gradient(90deg, #e6a817, #f9c846);
}

.session-progress-fill.overtime {
    background: linear-gradient(90deg, #dc3545, #ef5350);
    width: 100% !important;
}

/* ─── SOAP Notes ──────────────────────────────────────────────────────── */
.soap-section {
    padding: 0.4rem 0;
    line-height: 1.6;
}

.soap-section + .soap-section {
    border-top: 1px solid rgba(255,255,255,0.05);
}

.soap-label {
    font-weight: 700;
    color: var(--accent-light);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ─── Toast ────────────────────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    padding: 0.85rem 1.15rem;
    font-size: 0.85rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 340px;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.toast.success {
    border-left: 4px solid var(--accent);
    background: linear-gradient(135deg, var(--bg-card), rgba(46, 125, 50, 0.08));
}
.toast.error {
    border-left: 4px solid var(--danger);
    background: linear-gradient(135deg, var(--bg-card), rgba(198, 40, 40, 0.08));
}
.toast.info {
    border-left: 4px solid var(--info);
    background: linear-gradient(135deg, var(--bg-card), rgba(21, 101, 192, 0.08));
}

.toast.removing {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from { transform: translateX(100%) scale(0.95); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(110%); opacity: 0; }
}

/* ─── Loading ──────────────────────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent-light);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

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

.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    gap: 0.75rem;
    color: var(--fg-muted);
    font-size: 0.9rem;
}

/* Skeleton loading placeholder */
.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, rgba(255,255,255,0.06) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
    height: 1em;
}

.skeleton-text { width: 80%; height: 0.85rem; margin-bottom: 0.5rem; }
.skeleton-title { width: 50%; height: 1.2rem; margin-bottom: 0.75rem; }
.skeleton-card { height: 80px; border-radius: var(--radius); margin-bottom: var(--space-md); }

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ─── Empty State ──────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
    color: var(--fg-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 0.85rem;
    opacity: 0.5;
    display: block;
}

.empty-state p {
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 280px;
    margin: 0 auto;
}

.empty-state .btn {
    margin-top: var(--space-md);
}

/* ─── Tabs ─────────────────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    border-bottom: 2px solid rgba(255,255,255,0.06);
    margin-bottom: var(--space-md);
    overflow-x: auto;
    gap: 0;
}

.tabs button {
    background: none;
    border: none;
    color: var(--fg-muted);
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all var(--transition);
}

.tabs button:hover {
    color: var(--fg-secondary);
}

.tabs button.active {
    color: var(--accent-light);
    border-bottom-color: var(--accent-light);
    font-weight: 600;
}

/* ─── Search ───────────────────────────────────────────────────────────────── */
.search-box {
    position: relative;
    margin-bottom: var(--space-md);
}

.search-box input {
    width: 100%;
    padding: 0.7rem 0.85rem 0.7rem 2.5rem;
    background: var(--bg-input);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    color: var(--fg-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.search-box .search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fg-muted);
    font-size: 0.9rem;
}

/* ─── Page Transitions ─────────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Today at a Glance ───────────────────────────────────────────────────── */
.today-now-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 0.75rem;
    border-left: 4px solid var(--border);
    box-shadow: var(--shadow-card);
}
.today-now-active { border-left-color: var(--accent-light); background: rgba(46,125,50,0.08); }
.today-now-next { border-left-color: var(--warning); }
.today-now-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.5rem;
}
.today-now-active .today-now-badge { background: rgba(46,125,50,0.3); color: var(--accent-light); }
.today-now-next .today-now-badge { background: rgba(249,168,37,0.25); color: var(--warning); }
.today-now-card:not(.today-now-active):not(.today-now-next) .today-now-badge {
    background: rgba(255,255,255,0.06); color: var(--fg-muted);
}
.today-now-title { font-size: 1.15rem; font-weight: 700; }
.today-now-sub { font-size: 0.85rem; color: var(--fg-muted); margin-top: 0.15rem; }
.today-now-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.65rem;
    font-size: 0.8rem;
    color: var(--fg-secondary);
}
.today-now-action {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-light);
}

/* ─── Today Timeline ──────────────────────────────────────────────────────── */
.today-timeline { display: flex; flex-direction: column; gap: 0; }
.today-timeline-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background var(--transition);
    border-radius: var(--radius-sm);
}
.today-timeline-item:hover { background: rgba(255,255,255,0.03); }
.today-timeline-time {
    width: 60px;
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--fg-secondary);
    text-align: right;
}
.today-timeline-dot {
    font-size: 1rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}
.today-timeline-content { flex: 1; min-width: 0; }
.today-timeline-name { font-weight: 600; font-size: 0.9rem; }
.today-timeline-service { font-size: 0.78rem; color: var(--fg-muted); margin-top: 0.1rem; }
.timeline-active { background: rgba(46,125,50,0.08); }
.timeline-done { opacity: 0.5; }
.timeline-noshow { opacity: 0.4; }

/* ─── Calendar View ───────────────────────────────────────────────────────── */
.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.cal-week-label {
    font-weight: 600;
    font-size: 0.95rem;
}
.cal-grid {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    overflow: hidden;
}
.cal-header {
    display: grid;
    grid-template-columns: 50px repeat(7, 1fr);
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.cal-header-cell {
    padding: 0.5rem 0.25rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--fg-muted);
    line-height: 1.3;
}
.cal-header-cell strong { color: var(--fg-primary); font-size: 1rem; }
.cal-today-header { background: rgba(46,125,50,0.15); }
.cal-body { max-height: 60vh; overflow-y: auto; }
.cal-row {
    display: grid;
    grid-template-columns: 50px repeat(7, 1fr);
    min-height: 60px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cal-time-cell {
    padding: 0.3rem 0.25rem;
    font-size: 0.7rem;
    color: var(--fg-muted);
    text-align: right;
    border-right: 1px solid rgba(255,255,255,0.06);
}
.cal-body-cell {
    padding: 0.2rem;
    border-right: 1px solid rgba(255,255,255,0.04);
    min-height: 60px;
    position: relative;
}
.cal-body-cell:last-child { border-right: none; }
.cal-today-col { background: rgba(46,125,50,0.04); }
.cal-event {
    padding: 0.25rem 0.35rem;
    border-radius: 4px;
    margin-bottom: 2px;
    font-size: 0.68rem;
    line-height: 1.25;
    cursor: pointer;
    overflow: hidden;
    border-left: 3px solid transparent;
}
.cal-event-name { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event-svc { display: block; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event-pending { background: rgba(249,168,37,0.15); border-left-color: var(--warning); }
.cal-event-confirmed { background: rgba(46,125,50,0.15); border-left-color: var(--accent); }
.cal-event-completed { background: rgba(255,255,255,0.05); border-left-color: var(--fg-muted); opacity: 0.6; }
.cal-event-no_show { background: rgba(198,40,40,0.12); border-left-color: var(--danger); opacity: 0.6; }
.cal-event-alternate_offered { background: rgba(156,39,176,0.12); border-left-color: #9C27B0; }
.cal-event-live { animation: pulse-border 1.5s infinite; }
@keyframes pulse-border { 0%,100% { border-left-color: var(--accent-light); } 50% { border-left-color: var(--accent-dark); } }

.cal-time-col { width: 50px; }

/* ─── Mobile Portrait ──────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .list-item {
        flex-direction: column;
        gap: 0.35rem;
    }

    .list-item > div:last-child {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
    }

    /* Client cards: full card layout in portrait */
    .client-card {
        flex-direction: column;
        background: rgba(255,255,255,0.03);
        border-radius: var(--radius);
        padding: 1rem;
        margin-bottom: 0.5rem;
        border-bottom: none;
        gap: 0.5rem;
    }
    .client-card-icon {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }
    .client-card-name { font-size: 1.05rem; }
    .client-card-detail {
        font-size: 0.85rem;
        white-space: normal;
        word-break: break-word;
    }
    .client-card-badges {
        margin-top: 0.5rem;
        gap: 0.4rem;
    }
    .client-badge {
        font-size: 0.72rem;
        padding: 0.25rem 0.6rem;
    }

    /* Today at a glance: portrait tweaks */
    .today-timeline-time { width: 50px; font-size: 0.75rem; }
    .today-now-title { font-size: 1rem; }

    /* Calendar: day view on portrait */
    .cal-header { grid-template-columns: 40px repeat(7, 1fr); }
    .cal-row { grid-template-columns: 40px repeat(7, 1fr); min-height: 50px; }
    .cal-header-cell { font-size: 0.6rem; padding: 0.35rem 0.1rem; }
    .cal-header-cell strong { font-size: 0.8rem; }
    .cal-time-cell { font-size: 0.6rem; padding: 0.2rem; }
    .cal-event { font-size: 0.55rem; padding: 0.15rem 0.2rem; }
    .cal-event-svc { display: none; }

    /* Buttons: full-width stacked in portrait */
    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
        flex: none;
    }

    .modal-body .btn-block,
    .card .btn-block,
    .modal-footer .btn {
        width: 100%;
    }

    .modal-footer {
        flex-direction: column;
    }

    /* Admin billing table: stack as cards on small screens */
    .table-wrap .table thead { display: none; }
    .table-wrap .table,
    .table-wrap .table tbody,
    .table-wrap .table tr,
    .table-wrap .table td {
        display: block;
        width: 100%;
    }
    .table-wrap .table tr {
        padding: 0.85rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .table-wrap .table td {
        padding: 0.2rem 0;
        border-bottom: none;
        text-align: left;
        display: flex;
        align-items: baseline;
        gap: 0.4rem;
        flex-wrap: wrap;
    }
    .table-wrap .table td:empty,
    .table-wrap .table td[data-label=""] {
        display: none;
    }
    .table-wrap .table td::before {
        content: attr(data-label) ":";
        font-weight: 600;
        font-size: 0.7rem;
        color: var(--fg-muted);
        text-transform: uppercase;
        flex-shrink: 0;
    }
    .table-wrap .table td[data-label=""]::before {
        display: none;
    }

    .pain-scale-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .seg-btn {
        padding: 0.45rem 0;
        font-size: 0.65rem;
    }

    .seg-btn.selected {
        font-size: 0.85rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    /* ── Header actions: compact on narrow screens ── */
    .header-actions {
        gap: 0.25rem;
    }

    .header-actions .user-menu-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    /* ── Service cards: ensure btn-group inside cards stacks ── */
    .service-card .btn-group {
        flex-direction: column;
    }

    .service-card .btn-group .btn {
        width: 100%;
        min-height: 44px;
    }

    .service-card .service-meta {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    /* ── Technician availability grid: stack rows on mobile ── */
    .tech-avail-row {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .tech-avail-row label {
        min-width: 4rem;
        flex-shrink: 0;
    }

    .tech-avail-row .form-control.form-control-sm {
        min-width: 0;
        flex: 1 1 5rem;
        font-size: 0.8rem;
        padding: 0.45rem 0.4rem;
    }

    .tech-avail-row .text-muted {
        flex: 0 0 auto;
        font-size: 0.75rem;
    }

    /* ── Color grid: single column on narrow screens ── */
    .color-grid {
        grid-template-columns: 1fr;
    }

    /* ── Walk-in / booking modal slots grid: 2 columns in modals ── */
    .modal-body .slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* ── Tabs: ensure scrollable with no-show tab ── */
    .tabs {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tabs button {
        padding: 0.55rem 0.75rem;
        font-size: 0.8rem;
        flex-shrink: 0;
    }

    /* ── Client detail: waiver/consultation override buttons ── */
    .card [style*="display:flex"][style*="gap:0.5rem"] {
        flex-direction: column;
    }

    .card [style*="display:flex"][style*="gap:0.5rem"] .btn {
        width: 100%;
        min-height: 44px;
    }

    /* ── Flex-between headings: stack when tight ── */
    .flex-between {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .flex-between h1 {
        flex: 1 1 100%;
    }

    .flex-between .btn {
        min-height: 44px;
    }

    /* ── PHI warning list: tighter on mobile ── */
    .phi-warning-list .phi-item {
        flex-wrap: wrap;
    }

    .phi-warning-list .phi-item .phi-label {
        min-width: 4.5rem;
    }

    /* ── Modal max-height: account for small viewports ── */
    .modal {
        max-height: 85vh;
    }

    .modal-body {
        padding: var(--space-md);
    }

    .modal-header {
        padding: 0.75rem var(--space-md);
    }

    .modal-footer {
        padding: 0.75rem var(--space-md);
    }

    /* ── Notification panel: full-width on mobile ── */
    .notif-panel {
        width: 100%;
        right: -100%;
    }

    /* ── Ensure minimum touch targets for all interactive elements ── */
    .btn {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 36px;
    }

    .notification-bell {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* ── Toast: full-width on mobile ── */
    .toast-container {
        left: 1rem;
        right: 1rem;
    }

    .toast {
        max-width: none;
    }

    /* ── Pain scale header: wrap on mobile ── */
    .pain-scale-header {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    /* ── Session timer info: allow wrapping ── */
    .session-timer-info {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    /* ── Settings email toggle labels: proper tap targets ── */
    .toggle-label {
        min-height: 44px;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
}

/* ─── Responsive ───────────────────────────────────────────────────────────── */
/* Sidebar + hide bottom nav only on true wide screens (not landscape phones) */
@media (min-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .services-grid { grid-template-columns: repeat(3, 1fr); }
    .slots-grid { grid-template-columns: repeat(6, 1fr); }

    .sidebar {
        display: block;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }

    .admin-layout .bottom-nav { display: none; }

    .admin-layout .main-content {
        padding-bottom: var(--space-md);
    }

    .main-content {
        padding: var(--space-xl) var(--space-lg);
    }
}

/* Landscape: compact horizontal bottom nav */
@media (orientation: landscape) and (max-height: 500px) {
    .bottom-nav {
        padding: 0.2rem 0;
    }

    .bottom-nav button {
        flex-direction: row;
        gap: 0.3rem;
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
        min-width: auto;
    }

    .bottom-nav button .nav-icon {
        font-size: 1rem;
    }

    .bottom-nav button.active::after {
        display: none;
    }

    .app-header {
        padding: 0.4rem 1rem;
    }

    .main-content {
        padding-bottom: 3rem;
    }
}

/* Tablet-ish: grid improvements but keep bottom nav */
@media (min-width: 481px) and (max-width: 1023px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .slots-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ─── Screen Reader ────────────────────────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--accent);
    color: var(--fg-primary);
    z-index: 999;
    display: block;
    text-align: center;
    font-weight: 600;
}

/* ─── Utility ──────────────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.pt-1 { padding-top: var(--space-sm); }
.pb-1 { padding-bottom: var(--space-sm); }
.hidden { display: none !important; }
.clickable { cursor: pointer; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Technician Availability Grid ─────────────────────────────────────────── */
.tech-avail-grid { display: flex; flex-direction: column; gap: 0.4rem; }
.tech-avail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
}
.tech-avail-row label {
    min-width: 5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.tech-avail-row .form-control.form-control-sm {
    width: auto;
    min-width: 0;
    flex: 1;
    padding: 0.4rem 0.55rem;
    font-size: 0.85rem;
}
.tech-avail-row .text-muted { font-size: 0.8rem; flex-shrink: 0; }

/* ─── Settings Sections (Collapsible) ─────────────────────────────────────── */
.settings-section { overflow: hidden; }
.settings-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.85rem var(--space-md);
    user-select: none;
    transition: background var(--transition);
    border-radius: var(--radius-sm);
}
.settings-section-header:hover { background: rgba(255,255,255,0.03); }
.settings-section-header h2 { margin: 0; font-size: 1.1rem; }
.settings-toggle-icon {
    font-size: 0.75rem;
    transition: transform var(--transition);
    color: var(--fg-muted);
}
.settings-section.collapsed .settings-toggle-icon { transform: rotate(-90deg); }
.settings-section-body {
    padding: 0 var(--space-md) var(--space-md);
    transition: max-height 0.3s ease, padding 0.3s ease;
    max-height: 2000px;
    overflow: hidden;
}
.settings-section.collapsed .settings-section-body {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* ─── Color Grid ──────────────────────────────────────────────────────────── */
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}
.color-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--fg-secondary);
    margin-bottom: 0.25rem;
}
.color-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.color-input-wrap input[type="color"] {
    width: 40px;
    height: 36px;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    padding: 2px;
    cursor: pointer;
    background: var(--bg-input);
    flex-shrink: 0;
}
.color-input-wrap input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.color-input-wrap input[type="color"]::-webkit-color-swatch { border-radius: 3px; border: none; }
.color-hex {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem !important;
    width: 90px !important;
    padding: 0.4rem 0.5rem !important;
    text-transform: uppercase;
}

/* ─── Terminology Grid ────────────────────────────────────────────────────── */
.terminology-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.terminology-row {
    display: grid;
    grid-template-columns: 120px 1fr 1fr;
    gap: 0.5rem;
    align-items: center;
}
.terminology-row.terminology-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--fg-secondary);
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.terminology-label {
    font-size: 0.85rem;
    color: var(--fg-secondary);
    font-weight: 500;
}
.terminology-input .form-control {
    font-size: 0.85rem;
    padding: 0.4rem 0.55rem;
}
@media (max-width: 480px) {
    .terminology-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
    .terminology-row.terminology-header {
        display: none;
    }
    .terminology-label {
        font-weight: 600;
        margin-top: 0.5rem;
    }
}

/* ─── Branding Logo in Header ─────────────────────────────────────────────── */
.header-logo {
    max-height: 32px;
    width: auto;
    border-radius: var(--radius-sm);
    margin-right: 0.5rem;
    vertical-align: middle;
}
.login-brand-logo {
    max-height: 64px;
    width: auto;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

/* ─── Toggle Labels (Email settings checkboxes) ──────────────────────────── */
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* ─── Focus Visible ───────────────────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--accent-light);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 2px solid var(--accent-light);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--accent-subtle);
}

/* ─── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}
