/* TingTing Calls - RingCentral-style UI */
/* Clean, professional call center interface */

:root {
    /* ===== UNIFIED TINGTING COLOR SYSTEM ===== */
    
    /* Primary - Muted purple (dark theme accent) */
    --primary: #6F52A1;
    --primary-dark: #5A4380;
    --primary-light: #8B6FC4;
    --primary-lighter: #A78BFA;
    --primary-bg: rgba(111, 82, 161, 0.2);
    --primary-bg-light: rgba(111, 82, 161, 0.12);
    
    /* Secondary */
    --secondary: #1F2937;
    --secondary-light: #374151;
    
    /* Status Colors */
    --success: #059669;
    --success-light: #D1FAE5;
    --warning: #D97706;
    --warning-light: #FEF3C7;
    --danger: #DC2626;
    --danger-light: #FEE2E2;
    --info: #0284C7;
    --info-light: #E0F2FE;
    
    /* Neutrals */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --bg-hover: #F3F4F6;
    --bg-active: #EDE9FE;
    
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --text-light: #D1D5DB;
    
    --border-color: #E5E7EB;
    --border-light: #F3F4F6;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    
    /* Sizes */
    --icon-rail-width: 64px;
    --sidebar-width: 260px;
    --topbar-height: 56px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    background: #F3F4F6;
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow: hidden;
}

/* ===== UNIFIED TINGTING UI OVERRIDES ===== */

/* Brand Logo */
.brand-logo {
    background: transparent;
}

/* Navigation - Active States */
.rail-item.active {
    background: var(--primary);
    color: white;
}

.rail-item.active::before {
    display: none;
}

/* Top Navigation Bar */
.topbar {
    background: rgb(23, 23, 23);
}

/* Sidebar Active Item */
.sidebar-item.active {
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 600;
}

/* Primary Button */
.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* Recording Play Button */
.recording-play-btn {
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(91, 33, 182, 0.25);
}

/* Call Window Header */
.call-window-header {
    background: var(--primary);
}

/* Call Avatar */
.call-avatar-large {
    background: var(--primary);
    box-shadow: 0 8px 24px rgba(91, 33, 182, 0.25);
}

/* Active Action Button */
.call-action-btn.active .action-icon-wrapper {
    background: var(--primary);
}

/* Mini Expand Button */
.mini-expand-btn {
    background: var(--primary);
}

.mini-expand-btn:hover {
    background: var(--primary-dark);
}

/* Checkbox Styles */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    user-select: none;
}

.checkbox-container input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label {
    color: var(--text-primary);
}

/* Modal Body Adjustments */
.modal-body {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding: 24px;
}

/* Action Buttons Container */
.contact-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Tabs Navigation */
.nav-tabs {
    display: flex;
    gap: 14px;
    padding: 0 28px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 20;
    flex-wrap: wrap;
}

.nav-tab {
    padding: 14px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none !important;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.nav-tab:hover {
    color: var(--accent-purple);
    text-decoration: none !important;
}

.nav-tab.active {
    color: var(--accent-purple);
    border-bottom-color: var(--accent-purple);
}

.nav-tab-badge {
    padding: 2px 6px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.nav-tab.active .nav-tab-badge {
    background: var(--primary-bg);
    color: var(--primary);
}

.dashboard-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: #F3F4F6;
}

/* Icon Rail (thin left strip) - Dark theme */
.icon-rail {
    width: var(--icon-rail-width);
    background: rgb(30, 30, 30);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: calc(var(--topbar-height) + 12px) 0 12px;
    flex-shrink: 0;
    z-index: 100;
    position: relative;
}


.icon-rail-logo {
    width: 32px;
    height: 32px;
    margin-bottom: 24px;
    object-fit: contain;
}

.icon-rail-brand {
    margin-bottom: 24px;
    padding: 0 8px;
    display: flex;
    justify-content: center;
}

.brand-logo {
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo svg {
    width: 22px;
    height: 22px;
    color: white;
}

.icon-rail-logo-img {
    width: 36px;
    height: auto;
    display: block;
}

.icon-rail-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding: 0 8px;
}

.rail-item {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: rgb(187, 187, 187);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
    text-decoration: none;
}

.rail-item-button {
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
}

.rail-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.rail-item:active {
    transform: scale(0.92);
}

.rail-item.active {
    background: rgb(111, 82, 161);
    color: white;
}

.rail-item.active::before {
    display: none;
}

.rail-item svg {
    width: 24px;
    height: 24px;
}

.icon-rail-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 8px;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #FFFFFF;
    border-right: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    color: #374151;
}

.sidebar-section-header:hover {
    background: #F9FAFB;
}

.sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B7280;
}

.sidebar-section-title svg {
    width: 16px;
    height: 16px;
}

.sidebar-section-chevron {
    width: 16px;
    height: 16px;
    color: #6B7280;
    transition: transform 0.2s ease;
}

.sidebar-section.collapsed .sidebar-section-chevron {
    transform: rotate(-90deg);
}

.sidebar-section.collapsed .sidebar-section-content {
    display: none;
}

