/* ─────────────────────────────────────────────
   TeleHealth Connect · Design System
   ───────────────────────────────────────────── */

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

:root {
    /* Backgrounds */
    --bg:          #060e1c;
    --bg-surface:  #0c1628;
    --bg-card:     #101f36;
    --bg-elevated: #15273f;
    --bg-input:    #0a1525;

    /* Borders */
    --border:      #1e3050;
    --border-hover:#2a4068;

    /* Teal brand */
    --teal:        #0ea5e9;
    --teal-bright: #38bdf8;
    --teal-dim:    #0c4a6e;
    --teal-glow:   rgba(14,165,233,.15);

    /* Accent green (create/success) */
    --green:       #10b981;
    --green-dim:   rgba(16,185,129,.14);

    /* State colours */
    --red:         #ef4444;
    --amber:       #f59e0b;

    /* Text */
    --text:        #f0f4fa;
    --text-2:      #94a3b8;
    --text-3:      #4e6482;

    /* Geometry */
    --r-sm:  6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;

    /* Shadows */
    --s-sm: 0 1px 4px rgba(0,0,0,.3);
    --s-md: 0 4px 16px rgba(0,0,0,.4);
    --s-lg: 0 8px 32px rgba(0,0,0,.5);

    /* Legacy aliases (used by older inline styles) */
    --bg-color:     #060e1c;
    --card-bg:      #101f36;
    --card-border:  #1e3050;
    --text-color:   #f0f4fa;
    --text-muted:   #94a3b8;
    --primary-color: #0ea5e9;
    --primary-hover: #0284c7;
    --success-color: #10b981;
    --error-color:   #ef4444;
    --warning-color: #f59e0b;
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--teal-bright); }

/* ── Inputs ── */
input[type='text'],
input[type='password'],
input[type='email'],
input[type='tel'],
input[type='date'] {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-glow);
}
input::placeholder { color: var(--text-3); }

/* ── Buttons ── */
button {
    padding: 10px 20px;
    border: none;
    border-radius: var(--r-md);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
}
button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.btn-primary  { background: var(--teal); color: #fff; }
.btn-primary:hover  { background: #0284c7; transform: translateY(-1px); }
.btn-success  { background: var(--green); color: #fff; }
.btn-success:hover  { background: #059669; transform: translateY(-1px); }
.btn-danger   { background: var(--red);  color: #fff; }
.btn-ghost    { background: transparent; border: 1px solid var(--border); }
.btn-ghost:hover    { background: var(--bg-elevated); }
btn-secondary { background: var(--bg-elevated); border: 1px solid var(--border); }

/* form-group label style */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-2);
}

/* ── Divider ── */
.divider { display: flex; align-items: center; color: var(--text-3); margin: 8px 0; }
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border); }
.divider span { padding: 0 12px; font-size: 12px; }

/* ── Centered fallback ── */
.centered {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--r-xl);
    box-shadow: var(--s-lg);
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 320px;
    border: 1px solid var(--border);
}

/* ──────────────────────────────────────
   HOMEPAGE
────────────────────────────────────── */
.homepage-shell {
    width: min(1080px, 94vw);
    padding: 40px 0 60px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Top nav */
.home-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.home-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text);
    text-decoration: none;
}
.home-brand:hover { text-decoration: none; }
.brand-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--teal), #0284c7);
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1rem;
    box-shadow: 0 0 16px var(--teal-glow);
}
.brand-sub { font-size: 11px; font-weight: 400; color: var(--text-3); display: block; line-height: 1; }
.topbar-actions { display: flex; gap: 8px; }
.topbar-btn {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-2);
    font-size: 13px;
    transition: all .2s;
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 6px;
}
.topbar-btn:hover { color: var(--text); border-color: var(--teal); background: var(--bg-elevated); text-decoration: none; }

