:root {
    --bg-color: #0f172a;
    --sidebar-bg: rgba(15, 23, 42, 0.8);
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --danger: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top left, #1e1b4b, #0f172a 80%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border-right: 1px solid var(--glass-border);
    border-top: none;
    border-bottom: none;
    border-left: none;
    background: var(--sidebar-bg);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.logo h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.menu-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.menu-item.active {
    color: var(--text-main);
    background: rgba(59, 130, 246, 0.15);
    border-left: 3px solid var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2.5rem 3rem;
    overflow-y: auto;
}

.view-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view-section.active {
    display: block;
}

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

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

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: white; }

/* Dashboard Cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease;
}

.stat-card:hover { transform: translateY(-5px); }

.stat-icon {
    font-size: 2.5rem;
    color: var(--primary);
}

.stat-info h3 {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-info p {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Tables */
.table-container {
    padding: 1rem;
    overflow-x: auto;
}

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

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

.data-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.active { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge.suspended { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

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

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}
.close-btn:hover { color: white; }

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

input, select, textarea {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.3);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

/* Login Screen */
.login-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at top left, #1e1b4b, #0f172a 80%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.login-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.logout-btn {
    margin-top: auto;
    padding: 0.875rem 1rem;
    color: var(--danger);
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
}
.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
}

/* Voice Simulator Styles */
.ring-pulse {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    transition: all 0.3s ease;
    pointer-events: none; /* Safe click-through overlay */
}
.ring-pulse.idle {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
}
.ring-pulse.active {
    background: rgba(16, 185, 129, 0.1);
    border: 3px solid #10b981;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
    animation: simPulse 2s infinite ease-in-out;
}
@keyframes simPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.8; box-shadow: 0 0 50px rgba(16, 185, 129, 0.6); }
    100% { transform: scale(1); opacity: 1; }
}

.call-btn-circle {
    z-index: 2;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}
.call-btn-circle.idle {
    background: linear-gradient(135deg, #10B981, #059669);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}
.call-btn-circle.idle:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 25px rgba(16, 185, 129, 0.5);
}
.call-btn-circle.active {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.3);
    animation: simWobble 0.5s ease-in-out;
}
.call-btn-circle.active:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 25px rgba(239, 68, 68, 0.5);
}
@keyframes simWobble {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.equalizer-container .bar {
    width: 4px;
    height: 100%;
    background-color: var(--accent);
    border-radius: 2px;
    animation: equalizer 1.5s ease-in-out infinite alternate;
}
.equalizer-container .bar-1 { animation-delay: 0.1s; height: 10%; }
.equalizer-container .bar-2 { animation-delay: 0.3s; height: 40%; }
.equalizer-container .bar-3 { animation-delay: 0.5s; height: 80%; }
.equalizer-container .bar-4 { animation-delay: 0.2s; height: 50%; }
.equalizer-container .bar-5 { animation-delay: 0.4s; height: 20%; }

@keyframes equalizer {
    0% { height: 10%; }
    100% { height: 100%; }
}

/* Charts and Analytics Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}
@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.multi-select-container {
    position: relative;
    width: 250px;
}
.multi-select-trigger {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: white;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.multi-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    background: var(--sidebar-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-top: 4px;
}
.multi-select-dropdown.active {
    display: block;
}
.multi-select-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 0.85rem;
}
.multi-select-option:hover {
    background: rgba(255,255,255,0.05);
}
.multi-select-option input {
    width: auto !important;
}
