/* ============================================================
   Crazore Agency — UI Stylesheet v2
   Brand Primary:   #0F1240
   Brand Secondary: #1493FF
   ============================================================ */

:root {
    --brand-primary:   #0F1240;
    --brand-secondary: #1493FF;
    --brand-primary-light: #1a1f5e;
    --brand-hover:     rgba(20, 147, 255, 0.12);
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
    min-height: calc(100vh - 66px);
    background: var(--brand-primary);
    padding-top: .5rem;
}

.sidebar .nav-link {
    color: #aab4c8;
    padding: .55rem 1rem;
    border-radius: .4rem;
    margin: 2px .5rem;
    font-size: .875rem;
    transition: background .18s ease, color .18s ease;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: var(--brand-hover);
}

.sidebar .nav-link.active {
    color: #fff;
    background: var(--brand-secondary);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(20,147,255,.35);
}

.sidebar-heading {
    color: #5a6484 !important;
}

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
    background: var(--brand-primary) !important;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn-brand {
    background: var(--brand-secondary);
    border-color: var(--brand-secondary);
    color: #fff;
    font-weight: 600;
}
.btn-brand:hover {
    background: #0e7ee0;
    border-color: #0e7ee0;
    color: #fff;
}
.btn-outline-brand {
    border-color: var(--brand-secondary);
    color: var(--brand-secondary);
}
.btn-outline-brand:hover {
    background: var(--brand-secondary);
    color: #fff;
}

/* ── KPI / Stat Cards ───────────────────────────────────── */
.kpi-card {
    transition: transform .2s, box-shadow .2s;
    border-left: 4px solid transparent;
}
.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 .6rem 1.5rem rgba(0,0,0,.1) !important;
}
.kpi-income  { border-left-color: #198754 !important; }
.kpi-expense { border-left-color: #dc3545 !important; }
.kpi-profit  { border-left-color: var(--brand-secondary) !important; }
.kpi-invoice { border-left-color: #fd7e14 !important; }
.kpi-partner { border-left-color: #6f42c1 !important; }
.kpi-topearner { border-left-color: #ffc107 !important; }

.kpi-icon {
    min-width: 46px;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: .5rem;
}

/* ── Tables ─────────────────────────────────────────────── */
.table th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 700;
    white-space: nowrap;
}
.table td { font-size: .875rem; vertical-align: middle; }
.table-dark { background: var(--brand-primary) !important; }
.table-dark th { color: #cdd3e8; }

/* ── Cards ──────────────────────────────────────────────── */
.card { border-radius: .75rem; }
.card-header { border-radius: .75rem .75rem 0 0 !important; }

/* ── Form Controls ──────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
    border-color: var(--brand-secondary);
    box-shadow: 0 0 0 .2rem rgba(20,147,255,.2);
}

/* ── Badges ─────────────────────────────────────────────── */
.badge { font-weight: 500; }
.badge-paid       { background: #198754 !important; color: #fff; }
.badge-unpaid     { background: #ffc107 !important; color: #212529; }
.badge-partial    { background: #0dcaf0 !important; color: #212529; }
.badge-overdue    { background: #dc3545 !important; color: #fff; }
.badge-cancelled  { background: #6c757d !important; color: #fff; }

/* ── Currency badge ─────────────────────────────────────── */
.currency-lkr { background: #198754; color: #fff; }
.currency-usd { background: #0d6efd; color: #fff; }
.currency-eur { background: #6f42c1; color: #fff; }
.currency-aud { background: #fd7e14; color: #fff; }

/* ── General Utilities ──────────────────────────────────── */
.text-brand   { color: var(--brand-secondary) !important; }
.bg-brand     { background: var(--brand-primary) !important; }
.border-brand { border-color: var(--brand-secondary) !important; }
.bg-purple    { background-color: #6f42c1 !important; }
.border-3     { border-width: 3px !important; }
.cursor-pointer { cursor: pointer; }
details summary { cursor: pointer; user-select: none; }

/* ── Print ──────────────────────────────────────────────── */
@media print {
    .sidebar, .navbar, .no-print, .btn, .alert { display: none !important; }
    main { margin: 0 !important; padding: 0 !important; }
    .card { border: none !important; box-shadow: none !important; }
}

/* ── Exchange Rate Table ────────────────────────────────── */
.rate-month-card { border-left: 4px solid var(--brand-secondary); }

/* ── Invoice Print Page ─────────────────────────────────── */
.invoice-page {
    max-width: 820px;
    margin: 30px auto;
    background: #fff;
    padding: 50px;
    border-radius: 8px;
    box-shadow: 0 0 24px rgba(0,0,0,.08);
}
.invoice-header-bar {
    background: var(--brand-primary);
    color: #fff;
    padding: 20px 30px;
    border-radius: 6px 6px 0 0;
    margin: -50px -50px 30px -50px;
}
.invoice-total-row {
    background: var(--brand-primary);
    color: #fff;
    font-weight: 700;
}
.invoice-status {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb { background: #b0b8cc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #8a93aa; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .sidebar { min-height: auto; padding-bottom: 1rem; }
    main { padding: 1rem !important; }
    .invoice-header-bar { margin: -20px -20px 20px -20px; padding: 16px 20px; }
    .invoice-page { padding: 20px; }
}
