/* EA Data Insights - Base Styles */
/* Minimal, functional CSS. Security-focused app — substance over flash. */

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-card: #21242f;
    --border: #2d3140;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;
    --sidebar-width: 240px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

/* ─── Login Page ──────────────────────────────────────────────────────── */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.login-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.login-footer p { margin-bottom: 0.25rem; }

/* ─── Forms ───────────────────────────────────────────────────────────── */

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

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

/* ─── Buttons ─────────────────────────────────────────────────────────── */

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-primary {
    width: 100%;
    padding: 0.625rem;
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

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

.btn-logout {
    display: block;
    text-align: center;
    padding: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    border-radius: 4px;
    transition: all 0.15s;
}

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

/* ─── Alerts ──────────────────────────────────────────────────────────── */

.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    border: 1px solid;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

/* ─── Sidebar ─────────────────────────────────────────────────────────── */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 10;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.user-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nav-links {
    list-style: none;
    padding: 0.5rem 0;
    flex: 1;
    overflow-y: auto;
}

.nav-links li a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.nav-links li a:hover {
    background: rgba(59, 130, 246, 0.05);
    color: var(--text-primary);
}

.nav-links li a.active {
    background: rgba(59, 130, 246, 0.08);
    border-left-color: var(--accent);
    color: var(--accent);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

/* ─── Main Content ────────────────────────────────────────────────────── */

.content {
    margin-left: var(--sidebar-width);
    padding: 1.5rem 2rem;
    flex: 1;
    min-height: 100vh;
}

.dashboard-header {
    margin-bottom: 1.5rem;
}

.dashboard-header h1 {
    font-size: 1.375rem;
    font-weight: 700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

/* ─── Cards ───────────────────────────────────────────────────────────── */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
}

.card h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* ─── HTMX loading indicator ─────────────────────────────────────────── */

.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}
