/* ============================================
   MediGo — Main Stylesheet
   Design: Teal theme, Mobile-first, Friendly
   Font: Prompt (Google Fonts)
   ============================================ */

/* ─── CSS Variables ──────────────────────────── */
:root {
    --primary:       #0d9488;
    --primary-dark:  #0f766e;
    --primary-light: #ccfbf1;
    --secondary:     #0891b2;
    --secondary-dark:#0e7490;

    --success:  #16a34a;
    --warning:  #d97706;
    --danger:   #dc2626;
    --info:     #2563eb;

    --bg:       #f8fafc;
    --bg-card:  #ffffff;
    --bg-hover: #f0fdfa;

    --text:     #1e293b;
    --text-muted:#64748b;
    --text-light:#94a3b8;

    --border:   #e2e8f0;
    --border-focus:#0d9488;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow:    0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
    --shadow-xl: 0 20px 40px rgba(0,0,0,.12);

    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --transition: all .2s ease;
    --navbar-h:  68px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Prompt', 'Noto Sans Thai', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

img { max-width: 100%; height: auto; }
a  { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
ul { list-style: none; }

/* ─── Container ─────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.container-sm { max-width: 680px; margin: 0 auto; padding: 0 20px; }
.container-md { max-width: 900px; margin: 0 auto; padding: 0 20px; }

/* ─── Navbar ────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--navbar-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
}
.navbar.scrolled { box-shadow: var(--shadow); }

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--navbar-h);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.brand-icon { font-size: 1.5rem; }
.brand-name { background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-links a {
    display: block;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
    background: var(--primary-light);
    color: var(--primary);
}

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

.btn-notif {
    position: relative;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
}
.btn-notif .badge {
    position: absolute;
    top: 0; right: 0;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

/* ─── Page offset ───────────────────────────── */
.page-content { padding-top: calc(var(--navbar-h) + 24px); }

/* ─── Buttons ───────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
    min-height: 48px;
    white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13,148,136,.3);
}

.btn-secondary {
    background: var(--secondary);
    color: #fff;
    border-color: var(--secondary);
}
.btn-secondary:hover { background: var(--secondary-dark); border-color: var(--secondary-dark); color: #fff; }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover { background: #b91c1c; color: #fff; }

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-success:hover { background: #15803d; color: #fff; }

.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}
.btn-warning:hover { background: #b45309; color: #fff; }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; min-height: 36px; }
.btn-lg { padding: 16px 32px; font-size: 1.1rem; min-height: 56px; border-radius: var(--radius-lg); }
.btn-xl { padding: 20px 40px; font-size: 1.2rem; min-height: 64px; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; min-width: 44px; }

/* ─── Cards ─────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-body { padding: 24px; }
.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.card-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }

/* ─── Forms ─────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 0.95rem;
}
.form-label .required { color: var(--danger); margin-left: 4px; }

.form-control {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    background: #fff;
    transition: var(--transition);
    line-height: 1.5;
    min-height: 50px;
}
.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(13,148,136,.15);
}
.form-control::placeholder { color: var(--text-light); }
.form-control.error { border-color: var(--danger); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

.form-hint { font-size: 0.82rem; color: var(--text-muted); margin-top: 6px; }
.form-error { font-size: 0.82rem; color: var(--danger); margin-top: 6px; }

.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Checkbox/Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 0;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ─── Alerts ────────────────────────────────── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.95rem;
}
.alert-success  { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error    { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-warning  { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info     { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ─── Badges ────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
}
.badge-primary  { background: var(--primary-light); color: var(--primary-dark); }
.badge-success  { background: #f0fdf4; color: var(--success); }
.badge-warning  { background: #fffbeb; color: var(--warning); }
.badge-danger   { background: #fef2f2; color: var(--danger); }
.badge-info     { background: #eff6ff; color: var(--info); }
.badge-secondary{ background: #f1f5f9; color: var(--text-muted); }

/* ─── Tables ────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.93rem;
}
.table th {
    padding: 14px 16px;
    text-align: left;
    background: #f8fafc;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 2px solid var(--border);
}
.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-hover); }

/* ─── Stats cards ───────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-icon { font-size: 2rem; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }
.stat-card.primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.stat-card.primary .stat-value,
.stat-card.primary .stat-label { color: #fff; }

/* ─── Timeline ──────────────────────────────── */
.timeline { position: relative; padding-left: 32px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 12px; top: 0; bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    padding: 0 0 24px 20px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -8px; top: 4px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--border);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--border);
}
.timeline-item.done::before { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-item.active::before { background: var(--primary); box-shadow: 0 0 0 3px rgba(13,148,136,.3); animation: pulse 2s infinite; }
.timeline-item.cancelled::before { background: var(--danger); box-shadow: 0 0 0 2px var(--danger); }

.timeline-title { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.timeline-time  { font-size: 0.82rem; color: var(--text-muted); }
.timeline-note  { font-size: 0.88rem; color: var(--text-muted); margin-top: 4px; }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(13,148,136,.3); }
    50%       { box-shadow: 0 0 0 6px rgba(13,148,136,.15); }
}

