/* ═══════════════════════════════════════════════════════════════
   MokhbirPro Setups Catalog — Stylesheet
   Brand Design Guide: Forest Green + Gold on warm white
   Palette: #1a5722 · #228d38 · #9bbe87 · #c08629 · #fbe36b · #ebd5a5
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* ── Core Backgrounds ─────────────────────────────────────── */
    --bg-primary: #ecede8;
    --bg-secondary: #e2e3dd;
    --bg-card: #ffffff;
    --bg-card-hover: #f6f7f3;
    --bg-input: #f2f3ef;
    --border: #d5d8cf;
    --border-light: #c0c4b8;

    /* ── Text ─────────────────────────────────────────────────── */
    --text-primary: #1a1e1b;
    --text-secondary: #4a5548;
    --text-muted: #7a8574;

    /* ── Brand Accent — Gold ──────────────────────────────────── */
    --accent: #c08629;
    --accent-hover: #fbe36b;
    --accent-glow: rgba(192, 134, 41, 0.12);
    --accent-glow-strong: rgba(192, 134, 41, 0.22);
    --accent-warm: #ebd5a5;

    /* ── Brand Primary — Forest Green ─────────────────────────── */
    --brand: #1a5722;
    --brand-light: #228d38;
    --brand-glow: rgba(26, 87, 34, 0.10);
    --brand-sage: #9bbe87;
    --brand-sage-light: #adc89e;

    /* ── Dark Section (navbar/footer) ─────────────────────────── */
    --dark-bg: #1a2332;
    --dark-bg-lighter: #222e40;
    --dark-text: #ecede8;
    --dark-text-muted: #8a9ba8;
    --dark-border: #2e3d50;

    /* ── Semantic Colors ──────────────────────────────────────── */
    --green: #228d38;
    --green-bg: rgba(34, 141, 56, 0.10);
    --red: #c42b36;
    --red-bg: rgba(196, 43, 54, 0.08);
    --orange: #c87006;
    --orange-bg: rgba(200, 112, 6, 0.08);
    --light-green: #9bbe87;
    --light-green-bg: rgba(155, 190, 135, 0.12);

    /* ── Layout ───────────────────────────────────────────────── */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 4px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.10);
    --font-ar: 'Cairo', 'Tajawal', sans-serif;
    --font-en: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.2s ease;
}

/* ── Reset & Base ───────────────────────────────────────────── */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-ar);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* ── Navbar ─────────────────────────────────────────────────── */

.navbar {
    background: linear-gradient(180deg, #0E5A2F 0%, #013608 100%);
    border-bottom: 1px solid #02680F;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    width: 100%;
    padding: 0 36px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 16px;
    direction: ltr;
    position: relative;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.15rem;
    white-space: nowrap;
    transition: opacity var(--transition);
    text-decoration: none;
}

.nav-brand:hover {
    opacity: 0.85;
    color: #ffffff;
}

.nav-brand-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: #ffffff;
    transition: background 0.15s;
    margin-inline-start: 2px;
}

.nav-brand:hover .nav-brand-chevron {
    background: rgba(255,255,255,0.12);
}

.nav-back-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: #ffffff;
    font-size: 1.1rem;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
    margin-inline-start: 4px;
}
.nav-back-btn.visible { display: flex; }
.nav-back-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.35);
}

.brand-icon {
    font-size: 1.5rem;
}

.brand-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.brand-text {
    font-weight: 800;
}

.brand-sub {
    font-size: 0.72rem;
    color: var(--accent);
    font-weight: 600;
    padding: 2px 8px;
    background: var(--accent-glow);
    border-radius: 4px;
    display: none;
}

.nav-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.nav-search::before {
    content: '🔍';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    pointer-events: none;
    z-index: 1;
    opacity: 0.7;
}

.nav-search input {
    width: 100%;
    padding: 8px 16px 8px 40px;
    background: transparent;
    border: 1px solid #02680F;
    border-radius: 9999px;
    color: #ffffff;
    font-family: var(--font-ar);
    font-size: 0.875rem;
    outline: none;
    transition: all var(--transition);
    height: 36px;
}

.nav-search input::placeholder {
    color: rgba(255,255,255,0.6);
}

.nav-search input:focus {
    border-color: rgba(255,255,255,0.4);
    box-shadow: none;
    background: rgba(255,255,255,0.08);
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #0E5A2F;
    border: 1px solid #02680F;
    border-radius: var(--radius-sm);
    display: none;
    max-height: 320px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: var(--shadow-lg);
}

.search-dropdown.active {
    display: block;
}

.search-item {
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid #02680F;
    transition: background 0.12s;
    color: #ffffff;
}

.search-item:hover,
.search-item.highlighted {
    background: rgba(255,255,255,0.08);
}

.search-item:last-child {
    border-bottom: none;
}

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.nav-link {
    color: #ffffff;
    font-size: 0.875rem;
    padding: 8px 16px;
    border-radius: 9999px;
    transition: background 0.15s, color 0.15s;
    font-weight: 500;
    white-space: nowrap;
    height: 34px;
    display: flex;
    align-items: center;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.10);
}

.nav-link.active {
    background: #D4A321;
    color: #013608;
    font-weight: 600;
}

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: #0E5A2F;
    border: 1px solid #02680F;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    padding: 6px 0;
    margin-top: 0;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 8px 16px;
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    font-family: var(--font-ar);
    transition: all var(--transition);
    text-decoration: none;
}

.dropdown-item:hover {
    background: rgba(255,255,255,0.10);
    color: #ffffff;
}

/* Admin nav link */
.nav-admin-link {
    color: #D4A321 !important;
    font-weight: 600;
}

/* User info in navbar */
.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-inline-start: 8px;
}

.user-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--font-en);
    letter-spacing: 0.5px;
}

.user-role-badge.admin {
    background: rgba(195, 140, 52, 0.2);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.user-role-badge.user {
    background: rgba(138, 155, 168, 0.15);
    color: var(--dark-text-muted);
    border: 1px solid var(--dark-border);
}

.user-email {
    color: rgba(255,255,255,0.7);
    font-size: 0.82rem;
    font-family: var(--font-en);
}

.logout-link {
    font-size: 1.1rem;
    padding: 4px 8px !important;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #ffffff;
    border-radius: 1px;
    transition: all var(--transition);
}

.mobile-nav {
    display: none;
    background: #013608;
    border-bottom: 1px solid #02680F;
    padding: 12px 24px;
    gap: 8px;
    flex-direction: column;
}

.mobile-nav.active {
    display: flex;
}

/* ── Stats Bar ──────────────────────────────────────────────── */

.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 1400px;
    margin: 28px auto;
    padding: 0 0;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand);
    transition: background var(--transition);
}

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

.stat-card.accent {
    border-color: var(--accent);
}

.stat-card.accent::before {
    background: var(--accent);
}

.stat-number {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-en);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.stat-card.accent .stat-number {
    color: var(--accent);
}

/* ── Hero Pie Chart inside stat-card ────────────────────────── */
.stat-card-pie {
    padding: 14px 12px 8px;
}

.hero-pie-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin: 0;
    line-height: 1.2;
}

.hero-pie-title-en {
    font-size: 0.68rem;
    font-weight: 400;
    color: var(--text-muted);
    font-family: var(--font-en);
    text-align: center;
    margin: 0 0 6px;
}

.hero-pie-wrap {
    position: relative;
    height: 170px;
    cursor: pointer;
}

.hero-pie-wrap canvas {
    max-height: 170px;
    cursor: pointer;
}

.stat-label {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 600;
}

.stat-label-en {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-en);
    margin-top: 2px;
}

/* ── Filters ────────────────────────────────────────────────── */


.filters-bar {
    max-width: 1400px;
    margin: 0 auto 24px;
    padding: 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-chip {
    padding: 7px 18px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-ar);
    font-size: 0.85rem;
    transition: all var(--transition);
    font-weight: 500;
}

.filter-chip:hover {
    border-color: var(--text-muted);
    background: var(--bg-card-hover);
}

.filter-chip.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
    font-weight: 700;
    box-shadow: 0 0 12px var(--brand-glow);
}

.filter-select {
    padding: 7px 18px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font-ar);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition);
}

.filter-select:focus {
    border-color: var(--accent);
}

/* ── Validity Filters ───────────────────────────────────────── */

.validity-filters {
    margin-bottom: 12px;
}

.filter-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.validity-chip {
    padding: 7px 18px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-ar);
    font-size: 0.85rem;
    transition: all var(--transition);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.validity-chip:hover {
    border-color: var(--text-muted);
    background: var(--bg-card-hover);
}

.validity-chip.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
    font-weight: 700;
    box-shadow: 0 0 12px var(--brand-glow);
}

.validity-chip.active[data-validity="all_reached"] {
    background: var(--text-muted);
    border-color: var(--text-muted);
}

.validity-chip.active[data-validity="all"] {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 0 12px var(--brand-glow);
}

