/* ==========================================================================
   Selly Dashboard — token-first styles over the Platinumlist Design System.
   Every value resolves to a DS semantic token (--bg-*, --content-*,
   --interaction-*, --accent-*, --link-*, --radius-*, --shadow-*, --space-*,
   --font-*). Zero hardcoded hex / px / font-family. Light + dark both work via
   the DS light-dark() token layer; default theme is light.
   Legacy class names are kept so the dynamic render logic stays intact; only
   their styling is migrated to tokens. New compositions (table, tabs, toast,
   bulk-bar, progress) follow the .pl- token-first convention.
   ========================================================================== */

/* App background uses the DS wash surface per .pl-app */
body { background: var(--bg-wash); color: var(--content-primary); min-height: 100vh; -webkit-tap-highlight-color: transparent; }

/* Lucide icons render inline, sized to the surrounding text by default */
svg.lucide { display: inline-block; vertical-align: -0.125em; width: 1em; height: 1em; flex-shrink: 0; }
/* Status dot (replaces colour-emoji indicators) — fixed glyph size per DS dot convention */
.sdot { display: inline-block; width: 8px; height: 8px; border-radius: var(--radius-pill); vertical-align: middle; margin-right: var(--space-1); }

/* ---------- Role selection ---------- */
.role-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-direction: column; background: var(--bg-wash); padding: var(--space-4); }
.role-box { background: var(--bg-floating); padding: var(--space-10); border-radius: var(--radius-base); border: 1px solid var(--bg-border); text-align: center; max-width: 500px; width: 90%; box-shadow: var(--shadow-lg); }
.role-box h2 { font-family: var(--font-family-accent); color: var(--content-primary); margin-bottom: var(--space-3); font-size: var(--font-size-xl); }
.role-box p { color: var(--content-secondary); margin-bottom: var(--space-6); }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-3); }
.role-btn { padding: var(--space-4) var(--space-3); background: var(--bg-secondary); border: 1px solid var(--bg-border); border-radius: var(--radius-xs); color: var(--content-primary); cursor: pointer; font-size: var(--font-size-sm); font-weight: var(--font-weight-medium); transition: background var(--duration-base) var(--ease-out), border-color var(--duration-base) var(--ease-out); }
.role-btn:hover { border-color: var(--bg-border-hover); background: var(--bg-hover); }
.role-btn.selected { border-color: transparent; background: var(--interaction-primary-bg); color: var(--interaction-primary-content); }
.role-countries { font-size: var(--font-size-xs); color: var(--content-secondary); margin-top: var(--space-1); }

/* ---------- Dashboard shell ---------- */
.dashboard { display: none; padding: var(--space-5); }
.dashboard.active { display: block; }

/* ---------- Top tab bar (.pl-tabs token-first entity) ---------- */
.tabs { display: flex; gap: var(--space-1); margin-bottom: var(--space-5); border-bottom: 1px solid var(--bg-border); padding-bottom: var(--space-3); }
.tab { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-5); background: transparent; border: none; color: var(--content-secondary); cursor: pointer; font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); border-radius: var(--radius-xs) var(--radius-xs) 0 0; transition: color var(--duration-base) var(--ease-out), background var(--duration-base) var(--ease-out); }
.tab:hover { color: var(--content-primary); }
.tab.active { background: var(--bg-secondary); color: var(--content-primary); }
.tab svg { width: 16px; height: 16px; }

/* ---------- Header ---------- */
.header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-5); }
.header-brand { display: flex; align-items: center; gap: var(--space-3); }
.header-logo { height: 32px; width: auto; display: block; }
/* Product title sits quieter than the brand wordmark: body face (Inter), smaller,
   semibold — so the "Platinumlist" logotype leads and the two stop competing. */
h1 { font-family: var(--font-family-default); color: var(--content-primary); font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); letter-spacing: -0.01em; }
.user-info { color: var(--content-secondary); font-size: var(--font-size-xs); }
.user-info span { color: var(--content-primary); font-weight: var(--font-weight-semibold); }

/* ---------- Status banners ---------- */
.status { padding: var(--space-4); border-radius: var(--radius-xs); margin-bottom: var(--space-5); border: 1px solid var(--bg-border); }
.loading { background: var(--bg-floating); color: var(--content-secondary); }
.success { background: var(--accent-success-light); border-color: var(--accent-success); color: var(--accent-success); }
.error { background: var(--accent-alert-light); border-color: var(--accent-alert); color: var(--accent-alert); }