.sidebar-section-content {
    padding-bottom: 0.5rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 42px;
    color: #4B5563;
    text-decoration: none;
    font-size: 13.5px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.sidebar-item a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.sidebar-item:active {
    transform: scale(0.98);
}

.sidebar-item:hover {
    background: #F3F4F6;
}

.sidebar-item.active {
    background: #EBF5FF;
    color: var(--primary);
    font-weight: 600;
}

.sidebar-item-badge {
    margin-left: auto;
    background: #E02020;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* Top Bar */
.topbar {
    height: var(--topbar-height);
    background: linear-gradient(135deg, #18181B 0%, #111827 55%, #111827 100%);
    display: flex;
    align-items: center;
    padding: 0 18px;
    gap: 20px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    flex-shrink: 0;
}

.topbar-logo {
    height: 22px;
    width: auto;
    max-width: 120px;
    display: block;
    object-fit: contain;
}

.topbar-brand-sep {
    opacity: 0.7;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
}

.topbar-brand-connect {
    letter-spacing: 0.08em;
    font-weight: 700;
    color: white;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.topbar-nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
}

.topbar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: white;
    transform: translateY(-1px);
}

.topbar-search {
    flex: 1;
    max-width: 600px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-input-wrapper svg {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: white;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(139, 111, 196, 0.5);
    box-shadow: 0 0 0 4px rgba(111, 82, 161, 0.2);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.2s ease;
}

.topbar-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #F59E0B;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.dnd-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dnd-indicator.active {
    display: flex;
    background: #FEE2E2;
    color: #E02020;
}

.dnd-indicator svg {
    width: 14px;
    height: 14px;
}

/* Content Area */
.content-area {
    flex: 1;
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, #FFFFFF 100%);
    margin: 0 16px 16px;
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    min-height: 0;
}

/* Content Card */
.content-card {
    background: #FFFFFF;
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    margin-bottom: 24px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.content-card:hover {
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.09);
}

.content-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.content-card .card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.content-card .card-body {
    padding: 24px;
}

.app-shell-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: rgba(17, 24, 39, 0.98);
    border: 1px solid rgba(139, 111, 196, 0.25);
    border-radius: 16px;
    box-shadow: 0 22px 44px rgba(2, 6, 23, 0.45);
    z-index: 1200;
    overflow: hidden;
}

.app-shell-results__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.72);
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.app-shell-results__hint {
    color: rgba(196, 181, 253, 0.95);
}

.app-shell-results__list {
    max-height: 360px;
    overflow-y: auto;
    padding: 8px;
}

.app-shell-route-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #F8FAFC;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, transform 0.15s ease;
}

.app-shell-route-btn:hover,
.app-shell-route-btn.active {
    background: rgba(111, 82, 161, 0.2);
    transform: translateY(-1px);
}

.app-shell-route-btn__meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.app-shell-route-btn__label {
    font-size: 13px;
    font-weight: 600;
}

.app-shell-route-btn__desc {
    font-size: 12px;
    color: rgba(203, 213, 225, 0.78);
}

.app-shell-route-btn__path {
    flex-shrink: 0;
    font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 11px;
    color: rgba(196, 181, 253, 0.95);
}

.app-shell-route-empty {
    padding: 18px 16px;
    color: rgba(203, 213, 225, 0.78);
    font-size: 12px;
}

.app-shell-help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.58);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1400;
}

.app-shell-help-overlay[hidden] {
    display: none !important;
}

.app-shell-help-card {
    width: min(760px, 100%);
    background: #FFFFFF;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 22px;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.24);
    overflow: hidden;
}

.app-shell-help-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.app-shell-help-card__eyebrow {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-purple);
    font-weight: 700;
    margin-bottom: 6px;
}

.app-shell-help-card__header h2 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.3;
}

.app-shell-help-close {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: #F8FAFC;
    color: #334155;
    cursor: pointer;
}

.app-shell-help-close svg {
    width: 18px;
    height: 18px;
}

.app-shell-help-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    padding: 22px 24px 24px;
}

.app-shell-help-section h3 {
    margin: 0 0 12px;
    font-size: 0.95rem;
}

.app-shell-help-item {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(241, 245, 249, 0.95);
}

.app-shell-help-section p {
    margin: 0 0 10px;
    color: #475569;
    line-height: 1.6;
    font-size: 13px;
}

.app-shell-help-card kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(203, 213, 225, 0.95);
    background: #F8FAFC;
    color: #0F172A;
    font-size: 11px;
    font-weight: 700;
}

.app-shell-modal-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .app-shell-help-grid {
        grid-template-columns: 1fr;
    }
}

/* Admin Forms */
.admin-form {
    max-width: 600px;
}

.form-section {
    margin-bottom: 32px;
}

.form-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6B7280;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-title svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.form-group label .required {
    color: #E02020;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: #111827;
    background: white;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    transition: all 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-hint {
    font-size: 0.8125rem;
    color: #6B7280;
    margin-top: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Transport Options */
.transport-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 12px;
}

.transport-card {
    position: relative;
    padding: 20px;
    background: #F9FAFB;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
}

.transport-card:hover {
    border-color: var(--primary);
    background: #F0EFF8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.1);
}

.transport-card.selected {
    border-color: var(--primary);
    background: #F0EFF8;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.transport-card.selected:hover {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2), 0 4px 12px rgba(124, 58, 237, 0.15);
}

.transport-card input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
    z-index: 1;
}

.transport-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.transport-card.selected .transport-icon {
    background: var(--primary);
}

.transport-icon svg {
    width: 24px;
    height: 24px;
    color: #6B7280;
}

.transport-card.selected .transport-icon svg {
    color: white;
}

.transport-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.transport-desc {
    font-size: 0.75rem;
    color: #6B7280;
}

/* Action Buttons */
.action-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.action-btn:hover {
    background: #F3F4F6;
    color: #111827;
}

.action-btn.danger:hover {
    background: #FEE2E2;
    color: #E02020;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.875rem;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #F3F4F6;
}

.content-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.filter-btn svg {
    width: 16px;
    height: 16px;
}

/* Call History List */
.call-history-list {
    flex: 1;
    overflow-y: auto;
}

.call-history-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.call-history-item:hover {
    background: var(--bg-hover);
}

.call-history-item:last-child {
    border-bottom: none;
}

.call-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
    margin-right: 1rem;
    overflow: hidden;
}

