:root {
    --primary: #29c5e8;
    --primary-dark: #0ea5c9;
    --primary-glow: rgba(41, 197, 232, 0.15);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #080e1a;
    --bg-card: #0f1a2e;
    --bg-input: #1a2842;
    --text: #e8f4f8;
    --text-muted: #7a9bb5;
    --border: #1e3a5f;
    --border-accent: rgba(41, 197, 232, 0.25);
    --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* NAV */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.navbar-brand:hover { text-decoration: none; }
.navbar-logo {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
}
.navbar-brand-text { line-height: 1.2; }
.navbar-brand-title { display: block; font-size: 15px; font-weight: 700; color: var(--primary); }
.navbar-brand span { color: var(--text-muted); font-weight: 400; font-size: 12px; display: block; }
.navbar-links { display: flex; gap: 16px; align-items: center; }
.navbar-links a { color: var(--text-muted); font-size: 14px; }
.navbar-links a:hover { color: var(--text); text-decoration: none; }

/* CARDS */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.card-title { font-size: 18px; font-weight: 600; }

/* BUTTONS */
.btn {
    padding: 8px 16px;
    border-radius: var(--radius);
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; opacity: 0.9; transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: #000; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
textarea.form-control {
    min-height: 200px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
}

/* ALERTS */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-error { background: rgba(239, 68, 68, 0.15); border: 1px solid var(--danger); color: #fca5a5; }
.alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid var(--success); color: #6ee7b7; }
.alert-warning { background: rgba(245, 158, 11, 0.15); border: 1px solid var(--warning); color: #fcd34d; }

/* TABLE */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table th, .table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table th { color: var(--text-muted); font-weight: 500; font-size: 12px; text-transform: uppercase; }
.table tr:hover { background: var(--primary-glow); }

/* BADGES */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.badge-success { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.badge-info { background: rgba(41, 197, 232, 0.2); color: #7de8f8; }

/* GRID */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

/* SCORE */
.score-display {
    font-size: 48px;
    font-weight: 700;
    text-align: center;
    padding: 20px;
}
.score-high { color: var(--success); }
.score-mid { color: var(--warning); }
.score-low { color: var(--danger); }

/* DIFF */
.diff-view {
    background: #0d1117;
    border-radius: var(--radius);
    padding: 16px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
}
.diff-add { color: #3fb950; }
.diff-del { color: #f85149; }
.diff-ctx { color: #8b949e; }

/* LOGIN */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
}
.login-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}
.login-subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
    font-size: 14px;
}

/* CLIENT LIST */
.client-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    transition: border-color 0.2s;
}
.client-card:hover { border-color: var(--primary); }
.client-info h3 { font-size: 16px; margin-bottom: 4px; }
.client-info p { color: var(--text-muted); font-size: 13px; }

/* TABS */
.tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab {
    padding: 10px 20px;
    cursor: pointer;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* LOADING */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}
.loading-overlay.active { display: flex; }
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text-muted); font-size: 14px; }

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }
.empty-state p { margin-bottom: 20px; }

/* CONTENT PREVIEW */
.content-preview {
    background: var(--bg-input);
    border-radius: var(--radius);
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* STATS */
.stat-row { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.stat-box {
    flex: 1;
    min-width: 120px;
    background: var(--bg-input);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}
.stat-value { font-size: 24px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* CHANGE CARDS */
.diff-before {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-radius: var(--radius);
    padding: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: #fca5a5;
}
.diff-after {
    background: rgba(63, 185, 80, 0.1);
    border: 1px solid rgba(63, 185, 80, 0.3);
    border-radius: var(--radius);
    padding: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: #6ee7b7;
}
.change-reason {
    background: var(--bg-input);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-muted);
    border-left: 3px solid var(--warning);
}
.change-card { transition: all 0.3s ease; }

/* CHAT SIMULATION */
.test-conversation {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 12px;
    max-height: 400px;
    overflow-y: auto;
}
.chat-lead {
    background: var(--primary-glow);
    border-radius: 12px 12px 12px 2px;
    padding: 10px 14px;
    margin-bottom: 8px;
    max-width: 85%;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}
.chat-bot {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px 12px 2px 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
    max-width: 85%;
    margin-left: auto;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}
.chat-system {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 4px;
}
.chat-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; display: flex; }

/* T3A BRAND EXTRAS */
.navbar {
    background: linear-gradient(135deg, #080e1a 0%, #0a1628 100%);
    border-bottom: 1px solid var(--border-accent);
}
.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.4;
}
.navbar { position: relative; }

.card {
    border-color: var(--border);
    transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-accent); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 0 12px rgba(41, 197, 232, 0.2);
}
.btn-primary:hover {
    box-shadow: 0 0 20px rgba(41, 197, 232, 0.35);
    opacity: 1;
}

/* LOGIN PAGE T3A */
.login-card {
    border-color: var(--border-accent);
    box-shadow: 0 0 40px rgba(41, 197, 232, 0.08);
}
.login-logo {
    display: block;
    height: 64px;
    width: auto;
    margin: 0 auto 20px;
    background: #ffffff;
    border-radius: 12px;
    padding: 8px 12px;
}

