/* ==========================================================================
   MMSEC Customer Portal - design system
   Logical properties (inline-start/end) are used throughout so the same CSS
   serves LTR (English) and RTL (Arabic / Urdu).
   ========================================================================== */

:root {
    --brand: #0B3B5C;
    --brand-deep: #071F33;
    --brand-2: #0E7C66;
    --brand-2-soft: #E7F5F1;
    --gold: #C9A227;
    --gold-soft: #FBF5E1;

    --bg: #F3F5F9;
    --surface: #FFFFFF;
    --surface-2: #F8FAFC;
    --text: #101828;
    --text-2: #344054;
    --muted: #667085;
    --border: #E4E7EC;

    --success: #12B76A;
    --success-soft: #E8F8F0;
    --danger: #E5484D;
    --danger-soft: #FDECEC;
    --warning: #F79009;
    --warning-soft: #FEF4E6;
    --info: #2E90FA;
    --info-soft: #EAF3FF;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
    --shadow-lg: 0 12px 40px rgba(7, 31, 51, .18);
    --sidebar-w: 264px;
    --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, "Noto Sans Arabic", "Noto Nastaliq Urdu", sans-serif;
}

[data-theme="dark"] {
    --bg: #0B1220;
    --surface: #111A2B;
    --surface-2: #0F1726;
    --text: #E6EAF2;
    --text-2: #C3CAD7;
    --muted: #8C97AB;
    --border: #1F2A3E;
    --brand-2-soft: rgba(14, 124, 102, .16);
    --gold-soft: rgba(201, 162, 39, .14);
    --success-soft: rgba(18, 183, 106, .14);
    --danger-soft: rgba(229, 72, 77, .14);
    --warning-soft: rgba(247, 144, 9, .14);
    --info-soft: rgba(46, 144, 250, .14);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { margin: 0; color: var(--text); font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; unicode-bidi: plaintext; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.up { color: var(--success); }
.down { color: var(--danger); }
.nowrap { white-space: nowrap; }
.text-end { text-align: end; }
.hidden { display: none !important; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar-w); z-index: 40;
    background: linear-gradient(180deg, var(--brand-deep) 0%, var(--brand) 100%);
    color: #CFE0EE; display: flex; flex-direction: column; padding: 22px 16px;
}
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; color: #fff; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
    background: linear-gradient(135deg, var(--gold) 0%, #E9C95B 100%); color: var(--brand-deep); font-weight: 800; font-size: 17px;
    box-shadow: 0 6px 18px rgba(201, 162, 39, .35);
}
.brand-name { font-weight: 700; font-size: 16px; line-height: 1.15; }
.brand-sub { font-size: 11px; opacity: .7; letter-spacing: .04em; text-transform: uppercase; }

.nav { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; opacity: .55; padding: 16px 12px 6px; }
.nav a {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #CFE0EE;
    font-weight: 500; position: relative; transition: background .15s, color .15s;
}
.nav a i { width: 18px; text-align: center; opacity: .85; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255, 255, 255, .11); color: #fff; }
.nav a.active::before { content: ""; position: absolute; inset-inline-start: -16px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold); }
[dir="rtl"] .nav a.active::before { border-radius: 4px 0 0 4px; }
.nav .pill { margin-inline-start: auto; background: var(--gold); color: var(--brand-deep); font-size: 11px; font-weight: 700; border-radius: 20px; padding: 1px 8px; }

