/* ═══ TikPlanner — Mobile-First Light Dashboard ═══ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800&display=swap');

:root {
    --bg: #f4f5f9;
    --bg2: #ffffff;
    --bg3: #eef0f4;
    --bg4: #e1e3eb;
    --border: #e2e4eb;
    --border2: #cdd0db;
    --text: #1a1d2e;
    --text2: #4a4e69;
    --text3: #7c8098;
    --text4: #a0a4b8;
    --primary: #5b5fc7;
    --primary2: #4a4eb8;
    --primary-bg: rgba(91,95,199,.07);
    --green: #16a34a;
    --green-soft: #dcfce7;
    --green-text: #15803d;
    --blue: #2563eb;
    --blue-soft: #dbeafe;
    --blue-text: #1d4ed8;
    --purple: #9333ea;
    --purple-soft: #f3e8ff;
    --purple-text: #7e22ce;
    --red: #dc2626;
    --red-soft: #fee2e2;
    --red-text: #b91c1c;
    --amber: #d97706;
    --amber-soft: #fef3c7;
    --amber-text: #b45309;
    --book1: #16a34a;
    --book1-bg: #dcfce7;
    --book2: #5b5fc7;
    --book2-bg: rgba(91,95,199,.1);
    --fr: #2563eb;
    --de: #d97706;
    --en: #dc2626;
    --mouad: #2563eb;
    --fati: #9333ea;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.03), 0 1px 4px rgba(0,0,0,.02);
    --shadow: 0 2px 8px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.03);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
    --ease: cubic-bezier(.4,0,.2,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; }

/* ═══════════════════════════════════════
   LAYOUT — Mobile First
   ═══════════════════════════════════════ */
.app { display: flex; min-height: 100vh; }

.sidebar { display: none; }
.main {
    flex: 1;
    padding: 20px 16px 100px;
    min-height: 100vh;
    width: 100%;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.4px;
    margin-bottom: 2px;
}
.page-sub {
    font-size: 13px;
    color: var(--text3);
    margin-bottom: 20px;
    font-weight: 500;
}

/* ═══════════════════════════════════════
   DATE NAVIGATION
   ═══════════════════════════════════════ */
.date-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--bg2);
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.date-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text2);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .2s var(--ease);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.date-nav button:active { transform: scale(.95); background: var(--bg4); }
.date-nav .current-date {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    text-align: center;
    white-space: nowrap;
}
.btn-today-jump {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: var(--primary-bg);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: all .15s var(--ease);
    flex-shrink: 0;
}
.btn-today-jump:active { transform: scale(.95); }

/* ═══════════════════════════════════════
   STATS DUO (Today page)
   ═══════════════════════════════════════ */
.stats-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
}
.stat-pill {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
}
.stat-pill-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-pill-icon.posts {
    background: var(--primary-bg);
    color: var(--primary);
}
.stat-pill-ring {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}
.stat-pill-ring svg { display: block; transform: rotate(-90deg); }
.ring-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: var(--text);
}
.stat-pill-data { min-width: 0; }
.stat-pill-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    display: block;
    line-height: 1.1;
}
.stat-pill-total {
    font-size: 14px;
    font-weight: 600;
    color: var(--text4);
}
.stat-pill-label {
    font-size: 11px;
    color: var(--text3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-top: 2px;
}

/* ═══════════════════════════════════════
   TIME BLOCKS
   ═══════════════════════════════════════ */
/* ═══════════════════════════════════════
   ROUNDS GRID — Two-column layout
   ═══════════════════════════════════════ */
.rounds-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-top: 8px;
}

.round-col {
    flex: 1;
    min-width: 0;
}