.chip-count {
    font-family: var(--font-en);
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 700;
}

.visible-count {
    max-width: 1400px;
    margin: 0 auto 12px;
    padding: 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── Card Status Row ────────────────────────────────────────── */

.card-status-row {
    padding: 6px 20px 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.card-pending {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    background: var(--accent-glow);
    padding: 2px 10px;
    border-radius: 10px;
}

.card-reached-badge {
    font-size: 0.8rem;
    color: var(--green);
    font-weight: 600;
    background: var(--green-bg);
    padding: 2px 10px;
    border-radius: 10px;
}

.card-completed {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    background: rgba(110, 118, 129, 0.1);
    padding: 2px 10px;
    border-radius: 10px;
}

/* ── Cards Grid ─────────────────────────────────────────────── */

.cards-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 0 48px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: 20px;
}

.ticker-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    position: relative;
}

.ticker-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand);
    color: var(--text-primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 8px;
}

.card-ticker {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-en);
    color: var(--brand);
    letter-spacing: -0.01em;
    direction: ltr;
    unicode-bidi: isolate;
}

.card-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-en);
}

.card-image {
    padding: 8px 20px;
}

.card-image img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.card-image-placeholder {
    background: linear-gradient(135deg, #e8ebe4 0%, #f0f1ec 50%, #e5e8e0 100%);
    border-radius: var(--radius-sm);
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
}

.card-image-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, transparent, transparent 30px, rgba(31, 91, 39, 0.04) 30px, rgba(31, 91, 39, 0.04) 31px),
        repeating-linear-gradient(0deg, transparent, transparent 20px, rgba(31, 91, 39, 0.03) 20px, rgba(31, 91, 39, 0.03) 21px);
}

.placeholder-text {
    font-size: 2rem;
    font-weight: 800;
    color: rgba(31, 91, 39, 0.18);
    font-family: var(--font-en);
    z-index: 1;
}

.card-prices {
    padding: 4px 20px 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.price-badge {
    font-size: 0.78rem;
    padding: 3px 10px;
    border-radius: 12px;
    font-family: var(--font-en);
    font-weight: 600;
}

.price-badge.green {
    background: var(--green-bg);
    color: var(--green);
}

.price-badge.red {
    background: var(--red-bg);
    color: var(--red);
}

.price-badge.orange {
    background: var(--orange-bg);
    color: var(--orange);
}

.price-badge.light-green {
    background: var(--light-green-bg);
    color: var(--light-green);
}

.card-footer {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    font-size: 0.83rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* ── Ticker Detail Page ─────────────────────────────────────── */

.ticker-header {
    max-width: 1400px;
    margin: 28px auto 24px;
    padding: 0 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.ticker-symbol {
    font-size: 3.2rem;
    font-weight: 800;
    font-family: var(--font-en);
    color: var(--brand);
    letter-spacing: -0.02em;
    line-height: 1;
    direction: ltr;
    unicode-bidi: isolate;
}

.ticker-meta {
    display: flex;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 10px;
    flex-wrap: wrap;
}

.meta-sep {
    color: var(--text-muted);
}

.ticker-color-summary {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 8px;
}

.color-stat {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 6px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.color-stat strong {
    font-family: var(--font-en);
    color: var(--text-primary);
}

/* ── Chart Section ───────────────────────────────────────────── */

.chart-section {
    max-width: 1400px;
    margin: 0 auto 28px;
    padding: 0 0;
}

.chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.chart-interval-toggle {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.chart-interval-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: none;
    border-right: 1px solid var(--border);
    font-size: 0.74rem;
    font-family: var(--font-en);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.chart-interval-btn:last-child {
    border-right: none;
}

.chart-interval-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.chart-interval-btn.active {
    background: var(--brand);
    color: #fff;
}

.chart-range-btns,
.chart-range-input {
    display: flex;
    align-items: center;
    gap: 4px;
}

.range-value-input {
    width: 48px;
    padding: 4px 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-family: var(--font-en);
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
    -moz-appearance: textfield;
}
.range-value-input::-webkit-outer-spin-button,
.range-value-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.range-value-input:focus {
    outline: none;
    border-color: var(--brand);
}

.range-unit-select {
    padding: 4px 6px;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: var(--font-en);
    font-weight: 600;
    cursor: pointer;
    line-height: 1.4;
}
.range-unit-select:focus {
    outline: none;
    border-color: var(--brand);
}

.chart-range-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-family: var(--font-en);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.chart-range-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.chart-range-btn.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.chart-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
}

.chart-reset-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.chart-container {
    position: relative;
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: #ffffff;
}

#chart-currency-label {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted, #888);
    pointer-events: none;
    z-index: 2;
    opacity: 0.55;
    letter-spacing: 0.05em;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.chart-container .tv-lightweight-charts {
    border-radius: var(--radius);
}

#tv-chart {
    width: 100%;
    height: 720px;
    direction: ltr;
    overflow: hidden;
}

/* ── Page-level loading overlay (navigation feedback) ── */
.page-loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--bg-primary);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.page-loading-overlay.active {
    display: flex;
    opacity: 1;
}
.page-loading-overlay .page-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--brand);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.page-loading-overlay .page-loading-text {
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-ar);
}

.chart-loading,
.chart-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 720px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: var(--font-ar);
}

.chart-loading .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.chart-error {
    color: var(--red);
    flex-direction: column;
    gap: 4px;
}

.chart-error-retry {
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: underline;
}

.chart-error-retry:hover {
    color: var(--text-secondary);
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    padding: 8px 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-family: var(--font-en);
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.chart-legend-line {
    width: 20px;
    height: 2px;
    border-radius: 1px;
}

.chart-legend-line.dashed {
    background: repeating-linear-gradient(
        to right,
        currentColor 0px,
        currentColor 4px,
        transparent 4px,
        transparent 8px
    );
    height: 2px;
}

.chart-disclaimer {
    font-size: 0.72rem;
    color: var(--text-tertiary, #999);
    text-align: center;
    margin-top: 4px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .chart-section {
        padding: 0 12px;
    }

    #tv-chart {
        height: 300px;
    }

    .chart-loading,
    .chart-error {
        height: 300px;
    }

    .chart-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .chart-controls {
        width: 100%;
        justify-content: flex-start;
    }

    .chart-range-btn {
        padding: 4px 10px;
        font-size: 0.72rem;
    }

    .range-value-input {
        width: 40px;
        padding: 4px 4px;
        font-size: 0.72rem;
    }

    .range-unit-select {
        padding: 4px 4px;
        font-size: 0.70rem;
    }

    .chart-interval-btn {
        padding: 4px 8px;
        font-size: 0.70rem;
    }
}

/* ── Setup Tabs ─────────────────────────────────────────────── */

.setups-section {
    max-width: 1400px;
    margin: 0 auto 28px;
    padding: 0 0;
}

.setup-select-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

#setup-select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    font-size: 0.85rem;
    font-family: var(--font-ar), var(--font-en), sans-serif;
    cursor: pointer;
    min-width: 220px;
    max-width: 100%;
    transition: border-color 0.2s ease;
}

#setup-select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand-glow);
}

#setup-select optgroup {
    color: var(--text-muted);
    font-style: normal;
}

.setup-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.setup-tabs::-webkit-scrollbar { display: none; }

.setup-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-bottom: 2px solid transparent;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    font-size: 0.82rem;
    font-family: var(--font-en);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.setup-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.setup-tab.active {
    background: var(--bg-card);
    color: var(--brand);
    border-bottom-color: var(--brand);
    font-weight: 700;
}

.setup-tab .tab-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.setup-tab.active .tab-date {
    color: var(--brand);
}

.setup-tab .tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    font-size: 0.65rem;
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.setup-tab.active .tab-badge {
    background: var(--brand-glow);
    color: var(--brand);
}

.setup-panel {
    display: none;
}

.setup-panel.active {
    display: block;
}

.setup-image-container {
    margin-bottom: 16px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
}

/* Date edit row (admin) */
.setup-date-row {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px; font-size: 0.88rem;
}
.setup-date-display {
    color: var(--text-secondary); font-weight: 500;
    transition: color 0.3s;
}
.setup-date-display.date-updated { color: var(--brand); }
.btn-edit-date {
    background: none; border: none; cursor: pointer;
    font-size: 0.85rem; padding: 2px 4px; opacity: 0.5;
    transition: opacity 0.2s;
}
.btn-edit-date:hover { opacity: 1; }
.date-edit-inline {
    display: flex; align-items: center; gap: 6px;
}
.date-edit-input {
    padding: 4px 8px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg-card);
    color: var(--text-primary); font-family: var(--font-en);
    font-size: 0.85rem;
}
.date-edit-input:focus {
    border-color: var(--brand); outline: none;
    box-shadow: 0 0 0 2px rgba(34,197,94,0.15);
}
.btn-save-date, .btn-cancel-date {
    background: none; border: none; cursor: pointer;
    font-size: 0.95rem; padding: 2px;
}