.call-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.call-avatar.orange { background: #F5A623; }
.call-avatar.blue { background: var(--primary); }
.call-avatar.green { background: #00A650; }
.call-avatar.purple { background: #7B1FA2; }
.call-avatar.red { background: #E02020; }

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

.call-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.call-name.missed {
    color: var(--danger);
}

.call-number {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.call-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    flex-shrink: 0;
}

.call-type-icon {
    width: 20px;
    height: 20px;
}

.call-type-icon.inbound { color: var(--success); }
.call-type-icon.outbound { color: var(--primary); }
.call-type-icon.missed { color: var(--danger); }

.call-type-text {
    font-size: 0.875rem;
}

.call-type-text.missed {
    color: var(--danger);
}

.call-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
    margin-left: 1rem;
    flex-shrink: 0;
}

.call-duration {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.call-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.call-recording-icon {
    font-size: 0.75rem;
    color: var(--primary);
    opacity: 0.7;
}

/* Recording Play Button */
.recording-play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(6, 111, 172, 0.3);
}

.recording-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(6, 111, 172, 0.4);
}

.recording-play-btn svg {
    width: 14px;
    height: 14px;
    margin-left: 2px;
}

/* Call Action Small Button */
.call-action-small {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.call-action-small:hover {
    background: var(--success);
    color: white;
}

/* Call Actions Column */
.call-actions {
    display: flex;
    gap: 8px;
    margin-left: 12px;
}

/* Call Details Modal */
.call-details-modal {
    max-width: 480px;
}

.call-details-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}

.call-details-info {
    flex: 1;
}

.call-details-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.call-details-number {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.call-details-meta {
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.detail-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Recording Section */
.call-recording-section {
    background: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #BFDBFE;
}

.recording-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
}

.recording-player {
    margin-bottom: 12px;
}

.recording-player audio {
    width: 100%;
    height: 40px;
    border-radius: 8px;
}

.recording-player audio::-webkit-media-controls-panel {
    background: white;
}

.recording-actions {
    display: flex;
    gap: 8px;
}

/* Recording Modal */
.recording-modal {
    max-width: 500px;
}

.recording-modal .modal-title {
    display: flex;
    align-items: center;
}

.recording-player-large {
    padding: 20px 0;
}

.recording-player-large audio {
    width: 100%;
    height: 48px;
}

/* Recordings Grid */
.recordings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.recording-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s;
}

.recording-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(6, 111, 172, 0.1);
}

.recording-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.recording-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

.recording-avatar.blue { background: var(--primary); }
.recording-avatar.green { background: linear-gradient(135deg, #00A650 0%, #10B981 100%); }
.recording-avatar.red { background: linear-gradient(135deg, #E02020 0%, #EF4444 100%); }

.recording-card-info {
    flex: 1;
    min-width: 0;
}

.recording-card-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recording-card-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.recording-card-player {
    margin-bottom: 12px;
}

.recording-card-player audio {
    width: 100%;
    height: 36px;
    border-radius: 6px;
}

.recording-card-actions {
    display: flex;
    gap: 8px;
}

.recording-card-actions .btn {
    flex: 1;
    justify-content: center;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    min-height: 400px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: #F3F4F6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.empty-state-icon svg,
.empty-state > svg {
    width: 36px;
    height: 36px;
    color: #9CA3AF;
}

.empty-state > svg {
    width: 64px;
    height: 64px;
    color: #D1D5DB;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.375rem;
}

.empty-state-text {
    font-size: 0.875rem;
    color: #6B7280;
}

/* ==================== ACTIVE CALL WINDOW (Full Featured) ==================== */

/* Legacy active-call-overlay - hidden by default, replaced by active-call-fullpage */
.active-call-overlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.active-call-overlay.visible {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Legacy incoming-call-modal - hidden by default */
.incoming-call-modal {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.incoming-call-modal.visible {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.active-call-window {
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.25);
    width: 380px;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
}

.active-call-overlay.visible .active-call-window {
    transform: scale(1) translateY(0);
}

/* Call Window Header */
.call-window-header {
    background: var(--primary);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.call-window-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.call-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4ADE80;
    animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.call-status-indicator.ringing {
    background: #FBBF24;
}

.call-status-indicator.on-hold {
    background: #F97316;
    animation: none;
}

.call-timer {
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

.recording-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(239, 68, 68, 0.9);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recording-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    animation: recording-pulse 1s infinite;
}

@keyframes recording-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.call-minimize-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.call-minimize-btn:hover {
    background: rgba(255,255,255,0.25);
}

/* Call Info Section */
.call-window-info {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
}

.call-avatar-large {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 8px 24px rgba(6, 111, 172, 0.3);
}

.call-info-details {
    text-align: center;
}

.call-name-large {
    font-size: 1.375rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.call-number-large {
    font-size: 0.9375rem;
    color: #6B7280;
    margin-bottom: 8px;
}

.call-label {
    font-size: 0.8125rem;
    color: #9CA3AF;
    font-weight: 500;
}

/* Primary Actions Grid */
.call-window-actions {
    padding: 1rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.call-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 1rem 0.5rem;
    background: #F9FAFB;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.call-action-btn:hover {
    background: #F3F4F6;
    border-color: #E5E7EB;
}

.call-action-btn.active {
    background: #EFF6FF;
    border-color: #BFDBFE;
}

.call-action-btn.active .action-icon-wrapper {
    background: var(--primary);
}

.call-action-btn.active .call-action-icon {
    color: white;
}

.call-action-btn.recording {
    background: #FEF2F2;
    border-color: #FECACA;
}

.call-action-btn.recording .action-icon-wrapper {
    background: #EF4444;
}

.call-action-btn.recording .call-action-icon {
    color: white;
}

.action-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.call-action-icon {
    width: 22px;
    height: 22px;
    color: #374151;
}

.call-action-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6B7280;
}

/* Secondary Actions */
.call-window-secondary {
    padding: 0 1.5rem;
    display: flex;
    gap: 8px;
}

.secondary-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-action-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #374151;
}

.secondary-action-btn svg {
    width: 18px;
    height: 18px;
}

/* End Call Button */
.call-window-end {
    padding: 1.5rem;
    display: flex;
    justify-content: center;
}

.end-call-btn-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.end-call-btn-large:hover {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.end-call-btn-large svg {
    width: 22px;
    height: 22px;
}

/* Legacy support */
.end-call-btn {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--danger);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(224, 32, 32, 0.3);
}

.end-call-btn:hover {
    background: #C71A1A;
    transform: scale(1.05);
}

.end-call-btn svg {
    width: 32px;
    height: 32px;
    color: white;
}

/* ==================== MINIMIZED CALL BAR ==================== */

.minimized-call-bar {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.minimized-call-bar.visible {
    opacity: 1;
    visibility: visible;
}

.mini-call-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mini-call-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
}

.mini-call-text {
    display: flex;
    flex-direction: column;
}

.mini-call-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.mini-call-timer {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.mini-call-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.mini-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mini-action-btn:hover {
    background: var(--border-color);
}

.mini-action-btn.muted {
    background: var(--warning-light);
    color: var(--warning);
}

.mini-action-btn svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.mini-expand-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mini-expand-btn:hover {
    background: var(--primary-dark);
}

.mini-expand-btn svg {
    width: 18px;
    height: 18px;
    color: white;
}

.mini-end-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mini-end-btn:hover {
    background: #C71A1A;
}

.mini-end-btn svg {
    width: 18px;
    height: 18px;
    color: white;
}

/* ==================== DIALPAD PANEL (WINDOW STYLE) ==================== */

.dialpad-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    width: 320px;
    height: 560px;
    min-width: 280px;
    min-height: 520px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dialpad-panel.visible {
    opacity: 1;
    visibility: visible;
}

.dialpad-panel.minimized {
    width: 260px !important;
    height: 48px !important;
    min-height: 0 !important;
    top: auto !important;
    bottom: 24px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.dialpad-panel.minimized .dialpad-content,
.dialpad-panel.minimized .dialpad-resize-handle {
    display: none !important;
}

.dialpad-panel.minimized .dialpad-header {
    margin-bottom: 0;
    height: 100%;
    border-radius: 24px;
}

.dialpad-header {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0 12px 0 18px;
    cursor: move;
    user-select: none;
    flex-shrink: 0;
}

.dialpad-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.dialpad-header-title svg {
    opacity: 0.9;
}

.dialpad-window-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dialpad-window-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.85);
    transition: all 0.15s;
    padding: 0;
}

.dialpad-window-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.dialpad-window-btn.close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.dialpad-window-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
}

.dialpad-content {
    flex: 1;
    padding: 20px 20px 16px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
}

.dialpad-display {
    text-align: center;
    padding: 4px 0;
    margin-bottom: 12px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dial-input {
    font-size: 1.875rem;
    font-weight: 300;
    text-align: center;
    width: 100%;
    border: none;
    background: transparent;
    color: #1a1a2e;
    letter-spacing: 2px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.dial-input::placeholder {
    color: #c0c0c0;
    font-weight: 300;
    letter-spacing: 0;
}

.dial-input:focus {
    outline: none;
}

.dialpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.dial-btn {
    width: 72px;
    height: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f4f5f7;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.12s ease;
    margin: 0 auto;
}

.dial-btn:hover {
    background: #e8eaed;
    transform: scale(1.06);
}

.dial-btn:active {
    background: #dcdfe3;
    transform: scale(0.94);
}

.dial-btn-digit {
    font-size: 1.5rem;
    font-weight: 400;
    color: #1f2937;
    line-height: 1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.dial-btn-letters {
    font-size: 0.5625rem;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 1.5px;
    margin-top: 2px;
    text-transform: uppercase;
}

.dialpad-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-top: auto;
    padding: 16px 0 20px;
}

.dial-call-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.dial-call-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 28px rgba(34, 197, 94, 0.5);
}

.dial-call-btn:active {
    transform: scale(0.95);
}

.dial-call-btn svg {
    width: 28px;
    height: 28px;
    color: white;
}

.dial-backspace-btn {
    position: absolute;
    right: 40px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #9ca3af;
}

.dial-backspace-btn:hover {
    background: #f4f5f7;
    color: #6b7280;
}

.dial-backspace-btn:active {
    background: #e8eaed;
}

.dial-backspace-btn svg {
    width: 22px;
    height: 22px;
}

/* Resize Handle */
.dialpad-resize-handle {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 14px;
    height: 14px;
    cursor: nwse-resize;
    z-index: 10;
    opacity: 0.25;
    transition: opacity 0.2s;
}

.dialpad-resize-handle::before,
.dialpad-resize-handle::after {
    content: '';
    position: absolute;
    background: #9ca3af;
    border-radius: 1px;
}

.dialpad-resize-handle::before {
    width: 10px;
    height: 2px;
    bottom: 0;
    right: 0;
    transform: rotate(-45deg);
    transform-origin: right bottom;
}

.dialpad-resize-handle::after {
    width: 6px;
    height: 2px;
    bottom: 3px;
    right: 0;
    transform: rotate(-45deg);
    transform-origin: right bottom;
}

.dialpad-resize-handle:hover {
    opacity: 0.6;
}

.dialpad-panel.minimized .dialpad-resize-handle {
    display: none;
}

/* ==================== FULL-PAGE INCOMING CALL POPUP ==================== */

.incoming-call-fullpage {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    overflow: hidden;
    pointer-events: none;
}

.incoming-call-fullpage.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.incoming-call-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

.incoming-call-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow-y: auto;
}

.incoming-call-right {
    flex: 1;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.incoming-call-header {
    text-align: center;
    width: 100%;
    max-width: 500px;
}

.incoming-title {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-weight: 500;
}

.incoming-ring-animation {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
}

.ring-pulse {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-full);
    background: var(--success);
    opacity: 0.2;
    animation: ring-pulse-large 1.5s ease-out infinite;
}

.ring-pulse:nth-child(2) {
    animation-delay: 0.5s;
}

.ring-pulse:nth-child(3) {
    animation-delay: 1s;
}

@keyframes ring-pulse-large {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.incoming-avatar-large {
    position: relative;
    width: 160px;
    height: 160px;
    border-radius: var(--radius-full);
    background: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.incoming-avatar-large svg {
    width: 80px;
    height: 80px;
    color: white;
}

.incoming-caller-info {
    margin-top: 2rem;
    text-align: center;
    max-width: 500px;
}

.incoming-caller-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    word-wrap: break-word;
}

.incoming-caller-number {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-family: monospace;
}

.incoming-caller-company {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.incoming-caller-details {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.contact-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    color: var(--text-muted);
}

.loading-spinner-small {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Incoming Actions Grid (similar to active call) */
.incoming-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
    max-width: 500px;
    margin-top: 2rem;
    padding: 0 2rem;
}

.incoming-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.incoming-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.incoming-action-btn.reject-btn {
    border-color: var(--danger);
    color: var(--danger);
}

.incoming-action-btn.reject-btn:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.incoming-action-btn.reject-btn .incoming-action-icon {
    background: rgba(239, 68, 68, 0.1);
}

.incoming-action-btn.reject-btn:hover .incoming-action-icon {
    background: rgba(255, 255, 255, 0.2);
}

.incoming-action-btn.answer-btn {
    border-color: var(--success);
    color: var(--success);
}

.incoming-action-btn.answer-btn:hover {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.incoming-action-btn.answer-btn .incoming-action-icon {
    background: rgba(16, 185, 129, 0.1);
}

.incoming-action-btn.answer-btn:hover .incoming-action-icon {
    background: rgba(255, 255, 255, 0.2);
}

.incoming-action-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.incoming-action-icon svg {
    width: 32px;
    height: 32px;
}

/* Incoming Call Hint */
.incoming-call-hint {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Incoming Status Pill */
.call-status-pill.incoming-status {
    background: var(--info-light);
    color: var(--info);
}

.call-status-dot.ringing {
    background: var(--info);
    animation: pulse-ringing 1s ease-in-out infinite;
}

@keyframes pulse-ringing {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.4;
        transform: scale(1.2);
    }
}

/* Incoming Avatar Pulse Animation */
.incoming-avatar-pulse {
    position: relative;
}

.incoming-avatar-pulse::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 3px solid var(--success);
    opacity: 0.6;
    animation: avatar-pulse-ring 2s ease-out infinite;
}

.incoming-avatar-pulse::after {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    border: 3px solid var(--success);
    opacity: 0.3;
    animation: avatar-pulse-ring 2s ease-out infinite 0.5s;
}

@keyframes avatar-pulse-ring {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }
    50% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.05);
        opacity: 0;
    }
}

/* Legacy large buttons - keep for backwards compatibility */
.incoming-actions-large {
    display: flex !important;
    gap: 2rem;
    margin-top: 3rem;
    position: relative;
    z-index: 100;
    justify-content: center;
}

.incoming-reject-btn-large,
.incoming-answer-btn-large {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    border: none;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 101;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.incoming-reject-btn-large {
    background: var(--danger);
    color: white;
}

.incoming-reject-btn-large:hover {
    background: #C71A1A;
    transform: scale(1.05);
}

.incoming-answer-btn-large {
    background: var(--success);
    color: white;
}

.incoming-answer-btn-large:hover {
    background: #047857;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
}

.incoming-reject-btn-large:active,
.incoming-answer-btn-large:active {
    transform: scale(0.95);
}

.incoming-reject-btn-large svg,
.incoming-answer-btn-large svg {
    width: 48px;
    height: 48px;
}

.call-history-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.call-history-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.call-history-content {
    padding: 2rem;
    flex: 1;
}

.call-history-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.call-history-item {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.call-history-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.call-history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.call-history-item-type {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

.call-history-item-type.inbound {
    background: var(--info-light);
    color: var(--info);
}

.call-history-item-type.outbound {
    background: var(--success-light);
    color: var(--success);
}

.call-history-item-date {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.call-history-item-summary {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
}

.call-history-item-summary.empty {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
    font-style: italic;
}

/* ==================== REDESIGNED CALL HISTORY ==================== */

.call-history-recent {
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--bg-primary) 100%);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 2px solid var(--primary);
    box-shadow: 0 4px 12px rgba(91, 33, 182, 0.1);
}

.call-history-recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.call-history-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
}

.call-history-time {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.call-history-recent-summary {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 1rem;
    min-height: 2.8rem;
}

.call-history-recent-summary.empty {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
    font-style: italic;
}

.call-history-recent-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.call-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.call-type-badge.inbound {
    background: var(--info-light);
    color: var(--info);
}

.call-type-badge.outbound {
    background: var(--success-light);
    color: var(--success);
}

.call-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.call-meta-item svg {
    opacity: 0.7;
}

.call-history-older-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 1rem 0 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.call-history-item-compact {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.call-history-item-compact:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.call-history-compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.call-history-compact-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.call-history-compact-summary {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.call-history-compact-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.call-history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.call-history-empty svg {
    margin-bottom: 1rem;
    opacity: 0.3;
}

.call-history-empty p {
    font-size: 1rem;
    margin: 0;
}

/* Call Summary Modal */
.call-summary-info {
    margin-bottom: 1rem;
}

.call-summary-info > div {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.call-summary-info > div > div:first-child {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.call-summary-info > div > div:last-child {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.call-summary-info > div > div:last-child > div {
    margin-bottom: 0.25rem;
}

/* ==================== FULL-PAGE ACTIVE CALL UI ==================== */

.active-call-fullpage {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    overflow: hidden;
    pointer-events: none;
}

.active-call-fullpage.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.active-call-fullpage-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

.active-call-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 3rem;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative;
}

.active-call-right {
    width: 400px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.active-call-status-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
    justify-content: center;
}

.call-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--success-light);
    color: var(--success);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
}

.call-status-pill.connecting {
    background: var(--warning-light);
    color: var(--warning);
}

.call-status-pill.on-hold {
    background: var(--info-light);
    color: var(--info);
}

.call-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.call-timer-large {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--danger-light);
    color: var(--danger);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.75rem;
}

.recording-dot-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    animation: recording-pulse 1s ease-in-out infinite;
}

@keyframes recording-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

.active-call-contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
    flex: 1;
    justify-content: center;
}

.active-call-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(91, 33, 182, 0.25);
    overflow: hidden;
}

.active-call-avatar svg {
    width: 64px;
    height: 64px;
    color: white;
}

.active-call-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Initials fallback when CRM photo is missing or fails to load (webphone) */
.webphone-avatar-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    letter-spacing: -0.02em;
    user-select: none;
    font-size: 2.75rem;
}

.webphone-avatar-fallback--compact {
    font-size: 1.125rem;
}

.active-call-contact-info {
    text-align: center;
}

.active-call-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.active-call-number {
    font-size: 1.125rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 0.5rem;
}

.active-call-company {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 500;
}

.active-call-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 480px;
}

.active-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}

.active-action-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.active-action-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.active-action-btn.active:hover {
    background: var(--primary-hover);
}

.active-action-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.active-action-btn:hover .active-action-icon {
    background: var(--primary-bg);
}

.active-action-btn.active .active-action-icon {
    background: rgba(255, 255, 255, 0.2);
}

.active-action-icon svg {
    width: 22px;
    height: 22px;
}

.active-action-btn span {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Keypad Modal Styles */
.keypad-modal {
    max-width: 420px;
    width: 90%;
    margin: auto;
}

.keypad-modal .modal-body {
    padding: 1.5rem;
}

/* Legacy inline keypad styles (kept for backward compatibility) */
.active-call-keypad {
    width: 100%;
    max-width: 360px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.active-keypad-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.active-keypad-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.active-keypad-header p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.active-keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
}

.active-keypad-grid .dial-btn {
    width: 100%;
    aspect-ratio: 1;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.active-keypad-grid .dial-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.active-keypad-grid .dial-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.active-keypad-grid .dial-btn span {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
    text-transform: uppercase;
    line-height: 1;
}

.active-keypad-grid .dial-btn[data-digit="*"],
.active-keypad-grid .dial-btn[data-digit="#"] {
    font-size: 1.5rem;
    font-weight: 700;
}

.active-keypad-grid .dial-btn[data-digit="0"] span {
    font-size: 0.75rem;
    font-weight: 600;
}

.active-call-end-section {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.active-end-call-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 3rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
}

.active-end-call-btn:hover {
    background: #C71A1A;
    transform: scale(1.02);
}

.active-end-call-btn svg {
    width: 24px;
    height: 24px;
    transform: rotate(135deg);
}

.minimize-call-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.minimize-call-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.minimize-call-btn svg {
    width: 16px;
    height: 16px;
}

.active-call-right-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.active-call-right-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.active-call-right-content {
    padding: 2rem;
    flex: 1;
}

/* ==================== FLOATING PHONE BUTTON ==================== */

.webphone-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.fab-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(91, 33, 182, 0.4);
    transition: all var(--transition-fast);
}

.fab-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(91, 33, 182, 0.5);
}

.fab-btn svg {
    width: 28px;
    height: 28px;
}

.fab-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
}

.fab-status.connected {
    color: var(--success);
}

.fab-status.disconnected {
    color: var(--danger);
}

/* ==================== FLOATING DIALPAD ==================== */

.floating-dialpad {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 300px;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
}

.floating-dialpad.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-dialpad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
}

.floating-dialpad-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.floating-dialpad-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.floating-dialpad-body {
    padding: 1.5rem;
}

.floating-dial-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 1rem;
}

