/* MedLine AI Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #1769E0;
    --deep-blue: #0B2F6B;
    --light-blue: #EAF3FF;
    --bg: #F6F9FC;
    --surface: #FFFFFF;
    --text-primary: #132238;
    --text-secondary: #667085;
    --success: #12B76A;
    --warning: #F79009;
    --danger: #F04438;
    --border: #E4EAF1;
    --gradient: linear-gradient(135deg, #0B2F6B 0%, #1769E0 55%, #52A7FF 100%);
    --shadow-sm: 0 1px 2px rgba(19, 34, 56, 0.05);
    --shadow-md: 0 4px 16px rgba(19, 34, 56, 0.08);
    --shadow-lg: 0 12px 40px rgba(19, 34, 56, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --desktop-rail-width: 72px;
    --desktop-drawer-width: 280px;
    --chat-panel-width: 300px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: width 0.3s ease;
}
.main-content {
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease, margin-right 0.25s ease;
}

body.nav-classic .main-content {
    margin-left: var(--sidebar-width);
    margin-right: 0;
}

body.nav-rail .main-content {
    margin-left: 0;
    margin-right: var(--desktop-rail-width);
}
.page-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.page-body { padding: 24px 32px; flex: 1; }

/* Sidebar */
.sidebar-brand {
    padding: 28px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sidebar-logo {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--deep-blue);
    text-decoration: none;
    line-height: 1;
    user-select: none;
}
.sidebar-logo:hover {
    text-decoration: none;
    color: var(--primary);
}
.sidebar-brand h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--deep-blue);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-brand .logo-icon {
    width: 36px; height: 36px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 14px;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.nav-section { margin-bottom: 20px; }
.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    padding: 0 12px 8px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    text-decoration: none;
}
.nav-link:hover { background: var(--light-blue); color: var(--primary); text-decoration: none; }
.nav-link.active { background: var(--light-blue); color: var(--primary); font-weight: 600; }
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}
.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
}
.user-avatar {
    width: 36px; height: 36px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 600; font-size: 14px;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-secondary); }

