/* =========================
   GLOBAL
========================= */

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

body {
    font-family: 'Inter', sans-serif;
    background: #f5f7fb;
    color: #111827;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =========================
   HEADER
========================= */

.site-header {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #dbe2ea;
    padding: 18px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-box {
    width: 62px;
    height: 62px;
    border: 2px solid #ffffff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    overflow: hidden;
    flex-shrink: 0;
}

.site-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand-text {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.main-nav a {
    padding: 11px 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    font-weight: 600;
    color: #111827;
    transition: 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

/* =========================
   PAGE LAYOUT
========================= */

.stats-shell {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 24px 40px;
}

.stats-page-header {
    background: #ffffff;
    border: 1px solid #dbe2ea;
    border-radius: 24px;
    padding: 28px 30px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.stats-page-header h1 {
    font-size: 2.2rem;
    line-height: 1.1;
    margin-bottom: 10px;
    color: #0f172a;
}

.stats-page-header p {
    color: #475569;
    font-size: 1rem;
    max-width: 860px;
}

/* =========================
   STATS CARD
========================= */

.stats-container {
    background: #ffffff;
    border: 1px solid #dbe2ea;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.stats-section-heading {
    margin-bottom: 20px;
}

.stats-section-heading h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
}

.stats-section-heading p {
    color: #64748b;
    font-size: 0.98rem;
}

/* =========================
   TABLE
========================= */

.stats-table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.stats-table thead {
    background: #111827;
    color: #ffffff;
}

.stats-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.stats-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    color: #334155;
    font-weight: 600;
    vertical-align: middle;
}

.stats-table tbody tr:last-child td {
    border-bottom: none;
}

.stats-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.stats-table tbody tr:hover {
    background: #eef2f7;
}

.stats-table th:not(:first-child) {
    user-select: none;
}

.stats-table th[style*="cursor"],
.stats-table th.sortable {
    cursor: pointer;
}

/* =========================
   INFO NOTE
========================= */

.stats-note {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 0.94rem;
    font-weight: 600;
}

.stats-note span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.85rem;
}

/* =========================
   FOOTER
========================= */

.site-footer {
    padding: 24px;
    text-align: center;
    color: #64748b;
    font-size: 0.95rem;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1100px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav {
        width: 100%;
    }
}

@media (max-width: 800px) {
    .stats-shell {
        padding: 20px 16px 32px;
    }

    .stats-page-header {
        padding: 22px 20px;
    }

    .stats-page-header h1 {
        font-size: 1.8rem;
    }

    .stats-container {
        padding: 18px;
    }
}

@media (max-width: 700px) {
    .site-header {
        padding: 18px 20px;
    }

    .brand-text {
        font-size: 1.25rem;
        line-height: 1.2;
    }

    .main-nav a {
        padding: 10px 14px;
        font-size: 0.95rem;
    }
}

/* =========================
   TABS
========================= */

.stats-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.stats-tab {
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    color: #111827;
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.96rem;
    cursor: pointer;
    transition: 0.2s ease;
}

.stats-tab:hover {
    background: #e2e8f0;
}

.stats-tab.active {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.stats-panel {
    display: none;
}

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

.week-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
}

.week-tab {
  border: 1px solid #cbd5e1;
  background: white;
  color: #0f172a;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}

.week-tab.active {
  background: #0f172a;
  color: white;
  border-color: #0f172a;
}