/* Hero banner */
.home-hero {
    background: linear-gradient(130deg, #0a1829 0%, #0c2236 50%, #080f1e 100%);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 52px 48px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.home-hero::after {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14,165,233,.1) 0%, transparent 70%);
    pointer-events: none;
}
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px;
    background: rgba(14,165,233,.1);
    border: 1px solid rgba(14,165,233,.25);
    border-radius: 999px;
    font-size: 12px; font-weight: 600;
    color: var(--teal);
    margin-bottom: 14px;
}
.home-hero h1 {
    font-size: 2.6rem;
    margin-bottom: 16px;
    line-height: 1.15;
}
.home-hero h1 em { font-style: normal; color: var(--teal); }
.hero-desc { color: var(--text-2); font-size: 1rem; margin-bottom: 28px; max-width: 480px; line-height: 1.7; }
.hero-cta-row { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-cta {
    padding: 12px 22px;
    border-radius: var(--r-md);
    font-size: 14px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 8px;
    transition: all .2s; text-decoration: none; border: none; cursor: pointer;
}
.hero-cta.primary   { background: var(--teal); color: #fff; box-shadow: 0 4px 14px rgba(14,165,233,.3); }
.hero-cta.primary:hover   { background: #0284c7; transform: translateY(-2px); text-decoration: none; }
.hero-cta.secondary { background: var(--bg-elevated); color: var(--text-2); border: 1px solid var(--border); }
.hero-cta.secondary:hover { color: var(--text); border-color: var(--teal); text-decoration: none; }

/* Feature chips on right side of hero */
.hero-features { display: flex; flex-direction: column; gap: 12px; }
.feature-chip {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 14px 16px;
    display: flex; align-items: center; gap: 14px;
}
.chip-icon {
    width: 36px; height: 36px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0;
}
.chip-icon.teal  { background: rgba(14,165,233,.12); color: var(--teal); }
.chip-icon.green { background: rgba(16,185,129,.12); color: var(--green); }
.chip-icon.amber { background: rgba(245,158,11,.12); color: var(--amber); }
.feature-chip h4 { font-size: 13px; margin-bottom: 1px; font-weight: 600; }
.feature-chip p  { font-size: 11px; color: var(--text-3); margin: 0; }

/* Action panels */
.home-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.action-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--s-md);
    transition: border-color .2s;
}
.action-group:hover { border-color: var(--border-hover); }
.action-group .panel-head {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 6px;
}
.panel-head-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
}
.panel-head-icon.create { background: var(--green-dim); color: var(--green); }
.panel-head-icon.join   { background: rgba(14,165,233,.12); color: var(--teal); }
.action-group h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0; }
.action-group p  { font-size: 13px; color: var(--text-2); margin: 0 0 4px; }
.action-group label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }

/* legacy exact-ID button styles */
#create-button {
    background: var(--green);
    color: #fff;
    width: 100%; justify-content: center;
    padding: 12px;
    border-radius: var(--r-md);
    font-size: 14px;
}
#create-button:hover { background: #059669; transform: translateY(-1px); }
#connect-button {
    background: var(--teal);
    color: #fff;
    width: 100%; justify-content: center;
    padding: 12px;
    border-radius: var(--r-md);
    margin-top: 4px;
    font-size: 14px;
}
#connect-button:hover { background: #0284c7; transform: translateY(-1px); }
.primary-btn  { background: var(--green); color: #fff; }
.primary-btn:hover  { background: #059669; transform: translateY(-1px); }
.secondary-btn { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-2); }
.secondary-btn:hover { color: var(--text); }
.home-card { margin: 0; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: rgba(14,165,233,.1); border: 1px solid rgba(14,165,233,.25); font-size: 12px; color: var(--teal); }
.hero-text  { color: var(--text-2); font-size: 0.95rem; }
.hero-links { display: flex; gap: 10px; flex-wrap: wrap; }
.home-link  { padding: 8px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text-2); font-size: 13px; transition: all .2s; }
.home-link:hover { color: var(--text); border-color: var(--teal); text-decoration: none; }

/* ──────────────────────────────────────
   OVERLAY / LOADER
────────────────────────────────────── */
.overlay {
    position: fixed; inset: 0;
    background: rgba(4,9,20,.85);
    display: flex; justify-content: center; align-items: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}
