:root {
    --bg-primary: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    padding: 2rem;
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    padding: 2.5rem;
}

.brand-center {
    flex-direction: column;
    text-align: center;
    margin-bottom: 2rem;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, #3b82f6, #10b981);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.navbar h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

.status-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    color: var(--success-color);
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
}

.status-dot-off {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-secondary);
}

.status-dot-recording {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--danger-color);
    box-shadow: 0 0 8px var(--danger-color);
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0.3; }
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

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

.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.search-bar-wrapper {
    margin-bottom: 1.25rem;
}

.search-bar-wrapper input {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.checkbox-group {
    background: rgba(15, 23, 42, 0.4);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

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

input[type="text"], input[type="number"], input[type="password"] {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    width: 100%;
}

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

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

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

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

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    width: auto;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}

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

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

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.data-table th {
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.badge-ip {
    font-family: monospace;
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.ssl-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.ssl-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.ssl-none {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.ssl-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Modal Call Inspector */
.call-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.call-modal-content {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    padding: 1.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

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

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
}

.close-modal:hover { color: white; }

.trace-card {
    grid-column: span 2;
}

.capture-status-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.terminal-view {
    background: #090d16;
    border: 1px solid #1e293b;
    border-radius: 12px;
    overflow: hidden;
    font-family: 'Courier New', Courier, monospace;
}

.terminal-header {
    background: #0f172a;
    padding: 0.6rem 1rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #38bdf8;
    border-bottom: 1px solid #1e293b;
    font-weight: bold;
}

.terminal-body {
    padding: 1rem;
    min-height: 220px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.8rem;
    color: #00ff66;
}

.sip-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.sip-method-invite { color: #38bdf8; font-weight: bold; }
.sip-method-200 { color: #4ade80; font-weight: bold; }
.sip-method-bye { color: #f87171; font-weight: bold; }

.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    font-size: 0.9rem;
    transition: all 0.3s;
    z-index: 1000;
}

.toast.success { border-color: var(--success-color); color: var(--success-color); }
.toast.error { border-color: var(--danger-color); color: var(--danger-color); }
.hidden { display: none; }