.round-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 14px;
    margin-bottom: 12px;
}
.round-header.r1 {
    background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%);
    border: 1px solid #c7d2fe;
}
.round-header.r2 {
    background: linear-gradient(135deg, #fef3c7 0%, #ffedd5 100%);
    border: 1px solid #fde68a;
}
.round-num {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
}
.r1 .round-num { background: #6366f1; color: #fff; }
.r2 .round-num { background: #d97706; color: #fff; }
.round-title { font-weight: 700; font-size: 15px; color: var(--text); }
.round-time { font-size: 12px; color: var(--text3); margin-top: 1px; }

.round-empty {
    text-align: center;
    padding: 32px;
    color: var(--text4);
    font-size: 14px;
}

/* ═══════════════════════════════════════
   POST CARDS — Big, clear cards
   ═══════════════════════════════════════ */
.pcard {
    display: flex;
    align-items: stretch;
    border-radius: 14px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: all .2s var(--ease);
    box-shadow: var(--shadow-sm);
    -webkit-tap-highlight-color: transparent;
}
.pcard.r1 {
    background: #ffffff;
    border: 1px solid #e0e7ff;
}
.pcard.r2 {
    background: #fffcf5;
    border: 1px solid #fde68a;
}
.pcard:active { transform: scale(.99); }
.pcard.is-done {
    opacity: 0.35;
}
.pcard.is-done:active { opacity: 0.5; }

.pcard-time-col {
    width: 72px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    padding: 10px 4px;
}
.pcard-time-col.book1 { background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%); }
.pcard-time-col.book2 { background: linear-gradient(180deg, #e0e7ff 0%, #c7d2fe 100%); }

.pcard-time {
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.2px;
    white-space: nowrap;
}

.pcard-body {
    flex: 1;
    padding: 12px 14px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pcard-account {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
}

.pcard-content-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pcard-emoji {
    font-size: 20px;
    line-height: 1;
}
.pcard-content-text {
    font-size: 19px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.pcard-details {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pcard-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.pcard-badge.b1 { background: var(--book1-bg); color: var(--green-text); }
.pcard-badge.b2 { background: var(--book2-bg); color: var(--primary); }

.pcard-page {
    font-size: 12px;
    color: var(--text3);
    font-weight: 600;
    background: var(--bg3);
    padding: 2px 8px;
    border-radius: 6px;
}
.pcard-lang {
    font-size: 11px;
    font-weight: 700;
    color: var(--text4);
    background: var(--bg3);
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.pcard-action {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    flex-shrink: 0;
}

.manager-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.manager-dot.mouad { background: var(--blue); }
.manager-dot.fati { background: var(--purple); }

/* Shared — used by Track Hits */
.time-block {
    font-size: 11px;
    font-weight: 700;
    color: var(--text4);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 24px 0 10px;
    padding-left: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.time-block::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.meta-sep { color: var(--border2); font-weight: 300; }
.post-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 5px;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.post-badge.b1 { background: var(--book1-bg); color: var(--green-text); }
.post-badge.b2 { background: var(--book2-bg); color: var(--primary); }

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s var(--ease);
    -webkit-tap-highlight-color: transparent;
}
.action-btn:active { transform: scale(.9); }

.done-btn {
    background: var(--green-soft);
    color: var(--green-text);
    border-color: rgba(22,163,74,.15);
}
.done-btn:active { background: #bbf7d0; }

.trophy-btn {
    background: var(--amber-soft);
    color: var(--amber-text);
    border-color: rgba(217,119,6,.12);
}
.trophy-btn:active { background: #fde68a; }

.action-done-check {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-trophy-won {
    font-size: 10px;
    font-weight: 800;
    color: var(--amber-text);
    background: var(--amber-soft);
    padding: 4px 8px;
    border-radius: 8px;
    white-space: nowrap;
}

/* ═══════════════════════════════════════
   GENERIC CARDS & STATS
   ═══════════════════════════════════════ */
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s var(--ease);
}

.card-title {
    font-size: 11px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 10px;
    font-weight: 700;
}
.card-value {
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    color: var(--text);
}
.card-sub {
    font-size: 12px;
    color: var(--text3);
    margin-top: 6px;
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s var(--ease);
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-amber { background: var(--amber); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-ghost {
    background: transparent;
    color: var(--text3);
    border: 1px solid var(--border);
}
.btn-done {
    background: var(--green-soft);
    color: var(--green-text);
    border: 1px solid transparent;
    font-weight: 700;
}
.btn-winner {
    background: var(--amber-soft);
    color: var(--amber-text);
    border: 1px solid transparent;
    font-weight: 700;
}

/* ═══════════════════════════════════════
   FILTERS
   ═══════════════════════════════════════ */
.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    -webkit-overflow-scrolling: touch;
}
.filter-btn {
    padding: 9px 18px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text3);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s var(--ease);
    font-family: inherit;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.filter-btn:active { transform: scale(.96); }
.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(91,95,199,.25);
}

/* ═══════════════════════════════════════
   LANGUAGE TAGS
   ═══════════════════════════════════════ */
.lang-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.3px;
}
.lang-tag.FR { color: var(--blue-text); background: var(--blue-soft); }
.lang-tag.DE { color: var(--amber-text); background: var(--amber-soft); }
.lang-tag.EN { color: var(--red-text); background: var(--red-soft); }

/* ═══════════════════════════════════════
   CALENDAR
   ═══════════════════════════════════════ */
.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    background: var(--bg2);
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.cal-nav button {
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text2);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all .15s var(--ease);
    -webkit-tap-highlight-color: transparent;
}
.cal-nav button:active { transform: scale(.92); }
.cal-nav span { font-size: 17px; font-weight: 700; color: var(--text); }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    background: var(--bg2);
    padding: 14px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.cal-header {
    text-align: center;
    font-size: 10px;
    color: var(--text4);
    font-weight: 700;
    padding: 6px 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.cal-day {
    background: var(--bg);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 8px 2px;
    min-height: 72px;
    cursor: pointer;
    text-align: center;
    transition: all .15s var(--ease);
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}
.cal-day:active { transform: scale(.95); }
.cal-day.today {
    border-color: var(--primary);
    background: var(--primary-bg);
}
.cal-day.selected {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(91,95,199,.3);
}
.cal-day.selected * { color: #fff !important; }
.cal-day .day-num { font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 2px; }
.cal-day .day-count { font-size: 17px; font-weight: 800; color: var(--text); line-height: 1; margin: 2px 0; }
.cal-day .day-dots { display: flex; gap: 3px; justify-content: center; margin-top: 3px; }
.cal-day .dot { width: 6px; height: 6px; border-radius: 50%; }

/* ═══════════════════════════════════════
   ACCOUNTS
   ═══════════════════════════════════════ */
.acc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.acc-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    transition: all .15s var(--ease);
}
.acc-card:active { transform: scale(.99); }
.acc-card .acc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.acc-card .acc-name { font-weight: 700; font-size: 14px; color: var(--text); }
.acc-card .acc-books { display: flex; gap: 6px; flex-wrap: wrap; }
.acc-card .acc-book {
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 8px;
}

/* ═══════════════════════════════════════
   CONTENT TABLE
   ═══════════════════════════════════════ */
.content-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.content-table th {
    font-size: 10px;
    color: var(--text4);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
    font-weight: 700;
    white-space: nowrap;
}
.content-table td {
    padding: 12px;
    border-bottom: 1px solid var(--bg3);
    font-size: 13px;
    color: var(--text2);
}
.content-table tr:active td { background: var(--bg3); }
.content-table td:first-child { color: var(--text); font-weight: 600; }
.post-code {
    font-size: 11px;
    color: var(--text4);
    font-weight: 600;
}

/* ═══════════════════════════════════════
   WINNERS
   ═══════════════════════════════════════ */
.winner-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--amber);
}
.winner-card .winner-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.winner-views { font-size: 22px; font-weight: 800; color: var(--amber); }
.winner-link {
    font-size: 12px;
    color: var(--primary);
    word-break: break-all;
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary-bg);
    border-radius: 6px;
}

.manager-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: .6px;
    white-space: nowrap;
}
.manager-badge.mouad { color: var(--blue-text); background: var(--blue-soft); }
.manager-badge.fati { color: var(--purple-text); background: var(--purple-soft); }

/* ═══════════════════════════════════════
   ANALYTICS
   ═══════════════════════════════════════ */
.analytics-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.analytics-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--bg3);
}
.analytics-row:last-child { border-bottom: none; }
.row-label { font-weight: 600; font-size: 14px; }
.row-wins { font-weight: 800; color: var(--amber); font-size: 15px; }
.row-views { font-size: 12px; color: var(--text3); margin-top: 2px; }

.completion-bar-group { display: flex; gap: 8px; margin-top: 14px; }
.completion-day { flex: 1; text-align: center; }
.completion-day .day-label { font-size: 10px; color: var(--text4); margin-bottom: 5px; font-weight: 700; }
.completion-day .bar-track { height: 80px; background: var(--bg3); border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; }
.completion-day .bar-fill { width: 100%; border-radius: 8px; min-height: 2px; transition: height .4s var(--ease); }
.completion-day .bar-pct { font-size: 12px; font-weight: 800; margin-top: 6px; }

/* ═══════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════ */
.progress-bar { height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width .4s var(--ease); }

/* ═══════════════════════════════════════
   MODAL
   ═══════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26,29,46,.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    padding: 0;
}
.modal {
    background: var(--bg2);
    border-radius: 24px 24px 0 0;
    padding: 32px 24px calc(24px + env(safe-area-inset-bottom));
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: slideUp .3s var(--ease);
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.modal h3 { font-size: 20px; font-weight: 800; margin-bottom: 4px; color: var(--text); }
.modal label {
    display: block;
    font-size: 13px;
    color: var(--text2);
    margin-bottom: 6px;
    font-weight: 600;
}
.modal input, .modal select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 16px;
    margin-bottom: 14px;
    outline: none;
    font-family: inherit;
    -webkit-appearance: none;
    transition: border-color .15s var(--ease);
}
.modal input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,95,199,.1); }
.modal-btns { display: flex; gap: 10px; margin-top: 10px; }
.modal-btns .btn { flex: 1; justify-content: center; padding: 14px; font-size: 15px; }

/* ═══════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 10px;
}
.section-title { font-size: 15px; font-weight: 700; color: var(--text); }

/* ═══════════════════════════════════════
   TOAST
   ═══════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: #fff;
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    z-index: 2000;
    opacity: 0;
    transition: all .3s var(--ease);
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ═══════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text4);
    font-size: 14px;
    font-weight: 500;
}

/* ═══════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg);
}
.login-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px 28px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}
.login-card h1 { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.login-card .sub { font-size: 14px; color: var(--text3); margin-bottom: 28px; }
.login-card label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; font-weight: 600; }
.login-card input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 16px;
    margin-bottom: 14px;
    outline: none;
    font-family: inherit;
    -webkit-appearance: none;
}
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,95,199,.1); }
.login-card .btn { width: 100%; justify-content: center; padding: 16px; font-size: 16px; border-radius: var(--radius); }
.login-error {
    background: var(--red-soft);
    border: 1px solid #fca5a5;
    color: var(--red-text);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 500;
}

/* ═══════════════════════════════════════
   MOBILE BOTTOM NAV
   ═══════════════════════════════════════ */
.mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    z-index: 100;
    justify-content: space-around;
}
.mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    color: var(--text4);
    padding: 6px 8px;
    gap: 3px;
    font-weight: 600;
    transition: color .15s var(--ease);
    -webkit-tap-highlight-color: transparent;
    min-width: 52px;
}
.mobile-nav a.active { color: var(--primary); }
.mobile-nav a svg { width: 22px; height: 22px; }

/* ═══════════════════════════════════════
   TRACK HITS — Post picker cards
   ═══════════════════════════════════════ */
.hit-card {
    display: flex;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all .2s var(--ease);
    box-shadow: var(--shadow-sm);
    -webkit-tap-highlight-color: transparent;
}
.hit-card:active { transform: scale(.99); background: var(--bg3); }
.hit-card.has-views { border-color: rgba(217,119,6,.25); background: linear-gradient(135deg, var(--bg2), rgba(254,243,199,.15)); }
.hit-card-bar { width: 4px; flex-shrink: 0; min-height: 100%; }
.hit-card-bar.book1 { background: var(--book1); }
.hit-card-bar.book2 { background: var(--book2); }
.hit-card-body { flex: 1; padding: 14px; display: flex; align-items: center; gap: 12px; }
.hit-card-info { flex: 1; min-width: 0; }
.hit-card-account { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; line-height: 1.3; }
.hit-card-meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 12px; color: var(--text3); flex-wrap: wrap; line-height: 1.6; }
.hit-card-meta svg { color: var(--text4); flex-shrink: 0; }
.hit-card-right { flex-shrink: 0; }
.hit-add-btn {
    width: 40px; height: 40px; border-radius: 12px;
    background: var(--bg3); color: var(--text4);
    display: flex; align-items: center; justify-content: center;
    transition: all .15s var(--ease);
}
.hit-card:active .hit-add-btn { background: var(--bg4); }
.hit-views-badge {
    display: flex; align-items: center; gap: 5px;
    background: var(--amber-soft); color: var(--amber-text);
    padding: 6px 12px; border-radius: 10px;
    font-size: 13px; font-weight: 700;
    white-space: nowrap;
}