.floating-dial-input:focus {
    outline: none;
    border-color: var(--primary);
}

.floating-dialpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.floating-dialpad-grid .dial-btn {
    width: 100%;
    height: 50px;
    font-size: 1.25rem;
}

.floating-call-btn {
    width: 100%;
    padding: 0.875rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
}

.floating-call-btn:hover {
    background: #047857;
}

.floating-call-btn svg {
    width: 20px;
    height: 20px;
}

/* ==================== MINIMIZED CALL BAR IMPROVEMENTS ==================== */

.minimized-call-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    gap: 1rem;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    border: 2px solid var(--success);
}

.minimized-call-bar.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mini-call-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mini-call-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.mini-call-text {
    display: flex;
    flex-direction: column;
}

.mini-call-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.mini-call-timer {
    font-size: 0.75rem;
    color: var(--success);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

.mini-call-actions {
    display: flex;
    gap: 0.25rem;
}

.mini-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.mini-action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.mini-action-btn.active {
    background: var(--primary);
    color: white;
}

.mini-action-btn svg {
    width: 16px;
    height: 16px;
}

.mini-expand-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary-bg);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.mini-expand-btn:hover {
    background: var(--primary);
    color: white;
}

.mini-expand-btn svg {
    width: 16px;
    height: 16px;
}