.setup-image-container img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    display: block;
}

.setup-prices-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.setup-prices-table th {
    padding: 8px 12px;
    text-align: right;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    font-size: 0.78rem;
}

.setup-prices-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.setup-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .setups-section {
        padding: 0 12px;
    }

    .setup-tab {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .setup-image-container img {
        max-height: 300px;
    }
}

/* ── Gallery ────────────────────────────────────────────────── */

.gallery-section,
.prices-section {
    max-width: 1400px;
    margin: 0 auto 28px;
    padding: 0 0;
}

.section-title {
    font-size: 1.3rem;
    margin-bottom: 16px;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--brand);
    display: inline-block;
    font-weight: 700;
}

.gallery-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.gallery-scroll::-webkit-scrollbar {
    height: 6px;
}

.gallery-scroll::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.gallery-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.gallery-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

.gallery-item {
    flex: 0 0 auto;
    width: 520px;
    cursor: pointer;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.25s ease;
    scroll-snap-align: start;
    background: var(--bg-card);
}

.gallery-item:hover {
    border-color: var(--brand);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.gallery-img-wrapper {
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.02);
}

.extraction-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 1rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    line-height: 1;
}

.extraction-badge.extracted { background: rgba(26, 143, 60, 0.7); }
.extraction-badge.failed { background: rgba(204, 41, 54, 0.7); }
.extraction-badge.pending { background: rgba(110, 118, 129, 0.5); }

/* ── Ticker Admin Actions ───────────────────────────────────── */

.prices-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 0;
}

.prices-section-header .section-title {
    margin-bottom: 0;
}

.ticker-admin-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-ticker-action {
    padding: 7px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: var(--font-ar);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.btn-ticker-action:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.btn-ticker-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-ticker-add {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.btn-ticker-add:hover {
    background: var(--accent);
    color: #fff;
}

/* ── Ticker Task Status ─────────────────────────────────────── */

.ticker-task-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    width: 100%;
    margin-top: 4px;
}

.task-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Modal (ticker page) ────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.modal-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.modal-body p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
    white-space: pre-line;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 24px;
}

.admin-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input, var(--bg-card));
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-en);
    cursor: pointer;
}

.admin-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(31, 91, 39, 0.12);
}

.gallery-date {
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: var(--font-en);
    font-weight: 500;
}

.gallery-empty {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    width: 100%;
}

/* ── Tables ─────────────────────────────────────────────────── */

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    -webkit-overflow-scrolling: touch;
}

.tickers-table-section {
    max-width: 1400px;
    margin: 0 auto 40px;
    padding: 0 0;
}

.prices-table,
.tickers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.prices-table th,
.tickers-table th {
    background: var(--bg-secondary);
    padding: 14px 16px;
    text-align: right;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    cursor: pointer;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    transition: color var(--transition);
    user-select: none;
}

.prices-table th:hover,
.tickers-table th:hover {
    color: var(--brand);
}

.prices-table td,
.tickers-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    transition: background var(--transition);
}

.prices-table tbody tr:hover,
.tickers-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.prices-table tbody tr:last-child td,
.tickers-table tbody tr:last-child td {
    border-bottom: none;
}

.price-row {
    transition: background 0.12s;
}

.price-value {
    font-weight: 700;
    font-family: var(--font-en);
    font-size: 1.02rem;
    color: var(--text-primary);
    direction: ltr;
    unicode-bidi: isolate;
}

.color-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.zone-type {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.confidence-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}

.confidence-fill {
    height: 6px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: 3px;
    flex: 1;
    position: relative;
}

.confidence-text {
    font-family: var(--font-en);
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
}

.status-badge.reached {
    background: var(--green-bg);
    color: var(--green);
}

.status-badge.pending {
    background: rgba(139, 148, 158, 0.1);
    color: var(--text-muted);
}

.reached-row {
    opacity: 0.55;
}

.reached-row .price-value {
    text-decoration: line-through;
}

.reached-row:hover {
    opacity: 0.8;
}

/* ── Inline Price Editing ───────────────────────────────────── */

.edit-cell {
    white-space: nowrap;
}

.edit-actions,
.edit-confirm {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.btn-edit,
.btn-delete,
.btn-save,
.btn-cancel {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background var(--transition), border-color var(--transition);
    line-height: 1;
}

.btn-edit:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
}

.btn-delete:hover {
    background: var(--red-bg);
    border-color: var(--red);
}

.btn-save:hover {
    background: var(--green-bg);
    border-color: var(--green);
}

.btn-cancel:hover {
    background: var(--red-bg);
    border-color: var(--red);
}

.price-input {
    width: 100px;
    padding: 4px 8px;
    background: var(--bg-input);
    border: 1px solid var(--accent);
    border-radius: var(--radius-xs);
    color: var(--accent);
    font-family: var(--font-en);
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    outline: none;
}

.price-input:focus {
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.price-input.input-error {
    border-color: var(--red);
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.row-updated {
    animation: flash-success 1.2s ease;
}

@keyframes flash-success {
    0% { background: var(--green-bg); }
    100% { background: transparent; }
}

.clickable-row {
    cursor: pointer;
}

.ticker-cell {
    font-weight: 700;
    font-family: var(--font-en);
    color: var(--brand);
    font-size: 1rem;
    direction: ltr;
    unicode-bidi: isolate;
}

.color-count {
    font-family: var(--font-en);
    font-weight: 600;
}

.color-count.green { color: var(--green); }
.color-count.red { color: var(--red); }
.color-count.orange { color: var(--orange); }
.color-count.light-green { color: var(--light-green); }

.date-cell {
    font-family: var(--font-en);
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Sort indicators */
th.sort-asc::after { content: ' ▲'; color: var(--brand); }
th.sort-desc::after { content: ' ▼'; color: var(--brand); }

/* ── Page Header ────────────────────────────────────────────── */

.page-header {
    max-width: 1400px;
    margin: 28px auto 24px;
    padding: 0 0;
}

.page-header h1 {
    font-size: 1.8rem;
    color: var(--text-primary);
    font-weight: 800;
}

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

/* ── Empty State ────────────────────────────────────────────── */

.empty-state {
    padding: 48px;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.empty-state p {
    font-size: 1.1rem;
}

.empty-en {
    font-family: var(--font-en);
    font-size: 0.85rem !important;
    margin-top: 4px;
    color: var(--text-muted);
}

/* ── Lightbox ───────────────────────────────────────────────── */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    cursor: zoom-out;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 95vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: var(--radius-xs);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
}

.lightbox img.zoomed {
    transform: scale(2);
    cursor: zoom-out;
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 28px;
    font-size: 2.5rem;
    color: white;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition);
    z-index: 1001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lightbox-caption {
    color: var(--text-secondary);
    font-family: var(--font-en);
    font-size: 0.9rem;
    margin-top: 12px;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
}

/* ── Back Link ──────────────────────────────────────────────── */

.back-link {
    max-width: 1400px;
    margin: 0 auto 48px;
    padding: 0 0;
}

.back-link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition);
    font-weight: 500;
}

.back-link a:hover {
    color: var(--brand);
    border-color: var(--brand);
    background: var(--brand-glow);
}

/* ── Footer ─────────────────────────────────────────────────── */

.footer {
    margin-top: auto;
    background: var(--dark-bg);
    border-top: 1px solid var(--dark-border);
    padding: 28px 24px;
    text-align: center;
}

.footer-disclaimer {
    font-size: 0.78rem;
    color: var(--dark-text-muted);
    max-width: 700px;
    margin: 0 auto 10px;
    line-height: 1.6;
}

.footer-copy {
    font-size: 0.85rem;
    color: var(--dark-text);
    font-weight: 600;
}

/* ── Main Content ───────────────────────────────────────────── */

.main-content {
    flex: 1;
    overflow-x: hidden;
}

/* No-navbar mode (user view) */
.main-content.no-navbar {
    padding-top: 8px;
}

/* Public user view: show navbar with circle-like styling */
[data-view="user"] .navbar {
    background: #013608;
    border-bottom: 1px solid #02680F;
}

[data-view="user"] .mobile-nav {
    background: #013608;
}

/* Circle external links in merged navbar */
.nav-link.cn-ext-link {
    font-family: InterVariable, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    direction: ltr;
}
.nav-link.cn-ext-link.cn-active {
    background: #e5b138;
    color: #013608;
    font-weight: 600;
}
.nav-link.cn-ext-link.cn-outline {
    border: 1.5px solid #e5b138;
    color: #e5b138;
}
.nav-link.cn-ext-link.cn-outline:hover {
    background: #e5b138;
    color: #013608;
    border-color: #e5b138;
}

/* ── Profile Dropdown (public navbar) ────────────────────────── */
.nav-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.2);
    color: #ffffff;
    font-size: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}
