/* ═══════════════════════════════════════════════════════════════════
   UangKu SaaS — Modern Clean Design System
   Based on GridPro / CryptoPro design language
   ═══════════════════════════════════════════════════════════════════ */

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

:root {
    /* ── Core Colors ── */
    --bg-base: #f1f5f9;
    --bg-canvas: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.05);

    /* ── Primary Accent ── */
    --primary: #F26522;
    --primary-dim: #FFF3ED;
    --primary-hover: #E55A1B;
    --primary-pressed: #D4540F;

    /* ── Status ── */
    --pos: #10b981;
    --pos-dim: #ecfdf5;
    --neg: #f43f5e;
    --neg-dim: #fff1f2;
    --warn: #f59e0b;
    --warn-dim: #fffbeb;

    /* ── Text ── */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    --text-white: #ffffff;

    /* ── Borders & Shadows ── */
    --border: #e2e8f0;
    --sidebar-w: 260px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-card: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-sidebar: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-base);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* ── Modern Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 28px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo-box {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(242, 101, 34, 0.4);
    flex-shrink: 0;
}

.sidebar-header .logo-text {
    font-weight: 800;
    font-size: 18px;
    color: white;
    letter-spacing: -0.02em;
}

.sidebar-header .logo-sub {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
}

.sidebar-nav {
    flex: 1;
    padding: 0 16px 20px;
    overflow-y: auto;
}

.nav-group {
    margin-top: 24px;
}

.nav-group-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.3);
    margin: 0 12px 10px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    margin-bottom: 2px;
    font-size: 14px;
}

.sidebar-link i {
    font-size: 18px;
}

.sidebar-link:hover {
    color: white;
    background: var(--bg-sidebar-hover);
}

.sidebar-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 12px -4px rgba(242, 101, 34, 0.35);
}

.sidebar-link .nav-icon {
    font-size: 18px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link.active .nav-icon {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.sidebar-user {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-info .user-name {
    font-weight: 700;
    font-size: 14px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-template: ellipsis;
}

.user-info .user-role {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

/* ── Theme Toggle in Sidebar ── */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* ── Main Content ── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 36px 40px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: calc(100vw - var(--sidebar-w));
    overflow-x: hidden;
}

.sidebar.collapsed ~ .main-content,
.layout-wrapper:has(.sidebar.collapsed) .main-content {
    margin-left: 80px;
}

/* ── Page Header ── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    margin: 0;
    line-height: 1.2;
}

.page-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Modern Stat Cards ── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.modern-stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modern-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.stat-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.stat-val {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-footer {
    margin-top: 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
}

/* ── Display Cards ── */
.display-section {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
    margin-bottom: 28px;
}

.display-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.display-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.display-card h3 .card-icon {
    font-size: 16px;
}

.card-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ── Activity / Transaction List ── */
.activity-list {
    margin-top: 8px;
    position: relative;
}

.activity-list::before {
    content: '';
    position: absolute;
    left: 21px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: repeating-linear-gradient(to bottom, var(--border), var(--border) 4px, transparent 4px, transparent 8px);
    opacity: 0.6;
    z-index: 0;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    background: transparent;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.activity-item:hover {
    transform: translateX(3px);
}

.activity-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    background: white;
    box-shadow: 0 0 0 4px white, var(--shadow-sm);
    border: 1px solid var(--border);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-desc {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.activity-amount {
    font-weight: 800;
    font-size: 14px;
    text-align: right;
    white-space: nowrap;
}

.activity-amount.pos { color: var(--pos); }
.activity-amount.neg { color: var(--neg); }

/* ── Account Grid ── */
.account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.account-card {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.account-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(242, 101, 34, 0.1);
    transform: translateY(-2px);
}

.account-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.account-card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.account-card-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
}

.account-card-type {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: capitalize;
}

.account-card-balance {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
}

.account-card-balance.neg { color: var(--neg); }

/* ── Status Pills ── */
.status-pill {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pill-green  { background: var(--pos-dim); color: #059669; }
.pill-red    { background: var(--neg-dim); color: var(--neg); }
.pill-orange { background: var(--primary-dim); color: var(--primary); }
.pill-blue   { background: #eff6ff; color: #2563eb; }
.pill-gray   { background: var(--bg-base); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Auth Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(242, 101, 34, 0.25);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(242, 101, 34, 0.35);
    background: var(--primary-hover);
}
.btn-primary:active {
    transform: translateY(0);
    background: var(--primary-pressed);
}
.btn-secondary {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ── App Buttons ── */
.btn-modern {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary-modern {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(242, 101, 34, 0.25);
}

.btn-primary-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(242, 101, 34, 0.35);
    background: var(--primary-hover);
}

.btn-primary-modern:active {
    transform: translateY(0);
    background: var(--primary-pressed);
}

.btn-secondary-modern {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-secondary-modern:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Balance Hero Banner ── */
.balance-hero {
    background: linear-gradient(135deg, var(--primary) 0%, #EA580C 100%);
    border-radius: var(--radius-xl);
    padding: 28px 32px;
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 28px;
    box-shadow: 0 10px 30px -6px rgba(242, 101, 34, 0.4);
}

.balance-hero::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.balance-hero::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: 20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.balance-hero-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.balance-hero-value {
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 8px;
}

.balance-hero-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.balance-hero-sub span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ── Upgrade Banner ── */
.upgrade-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
}

.upgrade-banner-text {
    display: flex;
    align-items: center;
    gap: 14px;
}

.upgrade-banner-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.upgrade-banner h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.upgrade-banner p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.upgrade-btn {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(242, 101, 34, 0.3);
}

.upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(242, 101, 34, 0.4);
}

/* ── FAB ── */
.fab-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 54px;
    height: 54px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(242, 101, 34, 0.45);
    transition: all 0.2s ease;
    z-index: 500;
}

.fab-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 28px rgba(242, 101, 34, 0.55);
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modal-in 0.25s ease;
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-base);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--border);
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 24px 22px;
    border-top: 1px solid var(--border);
}

/* ── Form Elements ── */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.form-input,
.form-select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text-main);
    background: var(--bg-card);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-input:focus,
.form-select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(242, 101, 34, 0.12);
}

.form-input.mono,
.form-select.mono {
    font-family: 'JetBrains Mono', monospace;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 4px;
}

/* ── Toast ── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toast-in 0.3s ease;
    pointer-events: auto;
    min-width: 240px;
}

.toast.success { border-left: 3px solid var(--pos); }
.toast.error   { border-left: 3px solid var(--neg); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Table ── */
.modern-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

.modern-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-canvas);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.modern-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 13px;
}

