/* ===== GBI (Gold Bridge International) Design System ===== */
:root {
    /* Brand — GBI Maroon (deep burgundy) primary + Gold ('Gold Bridge' brand name) secondary accent */
    --primary: #5e1220;          /* GBI Maroon */
    --primary-deep: #44101a;     /* hover/active (darker maroon) */
    --primary-light: #f7e9eb;    /* background tint (light maroon) */
    --primary-accent: #c8a24a;   /* Gold accent */
    --primary-grad: linear-gradient(135deg, #5e1220 0%, #8a1c2b 60%, #b0263a 100%);
    --primary-grad-soft: linear-gradient(135deg, rgba(94,18,32,.10) 0%, rgba(200,162,74,.12) 100%);
    /* Bright red of the logo bridge mark (accent). Used optionally alongside the gold accent */
    --brand-red: #d81f27;
    --gold: #c8a24a;
    --gold-deep: #a9842f;

    /* Text */
    --text-dark: #0f172a;   /* Ink — headings, primary data values */
    --text-body: #334155;   /* Body — paragraph copy, secondary text */
    --text-muted: #64748b;  /* Muted — captions, labels, helper text */

    /* Status */
    --success: #0f9d6c;
    --success-soft: rgba(15,157,108,.12);
    --danger: #e0342a;
    --danger-soft: rgba(224,52,42,.12);
    --warning: #d97a06;
    --warning-soft: rgba(217,122,6,.12);

    --sidebar-w: 230px;
    --border: #e2e8f0;
    --bg-page: #f8fafc;
    --radius: 16px;
    --radius-lg: 22px;

    /* Elevation — ambient base + a brand-tinted glow reserved for premium hover/focus moments */
    --shadow-sm: 0 1px 2px rgba(15,23,42,.04);
    --shadow-md: 0 6px 20px rgba(15,23,42,.07);
    --shadow-lg: 0 16px 40px rgba(15,23,42,.10);
    --shadow-glow: 0 8px 28px rgba(94,18,32,.24);

    /* Motion — spring-forward easing for premium feel, standard easing kept for utility transitions */
    --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-base: 220ms;
    --duration-spring: 420ms;

    /* Glass — floating nav / header surfaces */
    --glass-bg: rgba(255,255,255,.72);
    --glass-border: rgba(255,255,255,.5);
}

* { box-sizing: border-box; }

/* Respect the user's OS-level motion preference everywhere — non-negotiable */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    font-family: 'Pretendard', 'Inter', -apple-system, sans-serif;
    background: radial-gradient(circle at 0% 0%, #f3edef 0%, #e7dee0 45%, #ece4e6 100%);
    font-size: 17px;
    color: var(--text-body);
    padding: 16px;
    margin: 0;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* === APP SHELL === */
.app-shell {
    display: flex;
    min-height: calc(100vh - 32px);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--bg-page);
}

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: #fff;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}

.sidebar-brand {
    padding: 24px 20px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand .logo {
    display: flex; align-items: center; gap: 10px; text-decoration: none;
}

.sidebar-brand .logo-icon {
    width: 38px; height: 38px;
    background: var(--primary-grad);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 17px;
    box-shadow: var(--shadow-glow);
}

.sidebar-brand .brand-title {
    font-size: 18px; font-weight: 700; color: var(--text-dark); line-height: 1.2;
}

.sidebar-brand .brand-sub {
    font-size: 9.5px; color: var(--primary); font-style: italic; letter-spacing: .2px;
}

.sidebar-toggle {
    background: none; border: none; color: #b0b8c4; font-size: 20px; cursor: pointer;
}

.sidebar-menu { flex: 1; padding: 8px 10px; overflow-y: auto; }

/* Main menu parent */
.menu-group { margin-bottom: 4px; }
.menu-parent {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    color: var(--text-dark); text-decoration: none;
    font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all var(--duration-fast) var(--ease-standard);
    border-radius: 10px;
    user-select: none;
}
.menu-parent:hover { background: var(--primary-light); color: var(--primary); }
.menu-parent.open { color: var(--primary); }
.menu-parent iconify-icon { font-size: 17px; width: 22px; text-align: center; color: var(--text-muted); }
.menu-parent:hover iconify-icon, .menu-parent.open iconify-icon { color: var(--primary); }
.menu-parent .arrow { margin-left: auto; font-size: 13px; transition: transform var(--duration-fast) var(--ease-standard); }
.menu-parent.open .arrow { transform: rotate(90deg); }

/* Sub menu — expand/collapse animates via grid-template-rows (0fr → 1fr) instead of
   the instant display:none/block snap; avoids animating height directly while still
   collapsing to zero height. .menu-sub-inner clips the content while it's collapsing. */
.menu-sub {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--duration-base) var(--ease-standard);
}
.menu-sub.show { grid-template-rows: 1fr; }
.menu-sub-inner { overflow: hidden; min-height: 0; padding: 2px 0 4px 0; }
.menu-sub .menu-child {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px 9px 50px;
    color: var(--text-body); text-decoration: none;
    font-size: 14px; font-weight: 500;
    border-radius: 8px;
    transition: all var(--duration-fast) var(--ease-standard);
    position: relative;
}
.menu-sub .menu-child::before {
    content: ''; position: absolute; left: 34px; top: 50%; transform: translateY(-50%);
    width: 5px; height: 5px; border-radius: 50%; background: #cbd5e1; transition: var(--duration-fast) var(--ease-standard);
}
.menu-sub .menu-child:hover { color: var(--primary); background: var(--primary-light); }
.menu-sub .menu-child:hover::before { background: var(--primary); }
.menu-sub .menu-child.active {
    color: var(--primary); background: var(--primary-light); font-weight: 600;
}
/* Active selection marker uses the brand gold (Gold Bridge accent) */
.menu-sub .menu-child.active::before {
    background: var(--gold); width: 7px; height: 7px;
    box-shadow: 0 0 0 3px rgba(200,162,74,.18);
}

/* Single menu item (no children) */
.sidebar-menu .menu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    color: var(--text-dark); text-decoration: none;
    font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all var(--duration-fast) var(--ease-standard);
    border-radius: 10px;
    margin-bottom: 2px;
}
.sidebar-menu .menu-item:hover { background: var(--primary-light); color: var(--primary); }
.sidebar-menu .menu-item.active {
    color: var(--primary); background: var(--primary-light); font-weight: 600;
}
.sidebar-menu .menu-item iconify-icon { font-size: 18px; width: 22px; text-align: center; color: var(--text-muted); }
.sidebar-menu .menu-item:hover iconify-icon { color: var(--primary); }
/* Active top-level item: gold icon marks the current selection */
.sidebar-menu .menu-item.active iconify-icon { color: var(--gold); }