/* ─── Dashboard sidebar layout ──────────────── */
.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - var(--navbar-h));
    padding-top: var(--navbar-h);
}

.sidebar {
    background: #fff;
    border-right: 1px solid var(--border);
    padding: 24px 0;
    position: sticky;
    top: var(--navbar-h);
    height: calc(100vh - var(--navbar-h));
    overflow-y: auto;
}
.sidebar-user {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}
.sidebar-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 10px;
    overflow: hidden;
}
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-name { font-weight: 700; color: var(--text); }
.sidebar-role { font-size: 0.82rem; color: var(--text-muted); }

.sidebar-nav { padding: 8px 12px; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.95rem;
}
.sidebar-nav a:hover { background: var(--bg); color: var(--text); }
.sidebar-nav a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sidebar-nav .nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }
.sidebar-nav .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}
.sidebar-divider { height: 1px; background: var(--border); margin: 8px 12px; }

.main-content { padding: 32px; overflow-y: auto; }

/* ─── Page header ───────────────────────────── */
.page-header {
    margin-bottom: 28px;
}
.page-header h1 { font-size: 1.6rem; font-weight: 700; color: var(--text); }
.page-header p  { color: var(--text-muted); margin-top: 6px; }
.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* ─── Grid layouts ──────────────────────────── */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ─── Hero section ──────────────────────────── */
.hero {
    background: linear-gradient(135deg, #ecfdf5 0%, #cffafe 50%, #e0f2fe 100%);
    padding: 100px 0 80px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13,148,136,.1) 0%, transparent 70%);
}
.hero-content { max-width: 600px; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-light);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 24px;
}
.hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 20px;
}
.hero h1 span { color: var(--primary); }
.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 36px;
    line-height: 1.7;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-image { text-align: center; font-size: 10rem; }

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 60px;
}

/* ─── Section ───────────────────────────────── */
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-title { text-align: center; margin-bottom: 48px; }
.section-title h2 { font-size: 2rem; font-weight: 700; color: var(--text); }
.section-title p { color: var(--text-muted); font-size: 1.05rem; margin-top: 12px; }
.section-alt { background: linear-gradient(180deg, #f8fafc 0%, #ecfdf5 100%); }

/* ─── Feature cards ─────────────────────────── */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.feature-card {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}
.feature-icon {
    width: 64px; height: 64px;
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
}
.feature-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }
.feature-card p  { color: var(--text-muted); line-height: 1.7; }

/* ─── Steps ─────────────────────────────────── */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; }
.step {
    text-align: center;
    padding: 24px;
}
.step-number {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 auto 16px;
}
.step h3 { font-weight: 700; margin-bottom: 8px; }
.step p  { color: var(--text-muted); font-size: 0.92rem; }

/* ─── Reviews ───────────────────────────────── */
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.review-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
}
.review-stars { color: #f59e0b; font-size: 1.1rem; margin-bottom: 12px; }
.review-text  { color: var(--text-muted); line-height: 1.7; margin-bottom: 16px; font-style: italic; }
.review-author { display: flex; align-items: center; gap: 12px; }
.review-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.review-name { font-weight: 700; font-size: 0.92rem; }
.review-role { font-size: 0.78rem; color: var(--text-muted); }

/* ─── FAQ ───────────────────────────────────── */
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
    padding: 20px 0;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text);
    transition: var(--transition);
}
.faq-q:hover { color: var(--primary); }
.faq-q .icon { transition: transform .25s; font-size: 1.1rem; flex-shrink: 0; }
.faq-q.open .icon { transform: rotate(45deg); }
.faq-a {
    padding: 0 0 20px;
    color: var(--text-muted);
    line-height: 1.7;
    display: none;
    font-size: 0.95rem;
}
.faq-a.open { display: block; }

