/* ============================================================
   LeadNSales Compliance — design system
   Premium, quiet, corporate. Light default, dark supported.
   ============================================================ */

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/poppins-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/poppins-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/poppins-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/poppins-700.woff2') format('woff2');
}

:root {
    --font: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --side-w: 236px;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    /* palette — Fair navy + sky blue, orange CTA */
    --accent:        #43aadf;
    --accent-strong: #2f96c8;
    --accent-soft:   #e2f1fa;
    --accent-on:     #ffffff;

    --cta:           #F59C40;
    --cta-strong:    #ed8d29;
    --cta-soft:      #fdf0e0;
    --cta-on:        #ffffff;

    --bg:            #F6FBFF;
    --surface:       #ffffff;
    --surface-2:     #EAF3FA;
    --border:        #dbe8f4;
    --border-strong: #c7d3ea;

    --ink:           #202246;
    --ink-2:         #4A5568;
    --ink-3:         #8794ad;

    --ok:            #1fa07c;
    --ok-soft:       #d9f3ea;
    --warn:          #b45309;
    --warn-soft:     #fdf0e0;
    --danger:        #e2604e;
    --danger-soft:   #ffe9e5;

    --shadow-1: 0 1px 2px rgba(18, 20, 26, .04);
    --shadow-2: 0 2px 8px rgba(18, 20, 26, .06);
    --shadow-3: 0 16px 48px rgba(18, 20, 26, .14);

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 12px;

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] {
        --accent:        #6fc0ea;
        --accent-strong: #8ecdf0;
        --accent-soft:   #23375c;
        --accent-on:     #101228;

        --cta:           #F59C40;
        --cta-strong:    #F5AF75;
        --cta-soft:      #3a2c14;
        --cta-on:        #1c1303;

        --bg:            #13152b;
        --surface:       #1b1e3a;
        --surface-2:     #222650;
        --border:        #2d3160;
        --border-strong: #3b4075;

        --ink:           #eef1fb;
        --ink-2:         #aab3d0;
        --ink-3:         #6e77a0;

        --ok:            #3CC29A;
        --ok-soft:       #12382d;
        --warn:          #FADB5E;
        --warn-soft:     #3a2c10;
        --danger:        #FF806F;
        --danger-soft:   #40201b;

        --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow-2: 0 4px 14px rgba(0, 0, 0, .5);
        --shadow-3: 0 12px 40px rgba(0, 0, 0, .6);

        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --accent:        #6fc0ea;
    --accent-strong: #8ecdf0;
    --accent-soft:   #23375c;
    --accent-on:     #101228;

    --cta:           #F59C40;
    --cta-strong:    #F5AF75;
    --cta-soft:      #3a2c14;
    --cta-on:        #1c1303;

    --bg:            #13152b;
    --surface:       #1b1e3a;
    --surface-2:     #222650;
    --border:        #2d3160;
    --border-strong: #3b4075;

    --ink:           #eef1fb;
    --ink-2:         #aab3d0;
    --ink-3:         #6e77a0;

    --ok:            #3CC29A;
    --ok-soft:       #12382d;
    --warn:          #FADB5E;
    --warn-soft:     #3a2c10;
    --danger:        #FF806F;
    --danger-soft:   #40201b;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 4px 14px rgba(0, 0, 0, .5);
    --shadow-3: 0 12px 40px rgba(0, 0, 0, .6);

    color-scheme: dark;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--font); font-weight: 650; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
img, svg { display: block; }

/* ---------- app shell: sidebar + main ---------- */
.app { min-height: 100vh; display: flex; }

