:root {
    --green: #16A249;
    --green-dim: rgba(22,162,73,0.12);
    --green-glow: rgba(22,162,73,0.25);
    --dark: #161616;
    --dark-2: #1e1e1e;
    --dark-3: #252525;
    --dark-border: #2e2e2e;
    --light-bg: #f5f6f8;
    --light-card: #ffffff;
    --light-border: #e4e7ec;
    --light-text: #1a1a2e;
    --muted: #6b7280;
    --muted-light: #9ca3af;
    --high: #ef4444;
    --high-bg: rgba(239,68,68,0.1);
    --medium: #f59e0b;
    --medium-bg: rgba(245,158,11,0.1);
    --low: #16A249;
    --low-bg: rgba(22,162,73,0.1);
}

.hero {
    width: 100%;
    height: 400px;
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 100px;
    border-bottom: 1px solid #333;
}
/* v2 */
.hero:before {
    content: "";
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0px;
    left: 0px;
    background: url(../img/hero-back.png) repeat center center, linear-gradient(to bottom, #1d1d1d, rgba(0, 0, 0, 0.322));
    background-size: 500px;
    background-attachment: fixed;
    z-index: -1;
}

.hero:after {
    content: "";
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0px;
    left: 0px;
    background: linear-gradient(to bottom, #16a24952, #00000052);

    z-index: -1;
}

.hero .container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 10;
    padding: 16px;
}
.hero .logo-bx{
    /* width: 400px; */
    /* height: auto; */
    /* animation: logoShine 3s ease-in-out infinite; */
}
.hero .logo-bx img{
    width: 300px;
    height: auto;
    animation: logoShine 3s ease-in-out infinite;
}

@keyframes logoShine {
    0%, 100% { 
    filter: brightness(1) drop-shadow(0 0 0px rgba(255, 138, 3, 0));
    }
    50% { 
    filter: brightness(1.2) drop-shadow(0 0 15px #16a249a1);
    }
}

.hero h1.title {
    font-size: 32px;
    text-align: center;
    padding-top: 8px !important;
    color: #dfdfdf;
}


@media (max-width: 950px) {
    .hero {
        height: 300px;
    }
    .hero:before {
        background-size: 100% !important;
    }
    .hero h1.title {
        font-size: 28px;
    }
}

.ec-wrap { background: var(--light-bg); min-height: 60vh; padding: 0 0 60px; }

.ec-hero {
    background: var(--dark);
    padding: 52px 24px 40px;
    border-bottom: 1px solid var(--dark-border);
}
.ec-hero-inner { max-width: 1440px; margin: 0 auto; }
.ec-hero-top {
    display: flex;
    flex-flow: column nowrap;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
}
.ec-hero-top p{
    line-height: 1.8;
}
.ec-hero-top .cont{
    width: 100%;
    max-width: 600px;
}
.ec-hero-btm {
    display: flex;
    justify-content: flex-end;
    margin: 40px auto auto;
    font-size: 18px;
}
.ec-title { font-size: 26px; font-weight: 700; color: #fff; margin: 0 0 6px; letter-spacing: -0.3px; }
.ec-title span { color: var(--green); }
.ec-subtitle { font-size: 13px; color: var(--muted-light); margin: 0; }
.ec-meta {
    width: fit-content;
    display: flex; align-items: center; gap: 8px;
    background: var(--dark-2); border: 1px solid var(--dark-border);
    border-radius: 8px; padding: 10px 16px; font-size: 12px;
    color: var(--muted-light); white-space: nowrap;
}
.ec-meta i { color: var(--green); font-size: 14px; }
.ec-meta strong { color: #fff; }

.ec-container { max-width: 1500px; margin: 0 auto; padding: 28px 24px 0; }

/* ── Filters ── */
.ec-filters {
    background: var(--light-card); border: 1px solid var(--light-border);
    border-radius: 14px; padding: 20px 22px;
    display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end;
    margin-bottom: 22px; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.fg { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 6px; }
.fg label {
    font-size: 11px; font-weight: 600; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.6px;
    display: flex; align-items: center; gap: 5px;
}
.fg label i { font-size: 13px; color: var(--green); }
.fg input, .fg select {
    width: 100%; padding: 9px 12px; background: var(--light-bg);
    border: 1px solid var(--light-border); border-radius: 8px;
    color: var(--light-text); font-size: 13px;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none; -webkit-appearance: none;
}
.fg input:focus, .fg select:focus {
    outline: none; border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-dim);
}

/* ── Custom Range Picker ── */
.fg-custom-dates {
    display: none; flex: 1; min-width: 200px;
    flex-direction: column; gap: 6px;
}
.fg-custom-dates.visible { display: flex; }
.fg-custom-dates label {
    font-size: 11px; font-weight: 600; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.6px;
}
.custom-range-trigger {
    width: 100%; padding: 7px 12px; background: var(--light-bg);
    border: 1px solid var(--light-border); border-radius: 8px;
    color: var(--light-text); font-size: 12px; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    box-sizing: border-box;
}
.custom-range-trigger:hover, .custom-range-trigger.active {
    border-color: var(--green); box-shadow: 0 0 0 3px var(--green-dim);
}
.custom-range-trigger i { color: var(--green); flex-shrink: 0; }

/* ── Range Picker Popup ── */
.range-picker-overlay {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.3); backdrop-filter: blur(2px);
}
.range-picker-overlay.open { display: flex; align-items: center; justify-content: center; }
.range-picker-popup {
    background: #fff; border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.18);
    padding: 24px; width: 100%; max-width: 340px;
    margin: 16px; box-sizing: border-box;
}
.rp-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.rp-title { font-size: 15px; font-weight: 700; color: var(--light-text); }
.rp-close {
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--light-border);
    background: var(--light-bg); cursor: pointer; display: flex;
    align-items: center; justify-content: center; font-size: 16px;
    color: var(--muted); transition: all 0.15s;
}
.rp-close:hover { background: var(--high-bg); color: var(--high); border-color: var(--high); }
.rp-calendars { display: block; }
.rp-cal { width: 100%; }
.rp-cal-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.rp-cal-nav {
    width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--light-border);
    background: var(--light-bg); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: var(--muted); transition: all 0.15s;
}
.rp-cal-nav:hover { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.rp-cal-month { font-size: 13px; font-weight: 700; color: var(--light-text); }
.rp-cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.rp-day-name {
    text-align: center; font-size: 10px; font-weight: 700;
    color: var(--muted); padding: 4px 0; text-transform: uppercase;
}
.rp-day {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: var(--light-text); border-radius: 7px;
    cursor: pointer; transition: all 0.15s; position: relative;
}
.rp-day:hover:not(.rp-day-empty):not(.rp-day-disabled) {
    background: var(--green-dim); color: var(--green);
}
.rp-day.rp-day-empty { cursor: default; }
.rp-day.rp-day-disabled { color: #ccc; cursor: not-allowed; }
.rp-day.rp-day-selected {
    background: var(--green) !important; color: #fff !important;
    font-weight: 700;
}
.rp-day.rp-day-in-range {
    background: var(--green-dim); color: var(--green); border-radius: 0;
}
.rp-day.rp-day-range-start { border-radius: 7px 0 0 7px; }
.rp-day.rp-day-range-end { border-radius: 0 7px 7px 0; }
.rp-day.rp-day-today::after {
    content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
    width: 4px; height: 4px; border-radius: 50%; background: var(--green);
}
.rp-day.rp-day-selected.rp-day-today::after { background: #fff; }

.rp-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--light-border);
    flex-wrap: wrap; gap: 10px;
}
.rp-selected-label { font-size: 12px; color: var(--muted); }
.rp-selected-label strong { color: var(--light-text); font-weight: 600; }
.rp-actions { display: flex; gap: 8px; }
.rp-btn {
    padding: 8px 16px; border-radius: 8px; font-size: 13px;
    font-weight: 600; cursor: pointer; border: none; transition: all 0.15s;
}
.rp-btn-cancel { background: var(--light-bg); color: var(--muted); border: 1px solid var(--light-border); }
.rp-btn-cancel:hover { border-color: var(--muted); }
.rp-btn-apply { background: var(--green); color: #fff; }
.rp-btn-apply:hover { background: #13923f; }
.rp-btn-apply:disabled { background: #ccc; cursor: not-allowed; }

/* ── Stats bar ── */
.ec-stats-bar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; flex-wrap: wrap; gap: 10px;
}
.ec-count { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ec-count strong { color: var(--light-text); font-weight: 600; }
.ec-impact-summary { display: flex; gap: 10px; flex-wrap: wrap; }
.impact-pill {
    display: flex; align-items: center; gap: 5px;
    font-size: 12px; padding: 4px 10px; border-radius: 20px; font-weight: 500;
}
.impact-pill.high { background: var(--high-bg); color: var(--high); }
.impact-pill.medium { background: var(--medium-bg); color: var(--medium); }
.impact-pill.low { background: var(--low-bg); color: var(--low); }

/* ── Pagination ── */
.ec-pagination {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-top: 1px solid var(--light-border);
    background: var(--light-card); flex-wrap: wrap; gap: 10px;
}
.ec-pagination-info { font-size: 12px; color: var(--muted); }
.ec-pagination-info strong { color: var(--light-text); }
.ec-pagination-controls { display: flex; align-items: center; gap: 6px; }
.ec-pg-btn {
    min-width: 34px; height: 34px; padding: 0 10px; border-radius: 8px;
    border: 1px solid var(--light-border); background: var(--light-card);
    color: var(--light-text); font-size: 13px; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.15s; white-space: nowrap;
}
.ec-pg-btn:hover:not(:disabled) {
    border-color: var(--green); color: var(--green); background: var(--green-dim);
}
.ec-pg-btn.active {
    background: var(--green); color: #fff; border-color: var(--green);
}
.ec-pg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ec-pg-sep { font-size: 13px; color: var(--muted-light); padding: 0 2px; }

/* ── Table card ── */
.ec-table-card {
    background: var(--light-card); border: 1px solid var(--light-border);
    border-radius: 14px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.ec-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.ec-table { width: 100%; border-collapse: collapse; min-width: 640px; }
table.ec-table thead th {
    text-align: left; padding: 13px 16px; background: var(--dark);
    color: #aaa; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.6px;
    border-bottom: 1px solid var(--dark-border); white-space: nowrap;
}
table.ec-table thead th i { color: var(--green); margin-right: 5px; font-size: 13px; }
table.ec-table tbody tr { border-bottom: 1px solid var(--light-border); transition: background 0.15s; }
table.ec-table tbody tr:last-child { border-bottom: none; }
table.ec-table tbody tr:hover { background: #f0faf4; }
table.ec-table tbody tr.is-today { background: #ffffff; }
table.ec-table td { padding: 12px 16px; font-size: 13px; color: var(--light-text); vertical-align: middle; }

.date-separator {
    background: var(--dark); color: #ccc; font-size: 11px; font-weight: 700;
    padding: 9px 16px; text-transform: uppercase; letter-spacing: 1px;
    display: flex; align-items: center; gap: 8px;
}
.date-separator i { color: var(--green); }
.date-separator .today-badge {
    background: var(--green); color: #fff; font-size: 10px;
    padding: 2px 7px; border-radius: 10px; margin-left: 6px;
    font-weight: 700; letter-spacing: 0.5px;
}

.td-time { white-space: nowrap; color: var(--muted); font-size: 12px; }
.td-country { white-space: nowrap; }
.country-icon { display: inline-flex; align-items: center; gap: 7px; }

/* Flag — uses flagcdn.com image, falls back gracefully */
.flag-box {
    width: 28px; height: 20px; border-radius: 4px;
    background: var(--dark); display: inline-flex;
    align-items: center; justify-content: center;
    overflow: hidden; border: 1px solid var(--light-border);
    flex-shrink: 0; font-size: 0; /* hide emoji fallback text */
}
.flag-box img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.flag-box .flag-emoji {
    font-size: 16px; line-height: 1;
}

.country-icon .cname { font-weight: 500; font-size: 13px; }
.currency-tag { font-size: 11px; color: var(--muted); margin-left: 4px; }

.td-event strong { font-size: 13px; font-weight: 600; color: var(--light-text); }
.td-event .unit-tag { font-size: 11px; color: var(--muted); margin-left: 4px; }

.impact-signal { display: inline-flex; align-items: flex-end; gap: 3px; height: 22px; }
.impact-signal .bar { width: 4px; border-radius: 2px; display: block; }
.impact-signal .bar:nth-child(1) { height: 5px; }
.impact-signal .bar:nth-child(2) { height: 10px; }
.impact-signal .bar:nth-child(3) { height: 14px; }
.impact-signal.sig-high .bar { background: var(--high); }
.impact-signal.sig-high .bar.inactive { background: rgba(239,68,68,0.2); }
.impact-signal.sig-medium .bar:nth-child(1),
.impact-signal.sig-medium .bar:nth-child(2) { background: var(--medium); }
.impact-signal.sig-medium .bar:nth-child(3) { background: rgba(245,158,11,0.2); }
.impact-signal.sig-low .bar:nth-child(1) { background: var(--low); }
.impact-signal.sig-low .bar:nth-child(2),
.impact-signal.sig-low .bar:nth-child(3) { background: rgba(22,162,73,0.2); }

.impact-label { font-size: 11px; font-weight: 600; margin-left: 6px; vertical-align: middle; }
.impact-label.lbl-high { color: var(--high); }
.impact-label.lbl-medium { color: var(--medium); }
.impact-label.lbl-low { color: var(--low); }

.val-actual { font-weight: 700; color: var(--light-text); }
.val-forecast { color: var(--muted); }
.val-previous { color: var(--muted-light); font-size: 12px; }
.val-empty { color: #ccc; }

/* ── Loader / empty / error ── */
.ec-loader {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 80px 24px; gap: 18px;
}
.ec-spinner {
    width: 42px; height: 42px; border: 3px solid var(--light-border);
    border-top-color: var(--green); border-radius: 50%;
    animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ec-loader-text { font-size: 14px; color: var(--muted); }

.ec-empty, .ec-error {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 72px 24px; gap: 14px; text-align: center;
}
.ec-empty-icon, .ec-error-icon {
    width: 56px; height: 56px; background: var(--light-bg);
    border: 1px solid var(--light-border); border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; color: var(--muted-light);
}
.ec-error-icon { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2); color: var(--high); }
.ec-empty h3, .ec-error h3 { font-size: 16px; font-weight: 600; color: var(--light-text); margin: 0; }
.ec-empty p, .ec-error p { font-size: 13px; color: var(--muted); margin: 0; max-width: 360px; }

/* ── Skeleton ── */
.skeleton-row td { padding: 13px 16px; }
.skeleton {
    height: 14px; border-radius: 6px;
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Mobile ── */
@media (max-width: 768px) {
    .ec-hero { padding: 36px 16px 28px; }
    .ec-container { padding: 18px 12px 0; }
    .ec-filters { padding: 14px; gap: 10px; }
    .fg { min-width: calc(50% - 7px); }
    .fg:first-child { min-width: 100%; }
    .fg-custom-dates { min-width: 100%; }
    .ec-title { font-size: 20px; }
    .ec-meta { display: none; }
    .impact-label { display: none; }
    table.ec-table { min-width: 560px; }
    table.ec-table td, table.ec-table thead th { padding: 10px 10px; font-size: 12px; }
    .ec-pagination { padding: 10px 12px; }
    .rp-cal { min-width: 100%; }
    .range-picker-popup { padding: 16px; max-width: calc(100% - 32px); }
}
@media (max-width: 480px) {
    .fg { min-width: 100%; }
    .ec-pg-btn { min-width: 30px; height: 30px; font-size: 12px; }
}
body.ar {
    direction: rtl !important;
}
body.ar .rp-cal,
body.ar .ec-pagination{
    direction: ltr !important;
}
body.ar .ec-hero-btm {
    justify-content: flex-start !important;
}