.mini-end-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--danger);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.mini-end-btn:hover {
    background: #C71A1A;
}

.mini-end-btn svg {
    width: 16px;
    height: 16px;
    transform: rotate(135deg);
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .active-call-fullpage-container {
        flex-direction: column;
    }
    
    .active-call-right {
        width: 100%;
        height: 40%;
    }
    
    .active-call-left {
        height: 60%;
    }
    
    .incoming-call-container {
        flex-direction: column;
    }
    
    .incoming-call-right {
        height: 40%;
    }
}

.call-history-item-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.call-history-item-duration {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Legacy small modal styles (kept for backward compatibility) */
.incoming-call-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.incoming-call-modal.visible {
    opacity: 1;
    visibility: visible;
}

.incoming-call-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 320px;
    padding: 2rem;
    text-align: center;
}

.incoming-ring-animation {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 1.5rem;
}

.ring-pulse {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-full);
    background: var(--success);
    opacity: 0.2;
    animation: ring-pulse 1.5s ease-out infinite;
}

.ring-pulse:nth-child(2) {
    animation-delay: 0.5s;
}

.ring-pulse:nth-child(3) {
    animation-delay: 1s;
}

@keyframes ring-pulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.incoming-avatar {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px;
}

.incoming-avatar svg {
    width: 40px;
    height: 40px;
    color: white;
}

