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

body {
    background: #0d0d0d;
    color: #ddd;
    font-family: sans-serif;
    min-height: 100vh;
    padding: 20px 16px 48px;
}

/* ── Header ── */
header {
    display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
header a {
    color: #666; text-decoration: none; font-size: 24px;
    line-height: 1; transition: color 0.2s;
}
header a:hover { color: #aaa; }
header h1 { font-size: 20px; color: #eee; font-weight: 700; }
header .session-count { margin-left: auto; font-size: 13px; color: #555; white-space: nowrap; }

/* ── Three-dots menu ── */
#menuBtn {
    background: transparent; border: none; color: #666; font-size: 22px;
    padding: 2px 6px; border-radius: 6px; cursor: pointer; line-height: 1;
    transition: color 0.2s; flex-shrink: 0; position: relative;
}
#menuBtn:hover { color: #aaa; }

#menuDropdown {
    display: none;
    position: absolute;
    top: 44px; right: 16px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 10px;
    overflow: hidden;
    z-index: 200;
    min-width: 160px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.5);
}
#menuDropdown.open { display: block; }
.menu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 16px; font-size: 15px; color: #ccc;
    cursor: pointer; user-select: none; transition: background 0.15s;
}
.menu-item:hover { background: #2a2a2a; }
.menu-item:active { background: #333; }
.menu-icon { font-size: 16px; width: 20px; text-align: center; }

/* ── Import/Export feedback ── */
#toastMsg {
    display: none;
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: #1e1e1e; border: 1px solid #333; border-radius: 10px;
    padding: 11px 20px; font-size: 14px; color: #ccc;
    z-index: 300; white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
#toastMsg.visible { display: block; }
#toastMsg.error { border-color: #dc3545; color: #f08; }
#toastMsg.success { border-color: #28a745; color: #5c5; }

/* ── Filter bar ── */
#filterBar { display: none; margin-bottom: 20px; }
#filterLabel {
    font-size: 11px; color: #555; letter-spacing: 0.08em;
    text-transform: uppercase; margin-bottom: 8px;
}
#filterChips { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-chip {
    font-size: 12px; padding: 5px 11px; border-radius: 20px; font-weight: 600;
    letter-spacing: 0.03em; cursor: pointer; user-select: none;
    background: #1a1a1a; color: #666; border: 1px solid #2a2a2a;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.filter-chip.active { background: #0e1e30; color: #4af; border-color: #1a3a55; }
.filter-chip-all { background: #1a1a1a; color: #555; border: 1px solid #2a2a2a; }
.filter-chip-all.active { background: #1a1a1a; color: #aaa; border-color: #555; }

/* ── Empty state ── */
#emptyState { text-align: center; padding: 60px 20px; color: #444; }
#emptyState p { font-size: 16px; margin-bottom: 8px; }
#emptyState small { font-size: 13px; }

/* ── Charts ── */
#chartsSection { display: none; }
.charts-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 12px; margin-bottom: 28px;
}
@media (max-width: 480px) { .charts-grid { grid-template-columns: 1fr; } }
.chart-card { background: #1a1a1a; border-radius: 14px; padding: 14px 14px 10px; }
.chart-card h3 {
    font-size: 11px; color: #666; letter-spacing: 0.08em;
    text-transform: uppercase; margin-bottom: 10px;
}
.chart-card canvas { width: 100% !important; }

/* ── Sessions list ── */
#sessionsList { display: flex; flex-direction: column; gap: 10px; }

#noResults { display: none; text-align: center; padding: 32px 20px; color: #444; font-size: 15px; }

/* ── Error modal (import validation failures) ── */
#errorModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 400;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
#errorModal.visible { display: flex; }
#errorModalBox {
    background: #1e0e0e;
    border: 1px solid #5a1a1a;
    border-radius: 14px;
    padding: 22px 20px 18px;
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
#errorModalTitle {
    font-size: 15px;
    font-weight: 700;
    color: #f08080;
    letter-spacing: 0.03em;
}
#errorModalMsg {
    font-size: 14px;
    color: #ccc;
    line-height: 1.55;
    word-break: break-word;
}
#errorModalOk {
    align-self: flex-end;
    padding: 9px 24px;
    background: #3a1010;
    border: 1px solid #5a1a1a;
    border-radius: 8px;
    color: #f08080;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
#errorModalOk:hover { background: #4a1515; }