/* ═══════════════════════════════════════
   CONTENT PERFORMANCE LIST (Analytics)
   ═══════════════════════════════════════ */
.content-perf-list { display: flex; flex-direction: column; }
.content-perf-item {
    display: flex;
    flex-direction: column;
    padding: 14px 0;
    border-bottom: 1px solid var(--bg3);
    gap: 8px;
}
.content-perf-item:last-child { border-bottom: none; }
.content-perf-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; flex-wrap: wrap; }
.content-perf-name { font-weight: 600; font-size: 14px; color: var(--text); }
.content-perf-code { font-size: 11px; color: var(--text4); font-weight: 600; background: var(--bg3); padding: 1px 7px; border-radius: 5px; flex-shrink: 0; }
.content-perf-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; flex-wrap: wrap; }
.content-perf-stat {
    display: flex; align-items: center; gap: 4px;
    font-size: 12px; color: var(--text3); font-weight: 600;
    white-space: nowrap;
}
.content-perf-stat svg { color: var(--text4); }
.content-perf-stat.views { color: var(--amber-text); font-weight: 700; }
.content-perf-stat.views svg { color: var(--amber); }
.content-perf-stat.hits { color: var(--amber); font-weight: 700; font-size: 11px; }
.content-perf-stat.muted { color: var(--text4); font-size: 11px; }
.content-perf-num { font-size: 15px; font-weight: 800; color: var(--text); }
.content-perf-stat.views .content-perf-num { color: var(--amber-text); }
.content-perf-label { font-size: 11px; color: var(--text4); }

