/* ============================================================
   TalkLog UI — KodLog Visual DNA
   Premium B2B SaaS 2026 · Enterprise · Indigo/Violet Brand
   ============================================================ */

/* === CSS Variables === */
:root {
    /* Brand — deep indigo/violet, close to KodLog */
    --brand-900: #0f1225;
    --brand-800: #151829;
    --brand-700: #1a1f36;
    --brand-600: #232844;
    --brand-500: #2d3561;
    --brand-400: #3d4a80;
    --brand-300: #4f5fa3;
    --brand-200: #6b7fd4;
    --brand-100: #a3b0e8;
    --brand-50:  #eef0fc;

    /* Accent violet */
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: #818cf8;
    --accent-bg: rgba(99,102,241,.08);
    --accent-subtle: rgba(99,102,241,.12);

    /* Legacy compat */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #a5b4fc;
    --primary-dark: #4338ca;
    --primary-bg: rgba(99,102,241,.08);
    --primary-subtle: rgba(99,102,241,.12);
    --secondary: #7c3aed;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    --secondary-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a78bfa 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);

    /* Semantic */
    --success: #059669;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --info: #2563eb;
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;

    /* Neutrals */
    --white: #ffffff;
    --gray-50: #f8f9fc;
    --gray-100: #f1f3f9;
    --gray-200: #e4e7f0;
    --gray-300: #c8cfe0;
    --gray-400: #9aa3c2;
    --gray-500: #6b7599;
    --gray-600: #4a5270;
    --gray-700: #2f3553;
    --gray-800: #1e2240;
    --gray-900: #12162e;

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f4f6fb;
    --border-color: #e5e7f0;
    --border: #e5e7f0;

    /* Layout */
    --sidebar-width: 264px;
    --header-height: 64px;

    /* Radii */
    --radius: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --radius-pill: 50px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(16,24,40,.05);
    --shadow-sm: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
    --shadow: 0 4px 8px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.04);
    --shadow-md: 0 6px 16px rgba(16,24,40,.08), 0 2px 6px rgba(16,24,40,.04);
    --shadow-lg: 0 12px 32px rgba(16,24,40,.10), 0 4px 12px rgba(16,24,40,.06);
    --shadow-xl: 0 24px 48px rgba(16,24,40,.14), 0 8px 20px rgba(16,24,40,.08);
    --shadow-accent: 0 4px 16px rgba(99,102,241,.3);
    --shadow-accent-lg: 0 8px 28px rgba(99,102,241,.4);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    --transition: all .22s cubic-bezier(.4,0,.2,1);
    --transition-fast: all .14s ease;

    /* Charts */
    --chart-1: #6366f1;
    --chart-2: #059669;
    --chart-3: #f59e0b;
    --chart-4: #ef4444;
    --chart-5: #8b5cf6;
    --chart-6: #0ea5e9;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text-primary); background: var(--bg-secondary); line-height: 1.6; overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
::selection { background: var(--accent); color: #fff; }

/* === App Layout === */
.app-layout { display: flex; min-height: 100vh; }
.main-content { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; background: var(--bg-secondary); }
.content-area { padding: 28px 32px; padding-bottom: var(--content-bottom-pad, 28px); }
/* Когда софтфон-виджет открыт, добавляем нижний отступ чтобы он не перекрывал кнопки */
body.has-softphone { --content-bottom-pad: 220px; }
body.has-softphone-iframe { --content-bottom-pad: 600px; }

/* ============================================================
   SIDEBAR — Dark brand, KodLog style
   ============================================================ */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--brand-800) 0%, var(--brand-900) 100%);
    color: #fff;
    z-index: 100;
    display: flex; flex-direction: column;
    overflow-y: auto; overflow-x: hidden;
    transition: var(--transition);
    box-shadow: 2px 0 24px rgba(0,0,0,.18);
}