/* ─── Auth pages ────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
    padding: 100px 20px 40px;
}
.auth-card {
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 48px;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo .brand-icon { font-size: 2.5rem; }
.auth-logo .brand-name { font-size: 1.8rem; display: block; }
.auth-title { text-align: center; margin-bottom: 32px; }
.auth-title h1 { font-size: 1.5rem; font-weight: 700; }
.auth-title p { color: var(--text-muted); margin-top: 8px; }
.auth-tabs {
    display: flex;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 28px;
}
.auth-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: var(--transition);
}
.auth-tab.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.auth-divider { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin: 20px 0; position: relative; }
.auth-divider::before, .auth-divider::after {
    content: '';
    position: absolute;
    top: 50%; width: 40%;
    height: 1px;
    background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

/* ─── Status progress bar ───────────────────── */
.status-progress { margin: 24px 0; }
.progress-steps {
    display: flex;
    align-items: center;
    overflow-x: auto;
    gap: 0;
}
.progress-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-width: 80px;
}
.progress-step::before {
    content: '';
    position: absolute;
    top: 16px;
    left: -50%; right: 50%;
    height: 2px;
    background: var(--border);
}
.progress-step:first-child::before { display: none; }
.progress-step.done::before { background: var(--primary); }
.progress-step.active::before { background: linear-gradient(90deg, var(--primary), var(--border)); }

.ps-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--border);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}
.progress-step.done .ps-dot   { background: var(--success); }
.progress-step.active .ps-dot { background: var(--primary); box-shadow: 0 0 0 4px rgba(13,148,136,.2); }
.ps-label {
    font-size: 0.72rem;
    text-align: center;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.3;
}
.progress-step.active .ps-label { color: var(--primary); font-weight: 600; }
.progress-step.done .ps-label   { color: var(--success); }

/* ─── Empty state ───────────────────────────── */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 4rem; margin-bottom: 16px; opacity: .6; }
.empty-state h3 { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: 0.95rem; margin-bottom: 24px; }

/* ─── Tabs ──────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 24px; gap: 0; }
.tab {
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}
.tab:hover   { color: var(--primary); }
.tab.active  { color: var(--primary); border-color: var(--primary); }

/* ─── Booking card ──────────────────────────── */
.booking-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.booking-card:hover { box-shadow: var(--shadow); border-color: var(--primary-light); }
.booking-icon {
    width: 48px; height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.booking-info { flex: 1; min-width: 0; }
.booking-code { font-size: 0.78rem; color: var(--text-muted); font-family: monospace; }
.booking-hospital { font-weight: 700; font-size: 1rem; color: var(--text); margin: 4px 0; }
.booking-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.85rem; color: var(--text-muted); }
.booking-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ─── Notification item ─────────────────────── */
.notif-item {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: #f0fdf4; border-left: 3px solid var(--primary); }
.notif-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 2px; }
.notif-title { font-weight: 700; font-size: 0.93rem; }
.notif-msg   { font-size: 0.87rem; color: var(--text-muted); margin-top: 4px; }
.notif-time  { font-size: 0.75rem; color: var(--text-light); margin-top: 6px; }