/* ---------- Filters ---------- */
.filters { background: var(--bg-floating); border: 1px solid var(--bg-border); border-radius: var(--radius-base); padding: var(--space-5); margin-bottom: var(--space-5); }
.filters-title { color: var(--content-secondary); font-size: var(--font-size-xs); font-weight: var(--font-weight-bold); margin-bottom: var(--space-4); text-transform: uppercase; letter-spacing: 0.02em; cursor: pointer; display: flex; justify-content: space-between; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); }
.filter-group label { display: block; color: var(--form-label); font-size: var(--font-size-xs); margin-bottom: var(--space-1); text-transform: uppercase; letter-spacing: 0.02em; }
.filter-group input, .filter-group select { width: 100%; padding: var(--space-3); border-radius: var(--radius-xs); border: 1px solid var(--form-border); background: var(--bg-floating); color: var(--content-primary); font-size: var(--font-size-sm); font-family: var(--font-family-default); outline: none; transition: border-color var(--duration-base) var(--ease-out); }
.filter-group input:focus, .filter-group select:focus { border-color: var(--form-border-hover); }
.filter-group input::placeholder { color: var(--form-placeholder); }

/* ---------- Stat cards (.pl-card) ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.stat-card { background: var(--bg-floating); border: 1px solid var(--bg-border); border-radius: var(--radius-base); padding: var(--space-5); box-shadow: var(--shadow-sm); transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-label { color: var(--content-secondary); font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.02em; }
.stat-value { color: var(--content-primary); font-size: var(--font-size-2xl); font-weight: var(--font-weight-bold); margin-top: var(--space-1); }

/* ---------- Buttons (.pl-btn family) ---------- */
.btn-group { margin-bottom: var(--space-5); display: flex; gap: var(--space-3); flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); background: var(--interaction-primary-bg); color: var(--interaction-primary-content); border: none; padding: var(--space-3) var(--space-5); border-radius: var(--radius-base); font-weight: var(--font-weight-semibold); font-size: var(--font-size-md); font-family: inherit; cursor: pointer; transition: background var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out); }
.btn:hover { background: var(--interaction-primary-bg-hover); color: var(--interaction-primary-content-hover); }
.btn:active { transform: scale(0.99); }
.btn:focus-visible { box-shadow: var(--shadow-focus); outline: none; }
.btn svg { width: 16px; height: 16px; }
.btn-secondary { background: var(--interaction-secondary-bg); color: var(--interaction-secondary-content); }
.btn-secondary:hover { background: var(--interaction-secondary-bg-hover); color: var(--interaction-secondary-content-hover); }
.btn-logout { background: transparent; border: 1px solid var(--accent-alert); color: var(--accent-alert); }
.btn-logout:hover { background: var(--accent-alert-light); color: var(--accent-alert); }
.btn-toggle-active { background: var(--interaction-primary-bg); color: var(--interaction-primary-content); }
.btn-icon { padding: var(--space-3); aspect-ratio: 1; border-radius: var(--radius-base); }

/* ---------- Bulk selection bar ---------- */
.row-checkbox { width: 16px; height: 16px; cursor: pointer; accent-color: var(--interaction-primary-bg); }
.bulk-bar { display: none; position: fixed; bottom: var(--space-5); left: 50%; transform: translateX(-50%); background: var(--bg-floating); border: 1px solid var(--bg-border); border-radius: var(--radius-base); padding: var(--space-3) var(--space-5); z-index: 999; align-items: center; gap: var(--space-3); box-shadow: var(--shadow-lg); }
.bulk-bar.active { display: flex; }
.bulk-bar .bulk-count { color: var(--content-primary); font-weight: var(--font-weight-bold); font-size: var(--font-size-sm); white-space: nowrap; }
.bulk-bar .btn { padding: var(--space-2) var(--space-4); font-size: var(--font-size-xs); }
tr.selected-row { background: var(--bg-hover); }