.overlay-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 44px;
    border-radius: var(--r-xl);
    text-align: center;
    max-width: 420px;
    width: 92%;
    box-shadow: var(--s-lg);
}
.overlay-content h2 { color: var(--teal); margin-bottom: 10px; }
.overlay-content p  { color: var(--text-2); margin-bottom: 24px; font-size: 14px; }
.loader {
    border: 3px solid var(--border);
    border-top-color: var(--teal);
    border-radius: 50%;
    width: 44px; height: 44px;
    animation: spin .85s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ──────────────────────────────────────
   HOST NOTIFICATIONS
────────────────────────────────────── */
.notifications-container {
    position: fixed; top: 20px; right: 20px;
    z-index: 2100;
    display: flex; flex-direction: column; gap: 10px;
}
.notification-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--teal);
    border-radius: var(--r-lg);
    padding: 14px 16px;
    box-shadow: var(--s-lg);
    display: flex; flex-direction: column; gap: 10px;
    min-width: 270px;
    animation: slideIn .3s ease-out;
}
@keyframes slideIn { from { transform: translateX(110%); opacity: 0; } to { transform: none; opacity: 1; } }
.notification-actions { display: flex; gap: 8px; }
.btn-admit { background: var(--green);  color: #fff; padding: 8px; flex: 1; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; }
.btn-deny  { background: var(--red);    color: #fff; padding: 8px; flex: 1; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; }

/* ──────────────────────────────────────
   VIDEO CALL ROOM
────────────────────────────────────── */
.video-container {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    position: relative; padding: 20px;
    box-sizing: border-box;
    background: #03070f;
}
.video-grid {
    display: flex; justify-content: center; gap: 14px;
    width: 100%; max-width: 1400px;
    flex-wrap: wrap; align-items: center;
    height: 80vh;
}
.video-wrapper {
    position: relative;
    width: 48%; max-width: 680px;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--border), 0 12px 40px rgba(0,0,0,.7);
}
/* Responsive layouts per participant count */
.video-grid.count-1 .video-wrapper  { width: 72%; max-width: 960px; }
.video-grid.count-2 .video-wrapper  { width: calc(50% - 7px); max-width: 780px; }
.video-grid.count-3 .video-wrapper  { width: calc(50% - 7px); max-width: 680px; }
.video-grid.count-4 .video-wrapper  { width: calc(50% - 7px); max-width: 680px; }
.video-grid.count-5 .video-wrapper  { width: calc(33.33% - 10px); max-width: 560px; }
video { width: 100%; height: 100%; object-fit: cover; background: #000; }
#user-video { transform: scaleX(-1); }

.room-header {
    position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
    background: rgba(6,14,28,.88);
    padding: 8px 18px;
    border-radius: 100px;
    display: flex; gap: 10px; align-items: center;
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    z-index: 100;
    max-width: calc(100vw - 40px);
    white-space: nowrap;
}
.room-header h2 { margin: 0; font-size: 0.9rem; font-weight: 600; }
.room-company-name {
    font-size: 10px; font-weight: 700;
    color: var(--teal); letter-spacing: .1em;
    text-transform: uppercase;
    border-right: 1px solid rgba(255,255,255,.12);
    padding-right: 10px;
    white-space: nowrap;
    display: none; /* hidden until populated by JS */
}
.room-company-name:not(:empty) { display: inline; }
.status-indicator { color: var(--green); font-size: 0.8rem; font-weight: 700; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* Meeting timer */
.meeting-timer {
    font-size: 11px; font-weight: 700; font-family: monospace;
    color: var(--text-2); background: rgba(255,255,255,.07);
    padding: 3px 9px; border-radius: 20px; margin-left: 2px;
    border: 1px solid var(--border); letter-spacing: .05em;
}
/* Connection quality */
.quality-indicator {
    font-size: 13px; cursor: help; margin-left: 2px;
    color: #22c55e; transition: color .4s;
}

.name-tag {
    position: absolute; bottom: 14px; left: 14px;
    background: rgba(0,0,0,.65);
    color: #fff; padding: 4px 12px;
    border-radius: 999px; font-size: 13px;
    backdrop-filter: blur(6px);
}

/* Controls */
.controls-bar {
    position: fixed; bottom: 26px; left: 50%;
    transform: translateX(-50%);
    background: rgba(12,22,40,.96);
    padding: 10px 20px;
    border-radius: 50px;
    display: flex; gap: 12px;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
    z-index: 1000;
    border: 1px solid var(--border);
}
.control-btn {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    background: var(--bg-elevated);
    color: #fff; font-size: 17px; padding: 0;
    border: 1px solid rgba(255,255,255,.06);
    transition: all .2s;
}
.control-btn:hover { background: #1e3a5a; transform: scale(1.08); }
.control-btn.active { background: var(--teal); border-color: var(--teal); }
#raise-hand-button.active { background: rgba(245,158,11,.22) !important; color: #f59e0b !important; border-color: rgba(245,158,11,.5) !important; }
.end-meeting-btn { background: rgba(239,68,68,.12) !important; color: #ef4444 !important; border-color: rgba(239,68,68,.3) !important; }
.end-meeting-btn:hover { background: rgba(239,68,68,.28) !important; transform: scale(1.08); }
.leave-btn { background: #7f1d1d; margin-left: 4px; }
.leave-btn:hover { background: var(--red); }

/* Toast */
#toast {
    visibility: hidden;
    min-width: 260px;
    background: var(--bg-card);
    border: 1px solid var(--teal);
    color: var(--text);
    text-align: center;
    border-radius: var(--r-lg);
    padding: 13px 20px;
    position: fixed; z-index: 3000;
    left: 50%; bottom: 100px;
    transform: translateX(-50%);
    box-shadow: var(--s-md);
    font-size: 13px;
    pointer-events: none;
}
#toast.show { visibility: visible; animation: fadein .4s, fadeout .45s 2.5s; }
@keyframes fadein  { from { bottom: 60px; opacity: 0; } to { bottom: 100px; opacity: 1; } }
@keyframes fadeout { from { bottom: 100px; opacity: 1; } to { bottom: 60px; opacity: 0; } }

/* Chat sidebar */
#chat-container {
    position: fixed; top: 0; right: -360px;
    width: 340px; height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    box-shadow: var(--s-lg);
    transition: right .3s ease;
    display: flex; flex-direction: column;
    z-index: 1001;
}
#chat-container.visible { right: 0; }
#chat-header {
    padding: 10px 20px 12px;
    background: var(--bg-surface);
    display: flex; flex-direction: column; gap: 4px;
    border-bottom: 1px solid var(--border);
}
#chat-company-name {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--teal);
    opacity: 0.85;
}
.chat-header-row {
    display: flex; justify-content: space-between; align-items: center;
}
#chat-header h3 { margin: 0; font-size: 0.95rem; }
#chat-close-btn {
    background: none; border: none;
    font-size: 1.4rem; color: var(--text-2);
    cursor: pointer; padding: 0; line-height: 1;
}
#chat-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
}
.message {
    background: var(--bg-elevated);
    padding: 10px 13px;
    border-radius: 10px;
    max-width: 82%;
    align-self: flex-start;
    word-wrap: break-word;
    font-size: 13px;
}
.message.my-message {
    background: var(--teal-dim);
    border: 1px solid rgba(14,165,233,.2);
    align-self: flex-end;
}
.message-sender { font-size: 11px; color: var(--text-3); margin-bottom: 3px; display: block; }
#chat-input-container {
    padding: 14px;
    display: flex; gap: 8px;
    border-top: 1px solid var(--border);
}
#chat-input {
    flex: 1; padding: 9px 14px;
    border-radius: 24px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text); font-size: 13px;
}
#chat-send-btn {
    background: var(--teal); color: #fff;
    width: 38px; height: 38px;
    border-radius: 50%; padding: 0;
    display: flex; justify-content: center; align-items: center;
    font-size: 13px; flex-shrink: 0;
}

