/* ===== ETF Platform — Base + Midnight (default) Theme ===== */
/* Theme CSS files override these variables to re-skin the platform.
   See docs/theme-selectors.md for the full contract.               */
:root {
    /* ── Backgrounds ──────────────────────── */
    --bg-dark: #0a1628;      /* alias kept for backwards compat */
    --bg-main: #0a1628;
    --bg-card: #0f1f35;
    --bg-card-hover: #132844;
    --bg-input: #0a1628;
    --bg-sidebar: #070f1c;

    /* ── Accent + semantic colors ─────────── */
    --accent: #10b981;
    --accent-hover: #0ea472;
    --accent-soft: rgba(16, 185, 129, 0.15);
    --secondary: #3b82f6;
    --secondary-soft: rgba(59, 130, 246, 0.15);
    --positive: #10b981;
    --negative: #ef4444;
    --negative-soft: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.15);
    --purple: #a855f7;
    --blue: #3b82f6;
    --yellow: #f59e0b;
    --pink: #ec4899;

    /* ── Text ─────────────────────────────── */
    --text-light: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* ── Borders ──────────────────────────── */
    --border: rgba(30, 58, 95, 0.4);
    --border-strong: rgba(30, 58, 95, 0.7);

    /* ── Typography ───────────────────────── */
    --font-heading: 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* ── Geometry ──────────────────────────── */
    --radius-card: 12px;
    --radius-btn: 8px;
    --radius-input: 8px;
    --radius-badge: 6px;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.4);
    --transition: 0.2s ease;

    /* ── Layout ────────────────────────────── */
    --sidebar-width: 240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

/* ===== Layout ===== */
.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.content-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.main-content {
    flex: 1;
    padding: 24px;
    max-width: 100%;
    overflow-x: hidden;
}

/* ===== Sidebar ===== */
.sidebar-logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.sidebar-logo img {
    max-width: 140px;
    height: auto;
}
.sidebar-logo h2 {
    font-size: 1.2rem;
    font-weight: 700;
}
.sidebar-logo h2 span { color: var(--accent); }

.sidebar-nav {
    flex: 1;
    padding: 0 12px;
}

.nav-section {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 12px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.15s;
    margin-bottom: 2px;
}
.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
}
.nav-link.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent);
}
.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.sidebar-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.7rem;
    flex-shrink: 0;
}

/* ===== Themed Checkboxes ===== */
.themed-check {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--bg-dark);
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    transition: all 0.15s;
}
.themed-check:checked {
    background: var(--accent);
    border-color: var(--accent);
}
.themed-check:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}
.themed-check:hover {
    border-color: var(--accent);
}

/* ===== Bell/Message Hover Dropdown ===== */
.bell-wrapper .bell-dropdown { display: none !important; }
.bell-wrapper.open .bell-dropdown { display: block !important; }
.bell-wrapper .bell-dropdown::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

/* ===== Desktop Top Bar ===== */
.desktop-top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

/* ===== Top Bar (mobile) ===== */
.top-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 90;
}
.menu-toggle {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: pointer;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.card-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===== Stats Row ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}
.stat-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
}
.stat-change {
    font-size: 0.8rem;
    margin-top: 4px;
}

/* ===== Tables ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(30, 58, 95, 0.5);
    font-size: 0.85rem;
}
.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}
.badge-green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent);
}
.badge-red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--negative);
}
.badge-blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    text-decoration: none;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent-hover);
}
.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.btn-sm {
    padding: 5px 10px;
    font-size: 0.75rem;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}
.form-input:focus {
    outline: none;
    border-color: var(--accent);
}
.form-input::placeholder {
    color: var(--text-dim);
}

/* ===== Page Header ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.page-title {
    font-size: 1.4rem;
    font-weight: 700;
}

/* ===== Skeleton Loading ===== */
@keyframes skeleton-pulse {
    0% { opacity: 0.4; }
    50% { opacity: 0.8; }
    100% { opacity: 0.4; }
}
.skeleton {
    background: var(--border);
    border-radius: 4px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}
.skeleton-text {
    height: 12px;
    margin-bottom: 8px;
    width: 80%;
}
.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 60%; }
.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.skeleton-card {
    height: 100px;
    border-radius: 12px;
}

