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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* Footer */
.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 12px;
    color: #6c757d;
}

.app-footer .version {
    font-weight: 500;
    color: #764ba2;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

header h1 {
    font-size: 24px;
    font-weight: 600;
}

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

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

.status-dot.inactive {
    background: #f87171;
}

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

.status-text {
    font-size: 14px;
    font-weight: 500;
}

.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.tab-button {
    flex: 1;
    padding: 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s;
    position: relative;
}

.tab-button:hover {
    background: #e9ecef;
}

.tab-button.active {
    color: #667eea;
    background: white;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #667eea;
}

.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

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

.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

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

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-grid .card h3 {
    min-height: 48px;
    display: flex;
    align-items: flex-start;
    line-height: 1.3;
}

.notification-toggle {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
}

.notification-toggle #notificationStatusText {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.4;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.stat-number {
    font-size: 48px;
    font-weight: bold;
    color: #667eea;
    margin: 16px 0;
}

.stat-label {
    color: #6c757d;
    font-size: 14px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

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

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

.btn-success {
    background: #28a745;
    color: white;
}

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

.phone-number-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s;
}

.phone-number-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.phone-number-item.inactive {
    opacity: 0.5;
    background: #f8f9fa;
}

.phone-info {
    flex: 1;
}

.phone-number {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
}

.phone-name {
    color: #6c757d;
    font-size: 14px;
    margin-top: 4px;
}

.phone-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.log-entry {
    padding: 16px;
    border-left: 4px solid #667eea;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 12px;
}

.log-entry.email {
    border-left-color: #667eea;
}

.log-entry.call {
    border-left-color: #28a745;
}

.log-entry.error {
    border-left-color: #dc3545;
}

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

.log-type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.log-type.email {
    background: #e0e7ff;
    color: #667eea;
}

.log-type.call {
    background: #d1fae5;
    color: #28a745;
}

.log-type.error {
    background: #fee;
    color: #dc3545;
}

.log-type.info {
    background: #e3f2fd;
    color: #2196f3;
}

.log-time {
    color: #6c757d;
    font-size: 13px;
}

.log-message {
    color: #212529;
    font-size: 14px;
    line-height: 1.5;
}

.log-details {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #dee2e6;
    font-size: 13px;
    color: #6c757d;
}

.log-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.log-controls select {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-header h3 {
    color: #212529;
}

.close {
    color: #6c757d;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #212529;
}

.form-group {
    padding: 24px;
}

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #6c757d;
    font-size: 13px;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.settings-section {
    margin-top: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.help-text {
    color: #6c757d;
    font-size: 13px;
    margin-top: 4px;
}

.info-table {
    width: 100%;
    margin-top: 20px;
}

.info-table td {
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-table tr:last-child td {
    border-bottom: none;
}

.recent-activity {
    max-height: 400px;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* Time Slots Styles */
.time-slot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s;
}

.time-slot-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.time-slot-item.inactive {
    opacity: 0.5;
    background: #f8f9fa;
}

.time-slot-info {
    flex: 1;
}

.time-slot-day {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-slot-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.time-slot-badge.weekday {
    background: #e0e7ff;
    color: #667eea;
}

.time-slot-badge.weekend {
    background: #fce7f3;
    color: #ec4899;
}

.time-slot-time {
    color: #6c757d;
    font-size: 14px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-slot-time .time-range {
    font-weight: 600;
    color: #212529;
}

.time-slot-time .overnight-badge {
    background: #fff3cd;
    color: #856404;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

.time-slot-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.time-info {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 8px;
}

.time-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.time-info-label {
    font-weight: 600;
    color: #6c757d;
}

.time-info-value {
    color: #212529;
}

.time-info-value.active {
    color: #28a745;
    font-weight: 600;
}

.time-info-value.inactive {
    color: #dc3545;
    font-weight: 600;
}

.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    background-color: white;
}

.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }
    
    header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        overflow-x: auto;
    }
    
    .tab-button {
        white-space: nowrap;
    }
    
    .header-right {
        flex-direction: column;
        gap: 10px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 8px;
    }
}

/* Login Page Styles - Calypso-inspired two-column layout */
.login-page {
    background: #f5f5f5;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrapper {
    display: flex;
    width: 100%;
    max-width: 900px;
    min-height: 500px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    overflow: hidden;
    margin: 20px;
}

.login-left {
    flex: 1;
    background: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: white;
}

.login-branding {
    text-align: center;
}

.logo-area {
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.login-branding h1 {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

.tagline {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 10px;
}

.tagline-info {
    font-size: 12px;
    opacity: 0.75;
    margin-top: 15px;
    line-height: 1.5;
    text-align: left;
    padding: 0 10px;
}

.login-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 50px 40px;
    background: #fafafa;
}

.login-form-container {
    max-width: 350px;
    margin: 0 auto;
    width: 100%;
}

.login-form-container form {
    width: 100%;
}

.login-form-container h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.login-form-container .form-group {
    margin-bottom: 18px;
    width: 100%;
    padding: 0;
}

.login-form-container .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.login-form-container .form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    box-sizing: border-box;
    display: block;
}

.login-form-container .form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102,126,234,0.2);
}

.login-form-container .login-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 10px 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 13px;
    border: 1px solid #fecaca;
    width: 100%;
    box-sizing: border-box;
}

.login-form-container .btn-login {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
}

.login-form-container .btn-login:hover {
    opacity: 0.95;
}

.login-form-container .btn-login:active {
    transform: scale(0.98);
}

.login-form-container .btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.login-footer-info {
    text-align: center;
    margin-top: 30px;
    font-size: 12px;
    color: #888;
}

/* Responsive for login page */
@media (max-width: 700px) {
    .login-wrapper {
        flex-direction: column;
        max-width: 400px;
        min-height: auto;
    }
    
    .login-left {
        padding: 30px 20px;
    }
    
    .logo-icon {
        font-size: 48px;
    }
    
    .login-branding h1 {
        font-size: 22px;
    }
    
    .login-right {
        padding: 30px 25px;
    }
}

/* Header User Info */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.user-name {
    font-weight: 500;
    font-size: 14px;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}
