:root,
html.light {
    --bg-canvas: #F3F6F4;
    --bg-header: #FFFFFF;
    --bg-surface: #FFFFFF;
    --bg-surface-elevated: #EAF0EC;
    --bg-surface-hover: #DDE6E0;
    --text-primary: #0D1914;
    --text-secondary: #43574D;
    --text-muted: #667A70;
    --border-subtle: #DCE5DF;
    --border-strong: #C2D1C8;
    --accent-primary: #059669;
    --accent-secondary: #10B981;
    --accent-primary-hover: #047857;
    --accent-primary-soft: rgba(5, 150, 105, 0.12);
    --accent-info: #2563EB;
    --accent-info-soft: rgba(37, 99, 235, 0.10);
    --accent-warning: #D97706;
    --accent-warning-soft: rgba(217, 119, 6, 0.10);
    --accent-danger: #DC2626;
    --accent-danger-soft: rgba(220, 38, 38, 0.10);
    --shadow-card: 0 1px 3px rgba(13, 25, 20, 0.06), 0 1px 2px rgba(13, 25, 20, 0.04);
    --shadow-elevated: 0 12px 28px -6px rgba(13, 25, 20, 0.10);
}

html.dark {
    --bg-canvas: #0F1115;
    --bg-header: #14171C;
    --bg-surface: #181B20;
    --bg-surface-elevated: #20242B;
    --bg-surface-hover: #272C35;
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --border-subtle: #262A33;
    --border-strong: #353B47;
    --accent-primary: #10B981;
    --accent-secondary: #34D399;
    --accent-primary-hover: #0EA572;
    --accent-primary-soft: rgba(16, 185, 129, 0.14);
    --accent-info: #3B82F6;
    --accent-info-soft: rgba(59, 130, 246, 0.12);
    --accent-warning: #F59E0B;
    --accent-warning-soft: rgba(245, 158, 11, 0.12);
    --accent-danger: #EF6B73;
    --accent-danger-soft: rgba(239, 107, 115, 0.14);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.32);
    --shadow-elevated: 0 14px 32px -8px rgba(0, 0, 0, 0.52);
}

body {
    font-family: 'Cairo', 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.botx-header {
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.botx-bottom-nav {
    background-color: var(--bg-header);
    border-top: 1px solid var(--border-subtle);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.45);
}

.botx-surface {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
}

.botx-surface-elevated {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
}

.botx-hero-surface {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-elevated);
}

.botx-card-interactive {
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.botx-card-interactive:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-elevated);
}

.botx-btn-primary,
.botx-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.botx-btn-primary {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #04150D;
    border: 1px solid rgba(52, 211, 153, 0.45);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.24);
}

.botx-btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.28) 50%, transparent 75%);
    transform: translateX(120%);
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.botx-btn-primary:hover::after {
    transform: translateX(-120%);
}

html.light .botx-btn-primary {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #FFFFFF;
    border: 1px solid rgba(4, 120, 87, 0.35);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.20);
}

.botx-btn-primary:hover {
    filter: brightness(1.06);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.32);
}

.botx-btn-primary:active,
.botx-btn-secondary:active {
    transform: scale(0.98);
}

.botx-btn-secondary {
    background-color: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
}

.botx-btn-secondary:hover {
    background-color: var(--bg-surface-hover);
    border-color: var(--accent-primary);
}

.botx-btn-primary:focus-visible,
.botx-btn-secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-primary-soft);
}

.botx-input {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.botx-input::placeholder {
    color: var(--text-muted);
    opacity: 0.85;
}

.botx-input:focus {
    outline: none;
    background-color: var(--bg-surface);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-soft);
}

.botx-sidebar-link {
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.botx-sidebar-link:hover {
    background-color: var(--bg-surface-elevated);
    transform: translateX(-2px);
}

.botx-sidebar-link.active {
    background-color: var(--accent-primary-soft);
    color: var(--accent-primary);
    font-weight: 600;
    border-right: 3px solid var(--accent-primary);
}

@keyframes botxFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes botxDrawLine {
    from {
        stroke-dashoffset: 600;
    }
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes botxPulseRing {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.botx-animate-in {
    animation: botxFadeUp 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.botx-reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.botx-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.botx-chart-line {
    stroke-dasharray: 600;
    stroke-dashoffset: 0;
    animation: botxDrawLine 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.botx-live-dot {
    animation: botxPulseRing 2.2s infinite;
}

.tabular-nums {
    font-variant-numeric: tabular-nums;
}

.num-ltr {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.safe-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