/* Sidebar section label */
.menu-label {
    font-size: 10px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1.5px;
    padding: 16px 16px 6px; margin-top: 4px;
}

.sidebar-footer {
    padding: 18px 20px; border-top: 1px solid var(--border);
}

.sidebar-footer .help-link {
    display: flex; align-items: center; gap: 8px;
    color: #64748b; font-size: 14px; margin-bottom: 16px;
    cursor: pointer; text-decoration: none;
}

.sidebar-footer .help-link:hover { color: var(--primary); }

.sidebar-footer .user-block {
    display: flex; align-items: center; gap: 10px;
}

.sidebar-footer .user-avatar {
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #e2e8f0;
}

.sidebar-footer .user-name { font-size: 14px; font-weight: 600; color: var(--text-dark); }
.sidebar-footer .user-role { font-size: 12px; color: var(--text-muted); }
.sidebar-footer .btn-logout {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #94a3b8; background: var(--bg-page); border: 1px solid var(--border);
    font-size: 18px; text-decoration: none; transition: var(--duration-fast) var(--ease-standard); flex-shrink: 0;
}
.sidebar-footer .btn-logout:hover { color: #ef4444; border-color: #fecaca; background: #fef2f2; }

/* === MAIN AREA === */
.main-area {
    flex: 1; display: flex; flex-direction: column;
    overflow-y: auto; background: var(--bg-page);
}

/* Top bar — floating glass surface, sticky over the scrolling page area */
.top-bar {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    padding: 18px 32px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
    position: sticky; top: 0; z-index: 50;
}

.top-bar h1 {
    font-size: 28px; font-weight: 800; margin: 0;
    color: var(--primary);                /* matched to the logo color (maroon) */
    letter-spacing: -0.01em;
    position: relative;
    padding-bottom: 7px;
}
/* Short gold underline accent under each page title (Gold Bridge detail) */
.top-bar h1::after {
    content: ''; position: absolute; left: 0; bottom: 0;
    width: 34px; height: 3px; border-radius: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-deep));
}