.nav-login-btn:hover {
    background: rgba(255,255,255,0.18);
}

/* Icon nav links in navbar actions */
.nav-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #ffffff;
    font-size: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
    text-decoration: none;
}
.nav-icon-link:hover {
    background: rgba(255,255,255,0.18);
    color: #ffffff;
}
.nav-icon-link.active {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.35);
}
.nav-icon-link .gemini-icon {
    width: 18px;
    height: 18px;
}
.nav-actions-sep {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.15);
    flex-shrink: 0;
}

/* Tutorial button in navbar */
.nav-tutorial-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #ffffff;
    font-size: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}
.nav-tutorial-btn:hover {
    background: rgba(255,255,255,0.18);
}

.nav-profile-dropdown {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #D4A321;
    color: #013608;
    font-size: 0.85rem;
    font-weight: 700;
    border: 2px solid rgba(255,255,255,0.25);
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
    font-family: var(--font-en);
    text-transform: uppercase;
}
.profile-avatar:hover {
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 0 0 3px rgba(212,163,33,0.25);
}

.profile-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: #0E5A2F;
    border: 1px solid #02680F;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    padding: 8px 0;
}

.profile-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

.nav-profile-dropdown:hover .profile-dropdown-menu {
    display: block;
}

.profile-dropdown-email {
    padding: 10px 16px 8px;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
    font-family: var(--font-en);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.profile-dropdown-sep {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 4px 0;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 16px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    font-family: var(--font-ar);
    cursor: pointer;
    transition: background 0.12s;
    text-decoration: none;
    direction: rtl;
}
.profile-dropdown-item:hover {
    background: rgba(255,255,255,0.10);
    color: #ffffff;
}
.profile-dropdown-logout {
    color: #ef5350;
}
.profile-dropdown-logout:hover {
    background: rgba(239,83,80,0.12);
    color: #ff6b6b;
}

/* Mobile nav separator & auth items */
.mobile-nav-sep {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 8px 16px;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 16px;
        gap: 12px;
    }

    .nav-search {
        max-width: 200px;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .brand-sub {
        display: none;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 16px;
        margin: 20px auto;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card-pie {
        padding: 12px 10px 6px;
    }

    .hero-pie-wrap {
        height: 150px;
    }

    .hero-pie-wrap canvas {
        max-height: 150px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        padding: 0 16px 32px;
        gap: 14px;
    }

    .filters-bar {
        padding: 0 16px;
    }

    .ticker-header {
        padding: 0 16px;
        margin: 20px auto 16px;
    }

    .ticker-symbol {
        font-size: 2.2rem;
    }

    .gallery-item {
        width: 340px;
    }

    .gallery-item img {
        height: 200px;
    }

    .gallery-section,
    .prices-section {
        padding: 0 16px;
    }

    .page-header, .back-link {
        padding: 0 16px;
    }

    .section-title {
        font-size: 1.15rem;
    }
}

@media (max-width: 480px) {
    .nav-search {
        max-width: 150px;
    }

    .nav-search input {
        font-size: 0.82rem;
        padding: 7px 14px;
    }

    .stats-bar {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px 10px;
    }

    .stat-card-pie {
        padding: 10px 8px 4px;
    }

    .hero-pie-wrap {
        height: 130px;
    }

    .hero-pie-wrap canvas {
        max-height: 130px;
    }

    .hero-pie-title {
        font-size: 0.78rem;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.82rem;
    }

    .gallery-item {
        width: 85vw;
    }

    .gallery-item img {
        height: 180px;
    }

    .ticker-color-summary {
        gap: 8px;
    }

    .color-stat {
        padding: 4px 10px;
        font-size: 0.82rem;
    }

    .filter-chip {
        padding: 5px 12px;
        font-size: 0.8rem;
    }
}

/* ── Selection ──────────────────────────────────────────────── */

::selection {
    background: rgba(31, 91, 39, 0.15);
    color: var(--text-primary);
}

/* ── Custom scrollbar ───────────────────────────────────────── */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ═══════════════════════════════════════════════════════════════
   Market Categorization, Sentiment, Signal & Pagination Styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Market Filter Bar ──────────────────────────────────────── */

.market-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto 16px;
    padding: 0 0;
    flex-wrap: wrap;
}

.market-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.market-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-ar);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.market-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.market-tab.active {
    background: var(--brand-glow);
    color: var(--brand);
    border-color: var(--brand);
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: var(--bg-primary);
    border-radius: 11px;
    font-size: 0.75rem;
    font-family: var(--font-en);
    font-weight: 600;
    color: var(--text-muted);
}

.market-tab.active .tab-count {
    background: var(--brand);
    color: #fff;
}

.sentiment-dropdown {
    flex-shrink: 0;
}

/* ── Market Badges ──────────────────────────────────────────── */

.market-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}

.market-us {
    background: rgba(37, 99, 180, 0.10);
    color: #2563b4;
    border-color: rgba(37, 99, 180, 0.25);
}

.market-saudi {
    background: rgba(22, 130, 88, 0.10);
    color: #168258;
    border-color: rgba(22, 130, 88, 0.25);
}

.market-egypt {
    background: rgba(22, 130, 88, 0.10);
    color: #22c686;
    border-color: rgba(22, 130, 88, 0.25);
}

.market-uae {
    background: rgba(22, 130, 88, 0.10);
    color: #22c686;
    border-color: rgba(22, 130, 88, 0.25);
}

.market-kuwait {
    background: rgba(22, 130, 88, 0.10);
    color: #22c686;
    border-color: rgba(22, 130, 88, 0.25);
}

.market-qatar {
    background: rgba(22, 130, 88, 0.10);
    color: #22c686;
    border-color: rgba(22, 130, 88, 0.25);
}

.market-crypto {
    background: rgba(180, 117, 8, 0.10);
    color: #b47508;
    border-color: rgba(180, 117, 8, 0.25);
}

.market-commodity {
    background: rgba(128, 60, 190, 0.10);
    color: #803cbe;
    border-color: rgba(128, 60, 190, 0.25);
}

.market-china {
    background: rgba(204, 41, 54, 0.10);
    color: #cc2936;
    border-color: rgba(204, 41, 54, 0.25);
}

.market-other {
    background: var(--bg-card);
    color: var(--text-secondary);
    border-color: var(--border);
}

/* ── Sentiment Badges ───────────────────────────────────────── */

.sentiment-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid transparent;
}

.sentiment-bullish {
    background: var(--green-bg);
    color: var(--green);
    border-color: rgba(26, 143, 60, 0.3);
}

.sentiment-bearish {
    background: var(--red-bg);
    color: var(--red);
    border-color: rgba(204, 41, 54, 0.3);
}

.sentiment-neutral {
    background: var(--orange-bg);
    color: var(--orange);
    border-color: rgba(217, 108, 6, 0.3);
}

/* ── Signal Indicators (4 colored boxes) ────────────────────── */

.signal-indicators {
    display: flex;
    gap: 3px;
    align-items: center;
}

.signal-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 22px;
    padding: 0 4px;
    border-radius: var(--radius-xs);
    font-size: 0.7rem;
    font-family: var(--font-en);
    font-weight: 700;
    color: #fff;
}

.signal-green {
    background: var(--green);
}

.signal-light-green {
    background: var(--light-green);
}

.signal-orange {
    background: var(--orange);
}

.signal-red {
    background: var(--red);
}

/* ── Card Header Enhanced ───────────────────────────────────── */

.card-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Stat Card Icon ─────────────────────────────────────────── */

.stat-icon {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

/* ── Results Count ──────────────────────────────────────────── */

.results-count-bar {
    max-width: 1400px;
    margin: 0 auto 12px;
    padding: 0 0;
}

.results-count-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-ar);
}

/* ── Pagination ─────────────────────────────────────────────── */

.pagination-bar {
    display: flex;
    justify-content: center;
    padding: 24px 0 40px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: var(--font-ar);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.page-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.page-btn.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
    font-weight: 700;
}

