/* ===========================================================================
   WhizzAct Workspace Dashboard — Professional UI
   =========================================================================== */

:root {
    --brand:        #4f46e5;
    --brand-hover:  #4338ca;
    --brand-soft:   #ede9fe;
    --brand-ink:    #ffffff;

    --bg:           #0f1628;
    --bg-soft:      #1a2340;
    --bg-border:    #1e2d4a;

    --surface:      #ffffff;
    --surface-2:    #f8fafc;
    --surface-3:    #f1f5f9;

    --ink:          #0f172a;
    --ink-2:        #334155;
    --ink-3:        #64748b;
    --ink-4:        #94a3b8;

    --border:       #e2e8f0;
    --border-2:     #cbd5e1;

    --green:        #10b981;
    --green-soft:   #d1fae5;
    --green-ink:    #065f46;

    --amber:        #f59e0b;
    --amber-soft:   #fef3c7;
    --amber-ink:    #92400e;

    --red:          #ef4444;
    --red-soft:     #fee2e2;
    --red-ink:      #991b1b;

    --purple:       #8b5cf6;
    --purple-soft:  #ede9fe;
    --purple-ink:   #5b21b6;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow:    0 4px 12px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.14), 0 6px 20px rgba(0,0,0,0.06);
    --shadow-modal: 0 30px 90px rgba(0,0,0,0.22);

    --sidebar-w: 258px;
    --radius:    12px;
    --radius-sm: 8px;
    --radius-xs: 6px;

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================================ RESET */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { background: var(--surface-2); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }
img { display: block; }

.hidden { display: none !important; }
.spacer { flex: 1; }
.muted  { color: var(--ink-3); }
.small  { font-size: 13px; }
.center { text-align: center; }

/* ============================================================ BUTTONS */
.btn {
    display: inline-flex; align-items: center; gap: 7px; justify-content: center;
    padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-weight: 600; font-size: 14px; cursor: pointer; transition: all 0.14s;
    background: var(--surface-3); color: var(--ink-2); white-space: nowrap; line-height: 1;
}
.btn:hover { background: var(--border); }
.btn.primary {
    background: var(--brand); color: #fff; border-color: var(--brand);
    box-shadow: 0 1px 3px rgba(79,70,229,.28), 0 4px 14px rgba(79,70,229,.18);
}
.btn.primary:hover { background: var(--brand-hover); box-shadow: 0 2px 6px rgba(79,70,229,.35), 0 6px 20px rgba(79,70,229,.22); }
.btn.ghost  { background: transparent; border-color: var(--border-2); color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { background: #fff; color: var(--red); border-color: #fecaca; }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm  { padding: 6px 11px; font-size: 13px; border-radius: var(--radius-xs); }
.btn.xs  { padding: 4px 9px;  font-size: 12px; border-radius: 5px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; pointer-events: none; }
.btn-spin { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: btnspin .6s linear infinite; }
@keyframes btnspin { to { transform: rotate(360deg); } }
.btn.block { width: 100%; }

/* ============================================================ AUTH */
.auth-wrap {
    min-height: 100vh; display: grid;
    grid-template-columns: 1.15fr 1fr;
}
.auth-hero {
    background: linear-gradient(150deg, #1e1b4b 0%, #2e1f6b 25%, #1e3a8a 65%, #0c4a6e 100%);
    color: #fff; padding: 56px 64px;
    display: flex; flex-direction: column;
    position: relative; overflow: hidden;
}
.auth-hero::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 10% 110%, rgba(79,70,229,.45) 0%, transparent 55%),
        radial-gradient(ellipse 50% 35% at 85% -5%, rgba(96,165,250,.3) 0%, transparent 55%);
    pointer-events: none;
}
.auth-hero > * { position: relative; z-index: 1; }
.hero-brand { color: #fff; }
.hero-brand .logo { background: #fff; padding: 4px; border-radius: 9px; border: 1px solid rgba(255,255,255,.6); }
.auth-hero-body { margin-top: auto; padding-top: 40px; }
.auth-hero h1 { font-size: 40px; line-height: 1.1; margin: 0 0 18px; font-weight: 800; letter-spacing: -.02em; }
.auth-hero p  { font-size: 17px; color: rgba(255,255,255,.7); max-width: 440px; line-height: 1.65; margin: 0; }
.auth-hero .feat { margin-top: 36px; display: grid; gap: 15px; }
.auth-hero .feat div { display: flex; gap: 13px; align-items: center; color: rgba(255,255,255,.85); font-size: 15px; }
.auth-hero .feat .dot {
    width: 32px; height: 32px; border-radius: 9px;
    background: rgba(255,255,255,.12); display: grid; place-items: center;
    flex: none; border: 1px solid rgba(255,255,255,.14); font-size: 16px;
}
.auth-hero-foot { margin-top: 48px; color: rgba(255,255,255,.3); font-size: 12px; }

.auth-panel {
    display: flex; align-items: center; justify-content: center;
    padding: 48px 40px; background: var(--surface);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand { margin-bottom: 4px; }
.auth-card h2 { margin: 28px 0 6px; font-size: 22px; font-weight: 700; }
.auth-note { font-size: 13px; color: var(--ink-3); text-align: center; margin-top: 14px; }
.auth-note .link { font-weight: 600; }
.auth-sub { font-size: 14px; color: var(--ink-3); line-height: 1.5; margin: 0 0 18px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -2px 0 16px; font-size: 13px; }
.auth-row .remember { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); cursor: pointer; user-select: none; }
.auth-row .remember input { width: auto; margin: 0; }
.link { color: var(--brand); cursor: pointer; font-weight: 500; }
.link:hover { text-decoration: underline; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--ink); }
.brand .logo { width: 32px; height: 32px; object-fit: contain; border-radius: 8px; }

.auth-tabs {
    display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm);
    margin: 24px 0 22px; overflow: hidden;
}
.auth-tabs button {
    flex: 1; border: 0; background: transparent; padding: 10px;
    font-weight: 600; font-size: 14px; color: var(--ink-3); cursor: pointer; transition: all .14s;
}
.auth-tabs button.active { background: var(--brand); color: #fff; }

.invite-title { margin: 24px 0 4px; font-size: 22px; }
.invite-sub   { margin: 0 0 20px; font-size: 15px; }

/* ============================================================ FORMS */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.field input, .field select, .field textarea {
    width: 100%; padding: 10px 13px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 14px; background: #fff;
    color: var(--ink); transition: all .14s; font-family: inherit;
}
.field input::placeholder { color: var(--ink-4); }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.field input:disabled, .field select:disabled { background: var(--surface-3); color: var(--ink-3); cursor: not-allowed; }
.field textarea { resize: vertical; min-height: 72px; }
.check-row {
    min-height: 39px; display: flex !important; align-items: center; gap: 8px;
    padding: 10px 0 0; color: var(--ink-2); cursor: pointer;
}
.check-row input { width: auto; flex: none; margin: 0; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

/* ============================================================ SHELL */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* Sidebar */
.sidebar {
    background: var(--bg); color: #c8d8f0;
    display: flex; flex-direction: column;
    border-right: 1px solid var(--bg-border);
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: 16px 12px;
}

.sidebar-desktop-brand { color: #fff; padding: 6px 8px 20px; }
.sidebar-desktop-brand .logo { background: rgba(255,255,255,.1); padding: 3px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; }
.sidebar-topbar { display: none; }
.nav-toggle     { display: none; }

.ws-switch {
    background: var(--bg-soft); border: 1px solid var(--bg-border); border-radius: 10px;
    padding: 10px 12px; display: flex; align-items: center; gap: 10px;
    cursor: pointer; margin-bottom: 20px; transition: all .14s;
}
.ws-switch:hover { background: #1e2d4a; border-color: #2a3f60; }
.ws-switch .av  { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.ws-switch .ws-info { flex: 1; min-width: 0; }
.ws-switch .nm  { font-weight: 700; color: #fff; font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-switch .pl  { font-size: 11px; color: #7a92bb; text-transform: uppercase; letter-spacing: .06em; margin-top: 1px; }
.ws-switch .caret { color: #4a6080; flex: none; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    border-radius: var(--radius-sm); color: #8aa8d0; font-weight: 500; font-size: 14px;
    cursor: pointer; transition: all .12s; text-decoration: none;
}
.nav a:hover  { background: var(--bg-soft); color: #d0e0f8; }
.nav a.active { background: rgba(79,70,229,.22); color: #a5b4fc; font-weight: 600; }
.nav a.active .nav-icon { opacity: 1; }
.nav-icon { width: 17px; height: 17px; flex: none; opacity: .7; }

.side-foot { margin-top: auto; border-top: 1px solid var(--bg-border); padding-top: 12px; }
.user-chip {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px;
    border-radius: var(--radius-sm); cursor: pointer; transition: all .12s;
}
.user-chip:hover { background: var(--bg-soft); }
.user-chip .av   { width: 32px; height: 32px; border-radius: 50%; background: #2a3f60; color: #a0b8da; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.user-chip .info { flex: 1; min-width: 0; overflow: hidden; }
.user-chip .nm   { color: #d0e0f8; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .pl   { color: #4a6080; font-size: 12px; }
.signout-icon    { color: #4a6080; flex: none; opacity: .7; }

.nav-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 29; backdrop-filter: blur(2px); }

/* ============================================================ MAIN */
.main { padding: 32px 36px; min-width: 0; }

.page-head { display: flex; align-items: flex-start; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.page-head-text { flex: 1; min-width: 0; }
.page-head-text h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.015em; color: var(--ink); }
.page-head-text p  { margin: 3px 0 0; color: var(--ink-3); font-size: 14px; }
.page-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ============================================================ GRID & CARDS */
.grid   { display: grid; gap: 16px; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 16px; }

/* Stat cards */
.stat-card { display: flex; flex-direction: column; }
.stat-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: grid; place-items: center; margin-bottom: 14px; font-size: 20px;
}
.stat-icon.blue   { background: #eff6ff; }
.stat-icon.green  { background: var(--green-soft); }
.stat-icon.purple { background: var(--purple-soft); }
.stat-icon.amber  { background: var(--amber-soft); }
.stat-label { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1.05; margin: 4px 0 6px; }
.stat-sub   { font-size: 13px; color: var(--ink-3); }

/* ============================================================ TABLE */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; min-width: 500px; }
.table th {
    text-align: left; font-size: 11.5px; text-transform: uppercase;
    letter-spacing: .06em; color: var(--ink-3); padding: 10px 14px;
    border-bottom: 1px solid var(--border); font-weight: 600; white-space: nowrap;
}
.table td {
    padding: 13px 14px; border-bottom: 1px solid var(--border);
    font-size: 14px; vertical-align: middle; color: var(--ink-2);
}
.table tbody tr { transition: background .1s; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }

.meetings-load-more { display: flex; justify-content: center; align-items: center; height: 0; overflow: hidden; transition: height .15s; }
.meetings-load-more:not(:empty) { height: 44px; }
.meetings-load-more .btn-spin { width: 18px; height: 18px; border-width: 2.5px; color: var(--brand); margin-right: 0; }

.person { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft);
    color: var(--brand); display: inline-grid; place-items: center;
    font-weight: 700; font-size: 12px; flex: none;
}
.person-name { font-weight: 600; color: var(--ink); font-size: 14px; }
.person-sub  { font-size: 12px; color: var(--ink-3); margin-top: 1px; }

/* ============================================================ BADGES */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
    white-space: nowrap;
}
.badge.owner  { background: var(--purple-soft); color: var(--purple-ink); }
.badge.admin  { background: #dbeafe; color: #1e40af; }
.badge.member { background: var(--surface-3); color: var(--ink-3); }
.badge.green  { background: var(--green-soft); color: var(--green-ink); }
.badge.amber  { background: var(--amber-soft); color: var(--amber-ink); }
.badge.red    { background: var(--red-soft); color: var(--red-ink); }
.badge.grey   { background: var(--surface-3); color: var(--ink-3); }
.badge.brand  { background: var(--brand-soft); color: var(--brand); }

/* ============================================================ PLAN CARDS */
.plans { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.plan {
    border: 2px solid var(--border); border-radius: var(--radius);
    padding: 24px; background: #fff; position: relative;
    display: flex; flex-direction: column; transition: all .18s;
}
.plan:hover { border-color: var(--border-2); box-shadow: var(--shadow); }
.plan.current { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79,70,229,.08); }
.plan-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.plan-desc { font-size: 13px; color: var(--ink-3); margin: 4px 0 16px; }
.plan .price { font-size: 34px; font-weight: 800; margin: 0; letter-spacing: -.025em; color: var(--ink); }
.plan .price span { font-size: 14px; color: var(--ink-3); font-weight: 500; }
.plan .price-period { font-size: 13px; color: var(--ink-3); margin: 4px 0 20px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; flex: 1; }
.plan li { display: flex; gap: 9px; font-size: 14px; color: var(--ink-2); align-items: flex-start; line-height: 1.4; }
.plan li .chk { color: var(--green); flex: none; margin-top: 2px; }
.plan .tag {
    position: absolute; top: -11px; right: 20px;
    background: var(--brand); color: #fff; font-size: 11px; font-weight: 700;
    padding: 3px 10px; border-radius: 999px; letter-spacing: .02em;
}

/* ============================================================ MEETING ITEMS */
.meeting-item {
    display: flex; align-items: center; gap: 14px;
    padding: 13px 0; border-bottom: 1px solid var(--border);
}
.meeting-item:last-child { border-bottom: 0; }
.meeting-dot {
    width: 44px; height: 44px; border-radius: 10px; background: var(--brand-soft);
    color: var(--brand); display: grid; place-items: center; font-weight: 700; flex: none;
    text-align: center; line-height: 1; font-size: 14px;
}
.meeting-dot small { font-size: 9px; display: block; text-transform: uppercase; }
.meeting-info { flex: 1; min-width: 0; }
.meeting-title { font-weight: 600; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meeting-meta  { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.meeting-actions { display: flex; gap: 6px; flex: none; }

/* ============================================================ EMPTY STATE */
.empty {
    text-align: center; padding: 56px 24px; color: var(--ink-3);
    display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty-icon {
    width: 52px; height: 52px; background: var(--surface-3); border-radius: 14px;
    display: grid; place-items: center; font-size: 24px; margin-bottom: 4px;
}
.empty h4 { margin: 0; font-size: 16px; font-weight: 600; color: var(--ink-2); }
.empty p  { margin: 0; font-size: 14px; max-width: 300px; line-height: 1.5; }

/* ============================================================ BILLING STATUS */
.billing-bar {
    display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
    padding: 20px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.billing-bar-item .bl { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.billing-bar-item .bv { font-size: 18px; font-weight: 700; color: var(--ink); }
.billing-bar-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* Seat progress */
.seat-bar { background: var(--surface-3); border-radius: 999px; height: 6px; overflow: hidden; margin-top: 6px; width: 120px; }
.seat-bar-fill { height: 100%; border-radius: 999px; background: var(--brand); transition: width .4s; }
.seat-bar-fill.warn   { background: var(--amber); }
.seat-bar-fill.danger { background: var(--red); }

/* ============================================================ COPY LINK */
.copy-link {
    display: flex; gap: 8px; align-items: center; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px;
}
.copy-link code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); font-family: 'SF Mono', Consolas, monospace; font-size: 12px; }

/* ============================================================ NOTICE */
.notice {
    display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px;
    border-radius: var(--radius-sm); border: 1px solid; font-size: 14px; line-height: 1.5;
}
.notice.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.notice.warn { background: var(--amber-soft); border-color: #fde68a; color: var(--amber-ink); }

/* ============================================================ MODAL */
.modal-bg {
    position: fixed; inset: 0; background: rgba(15,22,40,.48);
    display: grid; place-items: center; z-index: 50; padding: 20px;
    animation: fadein .15s;
}
.modal {
    background: #fff; border-radius: 16px; width: 100%; max-width: 500px;
    box-shadow: var(--shadow-modal); animation: scalein .18s cubic-bezier(.34,1.3,.64,1);
    max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-head {
    padding: 20px 24px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; flex: none;
}
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-foot {
    padding: 16px 24px; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 10px; flex: none;
}
.x {
    margin-left: auto; cursor: pointer; color: var(--ink-3); border: 0; background: none;
    width: 32px; height: 32px; border-radius: 7px; display: grid; place-items: center;
    font-size: 20px; transition: all .12s; flex: none; line-height: 1;
}
.x:hover { background: var(--surface-3); color: var(--ink); }

@keyframes fadein  { from { opacity: 0; } }
@keyframes scalein { from { transform: scale(.95); opacity: 0; } }

/* Right-side drawer variant (WhatsApp-style side panel) */
.modal-bg.drawer { place-items: stretch end; padding: 0; }
.modal-bg.drawer .modal {
    width: 460px; max-width: 92vw; height: 100vh; max-height: 100vh;
    border-radius: 0; box-shadow: -12px 0 40px rgba(15,22,40,.22);
    animation: slidein-right .28s cubic-bezier(.4,0,.2,1);
}
@keyframes slidein-right { from { transform: translateX(100%); } }

/* ============================================ INVITE CHIP INPUT */
.chip-input {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center; cursor: text;
    min-height: 46px; padding: 7px 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    transition: border-color .12s, box-shadow .12s;
}
.chip-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.chip {
    display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
    background: var(--brand-soft); color: var(--brand-hover);
    border-radius: 999px; padding: 3px 6px 3px 3px; font-size: 13px; font-weight: 600;
}
.chip .cav { width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 700; flex: none; }
.chip .clbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.chip .cx { cursor: pointer; border: 0; background: none; color: inherit; font-size: 15px; line-height: 1; padding: 0 3px; opacity: .65; }
.chip .cx:hover { opacity: 1; }
.chip.invalid { background: var(--red-soft); color: var(--red); }
.chip.invalid .cav { background: var(--red); }
.chip-text { flex: 1; min-width: 130px; border: 0; outline: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); padding: 4px 2px; }
.chip-text::placeholder { color: var(--ink-4); }
.chip-suggest {
    margin-top: 6px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: var(--shadow); max-height: 220px; overflow-y: auto;
}
.chip-suggest .sg { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; }
.chip-suggest .sg:hover, .chip-suggest .sg.active { background: var(--surface-3); }
.chip-suggest .sg .av { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.chip-suggest .sg .nm { font-size: 13px; font-weight: 600; color: var(--ink); }
.chip-suggest .sg .em { font-size: 12px; color: var(--ink-3); }

/* ============================================================ TOAST */
.toasts { position: fixed; bottom: 22px; right: 22px; display: grid; gap: 10px; z-index: 80; pointer-events: none; }
.toast {
    background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px;
    font-size: 14px; box-shadow: var(--shadow-lg);
    animation: slideup .22s cubic-bezier(.34,1.3,.64,1);
    max-width: 360px; pointer-events: auto;
}
.toast.err { background: var(--red); }
.toast.ok  { background: var(--green); }
@keyframes slideup { from { transform: translateY(14px); opacity: 0; } }

/* ============================================================ TABS (admin) */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs button {
    border: 0; background: transparent; padding: 10px 16px; font-size: 14px;
    font-weight: 600; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -1px; transition: all .14s; font-family: inherit;
}
.tabs button:hover  { color: var(--ink-2); }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ============================================================ REPORTS */
.segmented {
    display: inline-flex; align-items: center; overflow: hidden;
    border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface);
}
.segmented button {
    border: 0; background: transparent; color: var(--ink-3); cursor: pointer;
    padding: 8px 11px; font-size: 12px; font-weight: 700; min-width: 44px;
}
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button.active { background: var(--brand); color: #fff; }
.segmented button:hover:not(.active) { background: var(--surface-3); color: var(--ink-2); }

.report-tabs { margin-top: -8px; }
.report-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 16px; }
.report-card { min-height: 132px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.report-card.blue   { border-top: 3px solid #3b82f6; }
.report-card.green  { border-top: 3px solid var(--green); }
.report-card.purple { border-top: 3px solid var(--purple); }
.report-card.amber  { border-top: 3px solid var(--amber); }
.report-card.red    { border-top: 3px solid var(--red); }
.report-label {
    font-size: 11px; font-weight: 800; color: var(--ink-3);
    letter-spacing: .06em; text-transform: uppercase;
}
.report-value {
    color: var(--ink); font-size: 24px; line-height: 1.06;
    font-weight: 800; overflow-wrap: anywhere;
}
.report-sub { color: var(--ink-3); font-size: 12px; line-height: 1.4; margin-top: auto; }
.report-blocks { margin-top: 16px; }
.report-table-card { margin-top: 16px; }
.report-table { min-width: 720px; }
.seat-bar.wide { width: 100%; height: 7px; margin-top: 4px; }
.seat-bar.mini { width: 92px; height: 5px; margin-top: 5px; }

.dist-list { display: grid; gap: 14px; }
.dist-row { display: grid; gap: 7px; min-width: 0; }
.dist-meta { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: 13px; }
.dist-meta span { min-width: 0; overflow-wrap: anywhere; }
.dist-meta strong { color: var(--ink); font-size: 13px; white-space: nowrap; }
.dist-track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.dist-track span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.dist-track span.green  { background: var(--green); }
.dist-track span.purple { background: var(--purple); }
.dist-track span.amber  { background: var(--amber); }
.dist-track span.brand  { background: var(--brand); }

.trend-chart {
    height: 220px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    gap: 6px; align-items: end; padding: 8px 0 0; overflow: hidden;
}
.trend-bucket { min-width: 0; display: grid; grid-template-rows: 1fr 18px; gap: 6px; height: 100%; }
.trend-bars { display: flex; align-items: end; justify-content: center; gap: 2px; min-width: 0; }
.trend-bars span {
    width: 6px; min-height: 2px; border-radius: 6px 6px 0 0; display: block;
}
.trend-bars .org { background: #3b82f6; }
.trend-bars .user { background: var(--purple); }
.trend-bars .meeting { background: var(--green); }
.trend-label {
    color: var(--ink-3); font-size: 10px; line-height: 1;
    text-align: center; white-space: nowrap; overflow: hidden; text-overflow: clip;
}
.trend-legend {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    color: var(--ink-3); font-size: 12px; margin-top: 10px;
}
.trend-legend span { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-left: 8px; }
.trend-legend span:first-child { margin-left: 0; }
.trend-legend .org { background: #3b82f6; }
.trend-legend .user { background: var(--purple); }
.trend-legend .meeting { background: var(--green); }
.empty.compact { padding: 28px 12px; }

.skeleton {
    background: linear-gradient(90deg, var(--surface-3), #e7edf5, var(--surface-3));
    background-size: 200% 100%; border-radius: var(--radius-sm); animation: pulse 1.5s infinite;
}
.skeleton.h80 { height: 80px; }
.skeleton.h180 { height: 180px; }
@keyframes pulse { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================ INLINE ROLE SELECT */
.role-select {
    padding: 5px 8px; border-radius: 6px; border: 1px solid var(--border);
    font-size: 13px; color: var(--ink-2); background: var(--surface);
    font-family: inherit; cursor: pointer;
}
.role-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }

/* ============================================================
   RESPONSIVE — TABLET ≤ 960px
============================================================ */
@media (max-width: 960px) {
    /* Auth */
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .auth-panel {
        background: var(--surface-2); min-height: 100vh;
        padding: 32px 20px; align-items: flex-start; padding-top: 60px;
    }
    .auth-card { background: #fff; border-radius: 16px; padding: 32px; box-shadow: var(--shadow); }

    /* Shell */
    .shell { grid-template-columns: 1fr; }

    /* Sidebar → sticky top bar */
    .sidebar {
        position: sticky; top: 0; z-index: 30; height: auto;
        flex-direction: row; align-items: center;
        padding: 0 14px; overflow: visible;
        border-right: 0; border-bottom: 1px solid var(--bg-border);
        min-height: 58px;
    }
    .sidebar-desktop-brand { display: none; }
    .sidebar-topbar {
        display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
    }
    .sidebar-topbar .brand { font-size: 17px; }
    .sidebar-topbar .brand .logo { width: 26px; height: 26px; }

    .nav-toggle {
        display: grid; place-items: center;
        width: 36px; height: 36px; border-radius: 8px;
        background: var(--bg-soft); border: 1px solid var(--bg-border);
        color: #c8d8f0; cursor: pointer; font-size: 0; flex: none;
        transition: background .14s;
    }
    .nav-toggle svg { width: 18px; height: 18px; }
    .nav-toggle:hover { background: #1e2d4a; }

    .ws-switch { flex: none; margin: 0; padding: 7px 10px; max-width: 160px; }
    .ws-switch .pl { display: none; }
    .ws-switch .nm { font-size: 13px; }

    /* Nav drawer */
    .nav {
        position: fixed; top: 0; left: -290px; width: 270px; height: 100vh;
        background: var(--bg); padding: 20px 12px; z-index: 31;
        transition: left .26s cubic-bezier(.4,0,.2,1);
        overflow-y: auto; border-right: 1px solid var(--bg-border);
        box-shadow: 4px 0 30px rgba(0,0,0,.35);
    }
    .nav.open { left: 0; }

    .side-foot {
        margin-top: 0; border-top: 0; padding-top: 0;
        margin-left: auto; flex: none;
    }
    .user-chip .info  { display: none; }
    .user-chip .pl    { display: none; }
    .signout-icon     { display: none; }
    .user-chip        { padding: 6px; }
    .user-chip .av    { width: 34px; height: 34px; }

    .main { padding: 20px 18px; }
    .page-head { margin-bottom: 20px; }
    .page-head-actions { justify-content: flex-start; }

    .cols-3 { grid-template-columns: repeat(2,1fr); }
    .report-kpis { grid-template-columns: repeat(3,1fr); }
    .plans  { grid-template-columns: repeat(2,1fr); }
}

/* ============================================================
   RESPONSIVE — MOBILE ≤ 600px
============================================================ */
@media (max-width: 600px) {
    .cols-3, .cols-2, .plans, .report-kpis { grid-template-columns: 1fr; }

    .auth-panel { padding: 20px 14px; padding-top: 36px; }
    .auth-card  { padding: 24px 20px; }

    .main { padding: 14px 12px; }
    .card { padding: 16px; }

    .page-head-text h2 { font-size: 19px; }
    .page-head-actions .btn { font-size: 13px; }
    .segmented { width: 100%; }
    .segmented button { flex: 1; min-width: 0; }
    .report-card { min-height: 112px; }
    .report-value { font-size: 22px; }
    .trend-chart { height: 180px; gap: 3px; }
    .trend-bars span { width: 4px; }

    .table-wrap { margin: 0 -16px; padding: 0 16px; }

    .billing-bar { gap: 14px; padding: 16px; }
    .billing-bar-actions { margin-left: 0; width: 100%; }

    .meeting-item { flex-wrap: wrap; }
    .meeting-actions { width: 100%; justify-content: flex-end; }

    .modal-bg { align-items: flex-end; padding: 0; }
    .modal { border-radius: 16px 16px 0 0; max-height: 88vh; }

    .toasts { left: 10px; right: 10px; bottom: 14px; }
    .toast  { max-width: 100%; }

    .ws-switch { max-width: 130px; }
}