/* Scrollbar in sidebar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

.sidebar-header {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.sidebar-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none;
}
.sidebar-logo-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 800; color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,.4);
    flex-shrink: 0;
}
.sidebar-logo-text {
    font-size: 19px; font-weight: 800; color: #fff; line-height: 1;
}
.sidebar-logo-text span {
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav { flex: 1; padding: 12px 0 8px; }
.nav-section { padding: 0 12px; margin-bottom: 2px; }
.nav-section-title {
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.4px;
    color: rgba(255,255,255,.28);
    padding: 18px 12px 6px;
}
.nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px;
    color: rgba(255,255,255,.58);
    border-radius: var(--radius-xs);
    transition: var(--transition);
    font-weight: 500; font-size: 13.5px;
    text-decoration: none;
    margin-bottom: 1px;
    position: relative;
}
.nav-link:hover {
    color: rgba(255,255,255,.92);
    background: rgba(255,255,255,.07);
}
.nav-link.active {
    color: #fff;
    background: rgba(99,102,241,.22);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(99,102,241,.3);
}
.nav-link.active::before {
    content: '';
    position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 3px; border-radius: 0 2px 2px 0;
    background: linear-gradient(180deg, #818cf8, #a78bfa);
    left: -12px;
}
.nav-icon {
    width: 20px; height: 20px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: .7;
}
.nav-link.active .nav-icon, .nav-link:hover .nav-icon { opacity: 1; }
.nav-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: #fff; font-size: 10px; font-weight: 700;
    border-radius: 9px;
}

.nav-divider {
    height: 1px; background: rgba(255,255,255,.06);
    margin: 10px 12px;
}

.sidebar-footer {
    padding: 14px 16px 18px;
    border-top: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: var(--radius-xs);
    background: rgba(255,255,255,.05);
    transition: var(--transition); cursor: pointer;
    margin-bottom: 8px;
}
.sidebar-user:hover { background: rgba(255,255,255,.09); }
.sidebar-user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99,102,241,.35);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,.38); }
.sidebar-user-arrow { color: rgba(255,255,255,.3); font-size: 10px; }

.sidebar-footer-actions { display: flex; gap: 6px; }
.sidebar-footer-actions a,
.sidebar-footer-actions button {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 7px 10px; border-radius: var(--radius-xs);
    font-size: 12px; font-weight: 500; color: rgba(255,255,255,.45);
    background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06);
    cursor: pointer; transition: var(--transition); text-decoration: none;
}
.sidebar-footer-actions a:hover,
.sidebar-footer-actions button:hover {
    color: rgba(255,255,255,.8);
    background: rgba(255,255,255,.09);
    border-color: rgba(255,255,255,.12);
}

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99; }

/* ============================================================
   TOPBAR
   ============================================================ */