/* ===== Breadcrumbs ===== */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 12px;
}
.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}
.breadcrumbs a:hover {
    color: var(--accent);
}
.breadcrumbs .sep {
    color: var(--text-dim);
    font-size: 0.6rem;
}
.breadcrumbs .current {
    color: var(--text-light);
    font-weight: 500;
}

/* ===== Utilities ===== */
.text-positive { color: var(--positive); }
.text-negative { color: var(--negative); }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }

/* ===== Search ===== */
.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    gap: 8px;
    margin-bottom: 16px;
}
.search-bar i { color: var(--text-dim); }
.search-bar input {
    background: none;
    border: none;
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    flex: 1;
    outline: none;
}

/* ===== Responsive ===== */
/* ===== Mobile Bottom Nav ===== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
}
.mobile-bottom-nav .nav-items {
    display: flex;
    justify-content: space-around;
}
.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.6rem;
    transition: color 0.15s;
}
.mobile-bottom-nav a.active,
.mobile-bottom-nav a:hover {
    color: var(--accent);
}
.mobile-bottom-nav a i {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.open {
        display: block;
    }
    .content-wrapper {
        margin-left: 0;
    }
    .main-content {
        padding: 16px;
    }
    .desktop-top-bar {
        display: none;
    }
    .top-bar {
        display: flex;
    }
    .mobile-bottom-nav {
        display: block;
    }
    .main-content {
        padding-bottom: 70px; /* space for bottom nav */
    }
    .stats-row {
        grid-template-columns: 1fr;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .data-table { font-size: 0.8rem; }
    .data-table th, .data-table td { padding: 8px; }
}

/* ===== Utility Classes (Phase 7 — extracted from inline styles) ===== */

/* Flex */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* Gap */
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }

/* Margin */
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.ml-auto { margin-left: auto; }

/* Padding */
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.py-8 { padding-top: 8px; padding-bottom: 8px; }
.py-12 { padding-top: 12px; padding-bottom: 12px; }

/* Text */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-xs { font-size: 0.65rem; }
.text-sm { font-size: 0.8rem; }
.text-base { font-size: 0.85rem; }
.text-lg { font-size: 1rem; }
.text-xl { font-size: 1.3rem; }
.text-2xl { font-size: 1.5rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-positive { color: var(--positive); }
.text-negative { color: var(--negative); }
.text-purple { color: var(--purple); }
.nowrap { white-space: nowrap; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Borders */
.border-accent { border-color: var(--accent); }
.border-b { border-bottom: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.rounded-6 { border-radius: 6px; }
.rounded-8 { border-radius: 8px; }
.rounded-10 { border-radius: 10px; }
.rounded-12 { border-radius: 12px; }
.rounded-full { border-radius: 50%; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-auto-fill { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.grid-auto-fill-320 { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

/* Status Badges */
.badge-pending { background: rgba(245,158,11,0.15); color: #f59e0b; padding: 3px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.badge-processing { background: rgba(59,130,246,0.15); color: #3b82f6; padding: 3px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.badge-completed { background: rgba(16,185,129,0.15); color: #10b981; padding: 3px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.badge-failed { background: rgba(239,68,68,0.15); color: #ef4444; padding: 3px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.badge-canceled { background: rgba(100,116,139,0.15); color: #64748b; padding: 3px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.badge-refunded { background: rgba(168,85,247,0.15); color: #a855f7; padding: 3px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.badge-green { background: rgba(16,185,129,0.15); color: #10b981; padding: 3px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.badge-red { background: rgba(239,68,68,0.15); color: #ef4444; padding: 3px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.badge-yellow { background: rgba(245,158,11,0.15); color: #f59e0b; padding: 3px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.badge-blue { background: rgba(59,130,246,0.15); color: #3b82f6; padding: 3px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.badge-purple { background: rgba(168,85,247,0.15); color: #a855f7; padding: 3px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.badge-gray { background: rgba(100,116,139,0.15); color: #64748b; padding: 3px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }

/* Component: Batch Bar */
.batch-bar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-card); border-top: 1px solid var(--border); padding: 12px 24px; z-index: 100; box-shadow: 0 -4px 16px rgba(0,0,0,0.3); }

/* Component: Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; width: 100%; max-width: 500px; margin: 20px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; }

/* Component: Search Bar */
.search-wrapper { position: relative; flex: 1; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 0.8rem; }

/* Form inputs */
.form-input { width: 100%; background: var(--bg-dark); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; color: var(--text-light); font-family: Inter, sans-serif; font-size: 0.85rem; }
.form-input:focus { outline: none; border-color: var(--accent); }
.form-label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }

/* Buttons */
.btn { border: none; border-radius: 8px; padding: 10px 16px; cursor: pointer; font-family: Inter, sans-serif; font-weight: 600; font-size: 0.85rem; transition: background 0.2s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--negative); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 12px; font-size: 0.75rem; border-radius: 6px; }

/* Alert/Flash */
.alert { border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-size: 0.85rem; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: var(--positive); }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: var(--negative); }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); color: var(--yellow); }
.alert-info { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3); color: var(--blue); }