.modern-table tr:last-child td {
    border-bottom: none;
}

.modern-table tr:hover td {
    background: var(--bg-canvas);
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-dim);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    background: var(--bg-base);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}

.empty-state p {
    font-size: 14px;
    max-width: 280px;
    margin: 0 auto;
}

/* ── Mobile Overlay ── */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ── Mobile Toggle ── */
.mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 22px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.mobile-toggle:hover {
    background: var(--bg-canvas);
    border-color: var(--text-dim);
}

/* ── Utility ── */
.muted   { color: var(--text-dim); }
.bold    { font-weight: 700; }
.mono    { font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.text-pos { color: var(--pos); }
.text-neg { color: var(--neg); }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }

/* ── Responsive ── */
@media (max-width: 1280px) {
    .main-content { padding: 28px 24px; }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 2000;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.2);
    }
    .sidebar.open { transform: translateX(0); }
    .main-content {
        margin-left: 0;
        max-width: 100vw;
        padding: 24px;
    }
    .mobile-toggle { display: flex; }
    .display-section { grid-template-columns: 1fr; }
    .card-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .main-content { padding: 16px; }
    .page-header { flex-direction: column; gap: 12px; }
    .card-grid { grid-template-columns: 1fr; gap: 14px; }
    .balance-hero { padding: 22px 20px; }
    .balance-hero-value { font-size: 28px; }
    .upgrade-banner { flex-direction: column; }
    .display-card { padding: 20px 16px; }
    .modal { border-radius: var(--radius-lg); }
    .fab-btn { bottom: 24px; right: 20px; width: 48px; height: 48px; }
    .account-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════
   DARK MODE
   Applied via data-theme="dark" on <html>
   ══════════════════════════════════════════════ */
[data-theme="dark"] {
    color-scheme: dark;
    --bg-base:       #0d1117;
    --bg-canvas:     #0f172a;
    --bg-card:       #1e293b;
    --bg-sidebar:    #080e18;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.07);
    --primary-dim:   rgba(242, 101, 34, 0.18);
    --pos-dim:       rgba(16, 185, 129, 0.18);
    --neg-dim:       rgba(244, 63, 94, 0.18);
    --warn-dim:      rgba(245, 158, 11, 0.18);
    --text-main:     #f1f5f9;
    --text-muted:    #94a3b8;
    --text-dim:      #64748b;
    --border:        #334155;
    --shadow-sm:     0 1px 3px 0 rgb(0 0 0 / 0.3);
    --shadow-card:   0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

[data-theme="dark"] .activity-icon {
    background: var(--bg-card);
    box-shadow: 0 0 0 4px var(--bg-card), var(--shadow-sm);
    border-color: var(--border);
}

[data-theme="dark"] .stat-icon-wrap {
    background: var(--bg-sidebar-hover);
}

[data-theme="dark"] .mobile-toggle {
    background: var(--bg-card);
    border-color: var(--border);
}

[data-theme="dark"] .modern-table tr:hover td {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .account-card {
    background: var(--bg-canvas);
}

[data-theme="dark"] .account-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(242, 101, 34, 0.2);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--bg-canvas);
    border-color: var(--border);
    color: var(--text-main);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(242, 101, 34, 0.2);
}

[data-theme="dark"] .modal-close {
    background: var(--bg-canvas);
}

[data-theme="dark"] .modal-close:hover {
    background: var(--border);
}

[data-theme="dark"] .pill-green  { background: rgba(16, 185, 129, 0.2);  color: #34d399; }
[data-theme="dark"] .pill-red    { background: rgba(244, 63, 94, 0.2);    color: #fb7185; }
[data-theme="dark"] .pill-orange { background: rgba(242, 101, 34, 0.2);  color: #fb923c; }
[data-theme="dark"] .pill-blue   { background: rgba(37, 99, 235, 0.2);   color: #60a5fa; }
[data-theme="dark"] .pill-gray   { background: var(--bg-canvas); border-color: var(--border); color: var(--text-muted); }