/* ---------- Data table (.pl-table token-first entity) ---------- */
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { text-align: left; padding: var(--space-3) var(--space-2); color: var(--content-secondary); border-bottom: 1px solid var(--bg-border); font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.02em; position: sticky; top: 0; background: var(--bg-floating); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td { padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--bg-border); color: var(--content-primary); font-size: var(--font-size-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td:first-child { color: var(--content-primary); }
a { color: var(--link-base); text-decoration: none; transition: color var(--duration-base) var(--ease-out); }
a:hover { color: var(--link-hover); }
tr:hover td { background: var(--bg-hover); }
.table-container { max-height: 500px; overflow-y: auto; border: 1px solid var(--bg-border); border-radius: var(--radius-base); background: var(--bg-floating); box-shadow: var(--shadow-sm); }
.results-info { color: var(--content-secondary); text-align: center; padding: var(--space-3); font-size: var(--font-size-sm); }

/* ---------- Status badges (.pl-badge) ---------- */
.status-badge { display: inline-flex; align-items: center; padding: var(--spacing-4) 10px; border-radius: var(--radius-pill); font-size: var(--font-size-xs); font-weight: var(--font-weight-semibold); }
.status-new { background: var(--interaction-secondary-bg); color: var(--interaction-secondary-content); }
.status-done { background: var(--accent-success-light); color: var(--accent-success); }
.status-skip { background: var(--accent-alert-light); color: var(--accent-alert); }

/* ---------- Inline status / assign selects ---------- */
.status-input, .assign-select { background: var(--bg-floating); border: 1px solid var(--form-border); color: var(--content-primary); border-radius: var(--radius-xs); padding: var(--space-1) var(--space-2); font-size: var(--font-size-xs); font-family: var(--font-family-default); min-width: 0; width: 100%; cursor: pointer; transition: border-color var(--duration-base) var(--ease-out); }
.status-input:hover, .assign-select:hover { border-color: var(--form-border-hover); }
.status-input:focus, .assign-select:focus { outline: none; border-color: var(--form-border-hover); }
.status-input.s-new  { color: var(--content-primary); }
.status-input.s-done { color: var(--accent-success); border-color: var(--accent-success); }
.status-input.s-skip { color: var(--accent-alert); border-color: var(--accent-alert); }
.assign-select option { background: var(--bg-floating); color: var(--content-primary); }
.assign-select.assigned { color: var(--content-primary); border-color: var(--bg-border-hover); }

/* ---------- Title groups ---------- */
.group-parent-row { background: var(--bg-hover); cursor: pointer; }
.group-parent-row:hover { background: var(--bg-secondary); }
.group-toggle { display: inline-block; color: var(--content-secondary); font-size: var(--font-size-xs); font-weight: var(--font-weight-bold); margin-right: var(--space-1); user-select: none; vertical-align: middle; }
.group-child-row > td:nth-child(2) { padding-left: var(--space-6); border-left: 2px solid var(--bg-border); }
.group-child-row.hidden { display: none; }

/* ---------- Comments ---------- */
.comment-cell { max-width: 200px; }
.comment-text { cursor: pointer; padding: var(--space-1) var(--space-2); border-radius: var(--radius-xs); background: var(--bg-secondary); border: 1px solid var(--bg-border); display: inline-block; min-width: 80px; font-size: var(--font-size-xs); transition: border-color var(--duration-base) var(--ease-out); }
.comment-text:hover { border-color: var(--bg-border-hover); }
#tt { position: fixed; background: var(--bg-floating); color: var(--content-primary); font-size: var(--font-size-xs); padding: var(--space-1) var(--space-2); border-radius: var(--radius-xs); border: 1px solid var(--bg-border); box-shadow: var(--shadow-md); pointer-events: none; z-index: 9999; display: none; max-width: 320px; white-space: pre-wrap; word-break: break-word; line-height: var(--font-line-height-sm); }
.comment-text.empty { color: var(--form-placeholder); font-style: italic; }
.comment-text.has-comment { color: var(--content-primary); }
.commented-by { font-size: var(--font-size-xs); color: var(--content-secondary); display: block; margin-top: var(--space-1); }

.assign-cell { white-space: nowrap; }

/* ---------- Country groups ---------- */
.country-group { margin-bottom: var(--space-8); }
.country-header { background: var(--bg-secondary); padding: var(--space-4) var(--space-5); border-radius: var(--radius-base) var(--radius-base) 0 0; border: 1px solid var(--bg-border); border-bottom: none; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: background var(--duration-base) var(--ease-out); }
.country-header:hover { background: var(--bg-hover); border-color: var(--bg-border-hover); }
.country-header h3 { color: var(--content-primary); font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); margin: 0; }
.country-header .country-stats { color: var(--content-secondary); font-size: var(--font-size-sm); }
.country-header .country-stats span { color: var(--content-primary); margin-left: var(--space-4); font-weight: var(--font-weight-semibold); }
.country-table-wrap { border: 1px solid var(--bg-border); border-top: none; border-radius: 0 0 var(--radius-base) var(--radius-base); overflow: hidden; background: var(--bg-floating); box-shadow: var(--shadow-sm); }
.country-table-wrap.collapsed { display: none; }

/* ---------- Modal (.pl-modal) ---------- */
.modal-overlay { display: none; position: fixed; inset: 0; background: var(--bg-fade); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); z-index: 1000; align-items: center; justify-content: center; padding: var(--space-4); }
.modal-overlay.active { display: flex; }
.modal { background: var(--bg-floating); border-radius: var(--radius-2xlg); padding: var(--space-6); max-width: 500px; width: 90%; box-shadow: var(--shadow-lg); }
.modal h3 { font-family: var(--font-family-accent); color: var(--content-primary); font-size: var(--font-size-xl); margin-bottom: var(--space-3); }
.modal-event-title { color: var(--content-secondary); font-size: var(--font-size-sm); margin-bottom: var(--space-5); }
.modal textarea { width: 100%; min-height: 120px; padding: var(--space-3); border-radius: var(--radius-sm); border: 1px solid var(--form-border); background: var(--bg-floating); color: var(--content-primary); font-size: var(--font-size-sm); font-family: var(--font-family-default); resize: vertical; outline: none; box-sizing: border-box; transition: border-color var(--duration-base) var(--ease-out); }
.modal textarea:focus { border-color: var(--form-border-hover); }
.modal-buttons { display: flex; gap: var(--space-3); margin-top: var(--space-5); justify-content: flex-end; }
.modal-buttons button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-3) var(--space-5); border-radius: var(--radius-base); border: none; font-weight: var(--font-weight-semibold); font-family: inherit; cursor: pointer; transition: background var(--duration-base) var(--ease-out); }
.btn-save { background: var(--interaction-primary-bg); color: var(--interaction-primary-content); }
.btn-save:hover { background: var(--interaction-primary-bg-hover); color: var(--interaction-primary-content-hover); }
.btn-cancel { background: var(--interaction-secondary-bg); color: var(--interaction-secondary-content); }
.btn-cancel:hover { background: var(--interaction-secondary-bg-hover); }
.modal select, .modal input[type="text"] { width: 100%; padding: var(--space-3); border-radius: var(--radius-sm); border: 1px solid var(--form-border); background: var(--bg-floating); color: var(--content-primary); font-size: var(--font-size-sm); font-family: var(--font-family-default); outline: none; box-sizing: border-box; appearance: none; transition: border-color var(--duration-base) var(--ease-out); }
.modal select:focus, .modal input[type="text"]:focus { border-color: var(--form-border-hover); }
.modal-field { margin-bottom: var(--space-4); }
.modal-field label { display: block; color: var(--form-label); font-size: var(--font-size-xs); margin-bottom: var(--space-1); text-transform: uppercase; letter-spacing: 0.02em; }