.incoming-title {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.incoming-number {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.incoming-actions {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.incoming-reject-btn,
.incoming-answer-btn {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.incoming-reject-btn {
    background: var(--danger);
}

.incoming-reject-btn:hover {
    background: #C71A1A;
    transform: scale(1.05);
}

.incoming-answer-btn {
    background: var(--success);
}

.incoming-answer-btn:hover {
    background: #009040;
    transform: scale(1.05);
}

.incoming-reject-btn svg,
.incoming-answer-btn svg {
    width: 28px;
    height: 28px;
    color: white;
}

/* ==================== MODALS ==================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1010; /* Higher than fullpage call UI (1002) */
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
}

.modal-large {
    max-width: 600px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.25rem;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-tertiary);
}

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

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #C71A1A;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #009040;
}

/* Form Groups in Modals */
.modal-body .form-group {
    margin-bottom: 1rem;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

.modal-body label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

/* Form Inputs */
.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(6, 111, 172, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* ==================== TOAST NOTIFICATIONS ==================== */

.toast-container {
    position: fixed;
    top: calc(var(--topbar-height) + 1rem);
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1100;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toast-in 0.3s ease;
    max-width: 360px;
}

.toast.removing {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.toast-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    flex-shrink: 0;
}

.toast-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ==================== EMPTY STATES ==================== */
/* Note: Primary empty-state styles are defined above in the Empty State section */

/* ==================== AGENT STATUS BADGE ==================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
}

.status-badge.available {
    background: var(--success-light);
    color: var(--success);
}
.status-badge.available .status-dot {
    background: var(--success);
}

.status-badge.busy {
    background: var(--danger-light);
    color: var(--danger);
}
.status-badge.busy .status-dot {
    background: var(--danger);
}

.status-badge.away {
    background: var(--warning-light);
    color: var(--warning);
}
.status-badge.away .status-dot {
    background: var(--warning);
}

.status-badge.offline {
    background: var(--bg-hover);
    color: var(--text-muted);
}
.status-badge.offline .status-dot {
    background: var(--text-muted);
}

/* ==================== QUEUES PANEL ==================== */

.queue-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.queue-card:last-child {
    margin-bottom: 0;
}

.queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.queue-name {
    font-weight: 500;
    color: var(--text-primary);
}

.queue-count {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.queue-stats {
    display: flex;
    gap: 1rem;
}

.queue-stat {
    text-align: center;
}

.queue-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.queue-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==================== SETTINGS PANEL ==================== */

.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 4px;
}

.settings-item:hover {
    background: var(--bg-hover);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.settings-item-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
}

.settings-item-icon svg {
    width: 18px;
    height: 18px;
}

.settings-item-text {
    display: flex;
    flex-direction: column;
}

.settings-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-item-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border-color);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* ==================== SPEED DIAL ==================== */

.speed-dial-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 0.5rem;
}

.speed-dial-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.speed-dial-item:hover {
    background: var(--bg-hover);
}

.speed-dial-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
}

