/* ========================================================================
   WA CS AI -- design tokens & component overrides on top of Bootstrap 5.
   ======================================================================== */

:root {
    --brand: #4f46e5;
    --brand-dark: #4338ca;
    --brand-soft: #eef2ff;
    --ink-900: #0f172a;
    --ink-700: #334155;
    --ink-500: #64748b;
    --ink-300: #cbd5e1;
    --surface: #f8fafc;
    --surface-card: #ffffff;
    --border: #e2e8f0;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 12px rgba(15, 23, 42, 0.04);
}

* { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

body {
    background: var(--surface);
    color: var(--ink-900);
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

/* ---- Buttons ---- */
.btn { border-radius: var(--radius-sm); font-weight: 600; padding: 0.55rem 1.1rem; font-size: 0.9rem; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-outline-danger { color: var(--danger); border-color: #fecaca; }
.btn-outline-danger:hover { background: var(--danger); border-color: var(--danger); }
.btn-outline-secondary { color: var(--ink-700); border-color: var(--border); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8125rem; }

/* ---- Cards ---- */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}
.card-body { padding: 1.5rem; }
.card h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

/* ---- Forms ---- */
label.form-label, label.small { font-size: 0.8125rem; font-weight: 600; color: var(--ink-700); }
.form-control, .form-select, textarea {
    border-radius: var(--radius-sm);
    border-color: var(--border);
    font-size: 0.9rem;
    padding: 0.55rem 0.8rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.text-muted.small { color: var(--ink-500) !important; font-size: 0.825rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

/* ---- Tables ---- */
.table { font-size: 0.875rem; }
.table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-500);
    font-weight: 700;
    border-bottom-width: 1px;
    border-color: var(--border);
    padding-bottom: 0.6rem;
}
.table td { vertical-align: middle; border-color: var(--border); color: var(--ink-700); }

/* ---- Badges ---- */
.badge { font-weight: 600; font-size: 0.75rem; padding: 0.4em 0.75em; border-radius: 999px; }

/* ---- Alerts ---- */
.alert { border-radius: var(--radius-sm); border: none; font-size: 0.875rem; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #fee2e2; color: #991b1b; }

/* ========================================================================
   Auth pages (login/register) -- split screen
   ======================================================================== */
.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
}
@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
}
.auth-brand {
    background: linear-gradient(160deg, var(--brand) 0%, #7c3aed 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    position: relative;
    overflow: hidden;
}
.auth-brand::after {
    content: "";
    position: absolute;
    width: 480px; height: 480px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    right: -160px; bottom: -160px;
}
.auth-brand h1 { font-size: 2.1rem; font-weight: 800; margin-bottom: 0.75rem; }
.auth-brand p { font-size: 1rem; opacity: 0.9; max-width: 380px; }
.auth-brand .auth-badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: rgba(255,255,255,0.15);
    padding: 0.35rem 0.85rem; border-radius: 999px;
    font-size: 0.8rem; font-weight: 600; margin-bottom: 2rem; width: fit-content;
}
.auth-form-side {
    display: flex; align-items: center; justify-content: center;
    padding: 2rem;
}
.auth-form-card { width: 100%; max-width: 400px; }
.auth-form-card h4 { font-weight: 800; font-size: 1.4rem; }

/* ========================================================================
   Dashboard shell -- sidebar layout
   ======================================================================== */
.dash-shell { display: flex; min-height: 100vh; }
.dash-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #111827;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
}
.dash-sidebar .brand {
    display: flex; align-items: center; gap: 0.6rem;
    font-weight: 800; font-size: 1.05rem; color: #fff;
    padding: 0 0.5rem; margin-bottom: 2rem;
}
.dash-sidebar .brand-mark {
    width: 32px; height: 32px; border-radius: 9px;
    background: var(--brand);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
}
.dash-nav { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.dash-nav a {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 600;
}
.dash-nav a i { font-size: 1rem; width: 1.1rem; text-align: center; }
.dash-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.dash-nav a.active { background: var(--brand); color: #fff; }
.dash-sidebar .sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 1rem;
    font-size: 0.8rem;
}
.dash-sidebar .sidebar-footer .biz-name { color: #fff; font-weight: 600; }
.dash-sidebar .sidebar-footer a { color: #9ca3af; }
.dash-sidebar .sidebar-footer a:hover { color: #fff; }

.dash-main { flex: 1; min-width: 0; }
.dash-topbar {
    background: var(--surface-card);
    border-bottom: 1px solid var(--border);
    padding: 1.1rem 2rem;
}
.dash-topbar h1 { font-size: 1.15rem; font-weight: 800; margin: 0; color: var(--ink-900); }
.dash-content { padding: 2rem; max-width: 900px; }

/* Mobile: collapse sidebar into a top bar */
@media (max-width: 820px) {
    .dash-shell { flex-direction: column; }
    .dash-sidebar { width: 100%; flex-direction: row; align-items: center; padding: 0.75rem 1rem; }
    .dash-sidebar .brand { margin-bottom: 0; }
    .dash-nav { flex-direction: row; overflow-x: auto; }
    .dash-nav a span { display: none; }
    .sidebar-footer { display: none; }
    .dash-content { padding: 1.25rem; }
}