/* ──────────────────────────────────────
   ADMIN DASHBOARD
────────────────────────────────────── */
.login-shell {
    width: 100vw; min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 20px;
    background: var(--bg);
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 40px 36px;
    width: 100%; max-width: 420px;
    box-shadow: var(--s-lg);
}
.login-card-icon {
    width: 58px; height: 58px;
    border-radius: 16px;
    background: var(--teal-glow);
    border: 1px solid rgba(14,165,233,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: var(--teal);
    margin: 0 auto 22px;
}
.login-card h2 { text-align: center; font-size: 1.4rem; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--text-2); font-size: 13px; margin-bottom: 30px; }
.login-card button[type="submit"] { width: 100%; justify-content: center; padding: 12px; font-size: 14px; }
.login-hint { text-align: center; margin-top: 20px; font-size: 12px; color: var(--text-3); }
.error-text  { color: var(--red); font-size: 13px; min-height: 18px; }

.admin-shell { width: 100%; min-height: 100vh; display: none; }
.admin-shell.active { display: flex; }

.admin-sidebar {
    width: 240px; flex-shrink: 0;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 20px 14px;
    gap: 2px;
    min-height: 100vh;
}
.sidebar-logo {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 8px 20px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.sidebar-logo-icon {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--teal), #0284c7);
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.9rem; flex-shrink: 0;
}
.sidebar-logo strong { font-size: 0.9rem; display: block; }
.sidebar-logo span   { font-size: 11px; color: var(--text-3); }
.sidebar-section-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-3); font-weight: 700;
    padding: 12px 10px 4px;
}
.sidebar-btn {
    width: 100%; text-align: left;
    background: transparent;
    color: var(--text-2);
    border-radius: var(--r-md);
    padding: 9px 12px;
    font-size: 13px; font-weight: 500;
    gap: 10px; border: 1px solid transparent;
    justify-content: flex-start;
}
.sidebar-btn:hover  { background: rgba(255,255,255,.04); color: var(--text); }
.sidebar-btn.active { background: var(--teal-glow); color: var(--teal); border-color: rgba(14,165,233,.2); font-weight: 600; }
.sidebar-spacer { flex: 1; }
.sidebar-logout {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-2);
    width: 100%; border-radius: var(--r-md);
    padding: 9px 12px; font-size: 13px; gap: 10px;
    justify-content: flex-start;
}
.sidebar-logout:hover { background: rgba(239,68,68,.08); color: var(--red); border-color: rgba(239,68,68,.2); }