.sidebar-card {
    margin-top: auto; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px; padding: 14px; font-size: 12.5px;
}
.sidebar-card .rm { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; color: #fff; }
.sidebar-card .btn { width: 100%; justify-content: center; }

.main { flex: 1; min-width: 0; margin-inline-start: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 14px 28px;
    background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar .menu-btn { display: none; }
.topbar .page-title h1 { font-size: 20px; }
.topbar .page-title p { color: var(--muted); font-size: 12.5px; }
.topbar .spacer { flex: 1; }

.icon-btn {
    width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; cursor: pointer;
    background: var(--surface); border: 1px solid var(--border); color: var(--text-2); position: relative;
}
.icon-btn:hover { border-color: var(--brand-2); color: var(--brand-2); text-decoration: none; }
.icon-btn .dot { position: absolute; top: 8px; inset-inline-end: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; }
.avatar {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 13px;
    background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; flex: none;
}
.avatar.lg { width: 64px; height: 64px; border-radius: 18px; font-size: 22px; }
.user-chip .who { line-height: 1.15; padding-inline-end: 8px; }
.user-chip .who b { font-size: 13px; display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who span { font-size: 11.5px; color: var(--muted); }

.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 240px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; display: none; z-index: 60;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button {
    display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; border-radius: 8px; color: var(--text-2);
    background: none; border: 0; cursor: pointer; text-align: start;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); text-decoration: none; }
.dropdown-menu .sep { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown-menu a.active { color: var(--brand-2); font-weight: 600; }

.notif-menu { width: 360px; max-width: calc(100vw - 32px); padding: 0; }
.notif-menu .head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.notif-list { max-height: 380px; overflow: auto; }
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif b { display: block; color: var(--text); font-size: 13px; }
.notif p { font-size: 12.5px; color: var(--muted); }

.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }
.footer { padding: 18px 28px 28px; color: var(--muted); font-size: 12px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }

/* ---------- Grid ---------- */
.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-main-r { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mt { margin-top: 20px; }
.mt-s { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card.flush .card-head { padding: 18px 20px 0; }
.card-head h3 { font-size: 15.5px; }
.card-head p { font-size: 12.5px; color: var(--muted); }

.hero {
    position: relative; overflow: hidden; color: #fff; border: 0; padding: 26px 28px;
    background:
        radial-gradient(1200px 300px at 110% -40%, rgba(201, 162, 39, .35), transparent 60%),
        radial-gradient(600px 300px at -10% 120%, rgba(14, 124, 102, .55), transparent 60%),
        linear-gradient(135deg, var(--brand-deep) 0%, var(--brand) 55%, #0D5A6E 100%);
}
.hero::after {
    content: ""; position: absolute; inset: 0; opacity: .08; pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
    background-size: 28px 28px; mask-image: linear-gradient(90deg, transparent, #000 70%);
}
.hero h2, .hero h3 { color: #fff; }
.hero .label { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; opacity: .75; }
.hero .big { font-size: 40px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; margin: 6px 0 8px; }
.hero .big small { font-size: 16px; font-weight: 600; opacity: .7; margin-inline-end: 6px; }
.hero .delta { display: inline-flex; gap: 6px; align-items: center; background: rgba(255,255,255,.12); padding: 4px 10px; border-radius: 20px; font-size: 12.5px; font-weight: 600; }
.hero .split { display: flex; gap: 32px; margin-top: 22px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .split div span { display: block; font-size: 11.5px; opacity: .7; text-transform: uppercase; letter-spacing: .06em; }
.hero .split div b { font-size: 17px; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero { display: flex; flex-direction: column; }
.hero .hero-chart { position: relative; z-index: 1; flex: 1; min-height: 90px; margin: 18px -8px -8px; }
.hero .hero-top { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; position: relative; z-index: 1; }

.kpi { display: flex; gap: 14px; align-items: flex-start; }
.kpi .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; font-size: 16px; }
.kpi .ico.green { background: var(--brand-2-soft); color: var(--brand-2); }
.kpi .ico.gold { background: var(--gold-soft); color: #A27F12; }
.kpi .ico.blue { background: var(--info-soft); color: var(--info); }
.kpi .ico.red { background: var(--danger-soft); color: var(--danger); }
.kpi .lbl { color: var(--muted); font-size: 12.5px; }
.kpi .val { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.kpi .sub { font-size: 12px; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 11px; border: 1px solid transparent;
    font-weight: 600; font-size: 13.5px; cursor: pointer; transition: transform .05s, box-shadow .15s, background .15s; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand-2); color: #fff; box-shadow: 0 4px 14px rgba(14, 124, 102, .28); }
.btn-primary:hover { background: #0B6A57; }
.btn-gold { background: var(--gold); color: var(--brand-deep); box-shadow: 0 4px 14px rgba(201, 162, 39, .3); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--brand-2); color: var(--brand-2); }
.btn-light { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .2); }
.btn-light:hover { background: rgba(255, 255, 255, .22); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-buy { background: var(--success-soft); color: #0A8A50; }
.btn-sell { background: var(--danger-soft); color: var(--danger); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 13px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Badges & chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.success { background: var(--success-soft); color: #0A8A50; }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warning { background: var(--warning-soft); color: #B54708; }
.badge.info { background: var(--info-soft); color: #1570CD; }
.badge.muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge.gold { background: var(--gold-soft); color: #8A6A0A; }
.side-BUY { color: #0A8A50; font-weight: 700; }
.side-SELL { color: var(--danger); font-weight: 700; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    padding: 7px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
    font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.chip:hover { border-color: var(--brand-2); text-decoration: none; }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.demo-flag {
    display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px;
    background: var(--gold-soft); color: #8A6A0A; border: 1px dashed rgba(201, 162, 39, .6);
}
.live-flag { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: var(--success-soft); color: #0A8A50; }
.live-flag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(18, 183, 106, .6); } 70% { box-shadow: 0 0 0 7px rgba(18, 183, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0); } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: start; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .r { text-align: end; }
.sec-cell { display: flex; gap: 12px; align-items: center; }
.sec-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 11px; color: #fff; flex: none; }
.sec-cell b { display: block; font-size: 13.5px; }
.sec-cell span { font-size: 12px; color: var(--muted); }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .grow span { font-size: 12px; color: var(--muted); }
.date-box { width: 46px; text-align: center; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); padding: 4px 0; flex: none; }
.date-box b { display: block; font-size: 16px; line-height: 1.1; }
.date-box span { font-size: 10px; text-transform: uppercase; color: var(--muted); }

.progress { height: 8px; background: var(--surface-2); border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.progress > div { height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--brand-2), #3BB89A); }

.legend { display: flex; flex-direction: column; gap: 10px; }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend-row i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-row .grow { flex: 1; }

.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 200px; }
.donut-wrap { position: relative; height: 210px; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut-center b { font-size: 20px; display: block; }
.donut-center span { font-size: 11.5px; color: var(--muted); }

.tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; width: fit-content; }
.tabs button, .tabs a { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.tabs .active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 0 12px; }
.search input { border: 0; outline: 0; background: transparent; padding: 9px 0; min-width: 200px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.input, .select, .textarea {
    width: 100%; padding: 11px 14px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface);
    outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(14, 124, 102, .12); }
.input-group { position: relative; }
.input-group .addon { position: absolute; inset-block: 0; inset-inline-start: 14px; display: grid; place-items: center; color: var(--muted); font-size: 13px; pointer-events: none; }
.input-group .input { padding-inline-start: 52px; }
.input-group .addon-end { position: absolute; inset-block: 0; inset-inline-end: 6px; display: grid; place-items: center; }
.hint { font-size: 12px; color: var(--muted); }
.error-text { font-size: 12.5px; color: var(--danger); }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 5px; }
.seg input { display: none; }
.seg label { text-align: center; padding: 10px; border-radius: 10px; cursor: pointer; font-weight: 700; color: var(--muted); }
.seg input:checked + label.buy { background: var(--success); color: #fff; box-shadow: 0 4px 12px rgba(18, 183, 106, .3); }
.seg input:checked + label.sell { background: var(--danger); color: #fff; box-shadow: 0 4px 12px rgba(229, 72, 77, .3); }
.seg input:checked + label.neutral { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13px; }
.alert.danger { background: var(--danger-soft); color: #B42318; }
.alert.info { background: var(--info-soft); color: #1559A8; }
.alert.success { background: var(--success-soft); color: #067647; }
.alert.warning { background: var(--warning-soft); color: #93370D; }

.summary { border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); padding: 16px; }
.summary .line { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.summary .line span { color: var(--muted); }
.summary .total { border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 12px; font-weight: 700; font-size: 15px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding-inline-start: 30px; padding-bottom: 18px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 9px; top: 20px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .tdot { position: absolute; inset-inline-start: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; color: #fff; }
.tdot.success { background: var(--success); } .tdot.danger { background: var(--danger); } .tdot.warning { background: var(--warning); }
.tdot.info { background: var(--info); } .tdot.muted { background: var(--muted); }

/* ---------- Drawer & modal ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(7, 18, 32, .45); z-index: 80; display: none; backdrop-filter: blur(2px); }
.backdrop.open { display: block; }
.drawer {
    position: fixed; inset-block: 0; inset-inline-end: 0; width: 480px; max-width: 100%; background: var(--surface); z-index: 90;
    box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column;
}
[dir="rtl"] .drawer { transform: translateX(-100%); }
.drawer.open { transform: translateX(0) !important; }
.drawer .d-head { padding: 20px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.drawer .d-body { padding: 22px; overflow: auto; flex: 1; }

.toast-host { position: fixed; inset-block-end: 24px; inset-inline-end: 24px; z-index: 120; display: flex; flex-direction: column; gap: 10px; }
.toast {
    min-width: 280px; max-width: 380px; padding: 13px 16px; border-radius: 12px; background: var(--brand-deep); color: #fff;
    box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; animation: toastIn .25s ease;
}
.toast.success i { color: #4ADE80; } .toast.error i { color: #F87171; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Live prices ---------- */
.flash-up { animation: flashUp 1.2s ease; }
.flash-down { animation: flashDown 1.2s ease; }
@keyframes flashUp { 0% { background: rgba(18, 183, 106, .35); color: #067647; } 100% { background: transparent; } }
@keyframes flashDown { 0% { background: rgba(229, 72, 77, .32); color: #B42318; } 100% { background: transparent; } }
.flash-up, .flash-down { border-radius: 6px; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #E5484D; text-transform: uppercase; }
.live-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #E5484D; animation: pulseRed 1.4s infinite; }
@keyframes pulseRed { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .6); } 70% { box-shadow: 0 0 0 7px rgba(229, 72, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); } }

.fx-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fx-item { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.fx-item .ccy { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.fx-item .ccy span { font-size: 18px; }
.fx-item .rate { font-size: 18px; font-weight: 700; margin-top: 4px; }
.fx-item .name { font-size: 11.5px; color: var(--muted); }

/* ---------- Security picker (New Request) ---------- */
.sec-picker { display: flex; flex-direction: column; gap: 14px; }
.sec-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.sec-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sec-tile {
    text-align: start; border: 1.5px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--surface);
    cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .05s; position: relative;
}
.sec-tile:hover { border-color: var(--brand-2); }
.sec-tile.active { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(14, 124, 102, .14); background: var(--brand-2-soft); }
.sec-tile.active::after { content: "\f00c"; font-family: "Font Awesome 5 Free"; font-weight: 900; position: absolute; top: 10px; inset-inline-end: 12px; color: var(--brand-2); font-size: 12px; }
.sec-tile .t-tenor { font-weight: 700; font-size: 15px; }
.sec-tile .t-yield { font-size: 20px; font-weight: 750; margin-top: 2px; padding: 0 2px; display: inline-block; }
.sec-tile .t-sub { font-size: 11.5px; color: var(--muted); }
.sec-tile .t-chg { font-size: 11.5px; font-weight: 600; }

/* ---------- Ticker ---------- */
.ticker { overflow: hidden; white-space: nowrap; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); padding: 10px 0; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-track { display: inline-flex; gap: 36px; animation: ticker 40s linear infinite; padding-inline-start: 100%; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; }
.ticker-item b { color: var(--text); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-100%); } }
[dir="rtl"] .ticker-track { animation-name: tickerRtl; }
@keyframes tickerRtl { from { transform: translateX(0); } to { transform: translateX(100%); } }

.spark { width: 90px; height: 28px; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty i { font-size: 32px; color: var(--border); margin-bottom: 10px; display: block; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.auth-art {
    position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column;
    background:
        radial-gradient(900px 400px at 100% 0%, rgba(201, 162, 39, .32), transparent 60%),
        radial-gradient(700px 500px at 0% 100%, rgba(14, 124, 102, .6), transparent 60%),
        linear-gradient(140deg, var(--brand-deep) 0%, var(--brand) 60%, #0D5A6E 100%);
}
.auth-art h1 { color: #fff; font-size: 38px; line-height: 1.15; margin: auto 0 16px; max-width: 520px; letter-spacing: -.02em; }
.auth-art p.lead { opacity: .82; font-size: 16px; max-width: 480px; }
.auth-art .features { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 34px 0 auto; max-width: 560px; }
.auth-art .feature { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; padding: 14px; font-size: 13px; }
.auth-art .feature i { color: var(--gold); margin-bottom: 8px; display: block; font-size: 18px; }
.auth-art .feature b { display: block; margin-bottom: 2px; }
.auth-art .feature span { opacity: .75; }
.auth-art .mock {
    position: absolute; inset-inline-end: -60px; top: 120px; width: 300px; padding: 18px; border-radius: 18px; opacity: .9;
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(8px); transform: rotate(-6deg);
}
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 48px; }
.auth-form .inner { width: 100%; max-width: 400px; margin: 0 auto; }
.auth-form h2 { font-size: 26px; margin-bottom: 6px; }
.auth-form .lang { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: auto; }
.auth-form .lang a { font-size: 12.5px; padding: 5px 10px; border-radius: 8px; color: var(--muted); }
.auth-form .lang a.active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.otp { display: flex; gap: 10px; justify-content: space-between; direction: ltr; }
.otp input { width: 52px; height: 58px; text-align: center; font-size: 22px; font-weight: 700; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); outline: none; }
.otp input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(14, 124, 102, .12); }
.trust { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 28px; color: var(--muted); font-size: 12px; }
.trust span { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Mobile bottom navigation ---------- */
.bottom-nav { display: none; }

/* ---------- Print ---------- */
@media print {
    .sidebar, .topbar, .footer, .bottom-nav, .no-print { display: none !important; }
    .main { margin: 0 !important; }
    .content { padding: 0 !important; max-width: none; }
    body { background: #fff; }
    .card { box-shadow: none; border-color: #ddd; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1360px) {
    .auth-art .mock { display: none; }
}
@media (max-width: 1200px) {
    .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .g-main, .g-main-r { grid-template-columns: 1fr; }
}
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
    [dir="rtl"] .sidebar { transform: translateX(100%); }
    body.nav-open .sidebar { transform: none; }
    .main { margin-inline-start: 0; }
    .topbar { padding: 12px 16px; }
    .topbar .menu-btn { display: inline-grid; }
    .content { padding: 16px 16px 96px; }
    .g-3, .g-2 { grid-template-columns: 1fr; }
    .auth { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .user-chip .who, .user-chip > .fa-chevron-down { display: none; }
    .user-chip { padding: 3px; }
    .topbar { gap: 8px; }
    .topbar .icon-btn { width: 36px; height: 36px; }
    .topbar .page-title h1 { font-size: 17px; }
    .bottom-nav {
        display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 50;
        background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    }
    .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--muted); padding: 4px 0; }
    .bottom-nav a i { font-size: 17px; }
    .bottom-nav a.active { color: var(--brand-2); font-weight: 600; }
    .bottom-nav a.fab i { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--brand-2); color: #fff; margin-top: -18px; box-shadow: 0 6px 16px rgba(14, 124, 102, .35); }
    .hero .big { font-size: 32px; }
    .page-title p { display: none; }
    .search input { min-width: 0; width: 100%; }
}
@media (max-width: 900px) {
    .fx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .g-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
    .kpi { flex-direction: column; gap: 8px; }
    .kpi .val { font-size: 17px; }
    .card { padding: 16px; }
    .hero { padding: 22px 20px; }
    .hide-sm { display: none !important; }
    .otp input { width: 44px; height: 52px; }
    .auth-form { padding: 28px 20px; }
}
