/* Ewelit Analytics - application styles */
:root {
    --sidebar-width: 64px;
    --topbar-height: 60px;
    --brand: #2c7be5;
    --brand-dark: #1b5fc0;
    --sidebar-bg: #1e2a3a;
    --page-bg: #f5f7fb;
    --bs-primary: #2c7be5;
    --bs-primary-rgb: 44, 123, 229;
    --bs-link-color: #2c7be5;
    --bs-link-color-rgb: 44, 123, 229;
    --bs-link-hover-color: #1b5fc0;
    --bs-body-bg: #f5f7fb;
    --bs-body-color: #1f2937;
    --bs-font-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body { background: var(--page-bg); font-size: .9rem; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); }
.text-primary { color: var(--brand) !important; }
.bg-primary { background-color: var(--brand) !important; }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: #e3e8ef; --bs-btn-hover-bg: #f1f4f9; --bs-btn-hover-border-color: #d7dee8; }
.form-control:focus, .form-select:focus { border-color: #9bbff2; box-shadow: 0 0 0 .2rem rgba(44,123,229,.15); }

/* Sidebar */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width); background: var(--sidebar-bg); z-index: 1030; padding-top: .5rem; transition: transform .2s ease; }
.sidebar-brand { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; color: #fff; font-size: 1.35rem; border-radius: 10px; background: var(--brand); text-decoration: none; }
.sidebar-nav .nav-link { color: rgba(255,255,255,.55); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 10px; margin: 2px 0; font-size: 1.15rem; }
.sidebar-nav .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar-nav .nav-link.active { color: #fff; background: var(--brand); }
.main { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: var(--topbar-height); background: #fff; border-bottom: 1px solid #e6eaf0; position: sticky; top: 0; z-index: 1020; }
.website-selector { border-color: #e3e8ef; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.content { flex: 1; max-width: 1180px; }
footer { max-width: 1180px; }
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-open .sidebar { transform: none; }
    .main { margin-left: 0; }
}

/* Page header */
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-header h1 { font-size: 1.35rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: .5rem; }
.page-header h1 .bi { color: var(--brand); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

/* Cards */
.card { border: 1px solid #e6eaf0; border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: transparent; border-bottom: 1px solid #eef1f5; font-weight: 600; padding: .85rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-header .nav-tabs { border: 0; margin-bottom: -.85rem; }
.card-header .nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: #6b7280; font-weight: 500; padding: .5rem .75rem; }
.card-header .nav-tabs .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); background: transparent; }

/* Stat tiles */
.stat-card .stat-label { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; font-weight: 600; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.stat-card .stat-icon { width: 40px; height: 40px; border-radius: 10px; background: rgba(44,123,229,.1); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.stat-delta { font-size: .78rem; font-weight: 600; }
.stat-delta.up { color: #16a34a; } .stat-delta.down { color: #dc2626; } .stat-delta.flat { color: #6b7280; }

/* Ranked lists (pages, referrers, countries...) */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem .75rem; margin: 2px 0; border-radius: 8px; overflow: hidden; }
.rank-list li .bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(44,123,229,.10); border-radius: 8px; z-index: 0; }
.rank-list li .label, .rank-list li .value { position: relative; z-index: 1; }
.rank-list li .label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: .5rem; }
.rank-list li .value { font-weight: 600; white-space: nowrap; }
.rank-list li .value small { color: #6b7280; font-weight: 400; margin-left: .35rem; }
.rank-list li a.label { color: inherit; text-decoration: none; } .rank-list li a.label:hover { color: var(--brand); }

/* Tables */
.table { --bs-table-bg: transparent; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; font-weight: 600; border-bottom-width: 1px; }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { --bs-table-bg-state: #f8fafc; }

/* Filters + date range */
.filter-badge { font-size: .8rem; padding: .45rem .7rem; }
.date-range .dropdown-menu { min-width: 230px; }

/* Empty state */
.empty-state .empty-illustration { font-size: 3rem; color: #c7d2e0; }

/* Auth */
.auth-body { min-height: 100vh; background: linear-gradient(160deg, #eef3fb 0%, #f5f7fb 60%); }
.auth-card { width: 100%; max-width: 420px; border-radius: 16px; }
.auth-logo { width: 56px; height: 56px; border-radius: 14px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; }

/* Misc */
.code-block { background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 1rem; font-size: .8rem; white-space: pre-wrap; word-break: break-all; }
.badge-soft-success { background: rgba(22,163,74,.12); color: #15803d; }
.badge-soft-danger { background: rgba(220,38,38,.12); color: #b91c1c; }
.badge-soft-primary { background: rgba(44,123,229,.12); color: var(--brand-dark); }
.badge-soft-secondary { background: rgba(107,114,128,.12); color: #4b5563; }
.chart-container { position: relative; height: 320px; }
.chart-container.sm { height: 220px; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid #e6eaf0; margin-left: 12px; }
.timeline li { position: relative; padding: .35rem 0 .35rem 1.25rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .8rem; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); }
.cursor-pointer { cursor: pointer; }
.text-mono { font-family: SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; }
.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 0 rgba(22,163,74,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.5); } 70% { box-shadow: 0 0 0 8px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
