/* Sales Training LMS — app stylesheet (no external dependencies) */

:root {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text: #0f172a;
    --text-secondary: #475569;
    --muted: #64748b;
    --accent: #6366f1;
    --accent-dark: #4f46e5;
    --accent-light: #eef2ff;
    --sidebar-bg: #0f172a;
    --sidebar-text: #cbd5e1;
    --sidebar-active: #6366f1;
    --good: #10b981;
    --good-bg: #ecfdf5;
    --warn: #f59e0b;
    --warn-bg: #fffbeb;
    --bad: #ef4444;
    --bad-bg: #fef2f2;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.1);
    --sidebar-w: 252px;
    --topbar-h: 56px;
    --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --hero-from: #4338ca;
    --hero-to: #6366f1;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--accent); }

img, svg { display: block; max-width: 100%; }

/* ── App shell & sidebar ── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 300;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-head {
    padding: 1.25rem 1.125rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    color: #fff;
    font-weight: 700;
    font-size: 0.9375rem;
    letter-spacing: -0.02em;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.sidebar-logo {
    max-height: 36px;
    max-width: 120px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-brand:hover { color: #fff; opacity: 0.9; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.625rem;
}

.sidebar-label {
    display: block;
    padding: 0.875rem 0.75rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(148, 163, 184, 0.7);
}

.sidebar-link {
    display: block;
    padding: 0.5625rem 0.75rem;
    margin-bottom: 2px;
    border-radius: 8px;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    text-decoration: none;
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: #fff;
    font-weight: 600;
}

.role-agent .sidebar-link.active { background: var(--sidebar-active); }
.role-evaluator .sidebar-link.active { background: var(--sidebar-active); }

.sidebar-foot {
    padding: 0.875rem 1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.625rem;
}

.sidebar-user-info { min-width: 0; flex: 1; }

.sidebar-user-name {
    display: block;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    display: block;
    font-size: 0.75rem;
    color: rgba(148, 163, 184, 0.8);
}

.sidebar-logout {
    display: block;
    text-align: center;
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sidebar-text);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background 0.15s;
}

.sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    text-decoration: none;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 250;
    backdrop-filter: blur(2px);
}

.app-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-inner {
    height: 100%;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}

body.sidebar-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.sidebar-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.sidebar-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.topbar-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-actions { flex-shrink: 0; }

/* ── Main content ── */
.main {
    flex: 1;
    padding: 1.5rem;
}

.main-standalone { padding: 0; }

.container {
    max-width: 1140px;
    margin: 0 auto;
}

.container-narrow { max-width: 720px; }

/* ── Breadcrumb ── */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: var(--muted);
}

.breadcrumb a { color: var(--muted); font-weight: 500; }
.breadcrumb a:hover { color: var(--accent-dark); text-decoration: none; }
.breadcrumb-sep { opacity: 0.45; user-select: none; }
.breadcrumb-current { color: var(--text-secondary); font-weight: 600; }

/* ── Page head ── */
.page-head { margin-bottom: 1.5rem; }

.page-head h1 {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.25;
    color: var(--text);
}

.subtitle {
    margin-top: 0.375rem;
    color: var(--muted);
    font-size: 0.9375rem;
    max-width: 56ch;
}

.subtitle a { font-weight: 500; }

.page-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.page-toolbar .page-head { margin-bottom: 0; flex: 1; }