/* ---------- Week stats ---------- */
.week-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--space-5); }
.week-card { background: var(--bg-floating); border: 1px solid var(--bg-border); border-radius: var(--radius-base); padding: var(--space-5); box-shadow: var(--shadow-sm); }
.week-card h4 { color: var(--content-primary); margin-bottom: var(--space-4); font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); }
.progress-bar { height: 20px; background: var(--bg-secondary); border-radius: var(--radius-pill); overflow: hidden; margin: var(--space-3) 0; }
.progress-fill { height: 100%; transition: width var(--duration-slow) var(--ease-out); }
.progress-commented { background: var(--accent-success); }
.progress-empty { background: var(--bg-border); }
.week-numbers { display: flex; justify-content: space-between; font-size: var(--font-size-xs); color: var(--content-secondary); }

/* ---------- Role groups ---------- */
.role-box { max-width: 660px !important; }
#role-grid { display: flex; flex-direction: column; gap: 0; }
.role-group-section { margin-bottom: var(--space-3); }
.role-group-label { color: var(--content-secondary); font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.04em; padding: var(--space-2) var(--space-1) var(--space-1); border-top: 1px solid var(--bg-border); }
.role-group-section:first-child .role-group-label { border-top: none; padding-top: 0; }
.role-group-btns { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.role-group-btns .role-btn { min-width: 110px; flex: 0 0 auto; text-align: left; }

/* ---------- Analytics ---------- */
.analytics-card { background: var(--bg-floating); border: 1px solid var(--bg-border); border-radius: var(--radius-base); padding: var(--space-5); margin-bottom: var(--space-5); box-shadow: var(--shadow-sm); }
.analytics-card h3 { color: var(--content-primary); font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); margin-bottom: var(--space-4); display: flex; align-items: center; gap: var(--space-2); }
.analytics-table { width: 100%; border-collapse: collapse; }
.analytics-table th { text-align: left; padding: var(--space-3); color: var(--content-secondary); font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.02em; border-bottom: 1px solid var(--bg-border); background: var(--bg-secondary); }
.analytics-table td { padding: var(--space-3); border-bottom: 1px solid var(--bg-border); font-size: var(--font-size-sm); color: var(--content-primary); }
.analytics-table td:first-child { color: var(--content-primary); font-weight: var(--font-weight-medium); }
.analytics-table tr:hover td { background: var(--bg-hover); }
.analytics-total-row td { background: var(--accent-caution-light); border-top: 2px solid var(--bg-border-hover); color: var(--content-primary); font-weight: var(--font-weight-bold); }
.analytics-num { color: var(--content-primary); font-weight: var(--font-weight-bold); }
.analytics-num-warn { color: var(--accent-alert); font-weight: var(--font-weight-bold); }
.analytics-progress { display: flex; align-items: center; gap: var(--space-2); }
.analytics-bar { flex: 1; height: 14px; background: var(--bg-secondary); border-radius: var(--radius-pill); overflow: hidden; min-width: 60px; }
.analytics-bar-fill { height: 100%; border-radius: var(--radius-pill); transition: width var(--duration-slow) var(--ease-out); }
.analytics-pct { font-size: var(--font-size-xs); font-weight: var(--font-weight-bold); min-width: 38px; text-align: right; }
.fill-green { background: var(--accent-success); } .pct-green { color: var(--accent-success); }
.fill-orange { background: var(--accent-warning); } .pct-orange { color: var(--accent-warning); }
.fill-red { background: var(--accent-alert); } .pct-red { color: var(--accent-alert); }
.fill-gray { background: var(--bg-border); } .pct-gray { color: var(--content-secondary); }
.analytics-period-bar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-5); background: var(--bg-floating); border: 1px solid var(--bg-border); border-radius: var(--radius-sm); margin-bottom: var(--space-5); }
.analytics-period-bar label { color: var(--content-secondary); font-size: var(--font-size-xs); }
.analytics-period-bar select { background: var(--bg-floating); border: 1px solid var(--form-border); color: var(--content-primary); padding: var(--space-2) var(--space-3); border-radius: var(--radius-xs); font-size: var(--font-size-sm); font-family: var(--font-family-default); outline: none; cursor: pointer; }
.analytics-period-bar select:focus { border-color: var(--form-border-hover); }

