/* ============================================================
   REZOPAY ADMIN — DESIGN SYSTEM
   Palette: soft blue-white surface, deep confident blue primary,
   ledger-green for money/success. Monospace for all financial
   figures, transaction refs and IDs — a ledger reads by column,
   not by font used for prose.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --rz-blue-900: #0B1F4D;
    --rz-blue-700: #14328C;
    --rz-blue-600: #1849D6;
    --rz-blue-500: #2F6FED;
    --rz-blue-100: #E8EEFD;
    --rz-blue-50:  #F4F7FE;

    --rz-green-700: #0B7A4B;
    --rz-green-600: #0FA968;
    --rz-green-100: #DFF6EA;

    --rz-red-600: #D92D20;
    --rz-red-100: #FCE8E6;

    --rz-amber-600: #B54708;
    --rz-amber-100: #FEF0C7;

    --rz-ink-900: #101828;
    --rz-ink-600: #475467;
    --rz-ink-400: #98A2B3;

    --rz-bg: #F7F9FD;
    --rz-surface: #FFFFFF;
    --rz-border: #E4E8F1;

    --rz-radius: 10px;
    --rz-radius-lg: 14px;
    --rz-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);

    --rz-font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --rz-font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }

body {
    font-family: var(--rz-font-ui);
    background: var(--rz-bg);
    color: var(--rz-ink-900);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Ledger-style numeric formatting ---------- */
.mono, .money, .txn-ref, td.num, .otp-input {
    font-family: var(--rz-font-mono);
    font-feature-settings: 'tnum' 1;
    letter-spacing: -0.01em;
}
.money { font-weight: 600; }
.money.positive { color: var(--rz-green-700); }
.money.negative { color: var(--rz-red-600); }

/* ============================================================
   AUTH PAGES (login / 2fa)
   ============================================================ */