.page-ellipsis {
    color: var(--text-muted);
    padding: 0 4px;
    font-size: 0.85rem;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 1400px;
    margin: 0 auto 8px;
    padding: 16px 24px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-secondary);
    transition: color var(--transition);
}

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb-sep {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.breadcrumb-current {
    color: var(--brand);
    font-weight: 600;
    font-family: var(--font-en);
    direction: ltr;
    unicode-bidi: isolate;
}

/* ── Ticker Hero Enhanced ───────────────────────────────────── */

.ticker-hero-top {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.ticker-hero-top .ticker-symbol {
    margin-bottom: 0;
}

/* ── Responsive: Market Tabs ────────────────────────────────── */

@media (max-width: 768px) {
    .market-filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 0 16px;
    }

    .market-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        max-width: 100%;
        min-width: 0;
    }

    .market-tabs::-webkit-scrollbar {
        display: none;
    }

    /* Fade hint on the trailing edge */
    .market-tabs::after {
        content: '';
        flex-shrink: 0;
        width: 20px;
    }

    .market-tab {
        flex-shrink: 0;
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    /* Validity / filter chips — horizontal scroll on mobile */
    .filters-bar.validity-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 8px;
        max-width: 100vw;
        min-width: 0;
        box-sizing: border-box;
    }

    .filters-bar.validity-filters::-webkit-scrollbar {
        display: none;
    }

    .filters-bar.validity-filters .filter-group {
        flex-wrap: nowrap;
        flex-shrink: 0;
    }

    .filters-bar.validity-filters .filter-group:last-child::after {
        content: '';
        flex-shrink: 0;
        width: 16px;
    }

    .pagination {
        gap: 4px;
    }

    .page-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 0.8rem;
    }

    .breadcrumb {
        font-size: 0.75rem;
        gap: 6px;
        padding: 12px 16px 0;
    }

    .signal-box {
        min-width: 22px;
        height: 18px;
        font-size: 0.65rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   DARK THEME
   Activated by [data-theme="dark"] on <html> or by OS preference
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] {
    /* ── Core Backgrounds ─────────────────────────────────────── */
    --bg-primary: #111810;
    --bg-secondary: #182016;
    --bg-card: #1c261a;
    --bg-card-hover: #243222;
    --bg-input: #1c261a;
    --border: #2e3d2a;
    --border-light: #3a4d36;

    /* ── Text ─────────────────────────────────────────────────── */
    --text-primary: #e4e8e0;
    --text-secondary: #b0baa6;
    --text-muted: #7e8d72;

    /* ── Brand Accent — Gold (brighter for dark) ──────────────── */
    --accent: #d49a36;
    --accent-hover: #fbe36b;
    --accent-glow: rgba(212, 154, 54, 0.18);
    --accent-glow-strong: rgba(212, 154, 54, 0.30);
    --accent-warm: #483618;

    /* ── Brand Primary — Forest Green (lighter for dark) ──────── */
    --brand: #2ba83e;
    --brand-light: #34c44a;
    --brand-glow: rgba(43, 168, 62, 0.14);
    --brand-sage: #6a9c56;
    --brand-sage-light: #4a7a3c;

    /* ── Dark Section (navbar/footer) ─────────────────────────── */
    --dark-bg: #0c120a;
    --dark-bg-lighter: #141e12;
    --dark-text: #e4e8e0;
    --dark-text-muted: #7e8d72;
    --dark-border: #243222;

    /* ── Semantic Colors ──────────────────────────────────────── */
    --green: #34c44a;
    --green-bg: rgba(52, 196, 74, 0.12);
    --red: #e85460;
    --red-bg: rgba(232, 84, 96, 0.12);
    --orange: #e89820;
    --orange-bg: rgba(232, 152, 32, 0.10);
    --light-green: #6a9c56;
    --light-green-bg: rgba(106, 156, 86, 0.14);

    /* ── Layout ───────────────────────────────────────────────── */
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.30);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.40);
}

/* ── Dark theme element overrides ─────────────────────────────── */

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

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

[data-theme="dark"] .filter-group select,
[data-theme="dark"] .filter-group input {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .card-gallery img,
[data-theme="dark"] .ticker-gallery img {
    border-color: var(--border);
}

[data-theme="dark"] .card::after {
    background: linear-gradient(135deg, var(--accent-glow), transparent);
}

[data-theme="dark"] img {
    opacity: 0.92;
}

[data-theme="dark"] img:hover {
    opacity: 1;
}

/* ── Theme toggle button ──────────────────────────────────────── */

.theme-toggle {
    background: transparent;
    border: 1.5px solid #02680F;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.theme-toggle:hover {
    color: #D4A321;
    border-color: #D4A321;
    background: rgba(212,163,33,0.12);
}

/* ── Settings nav button (gear icon) ─────────────────────────── */

.settings-nav-btn {
    background: transparent;
    border: 1.5px solid #02680F;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    text-decoration: none;
}

.settings-nav-btn:hover {
    color: #D4A321;
    border-color: #D4A321;
    background: rgba(212,163,33,0.12);
}

[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }

/* ── OS preference fallback (when no explicit toggle) ─────────── */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #111810;
        --bg-secondary: #182016;
        --bg-card: #1c261a;
        --bg-card-hover: #243222;
        --bg-input: #1c261a;
        --border: #2e3d2a;
        --border-light: #3a4d36;
        --text-primary: #e4e8e0;
        --text-secondary: #b0baa6;
        --text-muted: #7e8d72;
        --accent: #d49a36;
        --accent-hover: #fbe36b;
        --accent-glow: rgba(212, 154, 54, 0.18);
        --accent-glow-strong: rgba(212, 154, 54, 0.30);
        --accent-warm: #483618;
        --brand: #2ba83e;
        --brand-light: #34c44a;
        --brand-glow: rgba(43, 168, 62, 0.14);
        --brand-sage: #6a9c56;
        --brand-sage-light: #4a7a3c;
        --dark-bg: #0c120a;
        --dark-bg-lighter: #141e12;
        --dark-text: #e4e8e0;
        --dark-text-muted: #7e8d72;
        --dark-border: #243222;
        --green: #34c44a;
        --green-bg: rgba(52, 196, 74, 0.12);
        --red: #e85460;
        --red-bg: rgba(232, 84, 96, 0.12);
        --orange: #e89820;
        --orange-bg: rgba(232, 152, 32, 0.10);
        --light-green: #6a9c56;
        --light-green-bg: rgba(106, 156, 86, 0.14);
        --shadow: 0 2px 8px rgba(0, 0, 0, 0.30);
        --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.40);
    }
}

/* ═══════════════════════════════════════════════════════════════
   STAGING FEATURE STYLES
   ═══════════════════════════════════════════════════════════════ */

/* ── Pilot stage banner ────────────────────────────────────── */

.pilot-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 16px;
    width: 100%;
    padding: 16px 32px;
    background: var(--accent-warm);
    color: var(--accent);
    border-bottom: 1px solid rgba(192, 134, 41, 0.30);
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.01em;
    box-sizing: border-box;
    font-family: 'Cairo', 'Inter', sans-serif;
}

.pilot-banner .pilot-sep {
    opacity: 0.5;
}

/* ── Card v2 layout ─────────────────────────────────────────── */

.card-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 0;
}

.card-top-left {
    display: flex;
    align-items: center;
}

.card-top-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-symbol-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 6px 16px 10px;
    gap: 8px;
}

.card-symbol {
    font-size: 1.25rem;
    font-weight: 800;
    font-family: var(--font-en);
    color: var(--brand);
    letter-spacing: -0.01em;
    direction: ltr;
    unicode-bidi: isolate;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.card-price {
    font-size: 1.05rem;
    font-weight: 700;
    font-family: var(--font-en);
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-change {
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-en);
    white-space: nowrap;
}

.card-change-up {
    color: var(--green, #2ea742);
}

.card-change-down {
    color: var(--red, #f26b6b);
}

.card-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-en);
    margin-right: auto;
}

.card-image {
    padding: 8px 20px;
}

.card-image img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.card-image-placeholder {
    background: linear-gradient(135deg, #e8ebe4 0%, #f0f1ec 50%, #e5e8e0 100%);
    border-radius: var(--radius-sm);
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
}

.card-image-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, transparent, transparent 30px, rgba(31, 91, 39, 0.04) 30px, rgba(31, 91, 39, 0.04) 31px),
        repeating-linear-gradient(0deg, transparent, transparent 20px, rgba(31, 91, 39, 0.03) 20px, rgba(31, 91, 39, 0.03) 21px);
}

.placeholder-text {
    font-size: 2rem;
    font-weight: 800;
    color: rgba(31, 91, 39, 0.18);
    font-family: var(--font-en);
    z-index: 1;
}

.card-prices {
    padding: 4px 20px 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.price-badge {
    font-size: 0.78rem;
    padding: 3px 10px;
    border-radius: 12px;
    font-family: var(--font-en);
    font-weight: 600;
}

.price-badge.green {
    background: var(--green-bg);
    color: var(--green);
}

.price-badge.red {
    background: var(--red-bg);
    color: var(--red);
}

.price-badge.orange {
    background: var(--orange-bg);
    color: var(--orange);
}

.price-badge.light-green {
    background: var(--light-green-bg);
    color: var(--light-green);
}

/* ── RRR Badge ───────────────────────────────────────────── */

.card-rrr-row {
    padding: 6px 16px 0;
    display: flex;
    align-items: center;
}

.rrr-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-en);
    padding: 3px 10px;
    border-radius: var(--radius-xs);
    border: 1px solid transparent;
    line-height: 1.3;
    direction: ltr;
    unicode-bidi: isolate;
}

/* ── RRR Style Variants ─────────────────────────────────── */