/* Sidebar groups */
.nav-link.top-level { font-weight: 600; margin-bottom: 4px; }
.nav-group { margin-bottom: 8px; }
.nav-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.nav-group-toggle span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}
.nav-group-toggle svg { width: 14px; height: 14px; }
.nav-chevron { transition: transform 0.2s ease; opacity: 0.5; }
.nav-group.open .nav-chevron { transform: rotate(180deg); }
.nav-group-items {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
}
.nav-group.open .nav-group-items { max-height: 600px; }
.nav-group .nav-link { padding-left: 20px; font-size: 13px; }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 { font-size: 16px; font-weight: 600; }
.card-body { padding: 24px; }

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.kpi-value { font-size: 28px; font-weight: 700; color: var(--text-primary); }
.kpi-change { font-size: 12px; margin-top: 6px; }
.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--danger); }
.kpi-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
}
.kpi-icon.blue { background: var(--light-blue); color: var(--primary); }
.kpi-icon.green { background: #ECFDF3; color: var(--success); }
.kpi-icon.orange { background: #FFF6ED; color: var(--warning); }
.kpi-icon.red { background: #FEF3F2; color: var(--danger); }

/* Dashboard executive summary */
.dashboard-exec { margin-top: 4px; }
.dashboard-exec-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.dashboard-exec-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--deep-blue);
    margin-bottom: 4px;
}
.dashboard-exec-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}
.dashboard-exec-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.dashboard-exec-stat-pill {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    min-width: 110px;
}
.dashboard-exec-stat-pill span {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dashboard-exec-stat-pill strong {
    font-size: 18px;
    color: var(--text-primary);
}
.dashboard-exec-stat-pill.is-success {
    background: #ecfdf3;
    border-color: #a6f4c5;
}
.dashboard-exec-stat-pill.is-success strong { color: #027a48; }
.dashboard-charts-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 18px;
}
.dashboard-chart-card {
    grid-column: span 4;
    overflow: hidden;
}
.dashboard-chart-wide { grid-column: span 8; }
.dashboard-health-card { grid-column: span 4; }
.dashboard-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 20px 0;
}
.dashboard-chart-head h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--deep-blue);
    margin-bottom: 2px;
}
.dashboard-chart-head p {
    font-size: 12px;
    color: var(--text-secondary);
}
.dashboard-chart-kpi {
    font-size: 24px;
    font-weight: 700;
    color: var(--success);
    line-height: 1;
}
.dashboard-chart-body {
    position: relative;
    height: 260px;
    padding: 12px 16px 18px;
}
.dashboard-chart-body-donut { height: 240px; }
.dashboard-health-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 16px 0;
}
.dashboard-health-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
}
.dashboard-health-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dashboard-health-icon svg { width: 18px; height: 18px; }
.dashboard-health-icon.is-blue { background: var(--light-blue); color: var(--primary); }
.dashboard-health-icon.is-green { background: #ecfdf3; color: var(--success); }
.dashboard-health-icon.is-purple { background: #f4f3ff; color: #6938ef; }
.dashboard-health-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dashboard-health-copy strong {
    font-size: 13px;
    font-weight: 600;
}
.dashboard-health-copy span {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dashboard-agent-rank {
    padding: 14px 16px 18px;
    border-top: 1px solid var(--border);
    margin-top: 10px;
}
.dashboard-agent-rank h5 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.dashboard-agent-rank-row {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.dashboard-agent-rank-row:last-child { border-bottom: none; }
.dashboard-agent-rank-num {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: var(--light-blue);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dashboard-agent-rank-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dashboard-agent-rank-meta {
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    font-family: inherit;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #1258c4; text-decoration: none; color: white; }
.btn-secondary { background: var(--surface); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); text-decoration: none; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--light-blue); color: var(--primary); text-decoration: none; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.12);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Tables */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; font-size: 14px; }
th { font-weight: 600; color: var(--text-secondary); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; border-bottom: 1px solid var(--border); background: var(--bg); }
td { border-bottom: 1px solid var(--border); }
tr:hover td { background: rgba(234, 243, 255, 0.3); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-success { background: #ECFDF3; color: var(--success); }
.badge-warning { background: #FFF6ED; color: var(--warning); }
.badge-danger { background: #FEF3F2; color: var(--danger); }
.badge-info { background: var(--light-blue); color: var(--primary); }
.badge-neutral { background: var(--bg); color: var(--text-secondary); }

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: #ECFDF3; color: #027A48; border: 1px solid #A6F4C5; }
.alert-error { background: #FEF3F2; color: #B42318; border: 1px solid #FECDCA; }
.alert-info { background: var(--light-blue); color: var(--deep-blue); border: 1px solid #B2DDFF; }

/* Login Page */
.login-page { display: flex; min-height: 100vh; }
.login-left {
    flex: 0 0 48%;
    background: var(--gradient);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}
.login-left-desc {
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 24px;
    line-height: 1.7;
}
.login-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-left-content { position: relative; z-index: 1; max-width: 480px; color: white; }
.login-left-content h1 { font-size: 36px; font-weight: 700; margin-bottom: 16px; }
.login-left-content p { font-size: 16px; opacity: 0.9; line-height: 1.7; margin-bottom: 32px; }
.feature-cards { display: grid; gap: 12px; margin-bottom: 40px; }
.feature-card {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 500;
}
.login-trust { font-size: 13px; opacity: 0.7; }
.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 64px;
    background: linear-gradient(180deg, #fafbfd 0%, #ffffff 42%, #f6f9fc 100%);
}
.login-form-shell {
    width: 100%;
    max-width: 520px;
}
.login-form-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 28px;
}
.login-form {
    width: 100%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 28px;
    padding: 40px 42px 36px;
    box-shadow:
        0 24px 64px rgba(19, 34, 56, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.login-form-intro { margin-bottom: 28px; }
.login-form-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--light-blue);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 18px;
}
.login-form h2 {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 10px;
    color: var(--deep-blue);
}
.login-form .subtitle {
    color: var(--text-secondary);
    margin-bottom: 0;
    font-size: 16px;
    line-height: 1.55;
}
.login-alert { margin-bottom: 20px; }
.login-field { margin-bottom: 18px; }
.login-field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}
.login-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.login-input {
    width: 100%;
    height: 54px;
    padding: 0 18px;
    border: 1px solid rgba(19, 34, 56, 0.1);
    border-radius: 14px;
    font-size: 16px;
    font-family: inherit;
    background: rgba(246, 249, 252, 0.9);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.15s ease;
    box-shadow: inset 0 1px 2px rgba(19, 34, 56, 0.04);
}
.login-input::placeholder { color: #98a2b3; }
.login-input:hover {
    border-color: rgba(23, 105, 224, 0.18);
    background: #fff;
}
.login-input:focus {
    outline: none;
    border-color: rgba(23, 105, 224, 0.45);
    background: #fff;
    box-shadow:
        0 0 0 4px rgba(23, 105, 224, 0.12),
        inset 0 1px 2px rgba(19, 34, 56, 0.03);
}
.login-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.login-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}
.login-forgot {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
}
.login-forgot:hover { text-decoration: underline; }
.login-submit {
    width: 100%;
    height: 54px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #1258c4 0%, #1769E0 55%, #3d8ef0 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 10px 24px rgba(23, 105, 224, 0.28);
}
.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(23, 105, 224, 0.32);
}
.login-submit:active { transform: translateY(0); }
.login-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 28px 0 22px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.login-social {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.login-social-btn {
    width: 100%;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid rgba(19, 34, 56, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 2px rgba(19, 34, 56, 0.04);
}
.login-social-btn:hover {
    background: #fff;
    border-color: rgba(23, 105, 224, 0.18);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(19, 34, 56, 0.06);
}
.login-social-btn.is-loading { opacity: 0.72; pointer-events: none; }
.login-social-btn-dark {
    background: #111827;
    border-color: #111827;
    color: #fff;
}
.login-social-btn-dark:hover {
    background: #1f2937;
    border-color: #1f2937;
    color: #fff;
}
.login-social-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.login-social-icon svg { width: 20px; height: 20px; display: block; }

@media (max-width: 1100px) {
    .login-left { flex-basis: 44%; padding: 40px; }
    .login-right { padding: 32px; }
    .login-form { padding: 32px 28px; }
    .login-form h2 { font-size: 28px; }
}

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.4; }

/* Transcript */
.transcript-msg { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 8px; font-size: 14px; }
.transcript-msg.agent { background: var(--light-blue); margin-right: 40px; }
.transcript-msg.user { background: var(--bg); margin-left: 40px; }
.transcript-role { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 4px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    background: none;
    border-top: none; border-left: none; border-right: none;
    font-family: inherit;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* Audio player */
.audio-player { background: var(--bg); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 20px; }
audio { width: 100%; }

/* Call detail 3-column */
.call-detail-grid { display: grid; grid-template-columns: 280px 1fr 320px; gap: 24px; }

/* Responsive */
@media (max-width: 1024px) {
    .grid-2, .grid-3, .call-detail-grid { grid-template-columns: 1fr; }
    .login-left { display: none; }
    .login-right {
        padding: 24px 18px;
        background: linear-gradient(180deg, #f6f9fc 0%, #ffffff 100%);
    }
    .login-form-shell { max-width: none; }
    .login-form {
        padding: 28px 22px 24px;
        border-radius: 22px;
    }
    .login-form h2 { font-size: 28px; }
    .login-form-top { margin-bottom: 16px; }
    body.nav-classic .sidebar { transform: translateX(-100%); }
    body.nav-classic .sidebar.open { transform: translateX(0); }
    body.nav-classic .main-content,
    body.nav-rail .main-content { margin-left: 0; margin-right: 0; }
    body.nav-rail .desktop-rail {
        display: flex;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: var(--mobile-rail-height, 68px);
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        z-index: 120;
    }
    body.nav-rail .desktop-rail-inner {
        flex-direction: row;
        align-items: center;
        width: 100%;
        padding: 8px 10px;
        gap: 6px;
    }
    body.nav-rail .desktop-rail-brand {
        display: none;
    }
    body.nav-rail .desktop-rail-scroll {
        flex: 1;
        min-height: 0;
        overflow-x: auto;
        overflow-y: hidden;
    }
    body.nav-rail .desktop-rail-grid {
        flex-direction: row;
        gap: 4px;
    }
    body.nav-rail .desktop-rail-foot {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        flex-direction: row;
        gap: 4px;
        flex-shrink: 0;
    }
    body.nav-rail .desktop-app-divider {
        width: 1px;
        height: 28px;
        margin: 0 2px;
    }
    body.nav-rail .desktop-app-tooltip {
        display: none;
    }
    body.nav-classic .desktop-rail { display: none; }
    .chat-widget { right: 24px; bottom: calc(var(--mobile-rail-height, 68px) + 16px); }
    body.nav-classic .chat-widget { bottom: 24px; }
    .header-mobile-toggle { display: inline-flex !important; }
    body.nav-rail .header-mobile-toggle { display: none !important; }
    .header-profile-name { display: none; }
    .page-body { padding-bottom: 16px; }
    body.nav-rail .page-body { padding-bottom: calc(var(--mobile-rail-height, 68px) + 16px); }
}
@media (max-width: 768px) {
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-chart-wide,
    .dashboard-chart-card,
    .dashboard-health-card { grid-column: span 12; }
    .dashboard-exec-header { flex-direction: column; }
    .dashboard-chart-body { height: 220px; }
    .form-row { grid-template-columns: 1fr; }
    .page-body { padding: 16px; }
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.3s ease; }

/* Wave animation for login */
.wave-container { position: absolute; bottom: 0; left: 0; right: 0; height: 120px; overflow: hidden; opacity: 0.15; }
.wave { position: absolute; bottom: 0; left: 0; width: 200%; height: 100%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'%3E%3Cpath d='M0,60 C300,120 600,0 900,60 C1050,90 1150,30 1200,60 L1200,120 L0,120 Z' fill='white'/%3E%3C/svg%3E") repeat-x; animation: wave 8s linear infinite; }
@keyframes wave { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* Status indicators */
.status-healthy { color: var(--success); }
.status-unhealthy { color: var(--danger); }

/* Page title area */
.page-title { font-size: 22px; font-weight: 700; }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }
.header-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.header-mobile-toggle { display: none !important; }

.header-lang-switch {
    display: inline-flex;
    padding: 3px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    gap: 2px;
}
.header-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 36px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
}
.header-lang-flag {
    display: block;
    width: 22px;
    height: 16px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(19, 34, 56, 0.08);
    flex-shrink: 0;
}
.header-lang-code { line-height: 1; letter-spacing: 0.04em; }
.header-lang-btn:hover { text-decoration: none; color: var(--primary); background: var(--light-blue); }
.header-lang-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.header-lang-btn.active .header-lang-flag {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

@media (min-width: 1025px) {
    .header-lang-switch { display: none; }
}

.lang-switch-drawer {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.lang-drawer-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: all 0.15s ease;
}
.lang-drawer-btn:hover {
    text-decoration: none;
    border-color: rgba(23, 105, 224, 0.35);
    background: var(--light-blue);
}
.lang-drawer-btn.active {
    border-color: var(--primary);
    background: var(--light-blue);
    color: var(--primary);
    font-weight: 600;
}
.lang-drawer-btn .header-lang-code {
    font-size: 14px;
    letter-spacing: 0;
    font-weight: inherit;
}

.lang-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.lang-picker-option { cursor: pointer; }
.lang-picker-option input { position: absolute; opacity: 0; pointer-events: none; }
.lang-picker-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
}
.lang-picker-flag {
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(19, 34, 56, 0.08);
    flex-shrink: 0;
}
.lang-picker-option:hover .lang-picker-card {
    border-color: rgba(23, 105, 224, 0.35);
    background: var(--light-blue);
}
.lang-picker-option input:checked + .lang-picker-card {
    border-color: var(--primary);
    background: var(--light-blue);
    box-shadow: 0 0 0 1px rgba(23, 105, 224, 0.15);
}

.header-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
    max-width: 200px;
    cursor: pointer;
    font: inherit;
}
.header-profile-link:hover {
    text-decoration: none;
    border-color: rgba(23, 105, 224, 0.25);
    box-shadow: var(--shadow-sm);
}
.header-profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.header-profile-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card-link {
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}
.user-card-link:hover,
.user-card-link.active {
    background: var(--light-blue);
    text-decoration: none;
}

/* Tool test panel */
.test-panel { background: var(--bg); border-radius: var(--radius-sm); padding: 16px; margin-top: 16px; }
.test-result { font-family: monospace; font-size: 13px; white-space: pre-wrap; background: #1e293b; color: #e2e8f0; padding: 16px; border-radius: 8px; margin-top: 12px; max-height: 300px; overflow: auto; }

/* Table action buttons */
.table-actions { display: flex; gap: 4px; align-items: center; }
.btn-icon { padding: 6px 8px; min-width: 32px; justify-content: center; }
.btn-icon-danger:hover { background: #FEF3F2; color: var(--danger); }

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal.is-open {
    opacity: 1;
    visibility: visible;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 47, 107, 0.45);
    backdrop-filter: blur(4px);
}
.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 48px);
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transform: translateY(16px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.34, 1.2, 0.64, 1);
    overflow: hidden;
}
.modal.is-open .modal-dialog {
    transform: translateY(0) scale(1);
}
.modal-dialog.modal-lg { max-width: 720px; }
.modal-dialog.modal-sm { max-width: 440px; }
.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 24px 0;
}
.modal-header-text { flex: 1; min-width: 0; }
.modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.modal-icon svg { width: 22px; height: 22px; }
.modal-icon.icon-danger { background: #FEF3F2; color: var(--danger); }
.modal-icon.icon-primary { background: var(--light-blue); color: var(--primary); }
.modal-icon.icon-warning { background: #FFF6ED; color: var(--warning); }
.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}
.modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.modal-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: var(--light-blue); color: var(--primary); }
.modal-close svg { width: 18px; height: 18px; }
.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}
.modal-body:empty { padding-top: 0; }
.modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--border);
}
.modal-message {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.modal-message strong { color: var(--text-primary); font-weight: 600; }
.modal-form-grid { display: flex; flex-direction: column; gap: 0; }
.modal-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}
.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    gap: 12px;
}
.modal-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
body.modal-open { overflow: hidden; }
body.wellness-open { overflow: hidden; }

.kpi-card-live {
    box-shadow: 0 0 0 2px rgba(247, 144, 9, 0.35), var(--shadow-md);
}
.kpi-card-live .kpi-value {
    color: var(--warning);
}

/* Active call toast notifications (Apple-style) */
.call-toast-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(360px, calc(100vw - 36px));
    pointer-events: none;
}
body.nav-rail .call-toast-stack {
    right: calc(var(--desktop-rail-width) + 18px);
}
.call-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow:
        0 10px 32px rgba(19, 34, 56, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
    color: var(--text-primary);
    text-decoration: none;
    pointer-events: auto;
    transform: translateX(120%) scale(0.96);
    opacity: 0;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}
.call-toast.is-visible {
    transform: translateX(0) scale(1);
    opacity: 1;
}
.call-toast.is-leaving {
    transform: translateX(120%) scale(0.96);
    opacity: 0;
}
.call-toast:hover {
    text-decoration: none;
    background: rgba(255, 255, 255, 0.82);
}
.call-toast-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #12B76A, #1769E0);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(23, 105, 224, 0.25);
}
.call-toast-icon svg { width: 18px; height: 18px; }
.call-toast-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.call-toast-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--deep-blue);
    line-height: 1.3;
}
.call-toast-meta {
    font-size: 11px;
    font-weight: 600;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.call-toast-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.call-toast-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(19, 34, 56, 0.06);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.15s ease;
}
.call-toast-close:hover {
    background: rgba(19, 34, 56, 0.12);
    color: var(--text-primary);
}
@media (max-width: 1024px) {
    body.nav-rail .call-toast-stack {
        right: 18px;
        top: 14px;
    }
}