.auth-body {
    background: radial-gradient(circle at 20% 20%, var(--rz-blue-900) 0%, #081638 55%, #050d24 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-wrapper { width: 100%; max-width: 400px; }
.auth-card {
    background: var(--rz-surface);
    border-radius: var(--rz-radius-lg);
    padding: 36px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.auth-brand {
    text-align: center;
    font-family: var(--rz-font-ui);
    font-weight: 800;
    font-size: 26px;
    margin-bottom: 28px;
}
.brand-rezo { color: var(--rz-blue-600); }
.brand-pay { color: var(--rz-green-600); }
.auth-sub { font-size: 12px; font-weight: 500; color: var(--rz-ink-400); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 4px; }
.auth-footer { text-align: center; font-size: 11px; color: var(--rz-ink-400); margin-top: 20px; }
.otp-input { letter-spacing: 0.5em; font-size: 20px; text-align: center; font-weight: 600; }

.btn-brand {
    background: var(--rz-blue-600);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--rz-radius);
    transition: background .15s ease;
}
.btn-brand:hover { background: var(--rz-blue-700); color: #fff; }
.btn-brand-green {
    background: var(--rz-green-600);
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: var(--rz-radius);
}
.btn-brand-green:hover { background: var(--rz-green-700); color: #fff; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 248px;
    flex-shrink: 0;
    background: var(--rz-blue-900);
    color: #cfd9f7;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    overflow-y: auto;
}
.sidebar-brand {
    padding: 22px 20px;
    font-weight: 800;
    font-size: 19px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .brand-rezo { color: #7EA2FF; }
.sidebar-brand .brand-pay { color: #5FE0A5; }

.sidebar-section-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6C82BF;
    padding: 18px 20px 6px;
    font-weight: 600;
}
.sidebar-nav { list-style: none; margin: 0; padding: 4px 10px; }
.sidebar-nav li { margin-bottom: 2px; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #B9C6EC;
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    transition: background .12s ease, color .12s ease;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav a.active { background: var(--rz-blue-600); color: #fff; }
.sidebar-nav .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .5; }

.main-area { margin-left: 248px; flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: 62px;
    background: var(--rz-surface);
    border-bottom: 1px solid var(--rz-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-title { font-weight: 700; font-size: 16px; }
.topbar-user { font-size: 13px; color: var(--rz-ink-600); display: flex; align-items: center; gap: 12px; }
.role-badge {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--rz-blue-100);
    color: var(--rz-blue-700);
    padding: 3px 8px;
    border-radius: 20px;
}

.content-area { padding: 24px; flex: 1; }

/* ---------- Cards / stats ---------- */
.rz-card {
    background: var(--rz-surface);
    border: 1px solid var(--rz-border);
    border-radius: var(--rz-radius-lg);
    box-shadow: var(--rz-shadow);
    padding: 20px;
}
.rz-card-title { font-size: 13px; font-weight: 600; color: var(--rz-ink-600); margin-bottom: 14px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
    background: var(--rz-surface);
    border: 1px solid var(--rz-border);
    border-radius: var(--rz-radius-lg);
    padding: 18px 20px;
    box-shadow: var(--rz-shadow);
}
.stat-label { font-size: 12px; color: var(--rz-ink-600); font-weight: 500; margin-bottom: 6px; }
.stat-value { font-family: var(--rz-font-mono); font-size: 22px; font-weight: 700; color: var(--rz-ink-900); }
.stat-value.green { color: var(--rz-green-700); }
.stat-value.red { color: var(--rz-red-600); }
.stat-delta { font-size: 11.5px; margin-top: 4px; font-weight: 600; }
.stat-delta.up { color: var(--rz-green-700); }
.stat-delta.down { color: var(--rz-red-600); }

/* ---------- Tables ---------- */
.rz-table-wrap { background: var(--rz-surface); border: 1px solid var(--rz-border); border-radius: var(--rz-radius-lg); overflow: hidden; box-shadow: var(--rz-shadow); }
table.rz-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.rz-table thead th {
    background: var(--rz-blue-50);
    color: var(--rz-ink-600);
    text-transform: uppercase;
    font-size: 10.5px;
    letter-spacing: 0.05em;
    font-weight: 700;
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--rz-border);
}
table.rz-table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--rz-border); vertical-align: middle; }
table.rz-table tbody tr:last-child td { border-bottom: none; }
table.rz-table tbody tr:hover { background: var(--rz-blue-50); }

/* ---------- Badges / status pills ---------- */
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; text-transform: capitalize; }
.pill-success { background: var(--rz-green-100); color: var(--rz-green-700); }
.pill-danger  { background: var(--rz-red-100); color: var(--rz-red-600); }
.pill-warning { background: var(--rz-amber-100); color: var(--rz-amber-600); }
.pill-info    { background: var(--rz-blue-100); color: var(--rz-blue-700); }
.pill-muted   { background: #EEF1F6; color: var(--rz-ink-600); }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: 12.5px; color: var(--rz-ink-900); }
.form-control, .form-select {
    border: 1px solid var(--rz-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13.5px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--rz-blue-500);
    box-shadow: 0 0 0 3px var(--rz-blue-100);
}
.form-text-hint { font-size: 11.5px; color: var(--rz-ink-400); }

/* ---------- Toggle switch for service ON/OFF ---------- */
.rz-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.rz-switch input { opacity: 0; width: 0; height: 0; }
.rz-switch .slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #D0D5DD; border-radius: 22px; transition: .15s;
}
.rz-switch .slider:before {
    content: ""; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: .15s;
}
.rz-switch input:checked + .slider { background: var(--rz-green-600); }
.rz-switch input:checked + .slider:before { transform: translateX(18px); }

/* ---------- Buttons ---------- */
.btn-outline-rz { border: 1px solid var(--rz-border); background: #fff; color: var(--rz-ink-900); font-weight: 500; border-radius: 8px; font-size: 13px; }
.btn-outline-rz:hover { background: var(--rz-blue-50); border-color: var(--rz-blue-500); }
.btn-sm-rz { padding: 5px 10px; font-size: 12px; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--rz-ink-400); }
.empty-state h6 { color: var(--rz-ink-600); font-weight: 600; margin-top: 10px; }

/* ---------- Utility ---------- */
.text-muted-rz { color: var(--rz-ink-600); }
.divider { border-top: 1px solid var(--rz-border); margin: 20px 0; }

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; z-index: 40; }
    .sidebar.open { transform: translateX(0); }
    .main-area { margin-left: 0; }
}