/* ═══════════════════════════════════════
   DESKTOP (min 768px)
   ═══════════════════════════════════════ */
@media (min-width: 769px) {
    .sidebar {
        display: flex;
        flex-direction: column;
        width: 260px;
        background: var(--bg2);
        border-right: 1px solid var(--border);
        padding: 28px 0 0;
        position: fixed;
        top: 0; left: 0; bottom: 0;
        overflow-y: auto;
        z-index: 100;
    }
    .sidebar-logo {
        padding: 0 24px 32px;
        font-size: 22px;
        font-weight: 800;
        letter-spacing: -0.5px;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .sidebar-logo span { color: var(--primary); }
    .sidebar-section {
        font-size: 10px;
        color: var(--text4);
        text-transform: uppercase;
        letter-spacing: 2px;
        padding: 24px 24px 10px;
        font-weight: 600;
    }
    .sidebar-nav { list-style: none; }
    .sidebar-nav a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 11px 24px;
        color: var(--text3);
        font-size: 14px;
        font-weight: 500;
        transition: all .15s var(--ease);
        border-left: 3px solid transparent;
    }
    .sidebar-nav a:hover { color: var(--text); background: var(--bg3); }
    .sidebar-nav a.active {
        color: var(--primary);
        background: var(--primary-bg);
        border-left-color: var(--primary);
        font-weight: 600;
    }
    .sidebar-nav a svg { flex-shrink: 0; }
    .sidebar-user {
        margin-top: auto;
        padding: 20px 24px;
        border-top: 1px solid var(--border);
        background: var(--bg3);
    }
    .sidebar-user .name { font-size: 13px; font-weight: 700; }
    .sidebar-user .role { font-size: 12px; color: var(--text3); margin-top: 2px; }
    .sidebar-user a { font-size: 12px; color: var(--text4); margin-top: 8px; display: inline-block; }

    .main {
        margin-left: 260px;
        padding: 36px 40px;
        max-width: 1280px;
    }
    .mobile-nav { display: none; }

    .page-title { font-size: 26px; }

    .stats-duo { gap: 16px; }
    .stat-pill { padding: 20px; gap: 16px; }
    .stat-pill-value { font-size: 24px; }

    .stats-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
    .card-value { font-size: 34px; }

    .post-card:hover, .pcard:hover { border-color: var(--border2); box-shadow: var(--shadow); transform: translateY(-1px); }
    .pcard.r1:hover { border-color: #a5b4fc; }
    .pcard.r2:hover { border-color: #fbbf24; }

    .rounds-grid {
        flex-direction: row;
        gap: 24px;
        align-items: flex-start;
    }
    .round-col { flex: 1; }

    .pcard-content-text { font-size: 20px; }
    .pcard-time-col { width: 80px; }
    .pcard-time { font-size: 14px; }

    .action-btn:hover { transform: scale(1.05); }
    .done-btn:hover { background: #bbf7d0; border-color: var(--green); }
    .trophy-btn:hover { background: #fde68a; border-color: var(--amber); }

    .acc-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
    .acc-card:hover { border-color: var(--border2); box-shadow: var(--shadow); transform: translateY(-2px); }

    .content-table tr:hover td { background: var(--bg); }

    .cal-grid { padding: 20px; gap: 6px; }
    .cal-day { min-height: 88px; padding: 10px 6px; border-radius: 12px; }
    .cal-day:hover { background: var(--bg3); border-color: var(--border2); transform: translateY(-1px); }
    .cal-day .day-count { font-size: 20px; }

    .analytics-grid-2 { grid-template-columns: 1fr 1fr; }

    .modal-overlay { align-items: center; padding: 20px; }
    .modal { border-radius: 24px; padding: 32px; max-width: 460px; animation: none; }

    .winner-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
    .filter-btn:hover { color: var(--text); border-color: var(--border2); }

    .hit-card:hover { border-color: var(--border2); box-shadow: var(--shadow); transform: translateY(-1px); }
    .hit-card:hover .hit-add-btn { background: var(--primary-bg); color: var(--primary); }
    .hit-card.has-views:hover { border-color: rgba(217,119,6,.4); }

    .content-perf-item { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
    .content-perf-right { flex-wrap: nowrap; }
}

/* ═══════════════════════════════════════
   SCROLLBAR (Desktop)
   ═══════════════════════════════════════ */
@media (min-width: 769px) {
    ::-webkit-scrollbar { width: 6px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
    ::-webkit-scrollbar-thumb:hover { background: var(--text4); }
}