/* Compact pill — small rounded pill, no emoji */
.rrr-badge.style-compact {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

/* Mini badge — slightly smaller, keeps background + emoji */
.rrr-badge.style-mini {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
}

/* Text-only — no background, no border, colored text */
.rrr-badge.style-text {
    font-size: 0.75rem;
    padding: 0;
    border: none;
    background: none !important;
    border-color: transparent !important;
}

/* ── RRR Placement: Overlay ─────────────────────────────── */

.card-image { position: relative; }

.rrr-overlay {
    position: absolute;
    bottom: 6px;
    right: 6px;
    z-index: 2;
}

.rrr-overlay .rrr-badge {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.rrr-overlay .rrr-badge.great {
    background: rgba(34,141,56,0.82);
    color: #fff;
    border-color: rgba(34,141,56,0.5);
}
.rrr-overlay .rrr-badge.fair {
    background: rgba(200,112,6,0.82);
    color: #fff;
    border-color: rgba(200,112,6,0.5);
}
.rrr-overlay .rrr-badge.poor {
    background: rgba(196,43,54,0.82);
    color: #fff;
    border-color: rgba(196,43,54,0.5);
}

/* Text-only on overlay: give contrast with a subtle text shadow */
.rrr-overlay .rrr-badge.style-text {
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}

/* ── RRR Placement: Footer ──────────────────────────────── */

.rrr-footer {
    margin-left: auto;
    direction: ltr;
}

/* ── RRR Placement: Inline (between name & price) ────────── */

.card-symbol-row { position: relative; }

.rrr-inline {
    display: flex;
    align-items: center;
}

.rrr-inline .rrr-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
}

/* ── RRR Color Variants (shared) ─────────────────────────── */

.rrr-badge.great {
    background: var(--green-bg);
    color: var(--green);
    border-color: rgba(34,141,56,0.25);
}

.rrr-badge.fair {
    background: var(--orange-bg);
    color: var(--orange);
    border-color: rgba(200,112,6,0.25);
}

.rrr-badge.poor {
    background: var(--red-bg);
    color: var(--red);
    border-color: rgba(196,43,54,0.25);
}

.rrr-badge.na {
    background: var(--bg-secondary);
    color: var(--text-muted);
    border-color: var(--border);
}

/* ── Breakout Badges ─────────────────────────────────────── */

.breakout-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid transparent;
    line-height: 1.3;
}

.breakout-badge.valid {
    background: var(--bg-secondary);
    color: var(--text-muted);
    border-color: var(--border);
}

.breakout-badge.broke-out {
    background: rgba(33, 150, 243, 0.12);
    color: #2196F3;
    border-color: rgba(33, 150, 243, 0.3);
}

.breakout-badge.type-1,
.breakout-badge.type-2,
.breakout-badge.type-3 {
    background: rgba(33, 150, 243, 0.12);
    color: #1976D2;
    border-color: rgba(33, 150, 243, 0.3);
}

.breakout-badge.type-4 {
    background: var(--orange-bg);
    color: var(--orange);
    border-color: rgba(200, 112, 6, 0.25);
}

.breakout-badge.target-reached {
    background: var(--green-bg);
    color: var(--green);
    border-color: rgba(34, 141, 56, 0.25);
}

.breakout-badge.failed {
    background: var(--red-bg);
    color: var(--red);
    border-color: rgba(196, 43, 54, 0.25);
}

/* ── Breakout Info in Setup Panel ────────────────────────── */

.setup-breakout-info {
    padding: 8px 12px;
    margin: 8px 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
}

.breakout-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.82rem;
}

.breakout-info-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.breakout-timestamp {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.breakout-level {
    color: var(--orange);
    font-weight: 600;
    font-family: var(--font-en);
    direction: ltr;
}

.card-footer {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.card-footer svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.card-footer-label {
    font-family: var(--font-ar);
    color: var(--text-muted);
}

/* ── Inline Theme Toggle (user view) ───────────────────────── */

.theme-toggle.user-toolbar-theme {
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    width: 32px;
    height: 32px;
    display: inline-flex;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.theme-toggle.user-toolbar-theme:hover {
    box-shadow: var(--shadow-lg);
}

/* ── Catalog Inline Search ──────────────────────────────────── */

.catalog-search {
    position: relative;
    width: 100%;
    max-width: 360px;
    flex-shrink: 0;
}

.filter-controls-row .catalog-search {
    flex: 1;
    max-width: none;
}

.catalog-search input {
    width: 100%;
    padding: 9px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-ar);
    font-size: 0.88rem;
    outline: none;
    transition: all var(--transition);
    box-sizing: border-box;
}

.catalog-search input::placeholder {
    color: var(--text-muted);
}

.catalog-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.catalog-search .search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.catalog-search .search-dropdown.active {
    display: block;
}

.catalog-search-inline {
    max-width: 220px;
    flex-shrink: 0;
}

.catalog-search-inline input {
    padding: 6px 14px;
    font-size: 0.82rem;
}

/* ── Market Tab Dropdown (Arabic sub-markets) ───────────────── */

.market-tab-dropdown {
    position: relative;
    display: inline-flex;
}

.market-tab-dropdown > .market-tab {
    padding-left: 10px;
}

.dropdown-arrow {
    font-size: 0.65rem;
    margin-right: 2px;
    opacity: 0.6;
    transition: transform var(--transition);
}

.market-tab-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.market-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 100;
    min-width: 200px;
    padding: 6px 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.market-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

.market-tab-dropdown:hover .market-dropdown-menu {
    display: block;
}

.market-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-family: var(--font-ar);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition);
}

.market-dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.market-dropdown-item.active {
    color: var(--brand);
    background: var(--brand-glow);
}

.market-dropdown-item .tab-count {
    margin-right: auto;
    font-size: 0.7rem;
}

.sentiment-dropdown {
    flex-shrink: 0;
}

/* ── Top Controls Bar (theme toggle + email/login, above stats) ── */
.top-controls-bar {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    box-sizing: border-box;
}

/* ── Filter Controls Row ────────────────────────────────────── */

.filter-controls-row {
    max-width: 1400px;
    margin: 0 auto 12px;
    padding: 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    box-sizing: border-box;
}

.filter-right-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Sort dropdown */
.sort-dropdown-wrap {
    position: relative;
}

.sort-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    color: var(--text-muted);
    font-family: var(--font-ar);
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color var(--transition);
}

.sort-dropdown-btn:hover,
.sort-dropdown-btn.open {
    border-color: var(--brand);
}

.sort-label {
    color: var(--brand);
    font-weight: 700;
}

.sort-chevron {
    transition: transform var(--transition);
    color: var(--text-muted);
    flex-shrink: 0;
}

.sort-dropdown-btn.open .sort-chevron {
    transform: rotate(180deg);
}

.sort-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    overflow: hidden;
}

.sort-dropdown-menu[hidden] {
    display: none;
}

.sort-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-family: var(--font-ar);
    font-size: 0.85rem;
    text-decoration: none;
    gap: 10px;
    transition: background var(--transition);
    border-bottom: 1px solid var(--border);
}

.sort-dropdown-item:last-child {
    border-bottom: none;
}

.sort-dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.sort-dropdown-item.active {
    background: var(--brand-glow);
    color: var(--brand);
}

.sort-item-inner {
    display: flex;
    align-items: center;
    gap: 7px;
}

.sort-check {
    color: var(--brand);
    font-size: 11px;
    width: 12px;
    text-align: center;
}

/* ── Sector dropdown ────────────────────────────────────── */
.sector-dropdown-wrap {
    position: relative;
}

.sector-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    color: var(--text-muted);
    font-family: var(--font-ar);
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color var(--transition);
}

.sector-dropdown-btn:hover,
.sector-dropdown-btn.open {
    border-color: var(--brand);
}

.sector-label {
    color: var(--brand);
    font-weight: 700;
}

.sector-chevron {
    transition: transform var(--transition);
    color: var(--text-muted);
    flex-shrink: 0;
}

.sector-dropdown-btn.open .sector-chevron {
    transform: rotate(180deg);
}

.sector-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    max-height: 320px;
    overflow-y: auto;
}

.sector-dropdown-menu[hidden] {
    display: none;
}

.sector-dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-family: var(--font-ar);
    font-size: 0.85rem;
    text-decoration: none;
    gap: 10px;
    transition: background var(--transition);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.sector-dropdown-item:last-child {
    border-bottom: none;
}

.sector-dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.sector-dropdown-item.active {
    background: var(--brand-glow);
    color: var(--brand);
}

.sector-count-badge {
    margin-right: auto;
    background: var(--bg-primary);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    font-family: var(--font-en);
}

.sector-dropdown-item.active .sector-count-badge {
    background: var(--brand);
    color: #fff;
}

.filter-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
    flex-shrink: 0;
}

/* View filter segmented pills */
.view-filter-group {
    display: inline-flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
}