.admin-main {
    flex: 1; padding: 28px 32px;
    overflow-y: auto; background: var(--bg);
}
.admin-topbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px; padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.admin-topbar-title h2 { font-size: 1.3rem; margin-bottom: 2px; }
.admin-topbar-title span { font-size: 12px; color: var(--text-3); }
.admin-topbar-actions { display: flex; gap: 8px; }

.stat-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 24px; }
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 18px 20px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: var(--s-sm);
}
.stat-icon {
    width: 46px; height: 46px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}
.stat-icon.teal  { background: var(--teal-glow); color: var(--teal); }
.stat-icon.green { background: var(--green-dim);  color: var(--green); }
.stat-icon.amber { background: rgba(245,158,11,.14); color: var(--amber); }
.stat-info strong { display: block; font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.stat-info span   { font-size: 11px; color: var(--text-3); }

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: var(--s-sm);
}
.panel-card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.panel-card-header h3 { font-size: 0.95rem; font-weight: 600; }
.muted { color: var(--text-2); font-size: 13px; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.data-list { display: flex; flex-direction: column; gap: 7px; max-height: 400px; overflow-y: auto; }
.data-item {
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px; padding: 11px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    font-size: 13px; transition: border-color .2s;
}
.data-item:hover { border-color: var(--border-hover); }
.data-item .item-title { font-weight: 500; }
.data-item .item-meta  { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.signature-thumb { height: 28px; background: #fff; border-radius: 4px; padding: 2px; flex-shrink: 0; }
.join-host-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; font-size: 12px; font-weight: 500;
    border-radius: var(--r-md); cursor: pointer; white-space: nowrap;
    border: 1px solid var(--border); background: var(--bg-elevated);
    color: var(--text-2); text-decoration: none; transition: background .15s, color .15s, border-color .15s;
    font-family: inherit;
}
.join-host-btn:hover { background: rgba(255,255,255,.06); color: var(--text); border-color: var(--border-hover); }
.join-host-btn.primary { background: var(--teal); border-color: transparent; color: #fff; }
.join-host-btn.primary:hover { background: var(--teal-bright); }

.admin-section { display: none; }
.admin-section.active { display: block; }

/* result area in admin create meeting */
#result-area {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px;
    margin-top: 14px;
}
#result-area #meeting-link { font-family: monospace; color: var(--teal); word-break: break-all; font-size: 13px; margin: 6px 0; }

/* ──────────────────────────────────────
   CONSENT FORM PAGE
────────────────────────────────────── */
.consent-page {
    width: 100%; min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center;
    padding: 36px 16px 60px;
    background: var(--bg);
    justify-content: flex-start;
}
.consent-topbar {
    width: min(840px,96vw);
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 24px;
}
.consent-brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 1rem; color: var(--text);
}
.consent-brand-icon {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--teal), #0284c7);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.85rem;
}
.consent-container {
    width: min(840px,96vw);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--s-lg);
}
.consent-banner {
    background: linear-gradient(130deg, #0a1829 0%, #091a1a 100%);
    padding: 28px 32px;
    display: flex; align-items: center; gap: 18px;
    border-bottom: 1px solid var(--border);
}
.consent-banner-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: var(--teal-glow);
    border: 1px solid rgba(14,165,233,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: var(--teal); flex-shrink: 0;
}
.consent-banner h2 { font-size: 1.15rem; margin-bottom: 3px; }
.consent-banner p  { font-size: 13px; color: var(--text-3); margin: 0; }
.consent-body { padding: 30px 32px; }

.consent-section { margin-bottom: 28px; }
.consent-section-title {
    font-size: 10px; text-transform: uppercase;
    letter-spacing: .06em; color: var(--teal);
    font-weight: 700; margin-bottom: 14px;
    display: flex; align-items: center; gap: 10px;
}
.consent-section-title::after { content: ''; flex: 1; border-bottom: 1px solid var(--border); }
.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }

.consent-text-box {
    background: rgba(255,255,255,.02);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 18px 20px;
    font-size: 13px; line-height: 1.8; color: var(--text-2);
    max-height: 280px; overflow-y: auto;
    margin-bottom: 4px;
}
.consent-text-box p { margin-bottom: 10px; }
.consent-text-box strong { color: var(--text); }
.consent-list { list-style: none; padding: 0; margin-top: 8px; }
.consent-list li {
    position: relative; padding-left: 22px;
    margin-bottom: 8px; font-size: 13px; color: var(--text-2);
}
.consent-list li::before { content: '✓'; position: absolute; left: 0; color: var(--teal); font-weight: 700; }

.signature-area label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--text-2); display: block; margin-bottom: 8px; }
.signature-pad-wrapper {
    border: 2px dashed var(--border);
    border-radius: var(--r-md);
    background: #fff; overflow: hidden;
    position: relative; transition: border-color .2s;
}
.signature-pad-wrapper:hover { border-color: var(--teal); }
#signatureCanvas { display: block; width: 100%; height: 160px; cursor: crosshair; }
.sig-hint {
    position: absolute; bottom: 8px; left: 50%;
    transform: translateX(-50%);
    font-size: 11px; color: #aaa;
    pointer-events: none; white-space: nowrap;
}
.signature-actions { margin-top: 8px; display: flex; justify-content: flex-end; }
.btn-clear-sig {
    background: transparent; border: 1px solid var(--border);
    color: var(--text-2); font-size: 13px;
    padding: 6px 14px; border-radius: var(--r-sm);
}
.btn-clear-sig:hover { border-color: var(--red); color: var(--red); }

.consent-submit-row {
    padding: 22px 32px;
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
    display: flex; gap: 14px;
    align-items: center; justify-content: space-between;
}
.consent-submit-row p { font-size: 12px; color: var(--text-3); max-width: 480px; }
.btn-submit-consent {
    background: var(--teal); color: #fff;
    padding: 12px 28px; border-radius: var(--r-md);
    font-size: 14px; font-weight: 600;
    white-space: nowrap; flex-shrink: 0; gap: 8px;
    border: none; cursor: pointer; transition: all .2s;
}
.btn-submit-consent:hover { background: #0284c7; transform: translateY(-1px); }
body.consent-body-scroll { justify-content: flex-start; align-items: stretch; }

/* ──────────────────────────────────────
   SITE FOOTER
────────────────────────────────────── */
.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 16px 24px;
    font-size: 12px;
    color: var(--text-3);
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
}
.site-footer .footer-company { color: var(--text-2); font-weight: 600; }
.site-footer .footer-sep { color: var(--border-hover); }
.site-footer .footer-credit strong { color: var(--teal); font-weight: 600; }
/* Footer inside homepage shell needs to clear from flex layout */
.homepage-shell .site-footer { margin-top: auto; }
/* Footer inside consent page */
.consent-page .site-footer { margin-top: 32px; }
/* Admin footer — spans below sidebar+main */
.admin-page-wrap { display: flex; flex-direction: column; min-height: 100vh; }
.admin-page-wrap .admin-shell.active { flex: 1; }

/* ──────────────────────────────────────
   ADMIN SETTINGS SECTION
────────────────────────────────────── */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.settings-grid .form-group.full { grid-column: 1 / -1; }
.settings-save-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.settings-save-row .save-hint {
    font-size: 12px;
    color: var(--text-3);
}
.settings-sub {
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 20px;
}
select.form-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
select.form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-glow); }

/* ──────────────────────────────────────
   RESPONSIVE
────────────────────────────────────── */
@media (max-width: 960px) {
    .home-hero { grid-template-columns: 1fr; }
    .hero-features { display: none; }
    .home-panels { grid-template-columns: 1fr; }
    .stat-row { grid-template-columns: 1fr 1fr; }
    .admin-sidebar { width: 200px; }
    .admin-main { padding: 20px 18px; }
}
@media (max-width: 680px) {
    .admin-shell.active { flex-direction: column; }
    .admin-sidebar { width: 100%; min-height: auto; flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--border); padding: 12px; }
    .sidebar-logo { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
    .sidebar-spacer { display: none; }
    .stat-row { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; gap: 0; }
    .consent-submit-row { flex-direction: column; align-items: stretch; }
    .btn-submit-consent { text-align: center; justify-content: center; }
    #chat-container { width: 100%; right: -100%; }
    .home-hero { padding: 28px 20px; }
    .consent-body { padding: 22px 18px; }
    .consent-submit-row { padding: 18px; }
    .settings-grid { grid-template-columns: 1fr; }
}