/* Wellness break popup + mini game */
.wellness-break {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.wellness-break.is-open {
    opacity: 1;
    visibility: visible;
}
.wellness-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 47, 107, 0.45);
    backdrop-filter: blur(6px);
}
.wellness-dialog {
    position: relative;
    width: min(440px, 92vw);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 28px 24px 24px;
    transform: translateY(16px) scale(0.98);
    transition: transform 0.25s ease;
}
.wellness-break.is-open .wellness-dialog {
    transform: translateY(0) scale(1);
}
.wellness-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wellness-close:hover { background: var(--light-blue); color: var(--primary); }
.wellness-close svg { width: 18px; height: 18px; }
.wellness-body {
    text-align: center;
    padding: 8px 12px 24px;
}
.wellness-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #EAF3FF, #D6E8FF);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.wellness-icon svg { width: 28px; height: 28px; }
.wellness-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--deep-blue);
    margin-bottom: 10px;
    line-height: 1.35;
}
.wellness-tip {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 360px;
    margin: 0 auto;
}
.wellness-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Desktop app rail (right) */
.desktop-rail {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--desktop-rail-width);
    z-index: 90;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}
.desktop-rail-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 15%, rgba(82, 167, 255, 0.35), transparent 45%),
        radial-gradient(circle at 80% 85%, rgba(23, 105, 224, 0.28), transparent 50%),
        linear-gradient(180deg, #0a2347 0%, #0f3d7a 42%, #1769e0 100%);
}
.desktop-rail-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 14px 14px;
    opacity: 0.35;
    pointer-events: none;
}
.desktop-rail-inner {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 10px 8px;
}
.desktop-rail-brand {
    display: block;
    text-align: center;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    line-height: 1.25;
    padding: 6px 4px 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    word-break: break-word;
}
.desktop-rail-brand:hover {
    color: #fff;
    text-decoration: none;
}
.desktop-rail-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}
.desktop-rail-scroll::-webkit-scrollbar { width: 3px; }
.desktop-rail-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
}
.desktop-rail-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.desktop-app {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 12px;
    text-decoration: none;
    color: #fff;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s ease, background 0.15s ease;
    width: 100%;
}
.desktop-app:hover {
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}
.desktop-app.active .desktop-app-icon {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 6px 16px rgba(0, 0, 0, 0.22);
}
.desktop-app-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    transition: box-shadow 0.15s ease, background 0.15s ease;
}
.desktop-app-icon svg { width: 18px; height: 18px; }
.desktop-app-divider {
    display: block;
    height: 1px;
    margin: 4px 8px;
    background: rgba(255, 255, 255, 0.16);
    flex-shrink: 0;
}
.desktop-app-tooltip {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--text-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    box-shadow: var(--shadow-md);
    z-index: 5;
}
.desktop-app-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -4px;
    width: 8px;
    height: 8px;
    background: var(--text-primary);
    transform: translateY(-50%) rotate(45deg);
}
.desktop-app:hover .desktop-app-tooltip,
.desktop-app:focus-visible .desktop-app-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}
.desktop-app-icon-profile {
    background: var(--gradient);
    font-size: 14px;
    font-weight: 700;
}
.desktop-app-badge {
    position: absolute;
    top: 0;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.desktop-rail-foot {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 480;
}
.profile-menu-backdrop[hidden] {
    display: none !important;
}
.profile-menu {
    position: fixed;
    z-index: 481;
    width: min(320px, calc(100vw - 24px));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(19, 34, 56, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}
.profile-menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
.profile-menu-header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.profile-menu-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.profile-menu-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.profile-menu-user-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.profile-menu-user-meta strong {
    font-size: 15px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-menu-user-meta span {
    font-size: 12px;
    color: var(--text-secondary);
}
.profile-menu-nav {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.profile-menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.profile-menu-link svg { width: 18px; height: 18px; color: var(--text-secondary); flex-shrink: 0; }
.profile-menu-link:hover {
    text-decoration: none;
    background: var(--light-blue);
    color: var(--primary);
}
.profile-menu-link:hover svg { color: var(--primary); }
.profile-menu-link.active {
    background: var(--light-blue);
    color: var(--primary);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary);
}
.profile-menu-link.active svg { color: var(--primary); }
.profile-menu-section {
    padding: 4px 8px 10px;
    border-top: 1px solid var(--border);
}
.profile-menu-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 8px 8px 6px;
}
.profile-menu-foot {
    padding: 8px 8px 12px;
    border-top: 1px solid var(--border);
}
.profile-menu-logout { color: var(--danger); }
.profile-menu-logout svg { color: var(--danger); }
.profile-menu-logout:hover {
    background: rgba(240, 68, 56, 0.08);
    color: var(--danger);
}

/* Chat widget */
body.chat-open {
    overflow: hidden;
}
.chat-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(19, 34, 56, 0.42);
    z-index: 500;
    backdrop-filter: blur(4px);
    border: none;
    padding: 0;
    margin: 0;
    cursor: default;
    pointer-events: auto;
    animation: chatBackdropIn 0.22s ease;
}
.chat-backdrop[hidden] {
    display: none !important;
}
.chat-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1100;
    pointer-events: none;
}
.chat-widget .chat-fab {
    pointer-events: auto;
}
.chat-panel {
    position: fixed;
    z-index: 501;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 24px 64px rgba(19, 34, 56, 0.22);
    display: none;
    flex-direction: column;
    overflow: hidden;
    pointer-events: auto;
    transition: width 0.28s ease, height 0.28s ease, transform 0.28s ease;
}
.chat-panel[hidden] {
    display: none !important;
}
.chat-panel.is-open:not([hidden]) {
    display: flex;
    animation: chatModalIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes chatBackdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes chatModalIn {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)) scale(0.96); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