/* ── Hero cards ── */
.dashboard-hero,
.agent-hero {
    background: linear-gradient(135deg, var(--hero-from, #4338ca) 0%, var(--hero-to, #6366f1) 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    box-shadow: 0 4px 20px color-mix(in srgb, var(--hero-to, #6366f1) 35%, transparent);
}

.role-agent .agent-hero {
    box-shadow: 0 4px 20px color-mix(in srgb, var(--hero-to, #0891b2) 30%, transparent);
}

.dashboard-hero h2,
.agent-hero h2 {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.375rem;
}

.dashboard-hero p,
.agent-hero p {
    opacity: 0.9;
    font-size: 0.9375rem;
    max-width: 46ch;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.875rem;
}

.hero-stat {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 0.35rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

.hero-stat strong { font-weight: 700; }

.hero-actions { display: flex; gap: 0.625rem; flex-wrap: wrap; flex-shrink: 0; }

.dashboard-hero .btn-primary,
.agent-hero .btn-primary {
    background: #fff;
    color: var(--accent-dark);
    box-shadow: none;
}

.dashboard-hero .btn-primary:hover,
.agent-hero .btn-primary:hover {
    background: #f8fafc;
    color: var(--accent-dark);
}

.dashboard-hero .btn-secondary,
.agent-hero .btn-secondary {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.45);
}

.dashboard-hero .btn-secondary:hover,
.agent-hero .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* ── Stats ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.125rem;
    box-shadow: var(--shadow);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.1;
}

.stat-label {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

/* ── Panels ── */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.375rem 1.5rem;
    box-shadow: var(--shadow);
}

.panel h2 {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    margin-bottom: 1rem;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.panel-head h2 { margin-bottom: 0; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

/* ── Buttons ── */
.btn-primary, .btn-secondary, .btn-ghost, .btn-danger, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5625rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 1px 2px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--accent-dark);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: #cbd5e1;
    color: var(--text);
    text-decoration: none;
}

.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 0.4375rem 0.875rem;
}

.btn-ghost:hover {
    background: var(--surface-hover);
    color: var(--text);
    text-decoration: none;
}

.btn-danger {
    background: var(--bad);
    color: #fff;
}

.btn-danger:hover { filter: brightness(0.95); }

.link-danger {
    background: none;
    border: none;
    color: var(--bad);
    cursor: pointer;
    font: inherit;
    font-weight: 500;
    padding: 0;
}

.link-danger:hover { text-decoration: underline; }

/* ── Alerts ── */
.alert, .error-box, .success-box {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.alert-error, .error-box {
    background: var(--bad-bg);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success, .success-box {
    background: var(--good-bg);
    color: #047857;
    border: 1px solid #a7f3d0;
}

.alert code, .error-box code, .success-box code {
    font-size: 0.85em;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

.info-callout {
    background: var(--accent-light);
    border: 1px solid #c7d2fe;
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.info-callout code {
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.6);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    background: var(--border-light);
    color: var(--muted);
}

.badge-good { background: var(--good-bg); color: var(--good); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-muted { background: #f1f5f9; color: var(--muted); }
.badge-role { background: var(--accent-light); color: var(--accent-dark); }

/* ── Forms ── */
.form-stack label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0.875rem 0 0.35rem;
}

.form-stack input[type="text"],
.form-stack input[type="password"],
.form-stack input[type="number"],
.form-stack input[type="email"],
.form-stack input[type="file"],
.form-stack select,
.form-stack textarea {
    width: 100%;
    padding: 0.5625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    font-size: 0.9375rem;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-stack input:focus,
.form-stack select:focus,
.form-stack textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-stack input[readonly] {
    background: var(--bg);
    color: var(--muted);
}

.form-stack button { margin-top: 1rem; }

.checkbox-label, .radio-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0.5rem 0;
    font-size: 0.875rem;
    cursor: pointer;
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.form-inline input[type="text"] {
    flex: 1;
    min-width: 120px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}

.inline-form { display: inline; }

.form-actions {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 1rem;
}

.stt-provider-row {
    align-items: flex-start;
    margin: 0.625rem 0;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.stt-local-backends {
    margin: 0.5rem 0 1rem 1rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--accent-light);
}

.stt-backend-row { background: var(--bg); }

.settings-stack { display: flex; flex-direction: column; gap: 1.25rem; }

.settings-stack .panel > p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.55;
}

/* ── Tables ── */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.25rem;
    padding: 0 0.25rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 0.6875rem 0.625rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table th {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    white-space: nowrap;
}

.data-table tbody tr:hover { background: var(--surface-hover); }

.actions { white-space: nowrap; }

/* ── Lists ── */
.simple-list { list-style: none; }

.simple-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.simple-list li:last-child { border-bottom: none; }
.simple-list a { font-weight: 500; }

.muted { color: var(--muted); }
.small { font-size: 0.8125rem; }
.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 1.5rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 2.5rem 1.25rem;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--bg);
    border: 2px dashed var(--border);
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.empty-state p {
    color: var(--muted);
    font-size: 0.875rem;
    max-width: 36ch;
    margin: 0 auto;
}

.empty-state .btn-primary { margin-top: 1rem; }

/* ── Progress ── */
.progress-panel { margin-bottom: 1.25rem; }

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.progress-bar-wrap {
    height: 8px;
    background: var(--border-light);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #818cf8);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.ready-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.75rem;
    padding: 0.4375rem 0.75rem;
    background: var(--good-bg);
    color: var(--good);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
}

/* ── Course tabs & modules ── */
.course-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.tab {
    padding: 0.4375rem 0.9375rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface);
    transition: all 0.15s;
}

.tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.tab:hover:not(.active) {
    border-color: var(--accent);
    color: var(--accent-dark);
    text-decoration: none;
}

.module-list { display: flex; flex-direction: column; gap: 0.75rem; }

.module-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.125rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: box-shadow 0.15s, border-color 0.15s;
}

.module-card:hover:not(.locked) {
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

.module-card.locked { opacity: 0.55; }
.module-card.completed { border-left: 3px solid var(--good); }
.module-card.in-progress { border-left: 3px solid var(--warn); }

.module-card-num {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent-dark);
    font-weight: 700;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.module-card.completed .module-card-num {
    background: var(--good-bg);
    color: var(--good);
}

.module-card-body { flex: 1; min-width: 0; }
.module-card-body h3 { font-size: 0.9375rem; font-weight: 600; }

.module-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.35rem;
}

.tag {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: var(--bg);
    color: var(--muted);
}

.tag-good { background: var(--good-bg); color: var(--good); }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-muted { background: #f1f5f9; }

.lock-reason { font-size: 0.8125rem; color: var(--warn); margin-top: 0.35rem; }
.module-card-action { flex-shrink: 0; }

/* ── Mock calls ── */
.mock-dial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.direct-dial-banner {
    margin-bottom: 1.25rem;
    background: var(--accent-light);
    border-color: #c7d2fe;
}

.direct-dial-banner.compact { padding: 1.125rem 1.375rem; }

.direct-dial-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.direct-dial-head h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
    margin: 0;
}

.direct-dial-actions { display: flex; gap: 0.625rem; flex-wrap: wrap; margin-top: 0.75rem; }

.mock-dial-card { text-align: center; padding: 1.5rem; }
.mock-dial-card h2 { text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--text); margin-bottom: 0.35rem; }
.mock-dial-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.mock-dial-form { margin-top: 1rem; text-align: left; }
.btn-dial { width: 100%; margin-top: 0.5rem; padding: 0.75rem; }

.session-banner {
    border-color: #fcd34d;
    background: var(--warn-bg);
    margin-bottom: 1.25rem;
}

.softphone {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    margin-top: 1rem;
}

.call-status { font-weight: 600; margin-bottom: 0.875rem; }

.phone-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.875rem;
}

.transcript-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    min-height: 180px;
    max-height: 320px;
    overflow-y: auto;
    margin: 0.875rem 0;
    text-align: left;
}