.top-bar .text-muted,
.top-bar .d-flex > iconify-icon,
.top-bar .d-flex .text-muted {
    color: var(--text-muted) !important;
}

/* The icon next to the page title is also emphasized with the logo color */
.top-bar .d-flex.align-items-center > iconify-icon.text-muted {
    color: var(--primary) !important;
}

.top-bar .header-actions {
    display: flex; align-items: center; gap: 16px;
}

/* Search input lives on a white top bar — was previously styled for a dark bar
   (white-on-white text/border that had become invisible after the top bar was
   recolored to white); restyled to sit on the actual light surface */
.top-bar .search-input {
    background: var(--bg-page); border: 1px solid var(--border); border-radius: 10px;
    padding: 9px 16px 9px 38px; font-size: 15px; outline: none; width: 180px;
    color: var(--text-dark);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: 14px center;
    transition: var(--duration-fast) var(--ease-standard);
}

.top-bar .search-input::placeholder { color: var(--text-muted); }

.top-bar .search-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(94,18,32,.12);
}

.top-bar .btn-primary {
    background: var(--primary); border-color: var(--primary);
}

.noti-bell {
    position: relative; font-size: 21px; color: var(--text-muted); cursor: pointer;
}

.noti-bell:hover { color: var(--primary); }

.noti-bell .dot {
    position: absolute; top:-2px; right:-2px;
    width:9px; height:9px; background: var(--danger);
    border-radius:50%; border:2px solid #fff;
}

/* Breadcrumb bar — light surface, consistent with the rest of the shell
   (previously a solid-black band that read as a disconnected dark stripe) */
