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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --background: #f1f5f9;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
}

.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: flex;
}

/* Login Screen */
#login-screen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
}

.login-container {
    background: var(--surface);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 28px;
    color: var(--text);
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-muted);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Register Screen */
#register-screen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
}

.register-container {
    background: var(--surface);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 500px;
}

/* Main Screen */
#main-screen {
    flex-direction: column;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.header-center {
    display: flex;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--background);
    border-radius: 20px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-dot.offline {
    background: var(--danger);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-info span:first-child {
    font-weight: 600;
}

.user-info span:last-child {
    font-size: 12px;
    color: var(--text-muted);
}

#status-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--background);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--border);
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 80px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    gap: 10px;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    border-radius: 8px;
    margin: 0 10px;
}

.nav-btn i {
    font-size: 20px;
}

.nav-btn span {
    font-size: 11px;
}

.nav-btn:hover {
    background: var(--background);
    color: var(--text);
}

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

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 24px;
}

/* Dialpad */
.dialpad-container {
    max-width: 350px;
    margin: 0 auto;
}

.call-display {
    background: var(--surface);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.caller-info {
    margin-bottom: 10px;
}

.caller-name {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.caller-number {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 2px;
}

.call-timer {
    font-size: 16px;
    color: var(--success);
    font-weight: 500;
}

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

.dial-btn {
    aspect-ratio: 1;
    border: none;
    background: var(--surface);
    border-radius: 12px;
    font-size: 24px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.dial-btn span {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.dial-btn:hover {
    background: var(--background);
    transform: scale(1.05);
}

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

.call-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.action-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.action-btn.call:hover {
    background: #16a34a;
}

.action-btn:not(.call) {
    background: var(--surface);
    color: var(--text);
}

.action-btn:not(.call):hover {
    background: var(--background);
}

/* Calls List */
.calls-list {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.call-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

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

.call-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.call-item.inbound .call-icon {
    background: #dcfce7;
    color: var(--success);
}

.call-item.outbound .call-icon {
    background: #dbeafe;
    color: var(--primary);
}

.call-details {
    flex: 1;
}

.call-number {
    display: block;
    font-weight: 600;
}

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

.btn-call-back {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--success);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-call-back:hover {
    background: #16a34a;
}

/* Contacts List */
.contacts-list {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.contact-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

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

.contact-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 15px;
}

.contact-details {
    flex: 1;
}

.contact-name {
    display: block;
    font-weight: 600;
}

.contact-phone {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-call-contact {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--success);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-call-contact:hover {
    background: #16a34a;
}

/* Search Box */
.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    width: 250px;
}

.btn-search {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    cursor: pointer;
}

/* Reports */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.report-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.report-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: #dbeafe;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.report-icon.inbound {
    background: #dcfce7;
    color: var(--success);
}

.report-icon.outbound {
    background: #fef3c7;
    color: var(--warning);
}

.report-icon.missed {
    background: #fee2e2;
    color: var(--danger);
}

.report-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
}

.report-label {
    font-size: 14px;
    color: var(--text-muted);
}

.chart-container {
    background: var(--surface);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Settings */
.settings-container {
    max-width: 600px;
}

.settings-group {
    background: var(--surface);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.settings-group h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.btn-save {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

/* Active Call Bar */
.active-call-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.call-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.call-status {
    font-weight: 600;
}

.call-controls {
    display: flex;
    gap: 10px;
}

.call-ctrl-btn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
}

.call-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

.call-ctrl-btn.end {
    background: var(--danger);
}

.call-ctrl-btn.end:hover {
    background: #dc2626;
}

.call-ctrl-btn.transfer {
    background: var(--warning);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.modal-content {
    background: var(--surface);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}

.incoming-call {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.incoming-call-header {
    background: var(--primary);
    color: white;
    padding: 20px;
    text-align: center;
}

.incoming-call-header i {
    font-size: 32px;
    margin-bottom: 10px;
}

.incoming-call-info {
    padding: 30px;
    text-align: center;
}

.incoming-call-info .caller-name {
    display: block;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.incoming-call-info .caller-number {
    font-size: 18px;
    color: var(--text-muted);
}

.incoming-call-actions {
    display: flex;
    padding: 20px;
    gap: 15px;
}

.call-action-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

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

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

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border);
}

.btn-cancel {
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
}

.btn-confirm {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Empty State */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 300;
    animation: slideUp 0.3s ease;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Filter Buttons */
.call-filters,
.report-filters {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .main-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .header-center {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .sidebar {
        width: 60px;
    }
    
    .nav-btn span {
        display: none;
    }
    
    .reports-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .active-call-bar {
        flex-direction: column;
        gap: 15px;
    }
}