.side {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    width: var(--side-w);
    display: flex; flex-direction: column;
    background:
        radial-gradient(500px 300px at -30% -10%, rgba(80, 167, 218, .22), transparent 60%),
        linear-gradient(168deg, #262a58 0%, #1b1e40 60%, #161832 100%);
    color: #c8cde6;
}
.side-brand {
    padding: 26px 22px 20px;
    display: flex; flex-direction: column; gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.side-logo { max-height: 54px; max-width: 150px; object-fit: contain; align-self: flex-start; }
.side-product { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #7d84ad; }

.side-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.side-link {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border-radius: 10px;
    color: #aab0d0; font-size: 13.5px; font-weight: 550;
    text-decoration: none;
    transition: background .12s ease, color .12s ease;
}
.side-link svg { opacity: .8; flex: none; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.side-link.on { background: color-mix(in srgb, var(--accent) 22%, transparent); color: #fff; }
.side-link.on svg { opacity: 1; color: var(--accent); }
.side-sep {
    margin: 16px 12px 6px; padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #6d7398;
}

.side-foot {
    padding: 14px 14px 18px;
    border-top: 1px solid rgba(255, 255, 255, .07);
    display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
}
.side-theme {
    grid-column: 1 / -1;
    display: flex; align-items: center; gap: 8px;
    background: none; border: none; color: #8b91b8;
    font-size: 12px; font-weight: 550; cursor: pointer;
    padding: 6px 8px; border-radius: 8px;
}
.side-theme:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-user { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; padding: 4px; border-radius: 10px; }
.side-user:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }
.side-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex: none;
    display: grid; place-items: center;
    background: var(--accent); color: #fff;
    font-size: 13px; font-weight: 700;
}
.side-user-meta { display: flex; flex-direction: column; min-width: 0; }
.side-user-name { color: #eceffb; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-sub { color: #7d84ad; font-size: 10.5px; }
.side-signout {
    background: none; border: 1px solid rgba(255,255,255,.12); color: #8b91b8;
    width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
    display: grid; place-items: center;
}
.side-signout:hover { color: #fff; border-color: rgba(255,255,255,.3); }

.main { flex: 1; margin-left: var(--side-w); display: flex; flex-direction: column; min-height: 100vh; }
.content { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 34px 36px 150px; }
.footer { padding: 16px 36px 24px; text-align: center; color: var(--ink-3); font-size: 12px; }
.footer strong { color: var(--ink-2); font-weight: 600; }

@media (max-width: 920px) {
    .side { position: static; width: 100%; flex-direction: row; align-items: center; flex-wrap: wrap; padding: 6px 10px; }
    .side-brand { border: none; padding: 8px 10px; flex-direction: row; align-items: center; }
    .side-logo { max-height: 30px; }
    .side-product { display: none; }
    .side-nav { flex-direction: row; padding: 4px; overflow-x: auto; }
    .side-sep { display: none; }
    .side-foot { border: none; margin-left: auto; padding: 4px; }
    .side-theme { display: none; }
    .app { flex-direction: column; }
    .main { margin-left: 0; }
    .content { padding: 20px 16px 150px; }
}

/* legacy aliases kept for auth pages */
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark { color: var(--accent); flex: none; }

/* ---------- buttons & inputs ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: var(--cta); color: var(--cta-on);
    font-weight: 600; font-size: 13.5px;
    cursor: pointer;
    transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn:hover { background: var(--cta-strong); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--border-strong); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; padding: 11px 16px; font-size: 14.5px; }
.icon-btn {
    display: grid; place-items: center;
    width: 32px; height: 32px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: transparent; color: var(--ink-2);
    cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="auto"] .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] .icon-sun { display: block; }
    :root[data-theme="auto"] .icon-moon { display: none; }
}

.field { margin-bottom: 16px; }
.field label {
    display: block; margin-bottom: 6px;
    font-size: 12.5px; font-weight: 600; color: var(--ink-2);
    letter-spacing: 0.02em;
}
.input, select.input {
    width: 100%;
    padding: 10px 13px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.input::placeholder { color: var(--ink-3); }
.field-error { margin-top: 6px; font-size: 12.5px; color: var(--danger); }

/* ---------- cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
}
.card-pad { padding: 20px; }

/* ---------- login ---------- */
.login-body {
    display: grid; place-items: center; min-height: 100vh; padding: 24px;
    background:
        radial-gradient(900px 480px at 8% -10%, rgba(80, 167, 218, .14), transparent 60%),
        radial-gradient(700px 420px at 105% 110%, rgba(245, 156, 64, .10), transparent 55%),
        var(--bg);
}
.login-card {
    width: 100%; max-width: 410px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 38px 30px;
    box-shadow: var(--shadow-3);
    text-align: center;
}
.login-card form { text-align: left; margin-top: 26px; }
.login-logo-band {
    margin: -40px -38px 22px;
    padding: 30px 20px;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(150deg, #262a56 0%, #191b3a 100%);
    display: flex; justify-content: center;
}
.login-client-logo { height: 44px; max-width: 70%; }
.admin-band-brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.admin-band-brand em { font-style: normal; font-weight: 500; color: #9fb2d8; }
.login-brand { display: flex; justify-content: center; margin-bottom: 18px; }
.login-card .login-client-name { font-size: 22px; }
.login-card .login-form-sub { margin-bottom: 0; }
.login-foot {
    margin-top: 26px; padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 12px; color: var(--ink-3); line-height: 1.7;
}
.login-foot strong { color: var(--ink-2); }
.login-panel {
    width: 100%; max-width: 880px;
    display: grid; grid-template-columns: 1.05fr 1fr;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-3);
}
.login-hero {
    position: relative;
    padding: 44px 40px;
    display: flex; flex-direction: column; justify-content: space-between;
    background:
        radial-gradient(1100px 500px at -10% -20%, rgba(80, 167, 218, .35), transparent 60%),
        radial-gradient(800px 420px at 120% 120%, rgba(245, 156, 64, .22), transparent 55%),
        linear-gradient(155deg, #262a56 0%, #191b3a 100%);
    color: #eef0fb;
}
.login-hero .brand { color: #fff; }
.login-hero .brand-mark { color: #6fc0ea; }
.login-hero-title {
    font-size: 26px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em;
    margin-top: 48px;
}
.login-hero-sub { margin-top: 12px; color: #b9bfdd; font-size: 14px; max-width: 34ch; }
.login-hero-points { margin: 26px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.login-hero-points li { display: flex; gap: 10px; align-items: flex-start; color: #cdd2ea; font-size: 13px; }
.login-hero-points svg { flex: none; margin-top: 2px; color: #7dd3a8; }
.login-hero-foot { margin-top: 40px; font-size: 12px; color: #8b91b5; }
.login-form-side { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-client-name { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.login-form-sub { color: var(--ink-2); font-size: 13.5px; margin: 6px 0 26px; }

@media (max-width: 760px) {
    .login-panel { grid-template-columns: 1fr; }
    .login-hero { display: none; }
}

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 24px; }
.page-sub { color: var(--ink-2); font-size: 13.5px; margin-top: 4px; }

/* ---------- hero band ---------- */
.hero {
    position: relative;
    margin-bottom: 24px;
    padding: 30px 30px 0;
    border-radius: 20px;
    background:
        radial-gradient(900px 400px at -5% -40%, rgba(80, 167, 218, .30), transparent 60%),
        radial-gradient(700px 380px at 108% 130%, rgba(246, 108, 71, .16), transparent 55%),
        linear-gradient(150deg, #262a56 0%, #191b3a 100%);
    box-shadow: var(--shadow-2);
}
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 26px; }
.hero-title { color: #fff; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.hero-sub { color: #aeb4d6; font-size: 13.5px; margin-top: 6px; }
.hero-logo { height: 38px; opacity: .97; }
@media (max-width: 700px) { .hero-logo { display: none; } }

/* ---------- stat strip ---------- */
.stats {
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    margin-bottom: 22px;
    overflow: hidden;
}
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stats-overlap { transform: none; margin: 0 0 22px; }
.hero + .toolbar { margin-top: 0; }
.stat { padding: 18px 22px; border-right: 1px solid var(--border); }
.stat:last-child { border-right: none; }
@media (max-width: 900px) { .stat:nth-child(2n) { border-right: none; } .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); } }
.stat-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.stat-ic { display: grid; place-items: center; color: var(--ink-3); flex: none; }
.stat-label { font-size: 11px; font-weight: 650; color: var(--ink-3); letter-spacing: 0.07em; text-transform: uppercase; }
.stat-value { font-family: var(--font); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-hint { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* ---------- toolbar (filters) ---------- */
.toolbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--ink-2);
    font-size: 13px; font-weight: 550;
    cursor: pointer;
    text-decoration: none;
    transition: all .12s ease;
    box-shadow: var(--shadow-1);
}
.chip:hover { border-color: var(--border-strong); color: var(--ink); text-decoration: none; }
.chip.is-active {
    background: var(--ink); color: var(--surface); border-color: var(--ink);
}
:root[data-theme="dark"] .chip.is-active,
:root[data-theme="auto"] .chip.is-active { font-weight: 600; }
.toolbar-search { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.toolbar-search .input { width: 250px; padding: 8px 12px; }
.date-inputs { display: flex; gap: 6px; align-items: center; }
.date-inputs .input { width: 140px; padding: 8px 10px; }

/* ---------- calls list ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }
.calls-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-1);
}
.calls-table th {
    text-align: left;
    padding: 13px 18px 11px;
    font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--ink-3);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: var(--surface);
}
.calls-table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 13.5px;
}
.calls-table tr:last-child td { border-bottom: none; }
.calls-table tbody tr { transition: background .1s ease; }
.calls-table tbody tr:hover { background: var(--surface-2); }
.calls-table tbody tr.is-playing { background: var(--accent-soft); }
.calls-table th:last-child, .calls-table td:last-child { width: 1%; white-space: nowrap; }
.cell-time { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12.5px; }
.cell-time strong { color: var(--ink); font-weight: 650; font-size: 13.5px; }
.cell-customer strong { font-weight: 650; font-size: 14px; }
.cell-phone { font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.cell-duration { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.closer-cell { display: inline-flex; align-items: center; gap: 8px; }
.closer-avatar {
    display: grid; place-items: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent);
    font-size: 11px; font-weight: 700; flex: none;
}
.pill {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 650; letter-spacing: 0.03em;
}
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.cell-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.play-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 15px 8px 11px;
    border-radius: 999px;
    border: none;
    background: var(--cta);
    color: #fff;
    font-size: 12.5px; font-weight: 650;
    cursor: pointer;
    transition: background .12s ease, transform .05s ease;
}
.play-btn:hover { background: var(--cta-strong); color: #fff; }
.play-btn:active { transform: translateY(1px); }
.play-btn.is-playing { background: var(--ink); color: var(--surface); }
.tr-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--ink-2);
    font-size: 12px; font-weight: 600;
    cursor: pointer;
    transition: all .12s ease;
}
.tr-btn:hover { border-color: var(--accent); color: var(--accent); }
.tr-btn.is-open { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.dl-link { color: var(--ink-3); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; }
.dl-link:hover { color: var(--accent); background: var(--surface-2); }

.empty {
    padding: 56px 24px 48px; text-align: center; color: var(--ink-3);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
}

/* ---------- pagination ---------- */
.pagination-bar { margin-top: 16px; display: flex; justify-content: center; }

/* ---------- bottom player ---------- */
.player {
    position: fixed; left: var(--side-w); right: 0; bottom: 0; z-index: 50;
    background: linear-gradient(168deg, #232752 0%, #181b38 100%);
    border-top: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 -8px 30px rgba(10, 12, 22, .25);
    transform: translateY(110%);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.player.is-open { transform: translateY(0); }
.player-inner {
    max-width: 1240px; margin: 0 auto;
    padding: 12px 28px 14px;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(300px, 2.2fr) minmax(150px, auto);
    gap: 20px; align-items: center;
}
.player-meta { min-width: 0; }
.player-title { color: #eef0fb; font-weight: 650; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-sub { font-size: 12px; color: #7d84ad; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.player-center { display: flex; flex-direction: column; gap: 6px; }
.player-controls { display: flex; align-items: center; justify-content: center; gap: 14px; }
.pc-btn {
    display: grid; place-items: center;
    width: 34px; height: 34px; border-radius: 50%;
    border: none; background: transparent; color: #aab0d0;
    cursor: pointer;
}
.pc-btn:hover { color: #fff; background: rgba(255,255,255,.08); }
.pc-btn-main {
    width: 42px; height: 42px;
    background: var(--accent); color: var(--accent-on);
}
.pc-btn-main:hover { background: var(--accent-strong); color: var(--accent-on); }
.player-track { display: flex; align-items: center; gap: 10px; }
.player-clock { font-size: 11.5px; color: #7d84ad; font-variant-numeric: tabular-nums; min-width: 40px; }
.player-clock.right { text-align: right; }
.seek {
    flex: 1; height: 5px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    position: relative; cursor: pointer;
}
.seek-fill {
    position: absolute; inset: 0 auto 0 0; width: 0%;
    border-radius: 999px;
    background: var(--accent);
}
.seek-knob {
    position: absolute; top: 50%; left: 0%;
    width: 13px; height: 13px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
    transform: translate(-50%, -50%) scale(0);
    transition: transform .12s ease;
}
.seek:hover .seek-knob, .seek.is-drag .seek-knob { transform: translate(-50%, -50%) scale(1); }
.player-right { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.speed-btn {
    padding: 5px 10px; border-radius: var(--r-sm);
    border: 1px solid rgba(255,255,255,.16);
    background: transparent; color: #aab0d0;
    font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums;
    cursor: pointer; min-width: 48px;
}
.speed-btn:hover { border-color: rgba(255,255,255,.35); color: #fff; }
.player-close { color: #7d84ad; border-color: rgba(255,255,255,.16); }
.player-close:hover { color: #fff; background: rgba(255,255,255,.08); }
@media (max-width: 800px) {
    .player-inner { grid-template-columns: 1fr; gap: 8px; padding: 10px 16px 12px; }
    .player-right { justify-content: center; }
}

/* ---------- transcript button + slide-over ---------- */
.tr-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--ink-2);
    font-size: 12.5px; font-weight: 600;
    cursor: pointer;
    transition: all .12s ease;
}
.tr-btn:hover { border-color: var(--accent); color: var(--accent); }
.tr-btn.is-open { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.tpanel {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
    width: min(440px, 92vw);
    display: flex; flex-direction: column;
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -14px 0 44px rgba(16, 22, 42, .18);
    transform: translateX(105%);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.tpanel.is-open { transform: translateX(0); }
.tpanel-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 18px 20px 10px;
}
.tpanel-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.tpanel-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.tpanel-hint {
    padding: 0 20px 12px;
    font-size: 11.5px; color: var(--ink-3);
    border-bottom: 1px solid var(--border);
}
.tpanel-body {
    flex: 1; overflow-y: auto;
    padding: 16px 18px 120px; /* keep clear of the docked player */
    display: flex; flex-direction: column; gap: 10px;
    scroll-behavior: smooth;
}
.tmsg { display: flex; flex-direction: column; max-width: 88%; cursor: pointer; }
.tmsg.spk-agent { align-self: flex-end; align-items: flex-end; }
.tmsg.spk-customer { align-self: flex-start; align-items: flex-start; }
.tmsg-meta { font-size: 10.5px; color: var(--ink-3); margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.tmsg-bubble {
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13px; line-height: 1.5;
    border: 1px solid transparent;
    transition: border-color .12s ease, background .12s ease;
}
.tmsg.spk-customer .tmsg-bubble {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--ink);
    border-bottom-left-radius: 4px;
}
.tmsg.spk-agent .tmsg-bubble {
    background: var(--accent-soft);
    color: var(--ink);
    border-bottom-right-radius: 4px;
}
.tmsg:hover .tmsg-bubble { border-color: var(--accent); }
.tmsg.is-live .tmsg-bubble {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}
.tpanel-loading { text-align: center; color: var(--ink-3); padding: 40px 0; font-size: 13px; }

/* ---------- call detail page ---------- */
.cust-link { color: var(--ink); }
.cust-link:hover { color: var(--accent); text-decoration: none; }
.call-head { display: flex; gap: 16px; align-items: center; }
.call-layout {
    display: grid; grid-template-columns: minmax(320px, 0.9fr) minmax(380px, 1.3fr);
    gap: 18px; align-items: start;
}
@media (max-width: 980px) { .call-layout { grid-template-columns: 1fr; } }
.insight-block { margin-bottom: 16px; }
.ai-chip {
    display: inline-block; margin-left: 8px; padding: 2px 9px;
    border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
    background: var(--accent-soft); color: var(--accent); vertical-align: 2px;
}
.insight-summary { font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
.topic-row { display: flex; flex-wrap: wrap; gap: 7px; }
.topic-chip {
    padding: 5px 11px; border-radius: 7px;
    background: var(--surface-2); color: var(--ink-2);
    border: 1px solid var(--border);
    font-size: 12.5px; font-weight: 550;
}
.action-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13px; color: var(--ink-2); }
.action-list li::marker { color: var(--accent); }
.mood-line { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14px; }
.mood-dot { width: 10px; height: 10px; border-radius: 50%; }
.mood-positive .mood-dot { background: var(--ok); }
.mood-neutral .mood-dot { background: var(--warn); }
.mood-negative .mood-dot { background: var(--danger); }
.ratio-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.ratio-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.ratio-fill { height: 100%; border-radius: 999px; background: var(--ok); }
.ratio-pct { font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.call-main { min-width: 0; }
.call-transcript { overflow: hidden; }
.tr-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    padding: 20px 24px 14px;
    border-bottom: 1px solid var(--border);
}
.tr-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tr-search {
    display: flex; align-items: center; gap: 7px;
    padding: 7px 12px;
    border: 1px solid var(--border-strong); border-radius: 999px;
    color: var(--ink-3);
    background: var(--surface);
}
.tr-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.tr-search input { border: none; outline: none; background: none; font: inherit; font-size: 13px; color: var(--ink); width: 170px; }
.tr-search-count { font-size: 11.5px; font-weight: 650; color: var(--accent); white-space: nowrap; }
.tr-tool {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px; border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--ink-2);
    font-size: 12.5px; font-weight: 600; cursor: pointer;
    transition: all .12s ease;
}
.tr-tool:hover { border-color: var(--accent); color: var(--accent); }
.tr-tool.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.show-transcript {
    padding: 8px 24px 40px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    scroll-behavior: smooth;
}
.tline {
    padding: 14px 14px 14px 16px;
    margin: 2px -14px 2px -16px;
    border-left: 3px solid transparent;
    border-radius: 0 10px 10px 0;
    transition: background .12s ease, border-color .12s ease;
}
.tline:hover { background: var(--surface-2); }
.tline.is-live { background: var(--accent-soft); border-left-color: var(--accent); }
.tline-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.tline-speaker { font-weight: 700; font-size: 13px; letter-spacing: .01em; }
.tline.spk-agent .tline-speaker { color: #b04a26; }
.tline.spk-customer .tline-speaker { color: #2d5da8; }
:root[data-theme="dark"] .tline.spk-customer .tline-speaker { color: #7fb0f2; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .tline.spk-customer .tline-speaker { color: #7fb0f2; } }
.tline-time {
    border: none; background: none; cursor: pointer; padding: 0;
    font-family: var(--mono); font-size: 11px; color: var(--ink-3);
}
.tline-time:hover { color: var(--accent); text-decoration: underline; }
.tline-text { font-size: 14px; line-height: 1.75; color: var(--ink); }
mark.tr-hit { background: #ffe27a; color: #3a2c00; border-radius: 3px; padding: 0 2px; }
:root[data-theme="dark"] mark.tr-hit { background: #8a6d1a; color: #fff3c4; }
.call-layout .mini-table td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--border); }
.call-layout .mini-table tr:last-child td { border-bottom: none; }

/* ---------- QA evaluation ---------- */
.pill-bad { background: var(--danger-soft); color: var(--danger); }
.eval-form { max-width: 860px; }
.eval-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
@media (max-width: 700px) { .eval-grid { grid-template-columns: 1fr; } }
.check-inline { display: inline-flex; align-items: center; gap: 7px; margin-right: 18px; font-size: 13.5px; padding: 9px 0; }
.fuel-checks { display: flex; }
.eval-section { overflow: hidden; }
.eval-section-head {
    padding: 12px 22px;
    background: linear-gradient(150deg, #262a56 0%, #1d2044 100%);
    color: #fff; font-weight: 650; font-size: 14px; letter-spacing: 0.01em;
}
.eval-q { padding: 14px 0; border-bottom: 1px solid var(--border); }
.eval-q:first-child { padding-top: 2px; }
.eval-q-label { font-size: 13.5px; font-weight: 550; margin-bottom: 10px; display: flex; justify-content: space-between; gap: 12px; }
.eval-points { color: var(--ink-3); font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.eval-options { display: flex; gap: 8px; flex-wrap: wrap; }
.eval-opt {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px; border-radius: 999px;
    border: 1px solid var(--border-strong);
    font-size: 13px; font-weight: 550; cursor: pointer;
    transition: all .12s ease;
}
.eval-opt input { accent-color: var(--accent); margin: 0; }
.eval-opt:hover { border-color: var(--accent); }
.eval-opt:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.eval-opt-not-compliant:has(input:checked), .eval-opt-no:has(input:checked) { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.eval-score {
    text-align: right; padding: 8px 18px;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    background: var(--surface);
}
.eval-score-num { display: block; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.eval-score-sub { font-size: 12px; color: var(--ink-3); }
.eval-score.is-good .eval-score-num { color: var(--ok); }
.eval-score.is-mid .eval-score-num { color: var(--warn); }
.eval-score.is-bad .eval-score-num { color: var(--danger); }

/* ---------- admin ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.section-title { font-family: var(--font-ui); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th { text-align: left; padding: 8px 10px; color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
.mini-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.mini-table tr:last-child td { border-bottom: none; }
.credentials-banner {
    background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
    color: var(--ok);
    border-radius: var(--r-md); padding: 14px 18px; margin-bottom: 18px;
    font-size: 13.5px;
}
.credentials-banner code { font-family: var(--mono); font-weight: 700; user-select: all; }
.muted { color: var(--ink-3); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 650; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); }
.tag-admin { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag-disabled { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.tag-active { background: var(--ok-soft); color: var(--ok); border-color: transparent; }

/* ---------- landing ---------- */
.landing-body { display: grid; place-items: center; min-height: 100vh; }
.landing-card { text-align: center; }
.landing-card .brand { justify-content: center; margin-bottom: 14px; }
.landing-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.landing-sub { color: var(--ink-3); margin-top: 8px; font-size: 13.5px; }

@media (max-width: 920px) { .player { left: 0; } }

:root[data-theme="dark"] .tline.spk-agent .tline-speaker { color: #f08a63; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .tline.spk-agent .tline-speaker { color: #f08a63; } }

/* rail: grouped sections inside one card */
.rail-sec { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.rail-sec:last-child { border-bottom: none; }
.rail-sec .section-title { margin-bottom: 10px; }

/* ---------- rail tabs (Aircall-style) ---------- */
.tabs { display: flex; gap: 2px; padding: 6px 10px 0; border-bottom: 1px solid var(--border); }
.tab {
    padding: 10px 14px 12px;
    border: none; background: none; cursor: pointer;
    font-size: 13px; font-weight: 600; color: var(--ink-3);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.on { display: block; }

.block-title { font-family: var(--font); font-size: 17px; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 10px; }

/* ---------- waveform seek ---------- */
.seek { height: 6px; }
.seek.has-wave { height: 38px; background: transparent; border-radius: 6px; }
.seek canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.seek.has-wave canvas { display: block; }
.seek.has-wave .seek-fill { display: none; }
.seek.has-wave .seek-knob { display: none; }

/* identity avatar */
.cust-avatar {
    width: 46px; height: 46px; border-radius: 14px; flex: none;
    display: grid; place-items: center;
    background: var(--accent); color: #fff;
    font-family: var(--font); font-size: 19px; font-weight: 700;
    box-shadow: var(--shadow-2);
}

/* clickable rows */
tr.row-link { cursor: pointer; }

/* ---------- craft details ---------- */
.cell-time, .cell-duration, .player-clock, .tline-time, .ratio-pct { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