.transcript-line { margin-bottom: 0.625rem; font-size: 0.875rem; }
.transcript-line .role { display: block; font-size: 0.625rem; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-bottom: 0.125rem; }
.transcript-line.agent { text-align: right; }

.bot-input-row { display: flex; gap: 0.5rem; }
.bot-input-row input { flex: 1; padding: 0.5625rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.bot-status { text-align: center; font-weight: 600; margin-bottom: 0.5rem; }
.lang-select { width: 100%; padding: 0.5625rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; margin-bottom: 0.5rem; }

.agent-preview {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5625rem 0.75rem;
    margin: 0.625rem 0;
    font-size: 0.8125rem;
}

.recording-notice { color: var(--warn); font-size: 0.8125rem; }
.recording-player { width: 100%; max-width: 200px; height: 32px; }

/* ── Admin modules ── */
.module-admin-list { list-style: none; }

.module-admin-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.module-admin-item:last-child { margin-bottom: 0; }

.module-admin-head { display: flex; gap: 0.625rem; align-items: flex-start; }
.module-num { font-weight: 700; color: var(--accent); min-width: 1.25rem; }
.module-admin-meta { margin: 0.35rem 0 0.5rem 1.875rem; font-size: 0.8125rem; }
.module-admin-item .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }

/* ── Quiz ── */
.quiz-form fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.125rem;
    margin-bottom: 0.875rem;
}