/* ─── Footer ────────────────────────────────── */
.footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 60px 0 0;
    margin-top: 80px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 48px;
}
.footer-logo { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.footer-logo .brand-name { color: #fff; -webkit-text-fill-color: #fff; font-size: 1.2rem; }
.footer-logo .brand-icon { font-size: 1.4rem; }
.footer-tagline { font-size: 0.92rem; line-height: 1.7; margin-bottom: 20px; }
.footer-social { display: flex; gap: 12px; }
.footer-social a { font-size: 1.3rem; transition: var(--transition); }
.footer-social a:hover { transform: scale(1.2); }
.footer-links h4 { color: #f1f5f9; font-size: 0.95rem; margin-bottom: 16px; }
.footer-links ul { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: #94a3b8; font-size: 0.88rem; transition: var(--transition); }
.footer-links a:hover { color: var(--primary); }
.footer-contact h4 { color: #f1f5f9; margin-bottom: 16px; }
.footer-contact p  { font-size: 0.88rem; margin-bottom: 8px; }
.footer-contact a  { color: #94a3b8; }
.footer-contact a:hover { color: var(--primary); }
.footer-bottom {
    border-top: 1px solid #334155;
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.83rem;
    flex-wrap: wrap;
    gap: 8px;
}
.footer-note { color: #64748b; }

/* ─── Utilities ─────────────────────────────── */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-sm      { font-size: 0.85rem; }
.text-xs      { font-size: 0.75rem; }
.fw-bold      { font-weight: 700; }
.fw-semibold  { font-weight: 600; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

.hidden   { display: none !important; }
.sr-only  { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ─── Scroll to top ─────────────────────────── */
#scrollTop {
    position: fixed;
    bottom: 24px; right: 24px;
    width: 44px; height: 44px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    z-index: 900;
}
#scrollTop:hover { background: var(--primary-dark); transform: translateY(-2px); }
#scrollTop.visible { display: flex; }

/* ─── Responsive ────────────────────────────── */
@media (max-width: 1024px) {
    .dashboard-layout { grid-template-columns: 220px 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .hero-grid { gap: 40px; }
    .hero h1 { font-size: 2.2rem; }
}

@media (max-width: 768px) {
    :root { --navbar-h: 60px; }

    .navbar-toggle { display: flex; }
    .navbar-menu {
        display: none;
        position: fixed;
        top: var(--navbar-h);
        left: 0; right: 0;
        background: #fff;
        border-bottom: 1px solid var(--border);
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        box-shadow: var(--shadow-lg);
    }
    .navbar-menu.open { display: flex; }
    .nav-links { flex-direction: column; width: 100%; }
    .nav-actions { flex-direction: column; width: 100%; }
    .nav-actions .btn { width: 100%; justify-content: center; }

    .dashboard-layout { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        top: var(--navbar-h);
        left: -100%;
        width: 80%;
        max-width: 280px;
        height: calc(100vh - var(--navbar-h));
        z-index: 999;
        transition: left .3s ease;
        box-shadow: var(--shadow-xl);
    }
    .sidebar.open { left: 0; }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 998;
    }
    .sidebar-overlay.show { display: block; }

    .main-content { padding: 20px 16px; }

    .hero { padding: 80px 0 60px; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-image { display: none; }
    .hero h1 { font-size: 1.8rem; }
    .hero p   { font-size: 1rem; }

    .section { padding: 52px 0; }
    .section-title h2 { font-size: 1.5rem; }

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

    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .footer-bottom { flex-direction: column; text-align: center; }

    .auth-card { padding: 32px 24px; }

    .table th, .table td { padding: 10px 12px; font-size: 0.85rem; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.5rem; }
    .btn-xl, .btn-lg { width: 100%; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-actions { flex-direction: column; }
}

/* ─── Print ──────────────────────────────────── */
@media print {
    .navbar, .sidebar, .footer { display: none; }
    .dashboard-layout { grid-template-columns: 1fr; }
    .main-content { padding: 0; }
}

/* ─── Animation helpers ──────────────────────── */
.fade-in { animation: fadeIn .4s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

.slide-in { animation: slideIn .3s ease; }
@keyframes slideIn { from { transform:translateX(-20px); opacity:0; } to { transform:translateX(0); opacity:1; } }

/* ─── Caregiver verification badge ───────────── */
.verify-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
}
.verify-badge.pending  { background: #fffbeb; color: var(--warning); }
.verify-badge.approved { background: #f0fdf4; color: var(--success); }
.verify-badge.rejected { background: #fef2f2; color: var(--danger); }

/* ─── Price display ──────────────────────────── */
.price-box {
    background: linear-gradient(135deg, var(--primary-light), #e0f2fe);
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
}
.price-label { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 4px; }
.price-amount { font-size: 2.2rem; font-weight: 700; color: var(--primary); }
.price-unit   { font-size: 0.9rem; color: var(--text-muted); }

/* ─── Page header row ────────────────────────── */
.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

/* ─── Divider ────────────────────────────────── */
.divider {
    height: 1px;
    background: var(--border);
    margin: 28px 0;
}

/* ─── Auth page ──────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0f2fe 0%, #ccfbf1 100%);
    padding: 40px 20px;
}
.auth-card {
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 480px;
}
@media(max-width:480px){ .auth-card { padding: 32px 20px; } }

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}
.auth-title {
    text-align: center;
    margin-bottom: 28px;
}
.auth-title h1 { font-size: 1.7rem; color: var(--text); }
.auth-title p  { color: var(--text-muted); margin-top: 6px; }
.auth-divider  { text-align: center; color: var(--text-muted); margin: 20px 0; font-size: .9rem; }

.auth-tabs {
    display: flex;
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 4px;
    gap: 4px;
    margin-bottom: 24px;
}
.auth-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
    color: var(--text-muted);
    transition: var(--transition);
    user-select: none;
}
.auth-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

/* ─── Tabs ───────────────────────────────────── */
.tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.tab {
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: .9rem;
    color: var(--text-muted);
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}
.tab.active, .tab:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* ─── FAQ section ────────────────────────────── */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.faq-q {
    padding: 18px 24px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}
.faq-q:hover  { background: var(--primary-light); color: var(--primary); }
.faq-q .icon  { font-size: 1.2rem; transition: var(--transition); }
.faq-a {
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    color: var(--text-muted);
    transition: max-height .3s ease, padding .3s ease;
}
.faq-item.open .faq-a  { max-height: 200px; padding-bottom: 18px; }
.faq-item.open .icon   { transform: rotate(45deg); }

/* ─── Feature grid ───────────────────────────── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.feature-card {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-icon { font-size: 2.5rem; margin-bottom: 16px; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p  { color: var(--text-muted); font-size: .9rem; }

/* ─── How It Works steps ─────────────────────── */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    text-align: center;
}
.step {
    padding: 32px 20px;
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.step-number {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.step h3 { margin-bottom: 8px; }
.step p   { color: var(--text-muted); font-size: .9rem; }

/* ─── Reviews ────────────────────────────────── */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.review-card {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.review-stars { font-size: 1.2rem; color: #f59e0b; margin-bottom: 12px; }
.review-text  { font-style: italic; color: var(--text-muted); margin-bottom: 16px; font-size: .95rem; }
.review-author { display: flex; align-items: center; gap: 12px; }
.review-avatar { font-size: 2rem; }
.review-name   { font-weight: 600; font-size: .9rem; }
.review-role   { font-size: .8rem; color: var(--text-muted); }

/* ─── Timeline ───────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
    position: relative;
    padding: 16px 16px 16px 44px;
    border-left: 3px solid var(--border);
    margin-left: 12px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 20px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--border);
    border: 3px solid #fff;
}
.timeline-item.done::before   { background: var(--success); border-color: #fff; }
.timeline-item.active::before { background: var(--primary); border-color: #fff; box-shadow: 0 0 0 4px var(--primary-light); }
.timeline-item.cancelled::before { background: var(--danger); }
.timeline-item:last-child { border-left: 3px solid transparent; }
.timeline-title { font-weight: 600; font-size: .95rem; }
.timeline-note  { font-size: .85rem; color: var(--text-muted); margin-top: 2px; }
.timeline-time  { font-size: .8rem; color: var(--text-light); margin-top: 4px; }

/* ─── Progress steps (booking tracking) ─────── */
.progress-steps {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
}
.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    text-align: center;
    position: relative;
}
.progress-step + .progress-step::before {
    content: '';
    position: absolute;
    top: 16px; right: 50%;
    width: 100%;
    height: 3px;
    background: var(--border);
    z-index: 0;
}
.progress-step.done   + .progress-step::before,
.progress-step.active + .progress-step::before { background: var(--primary); }
.ps-dot {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    transition: var(--transition);
    flex-shrink: 0;
}
.progress-step.done   .ps-dot { background: var(--success); color: #fff; }
.progress-step.active .ps-dot { background: var(--primary); color: #fff; box-shadow: 0 0 0 6px var(--primary-light); }
.ps-label { font-size: .72rem; color: var(--text-muted); margin-top: 6px; line-height: 1.3; }
.progress-step.active .ps-label { color: var(--primary); font-weight: 600; }

/* ─── Form helpers ───────────────────────────── */
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row-2 > .form-group { flex: 1; min-width: 200px; }
.form-check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.form-check input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.form-hint  { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.required   { color: var(--danger); }

/* ─── Table ──────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: var(--bg); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.table tbody tr:hover { background: var(--bg-hover); }
.table .text-xs { font-size: .75rem; }

/* ─── Button ghost ───────────────────────────── */
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #15803d; }
.btn-danger  { background: var(--danger);  color: #fff; border-color: var(--danger); }
.btn-danger:hover  { background: #b91c1c; }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: #b45309; }

/* ─── Text utilities ─────────────────────────── */
.text-primary { color: var(--primary)!important; }
.text-success { color: var(--success)!important; }
.text-danger  { color: var(--danger)!important; }
.text-muted   { color: var(--text-muted)!important; }
.text-sm  { font-size: .875rem; }
.text-xs  { font-size: .78rem; }
.fw-bold  { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.p-0  { padding: 0!important; }
.p-2  { padding: 8px; }
.p-3  { padding: 16px; }
.flex-1 { flex: 1; }
.d-flex { display: flex; }
.align-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.flex-wrap  { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.gap-4 { gap: 24px; }

/* ─── Responsive fix ─────────────────────────── */
@media(max-width:640px) {
    .grid-2 { grid-template-columns: 1fr!important; }
    .grid-4 { grid-template-columns: repeat(2,1fr)!important; }
    .form-row-2 > .form-group { min-width: 100%; }
    .auth-card { max-width: 100%!important; }
    .progress-steps { justify-content: flex-start; }
    .page-header-row { flex-direction: column; }
}