.view-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border-radius: calc(var(--radius-sm) - 2px);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-ar);
    font-size: 0.83rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.view-filter-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.view-filter-btn.active {
    background: var(--brand-glow);
    color: var(--brand);
}

.alpha-count-badge {
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 5px;
    font-family: var(--font-en);
}

.view-filter-btn.active .alpha-count-badge {
    background: rgba(26, 87, 34, 0.15);
    color: var(--brand);
}

.market-filter-bar {
    justify-content: flex-start;
}

@media (max-width: 640px) {
    .filter-controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 0 16px;
    }
    .filter-right-group {
        justify-content: flex-end;
    }
    .filter-divider {
        display: none;
    }
}

/* ── Breadcrumb (enhanced) ──────────────────────────────────── */

.breadcrumb-back {
    font-weight: 600;
    color: var(--accent) !important;
}

/* ── Responsive: Market Tabs (enhanced) ─────────────────────── */

@media (max-width: 768px) {
    .market-tab-dropdown {
        flex-shrink: 0;
    }
    .market-dropdown-menu {
        right: auto;
        left: 0;
        min-width: 180px;
    }
    .filters-bar.validity-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 8px;
        max-width: 100vw;
        min-width: 0;
        box-sizing: border-box;
    }
    .filters-bar.validity-filters::-webkit-scrollbar {
        display: none;
    }
    .filters-bar.validity-filters .filter-group {
        flex-wrap: nowrap;
        flex-shrink: 0;
    }
    .filters-bar.validity-filters .filter-group:last-child::after {
        content: '';
        flex-shrink: 0;
        width: 16px;
    }
}

/* ── Alpha Badge ─────────────────────────────────────────────── */
.alpha-badge {
    font-size: 1.1rem;
    line-height: 1;
    animation: alpha-pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 4px rgba(255, 120, 0, 0.45));
}
.alpha-badge-lg {
    font-size: 1.4rem;
    margin-inline-start: 4px;
}
@keyframes alpha-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.85; }
}

/* ── Alpha Fire Icon (card corner) ──────────────────────────── */

.alpha-fire-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.3rem;
    z-index: 2;
    filter: drop-shadow(0 1px 3px rgba(255, 120, 0, 0.5));
    animation: alpha-pulse 2s ease-in-out infinite;
    pointer-events: none;
}

/* ── Alpha Toggle Button (admin setup panel) ────────────────── */

.setup-admin-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    margin-bottom: 4px;
}

.setup-posted-price {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    margin: 4px 0 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #2962FF;
    background: rgba(41, 98, 255, 0.08);
    border: 1px dashed rgba(41, 98, 255, 0.3);
    border-radius: var(--radius-sm, 6px);
    line-height: 1.4;
}

.alpha-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.alpha-toggle-btn:hover {
    border-color: #ff8c00;
    color: #ff8c00;
}

.alpha-toggle-btn.active {
    background: rgba(255, 140, 0, 0.15);
    border-color: #ff8c00;
    color: #ff8c00;
    box-shadow: 0 0 8px rgba(255, 140, 0, 0.25);
}

.tab-alpha-fire {
    font-size: 0.75rem;
    margin-inline-end: 2px;
}

/* ── Bookmark Star ────────────────────────────────────────── */
.bookmark-star {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
    padding: 2px 4px;
    line-height: 1;
    transition: all 0.2s ease;
    opacity: 0.6;
    z-index: 2;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.bookmark-star::before {
    content: '';
    position: absolute;
    inset: -10px;
    z-index: -1;
}

.bookmark-star:hover {
    opacity: 1;
    transform: scale(1.2);
}

.bookmark-star.active {
    color: var(--accent);
    opacity: 1;
    text-shadow: 0 0 8px var(--accent-glow-strong);
}

.bookmark-star-lg {
    font-size: 1.6rem;
    padding: 2px 8px;
}

@media (max-width: 768px) {
    .bookmark-star {
        font-size: 1.4rem;
        padding: 8px;
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .bookmark-star-lg {
        font-size: 1.8rem;
        padding: 8px 10px;
    }
}

.bookmark-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all 0.2s ease;
    font-family: var(--font-ar);
    white-space: nowrap;
    text-decoration: none;
}

.bookmark-filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.bookmark-filter-btn.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.bookmark-filter-btn .bookmark-filter-icon {
    font-size: 1rem;
}

[data-view="admin"] .bookmark-star {
    display: none;
}
[data-view="admin"] .bookmark-filter-btn {
    display: none;
}

/* ── Alpha Filter Button ────────────────────────────────────── */
.alpha-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all 0.2s ease;
    font-family: var(--font-ar);
    white-space: nowrap;
    text-decoration: none;
}
.alpha-filter-btn:hover {
    border-color: #ff8c00;
    color: #ff8c00;
}
.alpha-filter-btn.active {
    background: rgba(255, 140, 0, 0.12);
    border-color: #ff8c00;
    color: #ff8c00;
    box-shadow: 0 0 8px rgba(255, 140, 0, 0.2);
}
.alpha-filter-icon {
    font-size: 1rem;
}
.alpha-filter-count {
    font-size: 0.7rem;
    background: rgba(255, 140, 0, 0.18);
    color: #ff8c00;
    padding: 1px 5px;
    border-radius: 6px;
    font-weight: 700;
}

/* ── Alpha toggle on cards (compact) ── */
.alpha-toggle-card {
    padding: 2px 6px;
    font-size: 0.7rem;
    border-radius: 6px;
    z-index: 2;
    position: relative;
}

/* ── Volatile (⚠️) badge & toggle ───────────────────────── */

.volatile-badge {
    font-size: 1.1rem;
    line-height: 1;
    animation: volatile-pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 4px rgba(30, 144, 255, 0.45));
}
@keyframes volatile-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.85; }
}

.volatile-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}
.volatile-toggle-btn:hover {
    border-color: #1e90ff;
    color: #1e90ff;
}
.volatile-toggle-btn.active {
    background: rgba(30, 144, 255, 0.15);
    border-color: #1e90ff;
    color: #1e90ff;
    box-shadow: 0 0 8px rgba(30, 144, 255, 0.25);
}

.guide-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}
.guide-toggle-btn:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
}
.guide-toggle-btn.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: #8b5cf6;
    color: #8b5cf6;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.25);
}

.tg-disabled-msg {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.tg-disabled-msg p { margin: 0; font-size: 0.9rem; }
.tg-disabled-msg .tg-disabled-icon { font-size: 1.8rem; opacity: 0.5; }

.volatile-toggle-card {
    padding: 2px 6px;
    font-size: 0.7rem;
    border-radius: 6px;
    z-index: 2;
    position: relative;
}

/* ── Alpha market tab (orange accent) ── */
.market-tab-alpha {
    color: #ff8c00 !important;
}
.market-tab-alpha:hover {
    border-color: #ff8c00;
    background: rgba(255, 140, 0, 0.08);
}
.market-tab-alpha.active {
    border-color: #ff8c00;
    background: rgba(255, 140, 0, 0.12) !important;
    color: #ff8c00 !important;
}
.market-tab-alpha .tab-count {
    background: rgba(255, 140, 0, 0.18);
    color: #ff8c00;
}

/* ── Visitor Email Indicator ────────────────────────────────── */
.visitor-email-pill,
.visitor-email-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #ddd);
    border-radius: 16px;
    font-size: 0.78rem;
    color: var(--text-secondary, #666);
    direction: ltr;
    max-width: 280px;
    white-space: nowrap;
}
.visitor-email-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}
.visitor-email-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
    font-family: var(--font-en, 'Inter', sans-serif);
}
.visitor-email-change {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
    line-height: 1;
}
.visitor-email-change:hover {
    opacity: 1;
}
.visitor-email-logout {
    margin-inline-start: -2px;
}

.visitor-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    background: var(--accent, #22c55e);
    color: #fff;
    border: none;
    border-radius: 16px;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
    transition: opacity 0.2s;
}
.visitor-login-btn:hover {
    opacity: 0.85;
}