.crumb-bar {
    background: var(--bg-page); padding: 12px 32px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.crumb-bar .crumbs a { color: var(--primary); }
.crumb-bar .crumbs .sep { color: var(--text-muted); }
.crumb-bar .crumbs .cur { color: var(--text-dark); font-weight: 600; }
.crumb-bar .btn-outline-secondary { border-color: var(--border); color: var(--text-body); }
.crumb-bar .btn-outline-secondary:hover { background: #fff; color: var(--text-dark); border-color: #cbd5e1; }

.crumb-bar .crumbs {
    display: flex; align-items: center; gap: 8px; font-size: 15px;
}

.crumb-bar .crumbs a {
    color: var(--primary); text-decoration: none; font-weight: 500;
}

/* Page area - KEY: generous padding */
.page-area {
    flex: 1;
    padding: 32px;
}

/* === CARDS — double-bezel: a faint outer ring plus the inner surface, soft-skill
   premium card architecture instead of a single flat bordered box === */
.card {
    box-shadow: var(--shadow-sm), 0 0 0 1px rgba(15,23,42,.02);
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--border);
    outline: 4px solid rgba(15,23,42,.015);
    outline-offset: -4px;
    transition: box-shadow var(--duration-spring) var(--ease-spring), transform var(--duration-spring) var(--ease-spring);
}

.card:hover {
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(15,23,42,.02);
    transform: translateY(-2px);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

/* === PATIENT DETAIL COMPONENTS === */
.profile-avatar-wrap {
    width: 92px; height: 92px; border-radius: 50%; overflow: hidden;
    border: 3px solid #d4a853; margin: 0 auto 12px;
}

.profile-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.stat-divider { width: 1px; background: var(--border); align-self: stretch; }

.detail-label {
    font-size: 11.5px; color: var(--text-muted); margin-bottom: 4px;
    text-transform: uppercase; letter-spacing: .5px; font-weight: 500;
}

.detail-value {
    font-size: 15px; font-weight: 600; color: var(--text-dark);
}

/* Tinted background carries the callout — no side-stripe accent (The No-Stripe Rule) */
.note-box {
    background: var(--primary-light);
    border-radius: 10px;
    padding: 16px 18px;
}

.note-box p {
    font-size: 15px; color: var(--text-body); line-height: 1.8; margin: 0;
}

/* Patient tabs pill style */
.patient-tabs .nav-link {
    border: 1px solid transparent; border-radius: 10px; color: var(--text-muted);
    font-size: 14px; font-weight: 500; padding: 10px 22px;
    transition: all var(--duration-fast) var(--ease-standard);
}

.patient-tabs .nav-link.active {
    color: var(--primary); border-color: var(--primary); background: #fff;
}

/* Default spacing between dashboard reward tab buttons (today/all/transaction history) — mobile layout handled separately in media queries */
.reward-tabs-nav { gap: 6px; }

/* Timeline */
.timeline { position: relative; padding-left: 32px; }

.timeline::before {
    content:''; position:absolute; left:9px; top:14px; bottom:14px;
    width:2.5px; background: var(--primary); border-radius: 2px;
}

.tl-item {
    position:relative; margin-bottom:16px; padding:18px 20px;
    background: var(--bg-page); border-radius: 12px;
}

.tl-item:last-child { margin-bottom:0; }

.tl-item::before {
    content:''; position:absolute; left:-28px; top:24px;
    width:14px; height:14px; border-radius:50%;
    border:2.5px solid var(--primary); background:#fff;
}

.tl-item.tl-green::before { background: var(--success-soft); border-color: var(--success); }
.tl-date-main { font-size:18px; font-weight:700; color: var(--text-dark); }
.tl-date-time { font-size: 12px; color: var(--primary); }

.tl-sep {
    width:1px; background: var(--border); align-self:stretch; margin:0 20px;
}

/* File list */
.file-row {
    display:flex; align-items:center; gap:14px;
    padding:12px 0; border-bottom:1px solid #f1f5f9;
}

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

.file-icon-box {
    width:40px; height:40px; background: var(--bg-page); border-radius:10px;
    display:flex; align-items:center; justify-content:center;
    color:#64748b; font-size:17px;
}

/* Calendar grid */
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; }

.cal-header-cell {
    text-align:center; font-weight:600; font-size: 13px;
    color:var(--text-muted); padding:10px 0;
}

.cal-cell {
    aspect-ratio:1; display:flex; align-items:flex-start; justify-content:flex-start;
    padding:7px; font-size: 13px; border-radius:8px; cursor:pointer; position:relative;
    font-weight: 500;
}

.cal-cell:hover { background:var(--primary-light); }

.cal-cell.today {
    background:var(--primary); color:#fff; font-weight:700; border-radius:8px;
}

.cal-cell.other-month { color:#d1d5db; }

.cal-cell .cal-dot {
    position:absolute; bottom:5px; left:50%; transform:translateX(-50%);
    width:5px; height:5px; background:var(--primary); border-radius:50%;
}

.cal-cell.today .cal-dot { background:#fff; }

/* Message contact — tinted background carries the active state, no side-stripe */
.msg-contact { cursor:pointer; transition: var(--duration-fast) var(--ease-standard); border-radius: 10px; }
.msg-contact:hover, .msg-contact.active { background: var(--primary-light); }

/* Settings form */
.settings-form .form-label {
    font-size: 14px; font-weight:600; color:var(--text-dark);
}

.settings-form .form-control {
    font-size: 15px; border-radius:10px; border:1px solid var(--border);
    padding: 10px 14px;
}

.settings-form .form-control:focus {
    border-color:var(--primary);
    box-shadow:0 0 0 3px rgba(94,18,32,.1);
}

/* === UTILITY === */
.text-primary { color: var(--primary) !important; }
.fs-11 { font-size: 12px; }
.fs-12 { font-size: 13px; }
.fs-13 { font-size: 14px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* Better Bootstrap overrides */
.btn { border-radius: 12px; font-weight: 500; font-size: 17px; padding:10px; transition: background var(--duration-spring) var(--ease-spring), transform var(--duration-spring) var(--ease-spring), box-shadow var(--duration-spring) var(--ease-spring); }
/* Press feedback — quick scale-down acknowledges the click before the action completes */
.btn:active { transform: scale(0.97); }
/* Premium gradient fill on primary actions */
.btn-primary { background: var(--primary-grad) !important; border-color: transparent; box-shadow: var(--shadow-glow); }
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-2px); box-shadow: 0 12px 32px rgba(94,18,32,.28); }
.btn-primary:active { filter: brightness(0.96); transform: scale(0.97); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-outline-secondary { border-color: var(--border); color: var(--text-body); }
.btn-outline-secondary:hover { background: var(--bg-page); border-color: #cbd5e1; color: var(--text-dark); }
.badge { font-weight: 500; letter-spacing: .2px; border-radius: 8px; }
.form-control, .form-select { border-radius: 10px; border-color: var(--border); font-size: 15px; color: var(--text-dark); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(94,18,32,.1); }
.table > :not(caption) > * > * { padding: 14px 12px; }
.pagination .page-link { border-radius: 8px; margin: 0 2px; border-color: var(--border); color: var(--text-body); font-size: 14px; }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* Common Profile Banner */
.profile-banner {
    background: #fff;
    border-radius: 16px;
    padding: 20px 28px;
    color: var(--text-dark);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}
.profile-banner::after {
    content: '';
    position: absolute;
    right: 200px;
    top: -30px;
    width: 160px;
    height: 160px;
    background: var(--primary-light);
    border-radius: 50%;
}
.profile-banner .pb-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.profile-banner .pb-avatar iconify-icon { font-size: 22px; color: var(--primary); }
.profile-banner .pb-info { flex-grow: 1; }
.profile-banner .pb-name { font-size: 17px; font-weight: 700; }
.profile-banner .pb-meta { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.profile-banner .pb-badges { display: flex; gap: 6px; margin-top: 6px; }
.profile-banner .pb-badge {
    padding: 3px 10px; border-radius: 12px; font-size: 14px; font-weight: 600;
    background: var(--primary-light); color: var(--primary); border: 1px solid var(--border);
}
.profile-banner .pb-points {
    display: flex; gap: 18px; flex-shrink: 0; margin-left: auto;
}
.profile-banner .pb-point { text-align: center; }
.profile-banner .pb-point-value { font-size: 17px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--text-dark); }
.profile-banner .pb-point-label { font-size: 10px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }

/* Mobile toggle button — sits on the white top bar, not a dark one */
.mobile-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--primary);
    font-size: 22px;
    padding: 4px 8px;
    cursor: pointer;
    margin-right: 10px;
    transition: var(--duration-fast) var(--ease-standard);
}
.mobile-toggle:hover { color: var(--primary-deep); background: var(--primary-light); border-color: var(--primary); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== RESPONSIVE ===== */

/* Mobile overlay for sidebar */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 998;
}
.sidebar-overlay.show { display: block; }

/* Tablet: <= 992px — sidebar collapses to overlay */
@media (max-width: 991.98px) {
    body { padding: 0; }

    .app-shell {
        border-radius: 0;
        min-height: 100vh;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        top: 0; bottom: 0;
        z-index: 9999;
        width: 260px;
        min-width: 260px;
        transition: left var(--duration-base) var(--ease-standard);
        box-shadow: 4px 0 24px rgba(0,0,0,.15);
    }

    .sidebar.open { left: 0; }

    .sidebar-toggle { display: flex !important; }

    .main-area { margin-left: 0; }

    .top-bar { padding: 14px 20px; }
    .top-bar h1 { font-size: 18px; }

    .crumb-bar { padding: 10px 20px; }

    .page-area { padding: 20px; }

    /* Hide search on small top bar */
    .top-bar .search-input { width: 140px; }
}

/* Mobile: <= 768px */
@media (max-width: 767.98px) {
    .top-bar .search-input { display: none; }

    .top-bar h1 { font-size: 17px; }
    .top-bar { padding: 12px 16px; }

    /* Profile banner stacking */
    .profile-banner { flex-wrap: wrap; padding: 16px 20px; }
    .profile-banner .pb-points { width: 100%; justify-content: space-around; margin-left: 0; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.1); }

    .crumb-bar { padding: 8px 16px; font-size: 13px; }
    .crumb-bar .crumbs { font-size: 13px; gap: 4px; }

    .page-area { padding: 16px; }

    /* Profile card stacking */
    .profile-avatar-wrap { width: 72px; height: 72px; }

    /* Timeline adjustments */
    .timeline { padding-left: 24px; }
    .tl-item::before { left: -20px; width: 11px; height: 11px; }
    .tl-date-main { font-size: 16px; }
    .tl-sep { margin: 0 10px; }

    /* Top bar actions */
    .header-actions { gap: 10px; }

    /* Patient list card grid */
    .plc-grid, .sc-grid, .inv-grid, .rc-grid, .hist-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px 16px !important;
    }

    .plc-header, .sc-header, .inv-header, .rc-header, .hist-header {
        padding: 16px 18px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .plc-body, .sc-body, .inv-body, .rc-body, .hist-body {
        padding: 0 18px 14px;
    }

    .plc-footer, .sc-footer, .inv-footer, .hist-footer {
        padding: 10px 18px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .plc-contact { flex-wrap: wrap; gap: 8px; }

    .plc-actions { margin-left: 0; width: 100%; justify-content: flex-end; }

    /* Dashboard reward tabs (Today's Reward / All Rewards / Transaction History) — on mobile,
       lay out the 3 tabs in a single row with equal width so they don't wrap and become uneven */
    .reward-tabs-nav { flex-wrap: nowrap; gap: 6px; }
    .reward-tabs-nav .nav-item { flex: 1 1 0; min-width: 0; }
    .reward-tabs-nav .nav-link {
        width: 100%;
        padding: 8px 6px;
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: center;
    }

    /* Reduce mobile padding on reward item rows (icon + label + value) */
    .reward-item { padding: 10px !important; gap: 10px !important; }
    .reward-item .fs-5 { font-size: 16px !important; }
    .reward-item .fs-13 { font-size: 13px !important; }
}

/* Small mobile: <= 576px */
@media (max-width: 575.98px) {
    .page-area { padding: 12px; }

    .card { border-radius: 10px; }

    .plc-grid, .sc-grid, .inv-grid, .rc-grid, .hist-grid {
        grid-template-columns: 1fr !important;
    }

    /* Stack summary strip */
    .summary-strip { flex-direction: column; }
    .summary-strip-item { border-right: none !important; border-bottom: 1px solid var(--border); padding: 14px 20px; }
    .summary-strip-item:last-child { border-bottom: none; }

    /* Reward tabs: shrink further so labels get smaller on narrower screens */
    .reward-tabs-nav .nav-link { padding: 7px 4px; font-size: 10px; }

    /* Messages full width */
    .chat-shell { min-height: auto; }

    /* Step bar compact */
    .step-bar { gap: 0; }
    .step-label { font-size: 10px; }
    .step-dot { width: 30px; height: 30px; font-size: 13px; }
}

/* Korean locale on hold until client confirmation — delete this rule to re-enable the switcher */
a[href="?lang=ko"] { display: none !important; }

/* ===== Unified gold accents (Gold Bridge) ===== */
/* Primary action buttons get a thin gold edge on hover. body-prefixed so it wins
   over the per-page .btn-* rules duplicated across dashboard.css regardless of order. */
body .btn-save:hover,
body .btn-search:hover,
body .btn-submit:hover {
    box-shadow: 0 6px 18px rgba(94,18,32,.30), inset 0 0 0 1px rgba(200,162,74,.6);
}
body .period-btn.active {
    box-shadow: 0 2px 8px rgba(94,18,32,.30), inset 0 0 0 1px rgba(200,162,74,.6);
}
/* Keyboard focus ring in brand gold (accessibility + brand cue) */
.btn-save:focus-visible, .btn-search:focus-visible, .btn-submit:focus-visible,
.btn-auth:focus-visible, .period-btn:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* ===== Background-video sound toggle (login / register / landing) ===== */
.bg-sound-toggle {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .35);
    background: rgba(8, 4, 6, .55);
    color: #fff;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
    transition: transform .2s var(--ease-standard), background .2s var(--ease-standard);
}
.bg-sound-toggle:hover { transform: translateY(-2px); }
.bg-sound-toggle.is-on { background: var(--primary); border-color: var(--gold); }