/* ──────────────────────────────────────
   MOBILE VIDEO CALL LAYOUT
────────────────────────────────────── */
@media (max-width: 768px) {
    /* Full viewport video room */
    .video-container {
        padding: 8px 8px 100px 8px;
        justify-content: flex-start;
    }

    /* Stack videos vertically, fill width */
    .video-grid {
        flex-direction: column;
        gap: 8px;
        height: auto;
        width: 100%;
        align-items: stretch;
    }

    /* Each video takes full width */
    .video-wrapper {
        width: 100% !important;
        max-width: 100%;
        aspect-ratio: 16/9;
        border-radius: 12px;
    }

    /* Compact room header */
    .room-header {
        bottom: 88px; left: 12px; right: 12px;
        transform: none;
        padding: 6px 12px;
        justify-content: center;
        border-radius: 100px;
    }
    .room-header h2 { font-size: 0.78rem; }
    .meeting-timer { font-size: 10px; padding: 2px 7px; }

    /* Controls bar — full width, tighter */
    .controls-bar {
        bottom: 16px;
        left: 12px; right: 12px;
        transform: none;
        width: auto;
        padding: 10px 14px;
        gap: 8px;
        justify-content: space-around;
        border-radius: 20px;
    }
    .control-btn {
        width: 44px; height: 44px;
        font-size: 15px;
    }

    /* Name tag smaller */
    .name-tag {
        font-size: 11px;
        padding: 3px 9px;
        bottom: 10px; left: 10px;
    }

    /* Chat full screen on mobile */
    #chat-container {
        width: 100% !important;
        right: -100% !important;
        bottom: 0; top: 0;
        border-radius: 0;
    }
    #chat-container.open {
        right: 0 !important;
    }
}

/* ─── AI Meeting Summary ─── */
.meeting-item-card { flex-direction: column; align-items: stretch !important; }
.meeting-summary-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 8px; padding: 5px 10px;
    background: rgba(20, 184, 166, 0.08);
    border: 1px solid rgba(20, 184, 166, 0.2);
    border-radius: 6px; font-size: 0.78rem; font-weight: 600;
    color: var(--teal); cursor: pointer; width: fit-content;
    transition: background 0.2s;
}
.meeting-summary-toggle:hover { background: rgba(20, 184, 166, 0.16); }
.summary-chevron { font-size: 0.7rem; transition: transform 0.25s; }
.meeting-summary-body {
    margin-top: 10px; padding: 12px 14px;
    background: rgba(20, 184, 166, 0.05);
    border-left: 3px solid var(--teal);
    border-radius: 0 6px 6px 0;
    font-size: 0.83rem; line-height: 1.6;
    color: var(--text-2); white-space: pre-wrap;
}

/* Transcript log */
.transcript-log { padding: 6px 0; }
.transcript-msg {
    padding: 8px 12px; border-radius: 6px;
    margin: 4px 0; background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
}
.transcript-sender {
    font-weight: 700; font-size: 0.78rem; color: var(--teal);
    margin-right: 8px;
}
.transcript-time { font-size: 0.72rem; color: var(--text-2); }
.transcript-text { margin-top: 3px; font-size: 0.82rem; color: var(--text-1); }

/* ─── Users Grid ─── */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    padding: 4px 0;
}
.user-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 18px 18px 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.user-card:hover {
    border-color: rgba(20,184,166,.35);
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
}