.top-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 28px 0 32px; height: var(--header-height);
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 50;
}
.top-header-left { display: flex; align-items: center; gap: 14px; }
.page-title { font-size: 17px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.page-subtitle { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.top-header-right { display: flex; align-items: center; gap: 8px; }
.menu-toggle {
    display: none; background: none; border: none;
    padding: 8px; border-radius: var(--radius-xs);
    cursor: pointer; color: var(--text-secondary);
    transition: var(--transition);
}
.menu-toggle:hover { background: var(--gray-100); color: var(--text-primary); }
.menu-toggle svg { display: block; }

/* Topbar search */
.topbar-search {
    position: relative;
}
.topbar-search input {
    width: 240px; padding: 8px 12px 8px 36px;
    border: 1.5px solid var(--border-color); border-radius: var(--radius-pill);
    font-size: 13px; background: var(--gray-50); color: var(--text-primary);
    outline: none; transition: var(--transition);
}
.topbar-search input:focus {
    border-color: var(--accent); width: 280px;
    background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search-icon {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none;
}

/* Icon button */
.icon-btn {
    width: 38px; height: 38px; border-radius: var(--radius-xs);
    display: flex; align-items: center; justify-content: center;
    background: none; border: 1.5px solid var(--border-color);
    cursor: pointer; color: var(--text-secondary);
    transition: var(--transition); position: relative;
}
.icon-btn:hover { background: var(--gray-100); border-color: var(--gray-300); color: var(--text-primary); }
.icon-btn .notif-dot {
    position: absolute; top: 6px; right: 6px;
    width: 8px; height: 8px; border-radius: 50%;
    background: #ef4444; border: 2px solid #fff;
}

/* Topbar user */
.topbar-user {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 8px 5px 5px; border-radius: var(--radius-pill);
    cursor: pointer; transition: var(--transition); border: 1.5px solid transparent;
}
.topbar-user:hover { background: var(--gray-100); border-color: var(--border-color); }
.topbar-user-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px; color: #fff;
}
.topbar-user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.topbar-user-chevron { color: var(--text-muted); font-size: 10px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 20px; border: none; border-radius: var(--radius-pill);
    font-weight: 600; font-size: 13.5px;
    cursor: pointer; transition: var(--transition);
    text-decoration: none; white-space: nowrap; line-height: 1.4;
    position: relative; overflow: hidden;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .5; pointer-events: none; }

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: var(--shadow-accent);
}
.btn-primary:hover { box-shadow: var(--shadow-accent-lg); color: #fff; }

.btn-secondary {
    background: #fff; color: var(--text-primary);
    border: 1.5px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }

.btn-accent {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: #fff; box-shadow: 0 4px 14px rgba(139,92,246,.3);
}
.btn-accent:hover { box-shadow: 0 6px 20px rgba(139,92,246,.45); color: #fff; }

.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 4px 14px rgba(220,38,38,.25); }
.btn-danger:hover { background: #b91c1c; box-shadow: 0 6px 20px rgba(220,38,38,.35); color: #fff; }

.btn-ghost { background: transparent; color: var(--text-secondary); border: 1.5px solid transparent; }
.btn-ghost:hover { color: var(--accent); background: var(--accent-bg); border-color: transparent; }

.btn-success { background: linear-gradient(135deg, #059669, #047857); color: #fff; box-shadow: 0 4px 14px rgba(5,150,105,.25); }
.btn-success:hover { box-shadow: 0 6px 20px rgba(5,150,105,.35); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 12.5px; }
.btn-xs { padding: 4px 10px; font-size: 11.5px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-xl { padding: 15px 36px; font-size: 16px; font-weight: 700; }
.btn-block { width: 100%; }

.btn-icon { padding: 9px; border-radius: var(--radius-xs); }
.btn-icon.btn-sm { padding: 6px; }
.btn-icon.btn-xs { padding: 5px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-color);
}
.card-title { font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card-body { padding: 22px; }
.card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border-color);
    background: var(--gray-50);
}

/* KPI / Stat card */
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px 22px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative; overflow: hidden;
    cursor: default;
}
.stat-card::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, transparent);
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card:hover::after { background: linear-gradient(90deg, var(--accent), var(--secondary)); }

.stat-card--accent:hover::after { background: linear-gradient(90deg, #6366f1, #7c3aed); }
.stat-card--green:hover::after { background: linear-gradient(90deg, #059669, #047857); }
.stat-card--amber:hover::after { background: linear-gradient(90deg, #d97706, #b45309); }
.stat-card--red:hover::after { background: linear-gradient(90deg, #dc2626, #b91c1c); }
.stat-card--blue:hover::after { background: linear-gradient(90deg, #2563eb, #1d4ed8); }

.stat-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.stat-icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon-accent { background: rgba(99,102,241,.1); color: var(--accent); }
.stat-icon-green { background: rgba(5,150,105,.1); color: var(--success); }
.stat-icon-amber { background: rgba(217,119,6,.1); color: var(--warning); }
.stat-icon-red { background: rgba(220,38,38,.1); color: var(--danger); }
.stat-icon-blue { background: rgba(37,99,235,.1); color: var(--info); }
.stat-icon-violet { background: rgba(124,58,237,.1); color: #7c3aed; }

.stat-value {
    font-size: 30px; font-weight: 800; color: var(--text-primary); line-height: 1.1;
    letter-spacing: -0.5px;
}
.stat-value-sm { font-size: 22px; font-weight: 800; }
.stat-change { font-size: 11.5px; font-weight: 600; margin-top: 5px; display: flex; align-items: center; gap: 4px; }
.stat-change-up { color: var(--success); }
.stat-change-down { color: var(--danger); }
.stat-change-neutral { color: var(--text-muted); }

/* Mini sparkline bar */
.stat-sparkline { display: flex; align-items: flex-end; gap: 3px; height: 32px; margin-top: 12px; }
.stat-sparkline-bar {
    flex: 1; border-radius: 3px 3px 0 0;
    background: rgba(99,102,241,.2);
    transition: background .2s;
    min-width: 4px;
}
.stat-sparkline-bar:hover { background: rgba(99,102,241,.5); }
.stat-sparkline-bar.active { background: rgba(99,102,241,.7); }

/* Legacy compat */
.metric-card { background: #fff; border-radius: var(--radius); padding: 20px 22px; border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); transition: var(--transition); position: relative; overflow: hidden; }
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.metric-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.metric-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.metric-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.metric-icon.purple { background: rgba(99,102,241,.1); color: var(--accent); }
.metric-icon.green { background: rgba(5,150,105,.1); color: var(--success); }
.metric-icon.blue { background: rgba(37,99,235,.1); color: var(--info); }
.metric-icon.orange { background: rgba(217,119,6,.1); color: var(--warning); }
.metric-icon.red { background: rgba(220,38,38,.1); color: var(--danger); }
.metric-icon.violet { background: rgba(124,58,237,.1); color: #7c3aed; }
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.metric-value { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1.2; letter-spacing: -.5px; }
.metric-change { font-size: 11.5px; font-weight: 600; margin-top: 4px; }
.metric-change.up { color: var(--success); }
.metric-change.down { color: var(--danger); }
.metric-change.neutral { color: var(--text-muted); }

/* ============================================================
   HERO BLOCK
   ============================================================ */
.page-hero {
    background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-600) 50%, var(--brand-500) 100%);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    color: #fff;
    margin-bottom: 24px;
    position: relative; overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute; top: -60px; right: -60px;
    width: 280px; height: 280px; border-radius: 50%;
    background: rgba(255,255,255,.04);
}
.page-hero::after {
    content: '';
    position: absolute; bottom: -80px; right: 15%;
    width: 200px; height: 200px; border-radius: 50%;
    background: rgba(99,102,241,.15);
}
.page-hero-inner { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-hero-title { font-size: 24px; font-weight: 800; line-height: 1.2; margin-bottom: 6px; }
.page-hero-sub { font-size: 13.5px; color: rgba(255,255,255,.6); }
.page-hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: var(--radius-pill);
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    font-size: 12px; font-weight: 600; color: rgba(255,255,255,.85);
    margin-bottom: 10px;
}
.page-hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; }

.page-hero-stats { display: flex; gap: 28px; }
.page-hero-stat { text-align: center; }
.page-hero-stat-val { font-size: 22px; font-weight: 800; line-height: 1; }
.page-hero-stat-label { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 3px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.form-label .required { color: var(--danger); }
.form-hint { display: block; font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }

.form-input, .form-select, .form-control {
    width: 100%; padding: 9px 13px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13.5px; color: var(--text-primary);
    background: #fff;
    transition: var(--transition);
    outline: none;
    line-height: 1.5;
}
.form-input:focus, .form-select:focus, .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.form-input::placeholder, .form-control::placeholder { color: var(--gray-400); }
.form-input.error, .form-control.error { border-color: var(--danger); }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

.form-textarea {
    width: 100%; padding: 10px 13px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13.5px; color: var(--text-primary);
    background: #fff; resize: vertical;
    transition: var(--transition); outline: none; line-height: 1.6;
    min-height: 90px;
}
.form-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }

/* Toggle */
.form-toggle {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    font-size: 13.5px; font-weight: 500; color: var(--text-primary);
    user-select: none;
}
.toggle-track {
    width: 40px; height: 22px; border-radius: 11px;
    background: var(--gray-300); transition: background .2s; flex-shrink: 0;
    position: relative;
}
.toggle-track::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; transition: transform .2s;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.form-toggle input { display: none; }
.form-toggle input:checked + .toggle-track { background: var(--accent); }
.form-toggle input:checked + .toggle-track::after { transform: translateX(18px); }

/* Checkbox */
.form-checkbox { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.form-checkbox input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); border-radius: 4px; }
.checkbox-label { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; }
.checkbox-label input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); border-radius: 4px; }

.form-range { width: 100%; accent-color: var(--accent); height: 4px; cursor: pointer; }

/* Search input */
.search-input-wrap { position: relative; }
.search-input-wrap input {
    padding-left: 36px;
}
.search-input-wrap .search-icon {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none;
}

/* ============================================================
   BADGES & TAGS
   ============================================================ */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: var(--radius-pill);
    font-size: 11.5px; font-weight: 600; line-height: 1.4;
    white-space: nowrap;
}
.badge svg { width: 10px; height: 10px; }
.badge-primary { background: rgba(99,102,241,.1); color: var(--accent); }
.badge-secondary { background: var(--gray-100); color: var(--gray-600); }
.badge-success { background: rgba(5,150,105,.1); color: var(--success); }
.badge-warning { background: rgba(217,119,6,.1); color: var(--warning); }
.badge-danger { background: rgba(220,38,38,.1); color: var(--danger); }
.badge-info { background: rgba(37,99,235,.1); color: var(--info); }
.badge-violet { background: rgba(124,58,237,.1); color: #7c3aed; }
.badge-dark { background: var(--brand-600); color: rgba(255,255,255,.75); }

/* Status chip with dot */
.status-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: var(--radius-pill);
    font-size: 12px; font-weight: 600; white-space: nowrap;
}
.status-chip .chip-dot { width: 6px; height: 6px; border-radius: 50%; }
.status-chip-active, .status-chip-completed, .status-chip-success {
    background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border);
}
.status-chip-active .chip-dot, .status-chip-completed .chip-dot { background: var(--success); }
.status-chip-pending, .status-chip-queued, .status-chip-paused {
    background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border);
}
.status-chip-pending .chip-dot { background: var(--warning); }
.status-chip-error, .status-chip-failed, .status-chip-danger {
    background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border);
}
.status-chip-error .chip-dot { background: var(--danger); }
.status-chip-draft, .status-chip-inactive {
    background: var(--gray-100); color: var(--gray-500); border: 1px solid var(--gray-200);
}
.status-chip-draft .chip-dot, .status-chip-inactive .chip-dot { background: var(--gray-400); }
.status-chip-scheduled {
    background: rgba(37,99,235,.1); color: #2563eb; border: 1px solid rgba(37,99,235,.2);
}
.status-chip-scheduled .chip-dot { background: #2563eb; }
.status-chip-info, .status-chip-running {
    background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border);
}
.status-chip-info .chip-dot { background: var(--info); }

/* ============================================================
   TABLES
   ============================================================ */
.table-container { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--gray-50); }
.data-table th {
    padding: 11px 16px; text-align: left;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .6px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--text-primary);
    vertical-align: middle; font-size: 13.5px;
}
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: rgba(99,102,241,.03); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .row-actions { opacity: 0; transition: opacity .15s; }
.data-table tbody tr:hover .row-actions { opacity: 1; }

/* ============================================================
   FILTERS BAR
   ============================================================ */
.filters-bar {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
    padding: 14px 18px;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.filter-input {
    padding: 7px 11px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: #fff; color: var(--text-primary);
    min-width: 130px;
    transition: var(--transition); outline: none;
}
.filter-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }

/* Status filter tabs (pill group) */
.filter-tabs {
    display: flex; gap: 4px; align-items: center;
    padding: 4px; background: var(--gray-100);
    border-radius: var(--radius-sm);
}
.filter-tab {
    padding: 6px 14px; border-radius: var(--radius-xs);
    font-size: 12.5px; font-weight: 500; color: var(--text-secondary);
    cursor: pointer; transition: var(--transition); border: none; background: none;
    white-space: nowrap;
}
.filter-tab:hover { color: var(--text-primary); }
.filter-tab.active {
    background: #fff; color: var(--accent); font-weight: 600;
    box-shadow: var(--shadow-xs);
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
    display: flex; gap: 0;
    border-bottom: 1.5px solid var(--border-color);
    margin-bottom: 20px; overflow-x: auto;
}
.tab {
    padding: 11px 18px; font-size: 13.5px; font-weight: 600;
    color: var(--text-muted); border: none; background: none;
    cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -1.5px; transition: var(--transition); white-space: nowrap;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15,18,37,.5);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
}
.modal-overlay.active { display: flex; animation: fadeIn .2s ease; }
.modal {
    background: #fff; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%; max-width: 560px; max-height: 92vh;
    overflow-y: auto; display: flex; flex-direction: column;
    animation: modalSlide .22s ease;
}
@keyframes modalSlide { from { opacity: 0; transform: translateY(-16px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
    width: 30px; height: 30px; border-radius: 50%;
    border: none; background: var(--gray-100);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-secondary);
    transition: var(--transition); font-size: 13px;
}
.modal-close:hover { background: var(--gray-200); color: var(--text-primary); }
.modal-body { padding: 22px; flex: 1; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--border-color);
    background: var(--gray-50);
    flex-shrink: 0;
}

/* ============================================================
   DRAWER
   ============================================================ */
.drawer-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.3);
    backdrop-filter: blur(4px); z-index: 999;
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-overlay.active { opacity: 1; pointer-events: auto; }
.drawer {
    position: fixed; right: -440px; top: 0; bottom: 0;
    width: 420px; background: #fff; z-index: 1000;
    box-shadow: -4px 0 32px rgba(0,0,0,.1);
    display: flex; flex-direction: column;
    transition: right .25s ease;
}
.drawer.active { right: 0; }
.drawer-header { padding: 18px 22px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.drawer-footer { padding: 14px 22px; border-top: 1px solid var(--border-color); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 13px 16px; border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 500;
    display: flex; align-items: flex-start; gap: 10px;
    margin-bottom: 16px;
    border: 1px solid;
}
.alert-success { background: var(--success-bg); color: #065f46; border-color: var(--success-border); }
.alert-error { background: var(--danger-bg); color: #991b1b; border-color: var(--danger-border); }
.alert-warning { background: var(--warning-bg); color: #92400e; border-color: var(--warning-border); }
.alert-info { background: var(--info-bg); color: #1e40af; border-color: var(--info-border); }

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container { position: fixed; top: 18px; right: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
    padding: 12px 18px; border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 500; color: #fff;
    box-shadow: var(--shadow-lg); animation: toastIn .28s ease;
    max-width: 360px; pointer-events: auto;
    display: flex; align-items: center; gap: 10px;
}
.toast-success { background: linear-gradient(135deg, #059669, #047857); }
.toast-error { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.toast-warning { background: linear-gradient(135deg, #d97706, #b45309); }
.toast-info { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
@keyframes toastIn { from { opacity: 0; transform: translateX(80px); } to { opacity: 1; transform: translateX(0); } }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 8px;
    border-radius: var(--radius-pill);
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
    border: 1.5px solid var(--border-color);
    background: #fff; transition: var(--transition);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.pagination .active { background: linear-gradient(135deg, #6366f1, #7c3aed); color: #fff; border-color: transparent; box-shadow: var(--shadow-accent); }
.pagination .disabled { opacity: .4; pointer-events: none; }
.pagination-info { font-size: 12px; color: var(--text-muted); margin-top: 10px; }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state { text-align: center; padding: 56px 24px; }
.empty-icon {
    width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 18px;
    display: flex; align-items: center; justify-content: center;
    background: var(--gray-100); color: var(--gray-400);
    font-size: 28px;
}
.empty-state h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; color: var(--text-primary); }
.empty-state p { color: var(--text-muted); margin-bottom: 22px; font-size: 13.5px; max-width: 320px; margin-left: auto; margin-right: auto; }

/* ============================================================
   SKELETONS
   ============================================================ */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%; animation: skeleton 1.5s infinite;
    border-radius: var(--radius-xs);
}
.skeleton-text { height: 14px; border-radius: 7px; }
.skeleton-card { height: 80px; border-radius: var(--radius); }
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================
   DROPDOWNS
   ============================================================ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    position: absolute; top: calc(100% + 6px); right: 0;
    background: #fff; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); border: 1px solid var(--border-color);
    min-width: 180px; z-index: 200;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .15s, transform .15s, visibility .15s;
}
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 14px;
    font-size: 13.5px; color: var(--text-primary);
    transition: background .12s; cursor: pointer; width: 100%;
    border: none; background: none; text-align: left;
    text-decoration: none;
}
.dropdown-item:hover { background: var(--gray-50); color: var(--accent); }
.dropdown-item:first-child { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.dropdown-item:last-child { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-bg); }
.dropdown-divider { height: 1px; background: var(--border-color); margin: 4px 0; }
.dropdown-menu-left { right: auto; left: 0; }

/* ============================================================
   CONFIRM DIALOG
   ============================================================ */
.confirm-overlay {
    position: fixed; inset: 0; background: rgba(15,18,37,.5);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; z-index: 2000;
}
.confirm-box {
    background: #fff; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl); padding: 28px;
    max-width: 380px; width: 90%; text-align: center;
    animation: modalSlide .2s ease;
}
.confirm-icon { font-size: 36px; margin-bottom: 12px; }
.confirm-box h3 { margin-bottom: 8px; font-size: 17px; font-weight: 700; }
.confirm-box p { color: var(--text-secondary); margin-bottom: 22px; font-size: 13.5px; line-height: 1.6; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }

/* ============================================================
   WIZARD STEPS
   ============================================================ */
.wizard-steps {
    display: flex; gap: 0; align-items: center;
    padding: 24px 32px; border-bottom: 1px solid var(--border-color);
    background: var(--gray-50); overflow-x: auto;
}
.wizard-step {
    display: flex; align-items: center; gap: 10px;
    flex-shrink: 0; position: relative;
}
.wizard-step + .wizard-step::before {
    content: '';
    display: block; width: 36px; height: 2px;
    background: var(--gray-200); flex-shrink: 0;
    margin: 0 8px;
}
.wizard-step.completed + .wizard-step::before { background: var(--success); }
.wizard-step .step-num {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--gray-200); color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
    transition: var(--transition);
}
.wizard-step .step-info {}
.wizard-step .step-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); transition: var(--transition); }
.wizard-step .step-sub { font-size: 11px; color: var(--text-muted); }
.wizard-step.active .step-num { background: linear-gradient(135deg, #6366f1, #7c3aed); color: #fff; box-shadow: var(--shadow-accent); }
.wizard-step.active .step-label { color: var(--accent); }
.wizard-step.completed .step-num { background: var(--success-gradient); color: #fff; }
.wizard-step.completed .step-label { color: var(--success); }

/* ============================================================
   AUDIO PLAYER
   ============================================================ */
.audio-player {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: var(--gray-50);
    border-radius: var(--radius-sm); border: 1px solid var(--border-color);
}
.audio-btn {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #7c3aed); color: #fff;
    border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0; transition: var(--transition);
    box-shadow: var(--shadow-accent);
}
.audio-btn:hover { transform: scale(1.06); box-shadow: var(--shadow-accent-lg); }
.audio-progress {
    flex: 1; height: 4px; background: var(--gray-200);
    border-radius: 2px; overflow: hidden; cursor: pointer; position: relative;
}
.audio-progress-bar { height: 100%; background: linear-gradient(90deg, #6366f1, #7c3aed); border-radius: 2px; transition: width .1s; }
.audio-time { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); min-width: 40px; }
.audio-waveform {
    display: flex; align-items: center; gap: 2px; height: 28px; flex: 1;
}
.audio-waveform-bar {
    flex: 1; min-width: 3px; background: rgba(99,102,241,.25); border-radius: 2px;
    transition: background .2s;
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 1.5px; background: var(--border-color); }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item::before {
    content: ''; position: absolute; left: -20px; top: 3px;
    width: 11px; height: 11px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    border: 2px solid #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.timeline-time { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); margin-bottom: 3px; }
.timeline-content { font-size: 13px; line-height: 1.5; }

/* ============================================================
   TRANSCRIPT
   ============================================================ */
.transcript { max-height: 480px; overflow-y: auto; }
.transcript-line {
    display: flex; gap: 10px; padding: 8px 10px;
    border-radius: var(--radius-xs); margin-bottom: 2px;
    transition: background .12s;
}
.transcript-line:hover { background: var(--gray-50); }
.transcript-timestamp { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); flex-shrink: 0; min-width: 44px; padding-top: 2px; }
.transcript-role { font-size: 10px; font-weight: 700; text-transform: uppercase; flex-shrink: 0; min-width: 52px; padding: 3px 7px; border-radius: var(--radius-pill); text-align: center; height: fit-content; }
.transcript-role.ai, .transcript-role.agent { background: rgba(99,102,241,.1); color: var(--accent); }
.transcript-role.client { background: rgba(5,150,105,.1); color: var(--success); }
.transcript-role.operator { background: rgba(37,99,235,.1); color: var(--info); }
.transcript-role.unknown { background: var(--gray-100); color: var(--text-muted); }
.transcript-text { font-size: 13.5px; line-height: 1.6; flex: 1; }

/* ============================================================
   IVR CANVAS
   ============================================================ */
.ivr-canvas {
    position: relative; min-height: 520px;
    background: var(--gray-50);
    border-radius: 0 0 var(--radius) var(--radius); overflow: hidden;
    background-image: radial-gradient(circle, var(--gray-200) 1px, transparent 1px);
    background-size: 22px 22px;
}
.ivr-node {
    position: absolute; padding: 12px 16px;
    background: #fff; border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    cursor: grab; user-select: none;
    transition: box-shadow .2s, border-color .2s; min-width: 150px;
}
.ivr-node:hover, .ivr-node.selected { box-shadow: var(--shadow-lg); border-color: var(--accent); }
.ivr-node-type { font-size: 10px; text-transform: uppercase; font-weight: 700; letter-spacing: .5px; color: var(--accent); margin-bottom: 4px; }
.ivr-node-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress { height: 6px; background: var(--gray-200); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 3px; transition: width .4s ease; }
.progress-bar-accent { background: linear-gradient(90deg, #6366f1, #7c3aed); }
.progress-bar-success { background: linear-gradient(90deg, #059669, #047857); }
.progress-bar-warning { background: linear-gradient(90deg, #d97706, #b45309); }
.progress-bar-danger { background: linear-gradient(90deg, #dc2626, #b91c1c); }

/* ============================================================
   STATUS DOT
   ============================================================ */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot.online { background: var(--success); box-shadow: 0 0 0 3px rgba(5,150,105,.2); }
.status-dot.offline { background: var(--gray-400); }
.status-dot.warning { background: var(--warning); box-shadow: 0 0 0 3px rgba(217,119,6,.2); }
.status-dot.error { background: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.2); }

/* ============================================================
   AVATARS
   ============================================================ */
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar-xs { width: 22px; height: 22px; font-size: 10px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar-xl { width: 64px; height: 64px; font-size: 24px; }
.avatar-square { border-radius: var(--radius-sm); }
.avatar-sm.avatar-square { border-radius: var(--radius-xs); }

/* ============================================================
   VOICE CARD
   ============================================================ */
.voice-card { transition: var(--transition); }
.voice-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.voice-card--inactive { opacity: .65; }
.voice-card--selected { border: 2px solid var(--accent) !important; box-shadow: 0 0 0 3px rgba(99,102,241,.15) !important; }
.voice-waveform {
    display: flex; align-items: center; gap: 2px; height: 32px;
    padding: 4px 0; margin: 8px 0;
}
.voice-waveform-bar {
    width: 3px; border-radius: 2px;
    background: rgba(99,102,241,.25); flex-shrink: 0;
    transition: background .2s;
}
.voice-waveform-bar.tall { height: 100%; }
.voice-waveform-bar.mid { height: 70%; }
.voice-waveform-bar.short { height: 40%; }
.voice-waveform-bar.xs { height: 20%; }

/* ============================================================
   CHART
   ============================================================ */
.chart-container { position: relative; height: 260px; }
.chart-container-sm { height: 180px; }
.chart-container-xs { height: 120px; }

/* ============================================================
   ACTIONS
   ============================================================ */
.actions { display: flex; gap: 3px; align-items: center; }
.row-actions { display: flex; gap: 3px; }

/* ============================================================
   GRID / FLEX UTILITIES
   ============================================================ */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.gap-20 { gap: 20px; } .gap-24 { gap: 24px; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* ============================================================
   SPACING
   ============================================================ */
.mt-2 { margin-top: 2px; } .mt-4 { margin-top: 4px; } .mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-4 { margin-bottom: 4px; } .mb-6 { margin-bottom: 6px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; }
.p-0 { padding: 0; } .px-0 { padding-left: 0; padding-right: 0; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.font-bold { font-weight: 700; } .font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; } .font-mono { font-family: var(--font-mono); }
.cursor-pointer { cursor: pointer; }
.text-lg { font-size: 16px; } .text-sm { font-size: 12.5px; } .text-xs { font-size: 11px; }
.text-center { text-align: center; } .text-right { text-align: right; }
.text-muted { color: var(--text-muted); } .text-secondary { color: var(--text-secondary); }
.text-primary-color { color: var(--text-primary); } .text-accent { color: var(--accent); }
.text-success { color: var(--success); } .text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.gradient-text {
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-500) 50%, var(--accent-hover) 100%);
    position: relative; overflow: hidden; padding: 20px;
}
.auth-page::before {
    content: ''; position: absolute;
    width: 560px; height: 560px; background: rgba(255,255,255,.05);
    border-radius: 50%; top: -200px; right: -100px;
    animation: authOrb 22s infinite ease-in-out;
}
.auth-page::after {
    content: ''; position: absolute;
    width: 380px; height: 380px; background: rgba(99,102,241,.15);
    border-radius: 50%; bottom: -140px; left: -80px;
    animation: authOrb 22s infinite ease-in-out reverse;
}
@keyframes authOrb {
    0%, 100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(28px,-28px) scale(1.08); }
    66% { transform: translate(-18px,18px) scale(.93); }
}
.auth-card {
    background: #fff; border-radius: var(--radius-xl);
    box-shadow: 0 32px 64px rgba(0,0,0,.22);
    padding: 44px 40px; width: 100%; max-width: 440px;
    position: relative; z-index: 1; animation: modalSlide .35s ease;
}
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 26px; }
.logo-icon { width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(135deg, #6366f1, #7c3aed); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; box-shadow: 0 4px 16px rgba(99,102,241,.4); }
.logo-text { font-size: 26px; font-weight: 800; color: var(--text-primary); }
.logo-text span { background: linear-gradient(135deg, #6366f1, #7c3aed); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-title { font-size: 21px; font-weight: 800; text-align: center; color: var(--text-primary); margin-bottom: 6px; }
.auth-subtitle { font-size: 13.5px; color: var(--text-muted); text-align: center; margin-bottom: 26px; }
.auth-links { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-secondary); }
.auth-links a { color: var(--accent); font-weight: 600; }
.auth-links a:hover { text-decoration: underline; }

/* ============================================================
   MISC
   ============================================================ */
.btn-block { width: 100%; }
.divider { height: 1px; background: var(--border-color); margin: 16px 0; }
.rounded-full { border-radius: 50%; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }

/* KodLog-style section title */
.section-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted); margin-bottom: 14px;
}

/* Info rows (key-value) */
.info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 20px; border-bottom: 1px solid var(--gray-100);
    font-size: 13px; gap: 12px;
}
.info-row:last-child { border-bottom: none; }
.info-row-label, .info-label { color: var(--text-muted); flex-shrink: 0; }
.info-row-value, .info-value { font-weight: 600; color: var(--text-primary); text-align: right; }

/* Feature list */
.feature-list { list-style: none; }
.feature-list li { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; font-size: 13.5px; }
.feature-list-icon { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; margin-top: 1px; }
.feature-list-icon-success { background: rgba(5,150,105,.1); color: var(--success); }
.feature-list-icon-danger { background: rgba(220,38,38,.1); color: var(--danger); }

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .sidebar, .sidebar-overlay, .top-header, .filters-bar, .btn, .pagination, .toast-container { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1280px) {
    .content-area { padding: 24px; }
}
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .content-area { padding: 20px; }
    .topbar-search input { width: 180px; }
}
@media (max-width: 768px) {
    .sidebar { left: -280px; width: 280px; }
    .sidebar.open { left: 0; }
    .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity .2s; }
    .sidebar.open ~ .sidebar-overlay { opacity: 1; pointer-events: auto; }
    .main-content { margin-left: 0; }
    .top-header { padding: 0 16px; }
    .menu-toggle { display: flex; }
    .content-area { padding: 16px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .filters-bar { flex-direction: column; }
    .wizard-steps { flex-wrap: wrap; padding: 16px; gap: 8px; }
    .wizard-step + .wizard-step::before { display: none; }
    .drawer { width: 100%; right: -100%; }
    .modal-xl, .modal-lg { max-width: 100%; margin: 8px; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .page-hero-stats { display: none; }
    .topbar-search { display: none; }
}
@media (max-width: 480px) {
    .metrics-grid { grid-template-columns: 1fr; }
    html { font-size: 13px; }
    .auth-card { padding: 28px 20px; }
    .page-hero { padding: 20px; }
    .page-hero-title { font-size: 18px; }
}