.quiz-form legend { font-weight: 600; font-size: 0.9375rem; padding: 0 0.25rem; }

.question-block { margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.question-head { display: flex; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.answer-list { list-style: none; }
.answer-list li { padding: 0.35rem 0; font-size: 0.875rem; display: flex; align-items: center; gap: 0.5rem; }
.correct-answer { color: var(--good); font-weight: 500; }
.active-link { font-weight: 600; color: var(--accent-dark); }

/* ── Media ── */
.media-block { margin-bottom: 1.25rem; }
.media-block h2 { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 0.5rem; }
.media-block video, .media-block audio { width: 100%; border-radius: 8px; background: #000; }

.back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
}

.back-link:hover { color: var(--accent-dark); text-decoration: none; }

.completion-actions { padding-top: 1rem; border-top: 1px solid var(--border); }
.completion-actions .btn-primary { min-width: 9rem; }

/* ── Evaluator ── */
.evaluator-desk .evaluator-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: var(--good-bg);
    color: var(--good);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.evaluator-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--good);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.queue-list { display: flex; flex-direction: column; gap: 0.625rem; }

.queue-item {
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.15s;
}

.queue-item:hover { border-color: var(--accent); }

.agent-info-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    margin-bottom: 0.875rem;
}

.eval-form h3 { font-size: 0.9375rem; font-weight: 600; margin: 1rem 0 0.5rem; }

/* ── Recordings admin ── */
.recording-item { padding: 1rem 0; border-bottom: 1px solid var(--border-light); }
.recording-item:last-child { border-bottom: none; }
.recording-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.snippet-details { margin-top: 0.5rem; font-size: 0.8125rem; }
.snippet-pre { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem; font-size: 0.8125rem; white-space: pre-wrap; max-height: 180px; overflow-y: auto; margin-top: 0.35rem; }

/* ── User avatar (legacy) ── */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Login ── */
.login-page { min-height: 100vh; display: flex; background: var(--bg); }

.login-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    min-height: 100vh;
}