/* ═══════════════════════════ Device Check Modal ═══════════════════════════ */
.dc-modal {
    background: var(--surface);
    border-radius: 16px;
    padding: 28px;
    width: 90%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 0 24px 64px rgba(0,0,0,.5);
    max-height: 90vh;
    overflow-y: auto;
}
.dc-header {
    display: flex;
    align-items: center;
    gap: 14px;
}
.dc-header-icon {
    width: 44px; height: 44px; flex-shrink: 0;
    border-radius: 12px;
    background: rgba(20,184,166,.12);
    color: var(--teal);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.dc-header h2 { font-size: 1rem; font-weight: 600; margin: 0 0 3px; }
.dc-header p  { font-size: 12px; color: var(--text-2); margin: 0; }

/* Preview */
.dc-preview-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0d0d0d;
    border-radius: 10px;
    overflow: hidden;
}
.dc-preview-video {
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* mirror */
}
.dc-no-camera {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: #555; gap: 10px; font-size: 13px;
}
.dc-no-camera i { font-size: 2rem; }

/* Status badges */
.dc-status-row { display: flex; gap: 10px; }
.dc-status-badge {
    flex: 1;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; border-radius: 8px;
    font-size: 13px; font-weight: 500;
    transition: background .3s, color .3s;
}
.dc-status-badge.dc-checking { background: rgba(255,255,255,.06); color: var(--text-2); }
.dc-status-badge.dc-ok       { background: rgba(34,197,94,.12);   color: #22c55e; }
.dc-status-badge.dc-fail     { background: rgba(239,68,68,.12);   color: #ef4444; }

/* Mic meter */
.dc-mic-level { display: flex; flex-direction: column; gap: 6px; }
.dc-level-label {
    font-size: 12px; font-weight: 500; color: var(--text-2);
    display: flex; align-items: center; gap: 6px;
}
.dc-mic-bar-track {
    width: 100%; height: 8px;
    background: rgba(255,255,255,.08);
    border-radius: 4px; overflow: hidden;
}
.dc-mic-bar-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #14b8a6, #22c55e);
    border-radius: 4px;
    transition: width .06s linear;
}
.dc-level-hint { font-size: 11px; color: var(--text-3, #555); }

/* Device selectors */
.dc-devices   { display: flex; flex-direction: column; gap: 10px; }
.dc-device-row { display: flex; flex-direction: column; gap: 4px; }
.dc-device-row label {
    font-size: 12px; font-weight: 500; color: var(--text-2);
    display: flex; align-items: center; gap: 6px;
}
.dc-device-row select {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    color: var(--text);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px; outline: none; cursor: pointer;
    width: 100%;
}
.dc-device-row select:focus { border-color: var(--teal); }

/* Action buttons */
.dc-actions { display: flex; gap: 10px; margin-top: 2px; }
.dc-cancel-btn {
    flex: 0 0 auto;
    padding: 11px 20px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,.12);
    background: transparent; color: var(--text-2);
    font-size: 14px; cursor: pointer; transition: all .2s;
}
.dc-cancel-btn:hover { background: rgba(255,255,255,.06); color: var(--text); }
.dc-join-btn {
    flex: 1;
    padding: 11px 20px; border-radius: 8px;
    border: none; background: var(--teal); color: #fff;
    font-size: 14px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: opacity .2s, transform .2s;
}
.dc-join-btn:hover { opacity: .88; transform: translateY(-1px); }
.dc-join-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ═══════════════════════════ SOAP Notes Panel ═══════════════════════════ */
#notes-panel {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 60px;   /* above controls bar */
    width: 320px;
    background: var(--surface);
    border-right: 1px solid rgba(255,255,255,.1);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
}
#notes-panel.visible { transform: translateX(0); }

#notes-header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(167,139,250,.08);
    flex-shrink: 0;
}

#notes-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.soap-section { display: flex; flex-direction: column; gap: 4px; }
.soap-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-2);
}
.soap-letter {
    width: 20px; height: 20px;
    background: rgba(167,139,250,.18);
    color: #a78bfa;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
}
.soap-textarea {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    color: var(--text);
    font-size: 12.5px;
    line-height: 1.55;
    padding: 9px 10px;
    resize: vertical;
    min-height: 64px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
}
.soap-textarea:focus { border-color: #a78bfa; }
.soap-textarea::placeholder { color: #3a3a4a; }

@media (max-width: 768px) {
    #notes-panel {
        width: 100%;
        border-right: none;
    }
}

/* ─── Recording pulse animation ─── */
@keyframes recPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .4; transform: scale(1.3); }
}

/* ─── Analytics Dashboard ─── */
.analytics-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 16px;
}
.analytics-canvas-wrap {
    position: relative;
    width: 100%;
    height: 200px;
}
.analytics-canvas {
    width: 100%;
    height: 100%;
    display: block;
}
.analytics-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-3, #555);
}
.analytics-sub {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-2);
    margin-left: 4px;
}
