:root {
    --bg: #060d13;
    --bg-elevated: #0a151e;
    --panel: #0d1c27;
    --panel-soft: #102330;
    --panel-hover: #142b3a;
    --line: rgba(158, 194, 215, .13);
    --line-strong: rgba(158, 194, 215, .22);
    --text: #edf5f9;
    --text-soft: #a7bcc9;
    --muted: #6e8998;
    --green: #36e0ab;
    --green-dim: rgba(54, 224, 171, .12);
    --blue: #5b9cff;
    --blue-dim: rgba(91, 156, 255, .12);
    --red: #ff6b7a;
    --red-dim: rgba(255, 107, 122, .12);
    --amber: #ffbe5c;
    --amber-dim: rgba(255, 190, 92, .12);
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 24px 70px rgba(0, 0, 0, .32);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 78% -10%, rgba(44, 111, 140, .16), transparent 65%),
        radial-gradient(800px 500px at 8% 108%, rgba(29, 98, 80, .10), transparent 65%),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid rgba(91, 156, 255, .75); outline-offset: 2px; }
a { color: var(--blue); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.icon-button {
    width: 36px; height: 36px; display: inline-grid; place-items: center;
    border: 1px solid transparent; border-radius: 10px; background: transparent;
    color: var(--text-soft); cursor: pointer; transition: .18s ease;
}
.icon-button:hover { color: var(--text); background: rgba(255, 255, 255, .05); border-color: var(--line); }
.icon-button svg { width: 18px; height: 18px; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px;
    background: linear-gradient(145deg, var(--green), #20a8c4);
    color: #04120f; box-shadow: 0 10px 28px rgba(54, 224, 171, .22);
}
.brand-mark svg { width: 21px; height: 21px; stroke-width: 2; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.16; }
.brand-copy strong { font-size: 19px; letter-spacing: .02em; font-weight: 700; }
.brand-copy small { margin-top: 4px; font-size: 9px; letter-spacing: .2em; color: var(--muted); font-weight: 700; }
.brand-large .brand-mark { width: 48px; height: 48px; border-radius: 16px; }
.brand-large .brand-copy strong { font-size: 22px; }

/* ---------- Login ---------- */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr); }
.login-visual {
    position: relative; overflow: hidden; display: flex; flex-direction: column;
    padding: 52px clamp(40px, 6vw, 92px); min-height: 100vh;
    background:
        radial-gradient(760px 520px at 58% 34%, rgba(33, 159, 174, .19), transparent 68%),
        radial-gradient(600px 500px at 10% 95%, rgba(54, 224, 171, .09), transparent 70%),
        linear-gradient(160deg, #0a1b28 0%, #071118 58%, #051016 100%);
    border-right: 1px solid var(--line);
}
.login-visual::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .4;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(circle at 55% 38%, black, transparent 72%);
}
.login-hero { position: relative; z-index: 2; margin-top: auto; max-width: 620px; }
.eyebrow { color: var(--green); font-size: 10px; letter-spacing: .26em; font-weight: 800; margin: 0 0 18px; }
.login-hero h1 { margin: 0 0 18px; font-size: clamp(38px, 4.4vw, 62px); line-height: 1.13; letter-spacing: -.045em; font-weight: 650; }
.hero-desc { color: var(--text-soft); font-size: 16px; line-height: 1.8; max-width: 490px; margin: 0; }
.feature-row { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 30px; margin-top: 46px; }
.feature-row div { display: flex; align-items: center; gap: 9px; color: #c0d2dc; font-size: 13px; }
.feature-row svg { width: 18px; height: 18px; color: var(--green); }
.login-footnote { position: relative; z-index: 2; margin: 42px 0 0; color: #506b7a; font-size: 11px; letter-spacing: .13em; }
.orb-stage { position: absolute; width: min(46vw, 610px); aspect-ratio: 1; top: 3%; right: -4%; z-index: 1; display: grid; place-items: center; opacity: .9; }
.orb-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(96, 201, 202, .14); }
.orb-ring.r1 { inset: 8%; animation: breathe 8s ease-in-out infinite; }
.orb-ring.r2 { inset: 20%; border-color: rgba(96, 201, 202, .18); animation: breathe 8s 1s ease-in-out infinite; }
.orb-ring.r3 { inset: 33%; border-color: rgba(54, 224, 171, .16); animation: breathe 8s 2s ease-in-out infinite; }
.orb-core {
    position: relative; width: 24%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%;
    color: #d6fff3;
    background: radial-gradient(circle at 35% 25%, rgba(90, 255, 213, .32), rgba(20, 84, 91, .34) 45%, rgba(6, 22, 28, .6) 70%);
    border: 1px solid rgba(108, 255, 219, .26);
    box-shadow: 0 0 60px rgba(45, 214, 180, .22), inset 0 0 40px rgba(45, 214, 180, .13);
    animation: float 6s ease-in-out infinite;
}
.orb-core svg { width: 32%; height: 32%; stroke-width: 1.4; filter: drop-shadow(0 0 16px rgba(54, 224, 171, .65)); }
.orb-dot { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 18px var(--green); }
.orb-dot.d1 { top: 17%; left: 26%; }
.orb-dot.d2 { right: 17%; top: 41%; background: var(--blue); box-shadow: 0 0 18px var(--blue); }
.orb-dot.d3 { left: 31%; bottom: 20%; width: 5px; height: 5px; opacity: .7; }
@keyframes breathe { 0%, 100% { transform: scale(.985); opacity: .65; } 50% { transform: scale(1.015); opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(-4px); } 50% { transform: translateY(7px); } }

.login-panel {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 48px clamp(24px, 5vw, 80px); position: relative;
    background: radial-gradient(700px 500px at 100% 0%, rgba(39, 94, 116, .09), transparent 65%), var(--bg);
}
.login-mobile-brand { display: none; }
.login-card { width: min(100%, 420px); }
.secure-pill {
    display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(54, 224, 171, .18);
    background: var(--green-dim); color: var(--green); padding: 6px 11px; border-radius: 100px;
    font-size: 11px; font-weight: 650; letter-spacing: .02em;
}
.secure-pill svg { width: 13px; height: 13px; }
.login-card h2 { font-size: 33px; letter-spacing: -.035em; margin: 22px 0 7px; font-weight: 650; }
.login-card > .muted { margin: 0 0 34px; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field > span { display: flex; justify-content: space-between; align-items: baseline; color: #b8cad4; font-size: 12px; font-weight: 600; }
.field em { font-style: normal; font-size: 10px; color: var(--muted); font-weight: 500; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > svg { position: absolute; left: 14px; width: 17px; height: 17px; color: #5f7d8c; pointer-events: none; }
.input-wrap input, .field > input, .search-box input {
    width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 12px;
    background: rgba(4, 13, 19, .55); color: var(--text); padding: 0 14px 0 43px;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.field > input { padding: 0 14px; }
.input-wrap input::placeholder, .field > input::placeholder, .search-box input::placeholder { color: #526d7b; }
.input-wrap input:focus, .field > input:focus, .search-box input:focus {
    outline: none; border-color: rgba(91, 156, 255, .55); background: rgba(8, 22, 31, .8);
    box-shadow: 0 0 0 4px rgba(91, 156, 255, .08);
}
.reveal { position: absolute; right: 10px; border: 0; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; padding: 7px; }
.reveal:hover { color: var(--text-soft); }
.form-error { min-height: 20px; color: var(--red); font-size: 12px; padding: 2px 0 10px; }
.btn {
    border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft);
    color: var(--text); height: 42px; padding: 0 16px; display: inline-flex; align-items: center;
    justify-content: center; gap: 8px; font-weight: 600; font-size: 13px; cursor: pointer;
    transition: transform .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease;
    white-space: nowrap;
}
.btn:hover { background: var(--panel-hover); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }
.btn-primary {
    background: linear-gradient(135deg, #38e3ae, #1fc4b3); border-color: transparent; color: #031713;
    box-shadow: 0 8px 24px rgba(54, 224, 171, .13);
}
.btn-primary:hover { background: linear-gradient(135deg, #52f1c1, #29d4c0); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-sm { height: 34px; padding: 0 11px; font-size: 12px; border-radius: 9px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-login { width: 100%; height: 50px; margin-top: 4px; border-radius: 13px; font-size: 14px; }
.btn-login svg { margin-left: auto; }
.login-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 27px; color: #587280; font-size: 11px; }
.login-note svg { width: 13px; height: 13px; }
.copyright { position: absolute; bottom: 22px; color: #3f5764; font-size: 10px; letter-spacing: .05em; }

/* ---------- App shell ---------- */
.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
    padding: 28px 20px 20px; border-right: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(10, 22, 31, .96), rgba(7, 15, 22, .98));
    z-index: 20;
}
.sidebar > .brand { padding: 0 10px 30px; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item {
    position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
    border: 1px solid transparent; background: transparent; color: #7f99a7; border-radius: 12px;
    height: 46px; padding: 0 13px; cursor: pointer; text-align: left; font-size: 13px; transition: .17s ease;
}
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { color: var(--text-soft); background: rgba(255, 255, 255, .025); }
.nav-item.active { color: var(--text); background: rgba(54, 224, 171, .075); border-color: rgba(54, 224, 171, .12); }
.nav-item.active::before { content: ""; position: absolute; left: -21px; width: 3px; height: 22px; border-radius: 0 4px 4px 0; background: var(--green); box-shadow: 0 0 16px rgba(54, 224, 171, .7); }
.nav-item.active svg { color: var(--green); }
.nav-badge {
    margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 20px;
    display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 800;
    background: var(--green); color: #041510;
}
.sidebar-bottom { margin-top: auto; }
.server-state {
    display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px;
    background: rgba(255, 255, 255, .018); padding: 11px 12px; margin: 0 2px 16px;
}
.server-state strong { display: block; color: #a9c0cb; font-size: 11px; font-weight: 600; }
.server-state small { color: #4f6976; font-size: 9px; letter-spacing: .03em; }
.account-security {
    display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 2px 12px;
    padding: 10px 11px; border: 1px solid var(--line); border-radius: 12px;
    background: rgba(255, 255, 255, .018); color: var(--text-soft); cursor: pointer;
    text-align: left; transition: background .17s ease, border-color .17s ease;
}
.account-security:hover { background: rgba(54, 224, 171, .06); border-color: rgba(54, 224, 171, .2); }
.security-icon { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; background: rgba(54, 224, 171, .1); color: var(--green); }
.security-icon svg { width: 14px; height: 14px; }
.security-copy { display: flex; flex-direction: column; }
.security-copy strong { font-size: 10.5px; font-weight: 600; color: #b5ccd6; }
.security-copy small { margin-top: 2px; color: #4f6976; font-size: 8px; letter-spacing: .04em; }
.account-security .chevron { width: 13px; height: 13px; margin-left: auto; color: #546e7b; }
.mobile-password {
    display: none; align-items: center; gap: 5px; height: 34px; padding: 0 10px;
    border: 1px solid var(--line); border-radius: 9px; background: transparent;
    color: #a9c0cb; font-size: 11px; cursor: pointer;
}
.mobile-password:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.mobile-password svg { width: 14px; height: 14px; }
.pulse-dot, .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(54, 224, 171, .09), 0 0 13px rgba(54, 224, 171, .5); flex: 0 0 auto; animation: pulseDot 2.4s ease-in-out infinite; }
@keyframes pulseDot { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
.admin-chip { display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--line); padding: 16px 4px 0; }
.avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #24506a, #17334a); color: #b8dbea; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.admin-chip > div { min-width: 0; flex: 1; }
.admin-chip strong { display: block; font-size: 11px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-chip small { display: block; color: var(--muted); font-size: 9px; }
.admin-chip .icon-button { width: 29px; height: 29px; }
.admin-chip .icon-button svg { width: 15px; height: 15px; }

.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 15; min-height: 93px; padding: 20px clamp(22px, 3vw, 40px);
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    background: rgba(6, 13, 19, .78); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(158, 194, 215, .08);
}
.topbar-kicker { margin: 0 0 4px; color: #577281; font-size: 9px; font-weight: 800; letter-spacing: .22em; }
.topbar h1 { margin: 0; font-size: 22px; letter-spacing: -.025em; font-weight: 650; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.mobile-admin { display: none; }
.live-connection { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #88a3b1; border: 1px solid var(--line); border-radius: 100px; padding: 7px 12px; background: rgba(255, 255, 255, .018); }
.live-connection > span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px var(--green); }
.live-connection.offline { color: var(--amber); }
.live-connection.offline > span { background: var(--amber); box-shadow: 0 0 9px var(--amber); }
.clock { color: #7892a0; font-variant-numeric: tabular-nums; font-size: 12px; letter-spacing: .03em; min-width: 46px; }
.content { width: 100%; max-width: 1480px; margin: 0 auto; padding: 30px clamp(22px, 3vw, 40px) 70px; transition: padding-bottom .25s ease; }
body.audio-live .content { padding-bottom: 145px; }
.view { animation: fadeUp .32s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* ---------- Stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 35px; }
.stat-card {
    position: relative; overflow: hidden; display: flex; align-items: center; gap: 13px;
    min-height: 92px; padding: 18px; border-radius: 16px; border: 1px solid var(--line);
    background: linear-gradient(145deg, rgba(16, 33, 44, .7), rgba(9, 21, 29, .6)); box-shadow: 0 12px 32px rgba(0, 0, 0, .09);
}
.stat-icon { width: 41px; height: 41px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; }
.stat-icon svg { width: 19px; height: 19px; }
.stat-icon.blue { background: var(--blue-dim); color: var(--blue); }
.stat-icon.green { background: var(--green-dim); color: var(--green); }
.stat-icon.red { background: var(--red-dim); color: var(--red); }
.stat-icon.amber { background: var(--amber-dim); color: var(--amber); }
.stat-card > div:nth-child(2) { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; }
.stat-card span { display: block; flex-basis: 100%; color: #829ba8; font-size: 11px; margin-bottom: 2px; }
.stat-card strong { font-size: 25px; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-card small { font-size: 10px; color: #58717e; }
.stat-glow { position: absolute; right: -25px; bottom: -35px; width: 90px; height: 90px; border-radius: 50%; background: rgba(54, 224, 171, .05); filter: blur(16px); }

/* ---------- Section head ---------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.section-head h2 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.015em; font-weight: 650; }
.section-head p { margin: 0; color: var(--muted); font-size: 11.5px; }
.section-head.compact { margin-top: 35px; }
.section-tools { display: flex; align-items: center; gap: 10px; }
.refresh-time { color: #526d7a; font-size: 10px; }
.text-button { display: inline-flex; align-items: center; gap: 3px; background: transparent; border: 0; color: #7e9cab; cursor: pointer; font-size: 11px; padding: 5px; }
.text-button:hover { color: var(--green); }
.text-button svg { width: 13px; height: 13px; }

/* ---------- Live cards ---------- */
.live-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.call-card {
    position: relative; border-radius: var(--radius); border: 1px solid var(--line);
    background: linear-gradient(155deg, rgba(16, 33, 44, .92), rgba(8, 19, 27, .94));
    padding: 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, .18); overflow: hidden;
}
.call-card::before {
    content: ""; position: absolute; inset: 0 0 auto; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(54, 224, 171, .55), transparent); opacity: 0;
}
.call-card.status-connected::before { opacity: 1; }
.call-card.agent-live { border-color: rgba(54, 224, 171, .3); box-shadow: 0 22px 55px rgba(0, 0, 0, .2), 0 0 0 1px rgba(54, 224, 171, .05) inset; }
.call-top { display: flex; align-items: flex-start; gap: 13px; }
.caller-avatar {
    width: 49px; height: 49px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center;
    background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .15), transparent 60%), var(--avatar, #24506a);
    color: #effcff; font-size: 15px; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09);
}
.call-main { min-width: 0; flex: 1; }
.call-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 5px; }
.status-pill {
    display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px;
    border-radius: 100px; font-size: 9px; font-weight: 700; letter-spacing: .03em;
    border: 1px solid transparent;
}
.status-pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pill.ringing { color: var(--amber); background: var(--amber-dim); border-color: rgba(255, 190, 92, .15); }
.status-pill.connected { color: var(--green); background: var(--green-dim); border-color: rgba(54, 224, 171, .15); }
.status-pill.ended { color: var(--muted); background: rgba(255, 255, 255, .04); }
.status-pill.agent { color: var(--blue); background: var(--blue-dim); border-color: rgba(91, 156, 255, .15); }
.auto-pill { color: #5f7b89; font-size: 9px; letter-spacing: .02em; }
.call-main h3 { margin: 0; font-size: 22px; letter-spacing: -.025em; font-weight: 620; line-height: 1.25; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-sub { margin: 4px 0 0; color: #728d9b; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-timer { text-align: right; flex: 0 0 auto; }
.call-timer strong { display: block; font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: .01em; font-weight: 550; }
.call-timer small { color: #536d7a; font-size: 9px; }
.call-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 17px 0 15px; padding: 13px 0; border-top: 1px solid rgba(158, 194, 215, .09); border-bottom: 1px solid rgba(158, 194, 215, .09); }
.call-meta-grid span { display: block; color: #58727f; font-size: 9px; margin-bottom: 2px; }
.call-meta-grid strong { display: block; color: #aec4cf; font-size: 10.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-meta-grid .accent { color: var(--green); }
.call-meta-grid .warn { color: var(--amber); }
.countdown-block { margin-bottom: 15px; }
.countdown-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; color: #657f8d; font-size: 9.5px; }
.countdown-label strong { color: #a5bdc9; font-size: 10px; font-weight: 550; }
.progress-track { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.progress-track > span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .5s linear; }
.progress-track .p-answer { background: linear-gradient(90deg, #2ecaa1, var(--green)); }
.progress-track .p-reject { background: linear-gradient(90deg, #c74f61, var(--red)); }
.progress-track .p-hangup { background: linear-gradient(90deg, #c28b39, var(--amber)); }
.call-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.call-actions .btn { flex: 1; min-width: 80px; height: 37px; font-size: 11px; border-radius: 9px; }
.call-actions .btn-success { background: var(--green); border-color: transparent; color: #041510; }
.call-actions .btn-success:hover { background: #57f2c2; }
.call-actions .btn-danger { background: rgba(255, 107, 122, .08); border-color: rgba(255, 107, 122, .25); color: #ff8b96; }
.call-actions .btn-danger:hover { background: var(--red-dim); border-color: rgba(255, 107, 122, .4); }
.call-actions .btn-join { background: var(--blue-dim); border-color: rgba(91, 156, 255, .25); color: #87b8ff; }
.call-actions .btn-join:hover { background: rgba(91, 156, 255, .18); }
.wave-bars { display: inline-flex; align-items: center; gap: 2px; height: 12px; margin-left: 4px; }
.wave-bars i { display: block; width: 2px; height: 4px; background: var(--green); border-radius: 2px; animation: wave 1s ease-in-out infinite; }
.wave-bars i:nth-child(2) { animation-delay: .15s; }
.wave-bars i:nth-child(3) { animation-delay: .3s; }
.wave-bars i:nth-child(4) { animation-delay: .45s; }
@keyframes wave { 0%, 100% { height: 4px; opacity: .55; } 50% { height: 11px; opacity: 1; } }

/* ---------- Empty state ---------- */
.empty-state {
    min-height: 315px; border: 1px dashed rgba(158, 194, 215, .17); border-radius: var(--radius);
    background: radial-gradient(500px 260px at 50% 0%, rgba(39, 94, 116, .1), transparent 70%);
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 38px 24px;
}
.empty-art { position: relative; width: 92px; height: 92px; display: grid; place-items: center; margin-bottom: 18px; }
.empty-art > span { position: absolute; border-radius: 50%; border: 1px solid rgba(54, 224, 171, .12); }
.empty-art > span:nth-child(1) { inset: 0; }
.empty-art > span:nth-child(2) { inset: 13px; border-color: rgba(54, 224, 171, .18); }
.empty-art > span:nth-child(3) { inset: 27px; background: rgba(54, 224, 171, .06); border-color: rgba(54, 224, 171, .2); }
.empty-art svg { position: relative; width: 22px; height: 22px; color: var(--green); }
.empty-state h3 { margin: 0 0 7px; font-size: 15px; font-weight: 600; }
.empty-state p { margin: 0; color: var(--muted); font-size: 11.5px; }
.empty-hint { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; border: 1px solid var(--line); border-radius: 100px; padding: 6px 12px; color: #6d8896; font-size: 10px; }
.empty-hint .pulse-dot { width: 5px; height: 5px; }

/* ---------- Recent ---------- */
.recent-list { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(10, 22, 30, .46); overflow: hidden; }
.recent-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid rgba(158, 194, 215, .075); }
.recent-item:last-child { border-bottom: 0; }
.recent-avatar { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .04); color: #86a5b5; font-size: 11px; }
.recent-main { flex: 1; min-width: 0; }
.recent-main strong { display: block; font-size: 12px; font-weight: 550; font-variant-numeric: tabular-nums; }
.recent-main small { display: block; color: var(--muted); font-size: 9.5px; margin-top: 2px; }
.recent-side { text-align: right; }
.recent-side strong { display: block; font-size: 10px; font-weight: 500; color: #93abb8; }
.recent-side small { display: block; color: #526b78; font-size: 9px; margin-top: 2px; }
.recent-empty { padding: 34px; text-align: center; color: var(--muted); font-size: 11px; }

/* ---------- History table ---------- */
.search-box { position: relative; display: flex; align-items: center; width: 220px; }
.search-box svg { position: absolute; left: 11px; width: 14px; height: 14px; color: #5b7583; }
.search-box input { height: 34px; padding: 0 11px 0 33px; font-size: 11px; border-radius: 9px; }
.table-card { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(10, 22, 30, .5); overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th { text-align: left; color: #5b7482; font-size: 9.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; padding: 14px 16px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .012); }
.data-table td { padding: 14px 16px; border-bottom: 1px solid rgba(158, 194, 215, .075); font-size: 11.5px; color: #a9c0cb; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, .018); }
.data-table .number-cell { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.data-table .sub { display: block; color: #536c79; font-size: 9px; margin-top: 2px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 100px; font-size: 9px; font-weight: 600; }
.badge.answered { color: var(--green); background: var(--green-dim); }
.badge.rejected { color: var(--red); background: var(--red-dim); }
.badge.missed { color: var(--amber); background: var(--amber-dim); }
.badge.canceled { color: #8da5b2; background: rgba(255, 255, 255, .05); }
.badge.failed { color: #9b8dcc; background: rgba(155, 141, 204, .1); }
.badge.pending { color: var(--blue); background: var(--blue-dim); }
.agent-yes { color: var(--blue); }
.agent-no { color: #526c79; }
.table-empty { padding: 52px 20px; text-align: center; color: var(--muted); font-size: 11.5px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-top: 1px solid var(--line); color: #5d7683; font-size: 10px; }
.pager { display: flex; align-items: center; gap: 10px; }
.pager span { color: #728c99; font-size: 10px; min-width: 64px; text-align: center; }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(150deg, rgba(16, 33, 44, .78), rgba(9, 20, 28, .7)); padding: 20px; }
.panel-head { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 19px; }
.panel-head .stat-icon { width: 35px; height: 35px; border-radius: 10px; }
.panel-head .stat-icon svg { width: 16px; height: 16px; }
.panel-head h3 { margin: 1px 0 3px; font-size: 13px; font-weight: 620; }
.panel-head p { margin: 0; color: var(--muted); font-size: 10px; }
.probability-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .05); margin-bottom: 12px; }
.probability-bar span { display: block; height: 100%; transition: width .35s ease; }
.bar-answer { background: linear-gradient(90deg, #2ecaa1, var(--green)); }
.bar-reject { background: linear-gradient(90deg, #d55c6c, var(--red)); }
.bar-missed { background: #48616e; }
.probability-legend { display: flex; flex-wrap: wrap; gap: 15px; color: #75909e; font-size: 9.5px; margin-bottom: 18px; }
.probability-legend span { display: flex; align-items: center; gap: 6px; }
.probability-legend b { color: #b8cbd4; font-weight: 600; }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--green); }
.dot.red { background: var(--red); }
.dot.gray { background: #526b78; }
.two-col, .range-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.range-row { grid-template-columns: 1fr auto 1fr; align-items: end; }
.range-dash { color: #435c69; padding-bottom: 15px; }
.panel .field { margin-bottom: 0; }
.panel .field input { height: 42px; }
.panel .field.narrow { width: 140px; }
.panel-note { display: flex; align-items: flex-start; gap: 6px; color: #57717e; font-size: 9.5px; line-height: 1.7; margin: 14px 0 0; }
.panel-note svg { flex: 0 0 auto; width: 13px; height: 13px; margin-top: 2px; color: #4e6a78; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid rgba(158, 194, 215, .08); cursor: pointer; }
.switch-row:last-child { border-bottom: 0; padding-bottom: 0; }
.switch-row strong { display: block; font-size: 11.5px; font-weight: 550; color: #b5c9d3; margin-bottom: 2px; }
.switch-row small { display: block; color: #5f7885; font-size: 9.5px; line-height: 1.6; max-width: 320px; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; width: 38px; height: 22px; flex: 0 0 auto; border-radius: 30px; background: #243945; border: 1px solid rgba(255, 255, 255, .06); transition: .2s ease; }
.switch::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; top: 2px; left: 2px; background: #78919e; transition: .2s ease; }
.switch-row input:checked + .switch { background: rgba(54, 224, 171, .22); border-color: rgba(54, 224, 171, .35); }
.switch-row input:checked + .switch::after { transform: translateX(16px); background: var(--green); box-shadow: 0 0 12px rgba(54, 224, 171, .4); }
.switch-row input:disabled + .switch { opacity: .7; cursor: default; }
.strategy-preview { margin-top: 16px; padding: 15px 18px; border: 1px solid rgba(91, 156, 255, .15); border-radius: 12px; background: var(--blue-dim); color: #9fb8c1; font-size: 11px; line-height: 1.75; }
.strategy-preview strong { color: #c9e6f2; font-weight: 600; }
.settings-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 18px; }
.settings-actions .muted { font-size: 10px; margin-right: auto; }
#saveSettings { position: sticky; top: 110px; }

/* ---------- Audio dock ---------- */
.audio-dock {
    position: fixed; left: calc(248px + 28px); right: 28px; bottom: 22px; z-index: 40;
    display: flex; align-items: center; gap: 20px; min-height: 74px; padding: 12px 15px 12px 18px;
    border-radius: 18px; border: 1px solid rgba(54, 224, 171, .23);
    background: linear-gradient(135deg, rgba(15, 42, 42, .96), rgba(8, 25, 33, .97));
    box-shadow: 0 24px 70px rgba(0, 0, 0, .5), 0 0 0 1px rgba(54, 224, 171, .04) inset;
    backdrop-filter: blur(22px); animation: dockIn .32s cubic-bezier(.22, .8, .35, 1) both;
}
@keyframes dockIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.audio-identity { display: flex; align-items: center; gap: 13px; min-width: 220px; }
.audio-pulse { display: flex; align-items: center; justify-content: center; gap: 2.5px; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px; background: rgba(54, 224, 171, .12); }
.audio-pulse i { width: 2.5px; border-radius: 2px; background: var(--green); animation: dockWave 1.1s ease-in-out infinite; }
.audio-pulse i:nth-child(1) { height: 9px; animation-delay: 0s; }
.audio-pulse i:nth-child(2) { height: 17px; animation-delay: .15s; }
.audio-pulse i:nth-child(3) { height: 11px; animation-delay: .3s; }
@keyframes dockWave { 0%, 100% { transform: scaleY(.55); opacity: .65; } 50% { transform: scaleY(1); opacity: 1; } }
.audio-label { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 9px; letter-spacing: .05em; font-weight: 700; }
.audio-label .live-dot { width: 5px; height: 5px; box-shadow: 0 0 7px var(--green); }
.audio-identity strong { display: block; font-size: 15px; font-variant-numeric: tabular-nums; margin-top: 2px; line-height: 1.25; }
.audio-identity small { display: block; color: #6f929c; font-size: 9.5px; margin-top: 1px; font-variant-numeric: tabular-nums; }
.audio-meter { flex: 1; min-width: 80px; max-width: 230px; height: 4px; background: rgba(255, 255, 255, .07); border-radius: 9px; overflow: hidden; }
.audio-meter span { display: block; height: 100%; width: 5%; border-radius: inherit; background: linear-gradient(90deg, #2ecaa1, var(--green)); transition: width .08s linear; }
.audio-controls { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.dock-btn { display: inline-flex; align-items: center; gap: 6px; height: 39px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: #b1c7d1; font-size: 10.5px; cursor: pointer; transition: .17s ease; white-space: nowrap; }
.dock-btn:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.dock-btn svg { width: 16px; height: 16px; }
.dock-btn.danger { color: #ff8b96; border-color: rgba(255, 107, 122, .22); }
.dock-btn.danger:hover { background: var(--red-dim); }
.dock-btn.muted { color: var(--red); border-color: rgba(255, 107, 122, .25); background: var(--red-dim); }
.volume-control { display: flex; align-items: center; gap: 8px; color: #6f8b97; padding: 0 5px; }
.volume-control svg { width: 16px; height: 16px; }
.volume-control input { width: 70px; height: 4px; accent-color: var(--green); cursor: pointer; }
.volume-control input::-webkit-slider-runnable-track { height: 4px; background: rgba(255, 255, 255, .12); border-radius: 9px; }
.volume-control input::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--green); margin-top: -4px; box-shadow: 0 0 8px rgba(54, 224, 171, .4); }

/* ---------- Toast / modal ---------- */
.toast {
    position: fixed; left: 50%; bottom: 118px; z-index: 80; transform: translate(-50%, 18px);
    padding: 11px 17px; border-radius: 10px; background: #eaf8f4; color: #07201a; font-size: 11.5px; font-weight: 600;
    box-shadow: 0 16px 45px rgba(0, 0, 0, .35); opacity: 0; pointer-events: none; transition: .22s ease; max-width: calc(100vw - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #ffeaec; color: #3a0b11; }
.modal {
    border: 1px solid var(--line-strong); border-radius: 18px; background: linear-gradient(155deg, #10232f, #091820);
    color: var(--text); padding: 0; width: min(420px, calc(100vw - 32px)); box-shadow: 0 35px 100px rgba(0, 0, 0, .6);
}
.modal::backdrop { background: rgba(2, 8, 12, .72); backdrop-filter: blur(4px); }
.modal > form, .modal > .modal-head, .modal > .detail-body { padding-left: 24px; padding-right: 24px; }
.modal > form { padding-bottom: 23px; }
.modal .modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding-top: 23px; padding-bottom: 20px; }
.modal h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }
.modal-wide { width: min(540px, calc(100vw - 32px)); }
.detail-body { padding-bottom: 24px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.detail-grid > div { background: #0b1b25; padding: 12px 14px; }
.detail-grid span { display: block; color: #5b7583; font-size: 9px; margin-bottom: 3px; }
.detail-grid strong { display: block; font-size: 11.5px; font-weight: 550; color: #bdd0da; word-break: break-all; }
.detail-note { margin-top: 13px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; color: #78909d; font-size: 10px; background: rgba(255, 255, 255, .018); }
.detail-timeline { margin-top: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; }
.timeline-item { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 10px; color: #6f8996; }
.timeline-item strong { color: #a8bdc8; font-weight: 500; text-align: right; }

/* ---------- Scrollbar / responsive ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(133, 163, 180, .22); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(133, 163, 180, .34); }

@media (max-width: 1200px) {
    .login-screen { grid-template-columns: minmax(0, 1fr) minmax(390px, .78fr); }
    .orb-stage { width: 540px; right: -80px; }
    .live-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
    .login-visual { display: none; }
    .login-screen { display: block; }
    .login-panel { min-height: 100vh; padding: 40px 24px 70px; }
    .login-mobile-brand { display: flex; margin-bottom: 40px; }
    .login-card h2 { font-size: 30px; }
    .copyright { position: absolute; }
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: 66px; width: 100%;
        flex-direction: row; align-items: center; padding: 7px 12px; border-right: 0; border-top: 1px solid var(--line);
        background: rgba(7, 17, 24, .96); backdrop-filter: blur(18px);
    }
    .sidebar > .brand, .sidebar-bottom .server-state, .admin-chip { display: none; }
    .sidebar-bottom { display: none; }
    .nav { flex-direction: row; width: 100%; justify-content: space-around; gap: 4px; }
    .nav-item { height: 51px; flex-direction: column; gap: 3px; width: auto; flex: 1; padding: 5px 8px; font-size: 9px; justify-content: center; }
    .nav-item svg { width: 18px; height: 18px; }
    .nav-item.active::before { display: none; }
    .nav-badge { position: absolute; top: 4px; right: calc(50% - 22px); margin: 0; min-width: 16px; height: 16px; font-size: 8px; padding: 0 4px; }
    .workspace { padding-bottom: 66px; }
    .topbar { min-height: 78px; padding: 15px 20px; }
    .mobile-admin { display: inline-grid; }
    .mobile-password { display: inline-flex; }
    .topbar-actions { gap: 7px; }
    .sidebar-bottom { display: none; }
    .content { padding: 22px 20px 105px; }
    .audio-dock { left: 12px; right: 12px; bottom: 78px; flex-wrap: wrap; gap: 10px 16px; padding: 13px 14px; }
    body.audio-live .content { padding-bottom: 235px; }
    .audio-identity { min-width: 0; flex: 1; }
    .audio-meter { order: 4; flex-basis: 100%; max-width: none; height: 3px; }
    .audio-controls { margin-left: 0; }
    .volume-control { display: none; }
    .toast { bottom: 155px; }
    .settings-grid { grid-template-columns: 1fr; }
    #saveSettings { position: static; }
}
@media (max-width: 700px) {
    .login-panel { justify-content: flex-start; padding-top: 32px; }
    .login-mobile-brand { margin-bottom: 30px; }
    .login-card h2 { font-size: 27px; }
    .login-card > .muted { margin-bottom: 26px; }
    .login-note { margin-top: 21px; }
    .topbar-actions .live-connection { display: none; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 27px; }
    .stat-card { padding: 13px; min-height: 78px; gap: 9px; }
    .stat-icon { width: 34px; height: 34px; border-radius: 10px; }
    .stat-icon svg { width: 16px; height: 16px; }
    .stat-card strong { font-size: 21px; }
    .section-head { align-items: flex-start; flex-direction: column; gap: 11px; }
    .section-tools { width: 100%; justify-content: space-between; }
    .call-card { padding: 16px; border-radius: 16px; }
    .call-main h3 { font-size: 19px; }
    .call-meta-grid { gap: 9px 10px; }
    .call-actions .btn { min-width: calc(50% - 4px); }
    .search-box { width: 100%; flex: 1; }
    .data-table th, .data-table td { padding: 11px 12px; }
    .data-table th:nth-child(2), .data-table td:nth-child(2), .data-table th:nth-child(3), .data-table td:nth-child(3), .data-table th:nth-child(7), .data-table td:nth-child(7) { display: none; }
    .table-footer { align-items: flex-start; flex-direction: column; gap: 10px; }
    .pager { width: 100%; justify-content: space-between; }
    .two-col { gap: 9px; }
    .panel { padding: 16px; border-radius: 16px; }
    .range-row { gap: 8px; }
    .audio-dock { align-items: flex-start; }
    .audio-controls { width: 100%; justify-content: space-between; gap: 5px; }
    .dock-btn { flex: 1; justify-content: center; padding: 0 6px; }
    .dock-btn span { font-size: 9px; }
    .audio-identity { flex-basis: 100%; }
    .modal > form, .modal > .modal-head, .modal > .detail-body { padding-left: 18px; padding-right: 18px; }
    .detail-grid { grid-template-columns: 1fr; }
    .topbar { min-height: 72px; }
    .topbar h1 { font-size: 19px; }
    .clock { display: none; }
    .empty-state { min-height: 265px; }
}
@media (max-width: 380px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { min-height: 71px; padding: 11px; }
    .stat-card strong { font-size: 18px; }
    .stat-icon { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