/* ---------- Toast (.pl-toast token-first entity) ---------- */
#toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-floating); color: var(--content-primary); padding: var(--space-3) var(--space-5); border-radius: var(--radius-sm); font-size: var(--font-size-sm); border: 1px solid var(--bg-border); box-shadow: var(--shadow-md);
  opacity: 0; transition: opacity var(--duration-slow), transform var(--duration-slow); pointer-events: none; z-index: 9999; white-space: nowrap; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.ok  { border-left: 3px solid var(--accent-success); }
#toast.err { border-left: 3px solid var(--accent-alert); }

/* ---------- Theme toggle ---------- */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-base); background: var(--interaction-secondary-bg); color: var(--interaction-secondary-content); border: none; cursor: pointer; transition: background var(--duration-base) var(--ease-out); }
.theme-toggle:hover { background: var(--interaction-secondary-bg-hover); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Flatpickr — re-themed to DS tokens ---------- */
.flatpickr-calendar { background: var(--bg-floating) !important; border: 1px solid var(--bg-border) !important; box-shadow: var(--shadow-lg) !important; color: var(--content-primary) !important; }
.flatpickr-months .flatpickr-month { background: var(--bg-floating) !important; color: var(--content-primary) !important; }
.flatpickr-current-month .flatpickr-monthDropdown-months { background: var(--bg-floating) !important; color: var(--content-primary) !important; }
.flatpickr-current-month input.cur-year { color: var(--content-primary) !important; }
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { color: var(--content-primary) !important; fill: var(--content-primary) !important; }
.flatpickr-weekdays { background: var(--bg-floating) !important; }
span.flatpickr-weekday { color: var(--content-secondary) !important; background: var(--bg-floating) !important; }
.flatpickr-days { background: var(--bg-floating) !important; }
.flatpickr-day { color: var(--content-primary) !important; border-radius: var(--radius-xs) !important; }
.flatpickr-day:hover { background: var(--bg-hover) !important; border-color: var(--bg-hover) !important; }
.flatpickr-day.selected { background: var(--interaction-primary-bg) !important; border-color: var(--interaction-primary-bg) !important; color: var(--interaction-primary-content) !important; }
.flatpickr-day.today { border-color: var(--bg-border-hover) !important; }
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: var(--content-highlight) !important; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  body { overflow-x: hidden; }
  .dashboard { padding: var(--space-3); }
  .header { flex-direction: column; align-items: flex-start; gap: var(--space-4); }
  .header > div:last-child { display: flex; gap: var(--space-2); width: 100%; }
  .header > div:last-child .btn { flex: 1; padding: var(--space-2) var(--space-3); font-size: var(--font-size-xs); }
  h1 { font-size: var(--font-size-lg); }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { white-space: nowrap; padding: var(--space-2) var(--space-4); font-size: var(--font-size-sm); }
  .filters { padding: var(--space-4); }
  .filters-grid { grid-template-columns: 1fr; gap: var(--space-3); }
  .filter-group input, .filter-group select { padding: var(--space-3); font-size: var(--font-size-md); }
  .role-grid { grid-template-columns: repeat(2, 1fr); }
  .role-box { padding: var(--space-6); }
  .btn-group { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
  .btn-group .btn { padding: var(--space-3) var(--space-2); font-size: var(--font-size-xs); text-align: center; }
  .btn-group .btn:last-child { grid-column: span 2; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
  .stat-card { padding: var(--space-4); }
  .stat-value { font-size: var(--font-size-xl); }
  .country-group { margin-bottom: var(--space-5); }
  .country-header { padding: var(--space-3) var(--space-4); flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .country-header h3 { font-size: var(--font-size-md); }
  .country-header .country-stats { font-size: var(--font-size-xs); }
  .country-header .country-stats span { margin-left: var(--space-3); }
  .country-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 600px; font-size: var(--font-size-xs); table-layout: auto; }
  td { white-space: normal; }
  th, td { padding: var(--space-3) var(--space-2); }
  .comment-cell { max-width: 120px; }
  .comment-text { font-size: var(--font-size-xs); min-width: 60px; padding: var(--space-1) var(--space-2); }
  .modal { padding: var(--space-5); margin: var(--space-3); }
  .modal h3 { font-size: var(--font-size-md); }
  .modal textarea { min-height: 100px; font-size: var(--font-size-md); }
  .modal-buttons { flex-direction: column; }
  .modal-buttons button { width: 100%; padding: var(--space-4); }
  .week-stats { grid-template-columns: 1fr; }
  .week-card { padding: var(--space-4); }
  .week-card h4 { font-size: var(--font-size-sm); }
  .hide-mobile { display: none; }
}
@media (max-width: 380px) {
  .role-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .btn-group { grid-template-columns: 1fr; }
  .btn-group .btn:last-child { grid-column: span 1; }
}
@media (min-width: 1200px) {
  .dashboard { max-width: 1400px; margin: 0 auto; padding: var(--space-8) var(--space-10); }
  .stats { grid-template-columns: repeat(5, 1fr); }
  .filters-grid { grid-template-columns: repeat(4, 1fr); }
}
