/* =====================================================================
   STT - custom styling on top of the Hyper template
   ===================================================================== */
:root {
    --stt-in: #2a78d6;          /* categorical slot 1 (blue)   */
    --stt-out: #eb6834;         /* categorical slot 2 (orange) */
    --stt-unknown: #8a94a6;
    --stt-good: #0ca30c;
    --stt-progress: #2a78d6;
    --stt-crit: #d03b3b;
    --stt-neutral: #9aa3ad;
    --stt-ink: #000;
    --stt-grad: linear-gradient(135deg, #4b57d6 0%, #727cf5 55%, #8f7cf5 100%);
}
[data-bs-theme="dark"] {
    --stt-in: #3987e5;
    --stt-out: #d95926;
    --stt-ink: #fff;
    --stt-neutral: #7d8794;
}

/* ---------------------------------------------------------------- brand */
.leftside-menu .logo .stt-brand { margin-left: .2rem; }
.stt-brand { display: inline-flex; align-items: center; gap: .6rem; line-height: 1; vertical-align: middle; color: var(--ct-body-color, #313a46); text-decoration: none; }
.stt-brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--stt-grad); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; box-shadow: 0 4px 12px rgba(114, 124, 245, .45); }
.stt-brand-text { font-size: 1.35rem; font-weight: 800; letter-spacing: .04em; }
.stt-brand-on-dark { color: #fff; }
.stt-topbar-hint { font-size: .8rem; color: var(--ct-secondary-color, #8391a2); }

.stt-avatar { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; background: var(--stt-grad); color: #fff; font-weight: 700; letter-spacing: .02em; box-shadow: 0 2px 8px rgba(114, 124, 245, .4); }
.stt-avatar-sm { width: 34px; height: 34px; font-size: .8rem; }
.stt-avatar-xl { width: 96px; height: 96px; font-size: 2rem; }

/* ---------------------------------------------------------------- login */
.stt-auth-body { background: var(--ct-body-bg); }
.stt-auth { min-height: 100vh; display: flex; }
.stt-auth-hero {
    flex: 1 1 56%; position: relative; overflow: hidden; color: #fff; padding: 2.5rem 3.5rem;
    flex-direction: column; justify-content: space-between;
    background: radial-gradient(1200px 600px at 15% 10%, rgba(255, 255, 255, .14), transparent 60%),
                linear-gradient(140deg, #1b2266 0%, #3a44c0 48%, #727cf5 100%);
}
.stt-auth-hero::before, .stt-auth-hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.stt-auth-hero::before { width: 520px; height: 520px; right: -160px; top: -140px; }
.stt-auth-hero::after { width: 380px; height: 380px; left: -120px; bottom: -140px; }
.stt-auth-hero > * { position: relative; z-index: 1; }
.stt-auth-hero .stt-brand { color: #fff; }
.stt-auth-hero .stt-brand-mark { background: rgba(255, 255, 255, .18); box-shadow: none; backdrop-filter: blur(4px); }
.stt-hero-body h1 { font-size: 2.4rem; font-weight: 800; line-height: 1.15; margin-bottom: 1rem; color: #fff; max-width: 30rem; }
.stt-hero-body p { font-size: 1.05rem; color: rgba(255, 255, 255, .8); max-width: 30rem; }
.stt-hero-points { list-style: none; padding: 0; margin: 1.8rem 0 0; display: grid; gap: .85rem; }
.stt-hero-points li { display: flex; align-items: center; gap: .8rem; color: rgba(255, 255, 255, .92); }
.stt-hero-points i { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .14); display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.stt-hero-foot { color: rgba(255, 255, 255, .6); font-size: .85rem; }

.stt-wave { display: flex; align-items: center; gap: 5px; height: 84px; margin-top: 2.2rem; }
.stt-wave span { flex: 0 0 5px; border-radius: 3px; background: rgba(255, 255, 255, .55); height: var(--h, 30%); animation: stt-wave 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * -0.09s); }
@keyframes stt-wave { 0%, 100% { transform: scaleY(.45); opacity: .55; } 50% { transform: scaleY(1); opacity: 1; } }

.stt-auth-panel { flex: 1 1 44%; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: var(--ct-body-bg); }
.stt-auth-card { width: 100%; max-width: 420px; }
.stt-auth-card .stt-auth-logo { display: none; margin-bottom: 1.5rem; }
.stt-auth-card h2 { font-weight: 800; margin-bottom: .35rem; }
.stt-auth-card .form-control { padding: .65rem .9rem; }
.stt-auth-card .input-group-text { background: transparent; }
.stt-btn-lg { padding: .75rem 1rem; font-weight: 700; border-radius: .6rem; box-shadow: 0 8px 20px rgba(114, 124, 245, .35); }
.stt-error-icon { font-size: 4rem; color: var(--stt-crit); line-height: 1; margin-bottom: .75rem; }
@media (max-width: 991.98px) { .stt-auth-card .stt-auth-logo { display: block; } }
.validation-summary-valid { display: none; }
.field-validation-error { display: block; margin-top: .25rem; font-size: .8rem; color: var(--stt-crit); }
.input-validation-error { border-color: var(--stt-crit) !important; }

/* ---------------------------------------------------------------- page bits */
.page-title-box .page-title { font-weight: 700; }
.stt-card-soft { border: 0; box-shadow: 0 2px 14px rgba(15, 23, 42, .06); border-radius: .85rem; }
[data-bs-theme="dark"] .stt-card-soft { box-shadow: 0 2px 14px rgba(0, 0, 0, .35); }

/* KPI tiles */
.stt-kpi { position: relative; overflow: hidden; }
.stt-kpi .card-body { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; }
.stt-kpi-icon { flex: 0 0 52px; height: 52px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; color: #fff; }
.stt-kpi-icon.k1 { background: linear-gradient(135deg, #4b57d6, #727cf5); box-shadow: 0 6px 16px rgba(114, 124, 245, .4); }
.stt-kpi-icon.k2 { background: linear-gradient(135deg, #0aa88f, #2bd1b0); box-shadow: 0 6px 16px rgba(10, 168, 143, .35); }
.stt-kpi-icon.k3 { background: linear-gradient(135deg, #f0883e, #fab219); box-shadow: 0 6px 16px rgba(240, 136, 62, .35); }
.stt-kpi-icon.k4 { background: linear-gradient(135deg, #0ca30c, #4cc94c); box-shadow: 0 6px 16px rgba(12, 163, 12, .35); }
.stt-kpi-label { color: var(--ct-secondary-color, #8391a2); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin: 0; }
.stt-kpi-value { font-size: 1.7rem; font-weight: 800; line-height: 1.2; margin: .1rem 0 0; }
.stt-kpi-sub { font-size: .8rem; color: var(--ct-secondary-color, #8391a2); margin: 0; }

.stt-chart { min-height: 300px; }
.stt-legend-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .35rem 0; }
.stt-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .5rem; }
.stt-meter { height: 8px; border-radius: 6px; background: var(--ct-tertiary-bg, #eef2f7); overflow: hidden; display: flex; gap: 2px; }
.stt-meter > span { display: block; height: 100%; }

/* ---------------------------------------------------------------- badges */
.stt-badge { --c: var(--stt-unknown); display: inline-flex; align-items: center; gap: .35rem; padding: .32rem .7rem; border-radius: 50rem; font-size: .75rem; font-weight: 700; line-height: 1; white-space: nowrap;
    color: color-mix(in srgb, var(--c) 68%, var(--stt-ink)); background: color-mix(in srgb, var(--c) 15%, transparent); }
.stt-in { --c: var(--stt-in); }
.stt-out { --c: var(--stt-out); }
.stt-unknown { --c: var(--stt-unknown); }
.stt-st-none { --c: var(--stt-neutral); }
.stt-st-queued { --c: #b98600; }
.stt-st-processing { --c: var(--stt-progress); }
.stt-st-done { --c: var(--stt-good); }
.stt-st-failed { --c: var(--stt-crit); }
.stt-badge .spinner-border { width: .75rem; height: .75rem; border-width: .15em; }

/* ---------------------------------------------------------------- recordings table */
.stt-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.stt-toolbar .stt-search { flex: 1 1 240px; min-width: 200px; position: relative; }
.stt-toolbar .stt-search i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--ct-secondary-color, #8391a2); }
.stt-toolbar .stt-search input { padding-left: 2.3rem; }
.stt-model-pill { display: inline-flex; align-items: center; gap: .45rem; font-size: .75rem; font-weight: 600; padding: .35rem .75rem; border-radius: 50rem; background: var(--ct-tertiary-bg, #eef2f7); color: var(--ct-body-color, #313a46); }
.stt-model-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--stt-neutral); }
.stt-model-pill[data-state="Ready"] .dot, .stt-model-pill[data-state="Downloaded"] .dot { background: var(--stt-good); }
.stt-model-pill[data-state="Downloading"] .dot, .stt-model-pill[data-state="Loading"] .dot { background: var(--stt-progress); animation: stt-pulse 1s infinite; }
.stt-model-pill[data-state="Error"] .dot { background: var(--stt-crit); }
@keyframes stt-pulse { 50% { opacity: .25; } }

.stt-table { margin-bottom: 0; }
.stt-check-col { width: 34px; text-align: center; padding-right: 0 !important; }
.stt-check-col .form-check-input { margin: 0; cursor: pointer; }
.stt-table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--ct-secondary-color, #8391a2); border-bottom-width: 1px; white-space: nowrap; }
.stt-table tbody tr { transition: background-color .15s; }
.stt-table th, .stt-table td { padding: .7rem .5rem; white-space: nowrap; }
.stt-table td { vertical-align: middle; }
.stt-date { font-weight: 600; line-height: 1.2; }
.stt-time { font-size: .78rem; color: var(--ct-secondary-color, #8391a2); }
.stt-phone { font-variant-numeric: tabular-nums; font-weight: 600; }
.stt-muted { color: var(--ct-secondary-color, #8391a2); }
.stt-row-playing { background: color-mix(in srgb, var(--ct-primary, #727cf5) 8%, transparent); }

.stt-player { display: flex; align-items: center; gap: .55rem; min-width: 165px; }
.stt-play { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--stt-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; box-shadow: 0 3px 10px rgba(114, 124, 245, .4); transition: transform .12s; }
.stt-play:hover { transform: scale(1.08); }
.stt-play:disabled { background: var(--stt-neutral); box-shadow: none; transform: none; }
.stt-play i { font-size: 1.2rem; line-height: 1; }
.stt-seek { flex: 1 1 auto; min-width: 75px; }
.stt-seek-bar { height: 6px; border-radius: 6px; background: var(--ct-tertiary-bg, #e3e8ef); overflow: hidden; cursor: pointer; }
.stt-seek-bar > div { height: 100%; width: 0; background: var(--stt-grad); border-radius: 6px; }
.stt-seek small { display: block; margin-top: .2rem; font-size: .7rem; color: var(--ct-secondary-color, #8391a2); font-variant-numeric: tabular-nums; }

.stt-text-note { display: inline-flex; align-items: flex-start; gap: .4rem; max-width: 140px; padding: .35rem .55rem; border-radius: .5rem; background: color-mix(in srgb, var(--stt-good) 9%, transparent); color: inherit; cursor: pointer; border: 0; text-align: left; }
.stt-text-note:hover { background: color-mix(in srgb, var(--stt-good) 16%, transparent); }
.stt-text-note i { color: var(--stt-good); margin-top: .1rem; }
.stt-text-note span { white-space: normal; font-size: .78rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.stt-actions { display: inline-flex; gap: .3rem; white-space: nowrap; }
.stt-icon-btn { width: 32px; height: 32px; padding: 0; border: 0; border-radius: .5rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; transition: transform .12s, background-color .15s; }
.stt-icon-btn:hover:not(:disabled) { transform: translateY(-1px); }
.stt-icon-btn.view { background: color-mix(in srgb, var(--stt-in) 14%, transparent); color: var(--stt-in); }
.stt-icon-btn.stt { background: color-mix(in srgb, var(--ct-primary, #727cf5) 15%, transparent); color: var(--ct-primary, #727cf5); }
.stt-icon-btn.redo { background: color-mix(in srgb, #b98600 15%, transparent); color: #b98600; }
.stt-icon-btn.clear { background: color-mix(in srgb, var(--stt-neutral) 20%, transparent); color: var(--ct-body-color, #313a46); }
.stt-icon-btn.del { background: color-mix(in srgb, var(--stt-crit) 13%, transparent); color: var(--stt-crit); }
.stt-icon-btn:disabled { opacity: .45; }

.stt-empty { padding: 3.5rem 1rem; text-align: center; color: var(--ct-secondary-color, #8391a2); }
.stt-empty i { font-size: 3.2rem; opacity: .6; }

/* ---------------------------------------------------------------- modals */
.stt-transcript { white-space: pre-wrap; word-break: break-word; max-height: 42vh; overflow: auto; padding: 1rem 1.1rem; border-radius: .6rem; background: var(--ct-tertiary-bg, #f4f6fa); line-height: 1.65; font-size: .95rem; }
.stt-transcript.is-empty { color: var(--ct-secondary-color, #8391a2); text-align: center; padding: 1.8rem 1rem; }
.stt-stat { padding: .6rem .8rem; border-radius: .6rem; background: var(--ct-tertiary-bg, #f4f6fa); height: 100%; }
.stt-stat small { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ct-secondary-color, #8391a2); font-weight: 700; }
.stt-stat div { font-weight: 700; }

.stt-drop { border: 2px dashed var(--ct-border-color, #dee2e6); border-radius: .85rem; padding: 2rem 1rem; text-align: center; cursor: pointer; transition: border-color .15s, background-color .15s; }
.stt-drop:hover, .stt-drop.is-over { border-color: var(--ct-primary, #727cf5); background: color-mix(in srgb, var(--ct-primary, #727cf5) 6%, transparent); }
.stt-drop i { font-size: 2.6rem; color: var(--ct-primary, #727cf5); }
.stt-file-list { list-style: none; padding: 0; margin: .75rem 0 0; max-height: 170px; overflow: auto; }
.stt-file-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .35rem .6rem; border-radius: .4rem; font-size: .85rem; }
.stt-file-list li:nth-child(odd) { background: var(--ct-tertiary-bg, #f4f6fa); }
.stt-file-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Settings page: recording-import bot background-service log ---- */
.stt-bot-log {
    background: #0f172a;
    color: #cbd5e1;
    border-radius: .6rem;
    padding: .85rem 1rem;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: .8rem;
    min-height: 320px;
    max-height: 520px;
    overflow-y: auto;
}
[data-bs-theme="dark"] .stt-bot-log { background: #05070d; }

.stt-log-line { display: flex; align-items: baseline; gap: .5rem; padding: .18rem 0; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.stt-log-time { color: #64748b; flex: 0 0 auto; }
.stt-log-icon { flex: 0 0 auto; }
.stt-log-msg { color: #e2e8f0; word-break: break-word; }

.stt-log-info .stt-log-icon { color: #60a5fa; }
.stt-log-success .stt-log-icon { color: #34d399; }
.stt-log-warning .stt-log-icon { color: #fbbf24; }
.stt-log-error .stt-log-icon { color: #f87171; }
.stt-log-error .stt-log-msg { color: #fca5a5; }