body.chat-open .chat-widget .chat-fab {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85);
}
.chat-fab {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: var(--gradient);
    color: #fff;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.15s ease;
}
.chat-fab:hover { transform: scale(1.05); }
.chat-fab svg { width: 26px; height: 26px; }
.chat-fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (max-width: 1024px) {
    .profile-menu {
        width: min(320px, calc(100vw - 24px));
        left: 12px !important;
        right: 12px !important;
        top: auto !important;
        bottom: calc(var(--mobile-rail-height, 68px) + 12px);
    }
    body.nav-classic .profile-menu {
        bottom: 12px;
    }
    body.nav-classic .chat-panel,
    body.nav-rail .chat-panel {
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translate(-50%, -50%);
        width: calc(100vw - 32px);
        height: min(520px, calc(100vh - 120px));
        max-height: calc(100vh - 120px);
        border-radius: 18px;
    }
    body.nav-classic .chat-panel.is-expanded,
    body.nav-rail .chat-panel.is-expanded {
        width: calc(100vw - 16px);
        height: calc(100vh - 88px);
        max-height: calc(100vh - 88px);
    }
}
.chat-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.chat-panel-title-wrap { flex: 1; min-width: 0; }
.chat-panel-title { font-size: 15px; font-weight: 700; line-height: 1.2; }
.chat-panel-subtitle { font-size: 11px; color: var(--text-secondary); }
.chat-back-btn, .chat-expand-btn, .chat-close-btn {
    width: 34px; height: 34px;
    border: none; border-radius: 10px;
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.chat-back-btn:hover, .chat-expand-btn:hover, .chat-close-btn:hover { background: var(--light-blue); color: var(--primary); }
.chat-back-btn svg, .chat-expand-btn svg, .chat-close-btn svg { width: 18px; height: 18px; pointer-events: none; }
.chat-views { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-view[hidden] { display: none !important; }
.chat-list-toolbar { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.chat-directory-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.chat-directory-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}
.chat-directory-online {
    font-size: 11px;
    font-weight: 600;
    color: var(--success);
}
.chat-staff-list, .chat-thread-list, .chat-user-list { flex: 1; overflow-y: auto; min-height: 0; }
.chat-staff-item, .chat-thread-item, .chat-user-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}
.chat-thread-item:hover, .chat-user-item:hover, .chat-staff-item:hover { background: rgba(234, 243, 255, 0.5); }
.chat-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.chat-presence-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid var(--surface);
    background: var(--text-secondary);
}
.chat-presence-dot.is-online { background: var(--success); }
.chat-presence-dot.is-away { background: var(--warning); }
.chat-presence-dot.is-offline { background: #98a2b3; }
.chat-staff-presence {
    display: block;
    font-size: 12px;
    margin-top: 2px;
}
.chat-staff-presence.is-online { color: var(--success); }
.chat-staff-presence.is-away { color: var(--warning); }
.chat-staff-presence.is-offline { color: var(--text-secondary); }
.chat-presence-subtitle.is-online { color: var(--success); font-weight: 500; }
.chat-presence-subtitle.is-away { color: var(--warning); }
.chat-presence-subtitle.is-offline { color: var(--text-secondary); }
.chat-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.chat-thread-body { flex: 1; min-width: 0; }
.chat-thread-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.chat-thread-preview { display: block; font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-thread-time { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.chat-unread {
    min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: 10px; background: var(--primary); color: #fff;
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.chat-user-role { display: block; font-size: 12px; color: var(--text-secondary); }
.chat-empty { padding: 24px; text-align: center; color: var(--text-secondary); font-size: 13px; }
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg);
}
.chat-msg {
    max-width: 82%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
}
.chat-msg.mine {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg.theirs {
    align-self: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}
.chat-msg-text { white-space: pre-wrap; word-break: break-word; }
.chat-msg-time { display: block; font-size: 10px; opacity: 0.75; margin-top: 4px; text-align: right; }
.chat-msg-image img { max-width: 200px; border-radius: 10px; display: block; margin-top: 4px; }
.chat-msg-file {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 4px; font-size: 13px; color: inherit;
    text-decoration: none;
}
.chat-msg-file:hover { text-decoration: underline; }
.chat-compose {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.chat-input { flex: 1; padding: 10px 12px !important; font-size: 14px !important; }
.chat-icon-btn, .chat-send-btn {
    width: 38px; height: 38px;
    border: none; border-radius: 12px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.chat-icon-btn { background: var(--bg); color: var(--text-secondary); }
.chat-icon-btn:hover { background: var(--light-blue); color: var(--primary); }
.chat-send-btn { background: var(--primary); color: #fff; }
.chat-send-btn:hover { background: #1258c4; }
.chat-icon-btn svg, .chat-send-btn svg { width: 18px; height: 18px; }

@media (min-width: 1025px) {
    body.nav-rail .chat-fab { display: none; }

    body.nav-classic .chat-panel,
    body.nav-rail .chat-panel {
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translate(-50%, -50%);
        width: min(440px, calc(100vw - 48px));
        height: min(580px, calc(100vh - 80px));
        max-width: none;
        max-height: none;
        border-radius: 20px;
    }

    body.nav-classic .chat-panel.is-expanded,
    body.nav-rail .chat-panel.is-expanded {
        width: min(960px, calc(100vw - 48px));
        height: min(760px, calc(100vh - 48px));
    }

    body.nav-classic .chat-panel.is-expanded .chat-messages {
        padding: 20px 24px;
    }
}

.nav-layout-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}
.nav-layout-option {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.nav-layout-option:hover {
    border-color: #c8d8ef;
    background: var(--bg);
}
.nav-layout-option.is-selected,
.nav-layout-option:has(input:checked) {
    border-color: var(--primary);
    background: var(--light-blue);
}
.nav-layout-option input {
    margin-top: 4px;
    accent-color: var(--primary);
}
.nav-layout-option-preview {
    width: 56px;
    height: 42px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.nav-layout-preview-rail::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 14px;
    background: linear-gradient(180deg, #0a2347, #1769e0);
}
.nav-layout-preview-rail::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 3px;
    width: 8px;
    height: 8px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.45);
    box-shadow: 0 14px 0 rgba(255, 255, 255, 0.35), 0 28px 0 rgba(255, 255, 255, 0.35);
}
.nav-layout-preview-classic::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 16px;
    background: var(--surface);
    border-right: 1px solid var(--border);
}
.nav-layout-preview-classic::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 4px;
    width: 8px;
    height: 3px;
    border-radius: 2px;
    background: var(--primary);
    box-shadow: 0 8px 0 var(--text-secondary), 0 16px 0 var(--text-secondary), 0 24px 0 var(--text-secondary);
}
.nav-layout-option-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.nav-layout-option-body strong {
    font-size: 14px;
    color: var(--text-primary);
}
.nav-layout-option-body span:last-child {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

@media (max-width: 768px) {
    .chat-widget { right: 16px; bottom: 16px; }
}

.call-report-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.call-report-hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.call-report-hero-badges .badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; }
.call-report-hero-badges .badge svg { width: 14px; height: 14px; }
.call-report-title { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.call-report-meta { font-size: 14px; color: var(--text-secondary); }
.conversion-ring { position: relative; width: 96px; height: 96px; flex-shrink: 0; }
.conversion-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.conversion-ring .ring-bg { fill: none; stroke: var(--border); stroke-width: 3; }
.conversion-ring .ring-fill { fill: none; stroke-width: 3; stroke-linecap: round; }
.conversion-ring .ring-high { stroke: var(--success); }
.conversion-ring .ring-medium { stroke: var(--warning); }
.conversion-ring .ring-low { stroke: var(--danger); }
.conversion-ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; color: var(--text-secondary); }
.conversion-ring-label strong { font-size: 20px; color: var(--text-primary); line-height: 1; }
.call-summary-text { font-size: 15px; line-height: 1.75; color: var(--text-primary); margin-bottom: 16px; }
.insight-list { list-style: none; padding: 0; margin: 0; }
.insight-list li { font-size: 13px; color: var(--text-secondary); padding: 8px 0; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.insight-list li::before { content: '•'; color: var(--primary); font-weight: 700; }
.recommendation-box { padding: 16px 18px; border-radius: var(--radius-sm); font-size: 14px; line-height: 1.6; }
.recommendation-high { background: #ECFDF3; color: #027A48; border: 1px solid #A6F4C5; }
.recommendation-medium { background: #FFF6ED; color: #B54708; border: 1px solid #FECDCA; }
.recommendation-low { background: #FEF3F2; color: #B42318; border: 1px solid #FECDCA; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; padding: 5px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.chip-topic { background: var(--light-blue); color: var(--primary); border-color: #B2DDFF; }
.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
.rank-list li svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; }
.rank-list-numbered li { justify-content: space-between; }
.rank-num { width: 24px; height: 24px; background: var(--light-blue); color: var(--primary); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.rank-name { flex: 1; font-weight: 500; }
.rank-count { font-size: 12px; color: var(--text-secondary); }
.sentiment-bars { display: flex; flex-direction: column; gap: 16px; }
.sentiment-bar-row { display: grid; grid-template-columns: 100px 1fr 80px; align-items: center; gap: 12px; }
.sentiment-bar-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.sentiment-bar-label svg { width: 16px; height: 16px; }
.sentiment-bar-track { height: 10px; background: var(--bg); border-radius: 10px; overflow: hidden; }
.sentiment-bar-fill { height: 100%; border-radius: 10px; transition: width 0.5s ease; }
.fill-primary { background: var(--primary); }
.fill-success { background: var(--success); }

.fill-warning { background: var(--warning); }
.fill-danger { background: var(--danger); }
.sentiment-bar-pct { font-size: 12px; color: var(--text-secondary); text-align: right; }

/* Usage & cost page */
.usage-page { max-width: 100%; }
.usage-page-intro {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}
.usage-kpi-section { margin-bottom: 24px; }
.usage-kpi-primary,
.usage-kpi-secondary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}
.usage-kpi-secondary { margin-bottom: 0; }
.usage-kpi-primary .kpi-card { min-height: 148px; }
.usage-kpi-secondary .kpi-card {
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.usage-kpi-secondary .kpi-value { font-size: 22px; }
.usage-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 24px;
    align-items: stretch;
}
.usage-grid-2 .card {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.usage-grid-2 .card-body { flex: 1; }
.usage-day-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) minmax(88px, auto);
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.usage-day-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.usage-day-value {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: right;
    line-height: 1.35;
    word-break: break-word;
}
.usage-table-card .card-body { padding: 0; }
.usage-table-card .table-wrapper { border-radius: 0 0 var(--radius) var(--radius); }
@media (max-width: 1200px) {
    .usage-kpi-primary,
    .usage-kpi-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .usage-kpi-primary,
    .usage-kpi-secondary { grid-template-columns: 1fr; }
    .usage-grid-2 { grid-template-columns: 1fr; }
    .usage-day-row { grid-template-columns: 48px minmax(0, 1fr); }
    .usage-day-value { grid-column: 2; text-align: left; margin-top: -4px; }
}

.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-item { display: flex; gap: 12px; padding: 10px 12px; background: var(--bg); border-radius: var(--radius-sm); }
.timeline-time { font-size: 11px; font-weight: 600; color: var(--text-secondary); min-width: 36px; padding-top: 2px; }
.timeline-content strong { display: block; font-size: 13px; margin-bottom: 2px; }
.timeline-content p { font-size: 13px; color: var(--text-secondary); margin: 0; }
.timeline-user { border-left: 3px solid var(--primary); }
.timeline-tool { border-left: 3px solid var(--warning); }
.transcript-msg.tool { background: #FFF6ED; margin-right: 40px; font-size: 13px; color: var(--text-secondary); }
.card-header h3 { display: flex; align-items: center; gap: 8px; }
.card-header h3 svg { width: 18px; height: 18px; color: var(--primary); }

/* Role management */
.role-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.role-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.role-card-header { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.role-card-header h4 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.role-card-header p { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.role-card-header .badge { margin-left: auto; flex-shrink: 0; }
.role-card-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.role-card-icon svg { width: 20px; height: 20px; }
.role-card-purple .role-card-icon { background: #F4F3FF; color: #7A5AF8; }
.role-card-blue .role-card-icon { background: var(--light-blue); color: var(--primary); }
.role-card-green .role-card-icon { background: #ECFDF3; color: var(--success); }
.role-card-orange .role-card-icon { background: #FFF6ED; color: var(--warning); }
.role-card-gray .role-card-icon { background: var(--bg); color: var(--text-secondary); }
.role-card-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; max-height: 220px; overflow-y: auto; }
.role-menu-group-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); margin-bottom: 6px; }
.role-menu-preview { margin-top: 4px; padding: 12px; background: var(--bg); border-radius: var(--radius-sm); }
.role-preview-group { margin-bottom: 10px; }
.role-preview-group strong { display: block; font-size: 11px; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-avatar-sm { width: 32px; height: 32px; font-size: 13px; }
table.role-matrix th { font-size: 11px; white-space: nowrap; }
table.role-matrix td { text-align: center; }
.matrix-cell { width: 80px; }
.matrix-yes { width: 18px; height: 18px; color: var(--success); }
.matrix-no { color: var(--border); font-size: 16px; }

/* Global page loader */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s;
}
.page-loader.is-active {
    opacity: 1;
    visibility: visible;
}
.page-loader-veil {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(23, 105, 224, 0.08) 0%, transparent 60%),
        rgba(246, 249, 252, 0.88);
    backdrop-filter: blur(12px) saturate(1.2);
}
.page-loader-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    overflow: hidden;
    z-index: 2;
    opacity: 0.9;
}
.page-loader-line span {
    display: block;
    height: 100%;
    width: 45%;
    background: linear-gradient(90deg, transparent, var(--primary) 30%, #52A7FF 70%, transparent);
    box-shadow: 0 0 20px rgba(23, 105, 224, 0.45);
    animation: pageLoaderLine 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes pageLoaderLine {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(280%); }
}
.page-loader-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 36px 44px 32px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 28px;
    box-shadow:
        0 32px 64px rgba(11, 47, 107, 0.1),
        0 0 0 1px rgba(23, 105, 224, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(12px) scale(0.96);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.35s ease;
}
.page-loader.is-active .page-loader-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.page-loader-glow {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(23, 105, 224, 0.18) 0%, transparent 68%);
    pointer-events: none;
    animation: loaderGlow 2.4s ease-in-out infinite;
}
@keyframes loaderGlow {
    0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(0.95); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}
.page-loader-lottie {
    width: 112px;
    height: 112px;
    position: relative;
    z-index: 1;
}
.page-loader-caption {
    display: flex;
    align-items: baseline;
    gap: 2px;
    margin: 4px 0 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--deep-blue);
}
.page-loader-caption-main {
    background: linear-gradient(135deg, var(--deep-blue), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-loader-caption-dots {
    display: inline-flex;
    gap: 3px;
    margin-left: 1px;
}
.page-loader-caption-dots i {
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.35;
    animation: loaderDot 1.2s ease-in-out infinite;
}
.page-loader-caption-dots i:nth-child(2) { animation-delay: 0.15s; }
.page-loader-caption-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes loaderDot {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}
body.is-loading {
    overflow: hidden;
    cursor: wait;
}
body.is-loading .app-layout {
    pointer-events: none;
}