.login-brand {
    background: linear-gradient(145deg, var(--hero-from, #312e81), var(--hero-to, #6366f1));
    color: #fff;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-brand-inner { max-width: 400px; }

.login-brand-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1.25rem;
}

.login-brand-logo {
    max-height: 56px;
    max-width: 200px;
    width: auto;
    object-fit: contain;
    margin-bottom: 1.25rem;
}

.login-brand h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 0.875rem; line-height: 1.15; }
.login-brand p { opacity: 0.9; line-height: 1.6; }

.login-brand-features { list-style: none; margin-top: 1.75rem; display: flex; flex-direction: column; gap: 0.75rem; }
.login-brand-features li { display: flex; align-items: center; gap: 0.625rem; font-size: 0.9375rem; }
.login-brand-features li::before { content: '✓'; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 0.65rem; flex-shrink: 0; }

.login-form-side { display: flex; align-items: center; justify-content: center; padding: 2rem 1.5rem; }
.login-wrap { width: 100%; max-width: 400px; }
.login-card { padding: 2rem; box-shadow: var(--shadow-lg); border: none; }
.login-card h2 { font-size: 1.375rem; font-weight: 700; margin-bottom: 0.25rem; }
.login-note { font-size: 0.8125rem; color: var(--muted); margin: 0.5rem 0 1rem; }

.login-form label { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); margin: 0.875rem 0 0.35rem; }
.login-form input { width: 100%; padding: 0.6875rem 0.875rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.login-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.login-form button { width: 100%; margin-top: 1.25rem; padding: 0.75rem; }

/* ── Responsive ── */
@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: var(--shadow-lg);
    }

    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-overlay { display: block; }

    .app-main { margin-left: 0; }
    .nav-toggle { display: flex; }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .main { padding: 1rem; }
    .dashboard-hero, .agent-hero { padding: 1.25rem 1.375rem; }
    .hero-actions { width: 100%; }
    .hero-actions .btn-primary, .hero-actions .btn-secondary { flex: 1; justify-content: center; }
    .module-card { flex-wrap: wrap; }
    .module-card-action { width: 100%; }
    .module-card-action .btn-primary, .module-card-action .btn-secondary { width: 100%; }
    .topbar-inner { padding: 0 1rem; }
    .login-split { grid-template-columns: 1fr; }
    .login-brand { padding: 2rem 1.5rem; min-height: auto; }
    .login-brand-features { display: none; }
}

@media (max-width: 860px) {
    .login-split { grid-template-columns: 1fr; }
    .login-brand-features { display: none; }
}

/* ── Appearance / branding admin ── */
.branding-layout { align-items: start; }

.branding-section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin: 1.25rem 0 0.75rem;
}

.color-field { margin-bottom: 0.875rem; }

.color-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.color-input-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.color-input-row input[type="color"] {
    width: 44px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: var(--surface);
    flex-shrink: 0;
}

.color-hex {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    font-size: 0.875rem;
    font-family: ui-monospace, monospace;
}

.logo-preview-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    padding: 1rem;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.logo-preview-empty { min-height: 72px; }

.logo-preview-img {
    max-height: 64px;
    max-width: 100%;
    object-fit: contain;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.625rem;
}

.preset-card { margin: 0; }

.preset-btn {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
    font: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.preset-btn:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.preset-swatches {
    display: flex;
    gap: 4px;
}

.preset-swatches span {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px var(--border);
}

.preset-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
}

.branding-preview-panel { position: sticky; top: calc(var(--topbar-h) + 1rem); }

.brand-preview {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 0.75rem;
}

.brand-preview-sidebar {
    background: var(--sidebar-bg);
    color: #cbd5e1;
    padding: 1rem;
}

.brand-preview-logo {
    max-height: 28px;
    max-width: 100px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.brand-preview-brand {
    color: #fff;
    font-weight: 700;
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
}

.brand-preview-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.brand-preview-nav span {
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    color: #94a3b8;
}

.brand-preview-nav span.active {
    background: var(--preview-active, var(--sidebar-active));
    color: #fff;
    font-weight: 600;
}

.brand-preview-main {
    padding: 1rem;
    background: var(--bg);
}

.brand-preview-hero {
    background: linear-gradient(135deg, var(--hero-from), var(--hero-to));
    color: #fff;
    border-radius: 8px;
    padding: 0.875rem 1rem;
    margin-bottom: 0.75rem;
}

.brand-preview-hero strong { display: block; font-size: 0.875rem; margin-bottom: 0.125rem; }
.brand-preview-hero span { opacity: 0.85; font-size: 0.6875rem; }

.brand-preview-btn {
    display: inline-block;
    padding: 0.4375rem 0.875rem;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.6875rem;
}

@media (max-width: 960px) {
    .branding-preview-panel { position: static; }
}