.speed-dial-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.speed-dial-number {
    font-size: 0.625rem;
    color: var(--text-muted);
}

.speed-dial-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    text-align: center;
    grid-column: 1 / -1;
}

/* ==================== ADMIN TABLES ==================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
}

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

.data-table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

.data-table tbody tr {
    cursor: pointer;
    transition: background 0.15s ease;
}

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

.data-table td {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.table-actions {
    display: flex;
    gap: 0.25rem;
}

.table-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.table-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.table-action-btn.danger:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* ==================== ADMIN NAVIGATION & BREADCRUMBS ==================== */

.admin-container {
    animation: adminFadeIn 0.3s ease;
}

@keyframes adminFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
}

.breadcrumb-item {
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s;
}

.breadcrumb-item:hover {
    color: var(--primary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
    cursor: default;
}

.breadcrumb-separator {
    color: var(--text-light);
}

.breadcrumb-separator svg {
    width: 14px;
    height: 14px;
}

/* Admin Menu Items */
.admin-menu {
    padding: 16px 24px;
}

.admin-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-menu-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(6, 111, 172, 0.1);
    transform: translateX(4px);
}

.admin-menu-item:active {
    transform: translateX(2px);
}

.admin-menu-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-menu-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-hover) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-menu-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.admin-menu-text {
    display: flex;
    flex-direction: column;
}