/* Responsive grid breakpoints */
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
    .hide-desktop { display: none !important; }
}

/* ===== Legacy Light Theme (kept for backwards compat; Phase 17 themes replace this) ===== */
body.light-theme {
    --bg-dark: #f1f5f9;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --text-light: #1e293b;
    --text-muted: #475569;
    --text-dim: #94a3b8;
}
body.light-theme .sidebar { background: #1e293b; }
body.light-theme .sidebar .nav-link { color: #94a3b8; }
body.light-theme .sidebar .nav-link.active { color: #ffffff; background: rgba(255,255,255,0.1); }
body.light-theme .sidebar .nav-link:hover { color: #e2e8f0; }
body.light-theme .top-bar { background: #ffffff; border-color: #e2e8f0; }
body.light-theme .desktop-top-bar { background: #ffffff; border-color: #e2e8f0; }
body.light-theme .mobile-bottom-nav { background: #ffffff; border-color: #e2e8f0; }
body.light-theme .search-bar { background: #f1f5f9; border-color: #e2e8f0; }
body.light-theme .form-input { background: #f8fafc; border-color: #e2e8f0; color: #1e293b; }
body.light-theme .btn-outline { border-color: #e2e8f0; color: #475569; }
body.light-theme .hero-wealth { background: #ffffff; border-color: #e2e8f0; }

/* ===== Phase 17 — Utility classes for inline-style replacement ===== */
/* These cover the top-30 most-repeated inline patterns (2,560 total).
   Views can swap style="..." for these classes; themes override via
   custom properties automatically. */

/* Text sizes */
.text-2xs { font-size: 0.65rem; }
/* .text-xs already defined above */
/* .text-sm already defined above */

/* Colors as classes */
.color-accent { color: var(--accent); }
.color-negative { color: var(--negative); }
.color-warning { color: var(--warning); }
.color-secondary { color: var(--secondary); }

/* Border colors */
.border-accent { border-color: var(--accent); }
.border-negative { border-color: var(--negative); }
.border-warning { border-color: var(--warning); }

/* Flex patterns */
.field-col { display: flex; flex-direction: column; gap: 4px; }
.inline-form { display: inline; }
.no-wrap { white-space: nowrap; }

/* Sidebar submenu indent */
.sidebar-sub { padding-left: 36px; font-size: 0.8rem; }

/* Button height (trade forms, filter bars) */
.h-btn { height: 42px; }

/* Card accent border (used by Ember theme) */
.card-accent-left { border-left: 3px solid var(--accent); }

/* Stats row — ensures grid even when used outside .stats-row */
.stat-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ===== Phase 19 — RTL support (Arabic) ===== */
/* When body has dir="rtl", flip the layout. Flexbox and Grid handle
   most cases automatically; sidebar + main-content need explicit flip. */
[dir="rtl"] .sidebar { left: auto; right: 0; border-right: none; border-left: 1px solid var(--border); }
[dir="rtl"] .main-content { margin-left: 0; margin-right: var(--sidebar-width); }
[dir="rtl"] .nav-link i { margin-right: 0; margin-left: 10px; }
[dir="rtl"] .text-right { text-align: left; }
[dir="rtl"] .data-table th, [dir="rtl"] .data-table td { text-align: right; }
[dir="rtl"] .badge { margin-left: 0; margin-right: auto; }
@media (max-width: 768px) {
    [dir="rtl"] .sidebar { right: -260px; left: auto; }
    [dir="rtl"] .sidebar.active { right: 0; }
    [dir="rtl"] .main-content { margin-right: 0; }
}
