/* ============================================================
   BillFast — Professional Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bf-primary: #4f46e5;
    --bf-primary-dark: #4338ca;
    --bf-primary-light: #eef2ff;
    --bf-sidebar-bg: #111827;
    --bf-sidebar-hover: #1f2937;
    --bf-sidebar-active: #4f46e5;
    --bf-bg: #f8fafc;
    --bf-text: #1e293b;
    --bf-muted: #64748b;
    --bf-border: #e2e8f0;
    --bf-success: #10b981;
    --bf-danger: #ef4444;
    --bf-warning: #f59e0b;
    --bf-info: #3b82f6;
    --bf-radius: 12px;
    --bf-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --bf-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bf-bg);
    color: var(--bf-text);
    font-size: 0.925rem;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #0f172a;
}

/* ---- Layout shell: sidebar + top bar ---- */
.bf-shell { display: flex; min-height: 100vh; }

.bf-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--bf-sidebar-bg);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.bf-sidebar .bf-brand {
    padding: 1.4rem 1.25rem 1rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
}
.bf-sidebar .bf-brand .dot { color: var(--bf-primary); font-size: 1.6rem; line-height: 0; }
.bf-sidebar nav { flex: 1; padding: 0.5rem 0.75rem; }
.bf-sidebar .bf-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background 0.12s ease, color 0.12s ease;
}
.bf-sidebar .bf-nav-link:hover { background: var(--bf-sidebar-hover); color: #fff; }
.bf-sidebar .bf-nav-link.active { background: var(--bf-sidebar-active); color: #fff; }
.bf-sidebar .bf-nav-link.highlight {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-weight: 600;
}
.bf-sidebar .bf-nav-link.highlight:hover { filter: brightness(1.08); }
.bf-sidebar .bf-icon { font-size: 1rem; width: 1.1rem; text-align: center; opacity: 0.9; }
.bf-sidebar .bf-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    padding: 1rem 0.85rem 0.35rem;
    font-weight: 700;
}
.bf-sidebar-footer { padding: 0.85rem; border-top: 1px solid #1f2937; }
.bf-sidebar-footer .btn { width: 100%; }

.bf-main { flex: 1; min-width: 0; }
.bf-topbar {
    background: #fff;
    border-bottom: 1px solid var(--bf-border);
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}
.bf-topbar h1 { font-size: 1.1rem; margin: 0; font-weight: 700; }
.bf-content { padding: 1.5rem; }

.bf-impersonation-banner {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    text-align: center;
    padding: 0.55rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
}
.bf-impersonation-banner .btn { margin-left: 0.75rem; }

/* ---- Cards ---- */
.card {
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius);
    box-shadow: var(--bf-shadow);
}
.card:hover { box-shadow: var(--bf-shadow); }

/* ---- Buttons ---- */
.btn { border-radius: 8px; font-weight: 500; font-size: 0.875rem; }
.btn-primary { background: var(--bf-primary); border-color: var(--bf-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--bf-primary-dark); border-color: var(--bf-primary-dark); }
.btn-outline-primary { color: var(--bf-primary); border-color: var(--bf-primary); }
.btn-outline-primary:hover { background: var(--bf-primary); border-color: var(--bf-primary); }

/* ---- Tables ---- */
.table { font-size: 0.875rem; }
.table thead th {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: var(--bf-muted);
    font-weight: 700;
    border-bottom-width: 1px;
    background: #f8fafc;
}
.table-hover tbody tr:hover { background: var(--bf-primary-light); }

/* ---- Badges ---- */
.badge { font-weight: 600; font-size: 0.7rem; padding: 0.4em 0.65em; border-radius: 6px; }

/* ---- Forms ---- */
.form-control, .form-select {
    border-radius: 8px;
    border-color: var(--bf-border);
    font-size: 0.875rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--bf-primary);
    box-shadow: 0 0 0 3px var(--bf-primary-light);
}
.form-label { font-weight: 600; font-size: 0.8rem; color: #334155; }

/* ---- Alerts ---- */
.alert { border-radius: var(--bf-radius); border: none; font-size: 0.875rem; }
.alert-info { background: var(--bf-primary-light); color: var(--bf-primary-dark); }

/* ---- Auth pages (login/register) ---- */
.bf-auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #312e81 50%, #4f46e5 100%);
    padding: 1.5rem;
}
.bf-auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--bf-shadow-md);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}
.bf-auth-brand {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.25rem;
}
.bf-auth-brand .dot { color: var(--bf-primary); }
.bf-auth-sub { text-align: center; color: var(--bf-muted); font-size: 0.875rem; margin-bottom: 1.75rem; }

/* ---- Misc ---- */
.text-muted { color: var(--bf-muted) !important; }
a { color: var(--bf-primary); }