.dashboard-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}
.dashboard-link-btn:hover {
    background: var(--accent, #22c55e);
    color: #fff;
    border-color: var(--accent, #22c55e);
}

[data-view="admin"] .visitor-email-bar,
[data-view="admin"] .visitor-email-pill {
    display: none !important;
}

@media (max-width: 768px) {
    .visitor-email-pill,
    .visitor-email-bar {
        padding: 3px 8px;
        font-size: 0.72rem;
        max-width: 200px;
    }
    .visitor-email-text {
        max-width: 120px;
    }
    .theme-toggle.user-toolbar-theme {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
}

/* ── Plan Gating: Card Lock & Glimpse ─────────────────────── */
.ticker-card.card-locked {
    position: relative;
    pointer-events: auto;
    cursor: pointer;
}
.ticker-card.card-glimpse-blur .card-image,
.ticker-card.card-glimpse-blur .card-symbol-row,
.ticker-card.card-glimpse-blur .card-footer {
    filter: blur(6px);
    user-select: none;
    -webkit-user-select: none;
}
.card-lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    border-radius: var(--radius, 12px);
    z-index: 5;
    gap: 6px;
}
.card-lock-overlay .lock-icon {
    font-size: 1.8rem;
}
.card-lock-overlay .lock-text {
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ── Paywall Modal ─────────────────────────────────────────── */
.paywall-modal {
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}
.paywall-content {
    background: var(--bg-card, #fff);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.paywall-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted, #999);
    cursor: pointer;
    line-height: 1;
}
.paywall-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.paywall-title {
    margin: 0 0 0.3rem;
    font-size: 1.15rem;
    color: var(--text-primary, #222);
}
.paywall-subtitle {
    margin: 0 0 0.75rem;
    font-size: 0.82rem;
    color: var(--text-secondary, #888);
}
.paywall-desc {
    margin: 0 0 1.2rem;
    font-size: 0.88rem;
    color: var(--text-secondary, #666);
    line-height: 1.5;
}
.paywall-btn {
    display: inline-block;
    width: 100%;
    padding: 0.65rem;
    background: var(--accent, #22c55e);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 0.5rem;
}
.paywall-btn:hover { opacity: 0.9; }
.paywall-dismiss {
    background: none;
    border: none;
    color: var(--text-secondary, #888);
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 8px;
}

/* ── Ticker Detail Paywall Gate ────────────────────────────── */
.ticker-paywall-gate {
    max-width: 600px;
    margin: 80px auto;
    padding: 0 0;
}
.paywall-gate-content {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #eee);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
}
.paywall-gate-content h2 {
    margin: 0.5rem 0;
    font-size: 1.3rem;
    color: var(--text-primary, #222);
}
.paywall-gate-content p {
    margin: 0.5rem 0;
    color: var(--text-secondary, #666);
    font-size: 0.92rem;
}
.paywall-gate-sub {
    font-size: 0.82rem !important;
    color: var(--text-muted, #999) !important;
    margin-bottom: 1.5rem !important;
}
.paywall-dismiss-link {
    display: block;
    margin-top: 1rem;
    color: var(--text-secondary, #888);
    font-size: 0.85rem;
    text-decoration: underline;
}

/* ── Card Actions Dropdown ───────────────────────────────── */
.card-actions-wrap {
    position: relative;
    display: inline-block;
}
.card-actions-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 2px 6px;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}
.card-actions-btn:hover {
    background: rgba(0,0,0,0.06);
    color: var(--text-primary);
}
[data-theme="dark"] .card-actions-btn:hover {
    background: rgba(255,255,255,0.1);
}
.card-actions-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    z-index: 100;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 4px;
    margin-top: 4px;
}
[dir="rtl"] .card-actions-menu {
    left: auto;
    right: 0;
}
.card-actions-menu.open {
    display: block;
}
.card-action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.12s;
    white-space: nowrap;
    border: none;
    background: none;
    width: 100%;
    text-align: right;
}
.card-action-item:hover {
    background: var(--bg-hover, rgba(0,0,0,0.04));
}
[data-theme="dark"] .card-action-item:hover {
    background: rgba(255,255,255,0.06);
}
.card-action-item .action-icon {
    font-size: 1rem;
    min-width: 20px;
    text-align: center;
}
.card-action-item.active {
    color: var(--accent, #22c55e);
    font-weight: 600;
}
.card-action-item.active.portfolio-action {
    color: #ef4444;
}

/* ── Inline Portfolio Form (in dropdown) ─────────────────── */
.pf-inline-form {
    padding: 6px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pf-inline-form input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.78rem;
    background: var(--bg-surface, var(--bg-card));
    color: var(--text-primary);
    box-sizing: border-box;
}
.pf-inline-form input::placeholder {
    color: var(--text-secondary);
    font-size: 0.75rem;
}
.pf-inline-submit {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--brand, #1a5722);
    color: #fff;
    transition: opacity 0.15s;
}
.pf-inline-submit:hover { opacity: 0.85; }

/* ── Ticker Detail: Portfolio Section ────────────────────── */
.ticker-portfolio-section {
    max-width: 1400px;
    margin: 0 auto 24px;
    padding: 0 0;
}
.portfolio-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius, 12px);
    padding: 20px;
}
.portfolio-form-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 14px;
}
.portfolio-form-title-en {
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-right: 8px;
}
.portfolio-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.pf-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.pf-field input, .pf-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    background: var(--bg-surface, var(--bg-card));
    color: var(--text-primary);
    box-sizing: border-box;
}
.pf-field textarea {
    resize: vertical;
    min-height: 38px;
}
.portfolio-form-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.pf-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.pf-btn-primary {
    background: var(--accent, #22c55e);
    color: #fff;
}
.pf-btn-primary:hover { opacity: 0.9; }
.pf-btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}
.pf-btn-danger:hover { background: rgba(239, 68, 68, 0.2); }
.pf-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 6px 0;
}
@media (max-width: 768px) {
    .portfolio-form-grid {
        grid-template-columns: 1fr;
    }
    .card-actions-menu {
        min-width: 160px;
    }
}

/* ── Notification Settings ───────────────────────────────── */
.notif-settings-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}
.notif-settings-btn:hover {
    background: var(--bg-card-hover, rgba(255,255,255,0.1));
}
.notif-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}
.notif-toggle-label {
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--border);
    border-radius: 24px;
    transition: 0.3s;
}
.toggle-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
    background-color: var(--brand, #1a5722);
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Gemini portfolio icon */
.gemini-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    border-radius: 5px;
}
.gemini-icon--lg {
    width: 28px;
    height: 28px;
}

/* ── "Year of the Camel" Arabic Font ──────────────────────── */

@font-face {
    font-family: 'YearOfTheCamel';
    src: url('/static/fonts/TheYearOfTheCamel-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ── Circle Community Nav Bar ──────────────────────────────── */

.circle-nav {
    background: #013608;
    border-bottom: 1px solid #02680F;
    position: sticky;
    top: 0;
    z-index: 100;
}

.circle-nav-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    min-height: 64px;
    max-height: 64px;
    padding: 8px 36px;
    position: relative;
}

/* ── Left: logo ─────────── */
.cn-left {
    position: absolute;
    left: 20px;
    top: 0;
    z-index: 30;
    display: flex;
    height: 64px;
    min-height: 64px;
    align-items: center;
}

.circle-nav-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #ffffff;
    padding: 12px 16px;
}

.circle-nav-brand:hover .cn-chevron {
    background: #e5b138;
    color: #013608;
}

.circle-nav-logo {
    max-height: 36px;
    max-width: 230px;
}

.cn-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: #ffffff;
    transition: background 0.15s, color 0.15s;
    margin-inline-start: 6px;
}

/* ── Center: nav links ──── */
.cn-center {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cn-center::-webkit-scrollbar {
    display: none;
}

.cn-center li {
    display: flex;
}

.cn-link {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 34px;
    padding: 8px 16px;
    border-radius: 9999px;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: InterVariable, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.cn-link:hover {
    background: #e5b138;
    color: #013608;
}

/* Active / filled style (matches Circle's !bg-c-header-active) */
.cn-link.cn-active {
    background: #e5b138;
    color: #013608;
    font-weight: 600;
}

.cn-link.cn-active:hover {
    background: #e5b138;
    color: #013608;
}

/* Gold-outlined pill style */
.cn-link.cn-outline {
    border: 1.5px solid #e5b138;
    color: #e5b138;
}

.cn-link.cn-outline:hover {
    background: #e5b138;
    color: #013608;
    border-color: #e5b138;
}

.cn-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Mobile toggle button */
.circle-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.15s;
}

.circle-nav-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.circle-nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

.circle-nav-toggle.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.circle-nav-toggle.open span:nth-child(2) {
    opacity: 0;
}
.circle-nav-toggle.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ── Circle Nav Responsive ─────────────────────────────────── */

@media (max-width: 768px) {
    .circle-nav-inner {
        display: flex;
        flex-wrap: wrap;
        padding: 8px 20px;
        min-height: 52px;
        max-height: none;
    }

    .cn-left {
        position: static;
        height: auto;
        min-height: auto;
        flex-shrink: 0;
    }

    .circle-nav-toggle {
        display: flex;
        margin-inline-start: auto;
    }

    .cn-center {
        position: static;
        left: auto;
        top: auto;
        transform: none;
        display: none;
        width: 100%;
        height: auto;
        flex-direction: column;
        gap: 4px;
        padding: 10px 0;
        border-top: 1px solid rgba(255,255,255,0.1);
        margin-top: 6px;
    }

    .cn-center.open {
        display: flex;
    }

    .cn-link {
        padding: 10px 14px;
        border-radius: 10px;
        width: 100%;
        justify-content: center;
        height: auto;
    }

    .cn-link:hover {
        background: #e5b138;
        color: #013608;
    }
}