.admin-menu-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.admin-menu-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.admin-menu-chevron {
    color: var(--text-light);
    transition: transform 0.2s;
}

.admin-menu-item:hover .admin-menu-chevron {
    transform: translateX(4px);
    color: var(--primary);
}

/* Admin Header with Back Button */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-back-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.admin-back-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.admin-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.admin-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ==================== AGENT CARD ==================== */

.agent-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

.agent-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(6, 111, 172, 0.12);
}

.agent-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border-light);
}

.agent-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(6, 111, 172, 0.25);
}

.agent-info {
    flex: 1;
}

.agent-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.agent-username {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.agent-card-body {
    padding: 16px 20px;
}

.agent-extensions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.extension-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.extension-badge.wss {
    background: #EFF6FF;
    color: var(--primary);
}

.extension-badge.udp {
    background: #FEF3C7;
    color: #D97706;
}

.extension-badge svg {
    width: 14px;
    height: 14px;
}

.extension-badge.primary {
    font-weight: 600;
}

.agent-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-light);
}

/* ==================== CREATE AGENT FORM ==================== */

.create-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
}

.form-section {
    margin-bottom: 32px;
}

.form-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-title svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.form-row.single {
    grid-template-columns: 1fr;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group label .required {
    color: var(--danger);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Extension Type Selector */
.transport-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.transport-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.transport-option:hover {
    border-color: var(--primary);
    background: #EFF6FF;
}

.transport-option.selected {
    border-color: var(--primary);
    background: #EFF6FF;
    box-shadow: 0 0 0 3px rgba(6, 111, 172, 0.15);
}

.transport-option input {
    display: none;
}

.transport-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.transport-option.selected .transport-icon {
    background: var(--primary);
}

.transport-option.selected .transport-icon svg {
    color: white;
}

.transport-icon svg {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.transport-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.transport-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* Extensions List (in agent detail) */
.extensions-list {
    margin-top: 16px;
}

.extension-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: all 0.15s;
}

.extension-row:hover {
    background: var(--bg-hover);
}

.extension-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.extension-type-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.extension-type-icon.wss {
    background: #EFF6FF;
    color: var(--primary);
}

.extension-type-icon.udp {
    background: #FEF3C7;
    color: #D97706;
}

.extension-type-icon svg {
    width: 20px;
    height: 20px;
}

.extension-details {
    display: flex;
    flex-direction: column;
}

.extension-number {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.extension-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.extension-actions {
    display: flex;
    gap: 8px;
}

/* Agent Grid */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    padding: 16px 24px;
}

/* Credentials Display */
.credentials-box {
    background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
    border: 1px solid #86EFAC;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 16px;
}

.credentials-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #166534;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.credentials-title svg {
    width: 18px;
    height: 18px;
}

.credential-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(134, 239, 172, 0.5);
}

.credential-row:last-child {
    border-bottom: none;
}

.credential-label {
    font-size: 0.8125rem;
    color: #166534;
}

.credential-value {
    font-family: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: #15803D;
    background: rgba(255, 255, 255, 0.5);
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.credential-value:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* Copy tooltip */
.copy-tooltip {
    position: absolute;
    background: var(--secondary);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}

.copy-tooltip.show {
    opacity: 1;
}

/* ==================== STATUS BADGES ==================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.available {
    background: #E8F5E9;
    color: #00A650;
}

.status-badge.busy {
    background: #FFEBEE;
    color: #E02020;
}

.status-badge.away {
    background: #FFF8E1;
    color: #F5A623;
}

.status-badge.offline {
    background: #F3F4F6;
    color: #6B7280;
}

.status-badge .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ==================== BUTTON VARIANTS ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-danger {
    background: #E02020;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #C71A1A;
}

.btn-success {
    background: #00A650;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #009040;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* ==================== LOADING STATES ==================== */

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .icon-rail {
        display: none;
    }
    
    .topbar-search {
        display: none;
    }
    
    .content-area {
        margin: 0;
        border-radius: 0;
    }
}

/* ==================== LOGIN PAGE ==================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #5B21B6 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: loginPattern 20s linear infinite;
    pointer-events: none;
}

@keyframes loginPattern {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 420px;
    padding: 3rem 2.5rem;
    position: relative;
    z-index: 1;
    animation: loginCardFadeIn 0.5s ease-out;
}

@keyframes loginCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo-wrapper {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-logo {
    width: auto;
    height: 64px;
    object-fit: contain;
}

.login-logo-fallback {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-form .form-group {
    margin-bottom: 0;
}

.login-form .form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.login-form .form-group label svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
    flex-shrink: 0;
}

.login-form .form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.login-form .form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(91, 33, 182, 0.1), 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.login-form .form-input::placeholder {
    color: var(--text-muted);
}

.error-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #FEE2E2;
    border: 1px solid #FECACA;
    border-radius: 12px;
    color: #991B1B;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    animation: errorShake 0.4s ease;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.error-message svg {
    flex-shrink: 0;
    color: #DC2626;
}

.btn-login {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(91, 33, 182, 0.3);
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(91, 33, 182, 0.4);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 12px rgba(91, 33, 182, 0.3);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}


/* Login Page Responsive */
@media (max-width: 640px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
    
    .login-header h1 {
        font-size: 1.75rem;
    }
    
    .login-logo {
        height: 56px;
    }
}

/* Override body styles for login page */
body:has(.login-container) {
    overflow: auto;
    background: transparent;
}

/* ==================== AUDIO ELEMENTS (Hidden) ==================== */

#remoteAudio,
#ringtone {
    display: none;
}

/* ==================== DND INDICATOR ==================== */

.dnd-indicator {
    display: none;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--danger-light);
    color: var(--danger);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.dnd-indicator.active {
    display: flex;
}

.dnd-indicator svg {
    width: 14px;
    height: 14px;
}
