:root {
    --admin-sidebar: #1e1b4b;
    --admin-sidebar-hover: #312e81;
    --admin-primary: #4f46e5;
    --merchant-sidebar: #14532d;
    --merchant-sidebar-hover: #166534;
    --merchant-primary: #16a34a;
    --sidebar-width: 260px;
}

/* ── General ─────────────────────────────────────── */
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #f1f5f9; }

/* ── Sidebar Layout ──────────────────────────────── */
.wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    left: 0; top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform .3s ease;
}

.sidebar-admin    { background: var(--admin-sidebar); }
.sidebar-merchant { background: var(--merchant-sidebar); }

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
    text-decoration: none;
}
.sidebar-brand h5 { color: #fff; margin: 0; font-weight: 700; font-size: 1.2rem; letter-spacing: .5px; }
.sidebar-brand small { color: rgba(255,255,255,.5); font-size: .7rem; text-transform: uppercase; letter-spacing: 1px; }

.sidebar-nav { padding: 1rem 0; flex: 1; }
.sidebar-nav .nav-section {
    color: rgba(255,255,255,.35);
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: .75rem 1.25rem .25rem;
}
.sidebar-nav .nav-item { list-style: none; }
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .625rem 1.25rem;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: .875rem;
    transition: background .2s, color .2s;
    border-radius: 0;
}
.sidebar-nav .nav-link i { font-size: 1.05rem; width: 20px; }
.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: #fff;
}
.sidebar-admin .nav-link:hover,
.sidebar-admin .nav-link.active    { background: var(--admin-sidebar-hover); }
.sidebar-merchant .nav-link:hover,
.sidebar-merchant .nav-link.active { background: var(--merchant-sidebar-hover); }

/* ── Main content ────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-title { font-weight: 600; font-size: 1rem; color: #1e293b; }
.topbar .user-info { display: flex; align-items: center; gap: .5rem; }
.topbar .user-info .avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem; color: #fff;
}
.admin-avatar    { background: var(--admin-primary); }
.merchant-avatar { background: var(--merchant-primary); }

.page-content { padding: 1.75rem; flex: 1; }

/* ── Stat Cards ──────────────────────────────────── */
.stat-card {
    border: none;
    border-radius: 12px;
    padding: 1.5rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
    transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.stat-card .stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
}
.stat-card .stat-value { font-size: 1.65rem; font-weight: 700; color: #1e293b; margin: .5rem 0 .15rem; }
.stat-card .stat-label { color: #64748b; font-size: .8rem; }

.icon-indigo  { background: #ede9fe; color: #4f46e5; }
.icon-green   { background: #dcfce7; color: #16a34a; }
.icon-blue    { background: #dbeafe; color: #2563eb; }
.icon-orange  { background: #ffedd5; color: #ea580c; }
.icon-red     { background: #fee2e2; color: #dc2626; }
.icon-teal    { background: #ccfbf1; color: #0d9488; }

/* ── Cards ───────────────────────────────────────── */
.card { border: none; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.card-header { background: #fff; border-bottom: 1px solid #f1f5f9; font-weight: 600; padding: 1rem 1.25rem; border-radius: 12px 12px 0 0 !important; }

/* ── Tables ──────────────────────────────────────── */
.table thead th { background: #f8fafc; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: #64748b; border-bottom: 1px solid #e2e8f0; }
.table tbody td { vertical-align: middle; font-size: .875rem; color: #334155; }
.table tbody tr:hover { background: #f8fafc; }

/* ── Badges ──────────────────────────────────────── */
.badge-success  { background: #dcfce7; color: #15803d; }
.badge-failed   { background: #fee2e2; color: #b91c1c; }
.badge-pending  { background: #fef9c3; color: #a16207; }
.badge-cancelled{ background: #f1f5f9; color: #475569; }
.status-badge { padding: .3em .75em; border-radius: 20px; font-size: .75rem; font-weight: 600; }

/* ── Buttons ─────────────────────────────────────── */
.btn-admin    { background: var(--admin-primary);    color: #fff; border: none; }
.btn-admin:hover  { background: #4338ca; color: #fff; }
.btn-merchant { background: var(--merchant-primary); color: #fff; border: none; }
.btn-merchant:hover { background: #15803d; color: #fff; }

/* ── Login Page ──────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-wrapper.merchant-login {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}
.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.login-card .logo-icon {
    width: 60px; height: 60px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1.25rem;
}
.login-card .logo-icon.admin-icon    { background: #ede9fe; color: #4f46e5; }
.login-card .logo-icon.merchant-icon { background: #dcfce7; color: #16a34a; }

/* ── Payment Page ────────────────────────────────── */
.payment-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.payment-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,.12);
    width: 100%;
    max-width: 480px;
}
.payment-card .payment-header {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    padding: 2rem;
    text-align: center;
    color: #fff;
}
.payment-card .payment-header .amount-display {
    font-size: 2.5rem;
    font-weight: 800;
    margin: .5rem 0;
}

/* ── Code block ──────────────────────────────────── */
.code-block {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
    font-family: 'Consolas', monospace;
    font-size: .82rem;
    overflow-x: auto;
}

/* ── Responsive ──────────────────────────────────── */
.sidebar-toggle { display: none; }

@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: inline-flex; }
    .sidebar-overlay {
        display: none;
        position: fixed; inset: 0;
        background: rgba(0,0,0,.5);
        z-index: 999;
    }
    .sidebar-overlay.show { display: block; }
}

/* ── Misc ────────────────────────────────────────── */
.copy-btn { cursor: pointer; }
.text-muted-sm { color: #94a3b8; font-size: .78rem; }
.border-dashed { border-style: dashed !important; }
