/* Pool Design PWA — Design System */
:root {
  --color-primary:       #2C6B4A;
  --color-primary-light: #E8F4EE;
  --color-primary-mid:   #4A8B6A;
  --color-primary-dark:  #1A5C36;
  --accent:              #C8A84B;
  --accent-light:        #FDF6E3;
  --bg:                  #F5F4F0;
  --surface:             #FFFFFF;
  --surface-2:           #F0EFEB;
  --surface-3:           #E8E7E2;
  --border:              rgba(0,0,0,0.08);
  --border-mid:          rgba(0,0,0,0.12);
  --text-1:              #1A1A18;
  --text-2:              #5C5C58;
  --text-3:              #9C9C96;
  --warn-bg:             #FEF9E7;
  --warn-border:         #E8C840;
  --warn-text:           #6B4F08;
  --danger:              #C0392B;
  --danger-light:        #FDECEA;
  --success:             #27AE60;
  --success-light:       #E3F2EC;
  --radius-sm:           8px;
  --radius-md:           12px;
  --radius-lg:           16px;
  --radius-xl:           24px;
  --font:                'DM Sans', system-ui, sans-serif;
  --font-mono:           'DM Mono', monospace;
  --topbar-h:            56px;
  --bottomnav-h:         64px;
  --sidebar-w:           220px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* ── BLAZOR ─────────────────────────────── */
.blazor-error-boundary {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--warn-text);
  font-size: 13px;
  margin: 16px;
}
.blazor-error-boundary::after { content: "Ocorreu um erro. Recarregue a página."; }

.valid.modified:not([type=checkbox]) { outline: none; }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); font-size: 12px; margin-top: 4px; }

/* ── PAGE WRAP ────────────────────────────── */
.page-wrap { max-width: 680px; margin: 0 auto; padding: 20px 16px; }
@media (min-width: 768px) { .page-wrap { padding: 28px 32px; } }
@media (min-width: 768px) { .page-wrap--wide { max-width: 1080px; } }

/* ── DASHBOARD 2-COL LAYOUT (desktop) ──────── */
.dashboard-body { display: block; }
@media (min-width: 768px) {
  .dashboard-body { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
}
.dashboard-col-main, .dashboard-col-side { min-width: 0; }

/* ── PAGE HEAD ─────────────────────────────── */
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 22px; font-weight: 700; color: var(--text-1); margin: 0; }
.page-head h1:focus { outline: none; }
.page-head p { font-size: 13px; color: var(--text-2); margin-top: 3px; }

/* ── CARDS ──────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 16px;
}
.card-head {
  padding: 12px 16px; font-size: 12px; font-weight: 600; color: var(--text-2);
  border-bottom: 1px solid var(--border); letter-spacing: 0.03em;
  display: flex; align-items: center; justify-content: space-between;
}
.card-head-link { font-size: 12px; font-weight: 500; color: var(--color-primary); cursor: pointer; }

/* ── METRIC GRID ────────────────────────────── */
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
@media (min-width: 768px) { .metric-grid { grid-template-columns: repeat(4, 1fr); } }
.metric-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px;
}
@media (min-width: 768px) { .metric-card { padding: 18px 20px; } }
.metric-label { font-size: 11px; color: var(--text-2); line-height: 1.4; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.metric-value { font-size: 26px; font-weight: 600; color: var(--text-1); margin-top: 6px; letter-spacing: -0.02em; }
@media (min-width: 768px) { .metric-value { font-size: 30px; } }
.metric-value.sm { font-size: 20px; }
.metric-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.metric-grid--comparacao { grid-template-columns: 1fr; }
@media (min-width: 768px) { .metric-grid--comparacao { grid-template-columns: 1fr; } }
.metric-compare-subs { display: flex; gap: 16px; margin-top: 6px; }
.metric-compare-subs .metric-sub { flex: 1; }
.metric-compare-values { display: flex; align-items: baseline; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
.metric-compare-values .metric-value { flex: 1; min-width: 80px; }
.metric-variacao { font-size: 13px; font-weight: 600; white-space: nowrap; }
.text-success { color: var(--green); }
.text-danger  { color: var(--red); }

/* ── ROW ITEMS ──────────────────────────────── */
.row-item {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.row-item:last-child { border-bottom: none; }
.row-main { font-size: 13px; font-weight: 600; color: var(--text-1); }
.row-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.row-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.row-right { text-align: right; flex-shrink: 0; }
.scroll-list { max-height: 360px; overflow-y: auto; }

/* ── BANNER ─────────────────────────────────── */
.banner-card {
  width: 100%; border-radius: var(--radius-lg); overflow: hidden;
  position: relative; margin-bottom: 20px;
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary-mid) 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 240px; cursor: pointer;
}
.banner-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.1) 60%);
}
.banner-content { position: relative; z-index: 1; padding: 16px 20px; }
.banner-tag {
  font-size: 10px; background: rgba(200,168,75,0.9); color: #fff;
  border-radius: 20px; padding: 3px 10px; letter-spacing: 0.08em; font-weight: 600;
  display: inline-block; margin-bottom: 8px;
}
.banner-title { font-size: 18px; font-weight: 700; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.4); margin-bottom: 10px; line-height: 1.25; }
.banner-links { display: flex; gap: 8px; flex-wrap: wrap; }
.banner-link {
  font-size: 11px; padding: 5px 12px; border-radius: 20px;
  background: rgba(255,255,255,0.2); color: #fff;
  border: 1px solid rgba(255,255,255,0.4); cursor: pointer;
  transition: background 0.15s; text-decoration: none;
}
.banner-link:hover { background: rgba(255,255,255,0.35); }

/* ── BUTTONS ────────────────────────────────── */
.btn-primary {
  width: 100%; padding: 14px;
  background: var(--color-primary); color: #fff;
  border: none; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: var(--font); letter-spacing: 0.01em;
  transition: background 0.15s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover { background: var(--color-primary-mid); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary {
  width: 100%; padding: 13px;
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border-mid); border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: var(--font); margin-top: 8px; transition: background 0.15s;
}
.btn-secondary:hover { background: var(--surface-2); }

/* ── FILTER BAR ─────────────────────────────── */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  margin-bottom: 16px; align-items: center;
}
.filter-select {
  padding: 7px 10px; font-size: 12px; font-family: var(--font);
  border: 1px solid var(--border-mid); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-1);
  cursor: pointer; flex: 1; min-width: 120px;
}
.compare-btn {
  padding: 7px 12px; font-size: 12px; font-family: var(--font);
  border: 1px solid var(--border-mid); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-2); cursor: pointer;
  white-space: nowrap; transition: background 0.15s;
}
.compare-btn:hover { background: var(--surface-3); }
.compare-btn.active { background: var(--color-primary-light); color: var(--color-primary-dark); border-color: var(--color-primary); }
.filter-bar--comparacao { flex-direction: column; align-items: stretch; gap: 10px; }
.filter-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.filter-label { font-size: 11px; color: var(--text-3); white-space: nowrap; min-width: 72px; }
.filter-dates { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-date {
  padding: 7px 10px; font-size: 12px; font-family: var(--font);
  border: 1px solid var(--border-mid); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-1); flex: 1; min-width: 130px;
}
.filter-error {
  padding: 8px 16px; font-size: 12px; color: var(--red);
  background: var(--red-light); border-radius: var(--radius-sm); margin-bottom: 12px;
}

/* ── SUMMARY STRIP ──────────────────────────── */
.summary-strip {
  display: flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden; margin-bottom: 16px;
}
.summary-item {
  flex: 1; padding: 12px 14px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.summary-item:last-child { border-right: none; }
.sum-val { font-size: 17px; font-weight: 600; color: var(--text-1); font-family: var(--font-mono); }
.sum-label { font-size: 11px; color: var(--text-3); }

/* ── SEGMENT BAR ────────────────────────────── */
.seg-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.seg-row:last-child { border-bottom: none; }
.seg-name { font-size: 12px; flex: 1; color: var(--text-1); }
.seg-val { font-size: 12px; color: var(--text-2); font-family: var(--font-mono); min-width: 80px; text-align: right; }
.seg-bar-wrap { width: 80px; height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.seg-bar-fill { height: 100%; background: var(--color-primary); border-radius: 3px; }

/* ── ALERT CARD ─────────────────────────────── */
.alert-card {
  background: var(--warn-bg); border: 1px solid var(--warn-border);
  border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 16px;
}
.alert-head { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--warn-text); margin-bottom: 5px; }
.alert-head svg { width: 15px; height: 15px; flex-shrink: 0; }
.alert-text { font-size: 12px; color: var(--warn-text); line-height: 1.5; }
.alert-link { font-size: 12px; color: var(--accent); font-weight: 600; margin-top: 6px; cursor: pointer; display: inline-block; }

/* ── PROGRESS ───────────────────────────────── */
.progress-bar { width: 100%; height: 7px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--color-primary); border-radius: 4px; transition: width 0.4s ease; }

/* ── FORM ───────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; letter-spacing: 0.04em; text-transform: uppercase; }
.form-label small { font-weight: 400; color: var(--text-3); text-transform: none; }
.form-input {
  width: 100%; padding: 10px 12px; font-size: 13px; font-family: var(--font);
  border: 1px solid var(--border-mid); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-1); transition: border-color 0.15s;
}
.form-input:focus { outline: none; border-color: var(--color-primary); }
.form-input[readonly], .form-input.readonly { background: var(--surface-2); color: var(--text-3); cursor: default; }
select.form-input { cursor: pointer; }
.form-divider { height: 1px; background: var(--border); margin: 20px 0; }
.form-section { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 14px; }

/* ── BADGES ─────────────────────────────────── */
.badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px; letter-spacing: 0.06em;
}
.badge-active { background: var(--color-primary-light); color: var(--color-primary-dark); }
.badge-ended  { background: var(--surface-2); color: var(--text-3); }

/* ── CAMP CARD ──────────────────────────────── */
.camp-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 16px;
}
.camp-banner-img {
  width: 100%; aspect-ratio: 16/5;
  object-fit: cover; object-position: center; display: block;
}
.camp-banner-placeholder {
  width: 100%; height: 90px;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary-mid) 100%);
  display: flex; align-items: flex-end; padding: 10px 14px;
}
.camp-body { padding: 14px 16px; }
.camp-name { font-size: 14px; font-weight: 600; color: var(--text-1); }
.camp-meta { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.camp-links { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.camp-link-btn {
  font-size: 11px; padding: 5px 10px;
  border: 1px solid var(--border-mid); border-radius: var(--radius-sm);
  color: var(--text-2); background: var(--surface-2); cursor: pointer;
  transition: background 0.15s; text-decoration: none;
}
.camp-link-btn:hover { background: var(--surface-3); }

/* ── MEDAL COLORS ───────────────────────────── */
.medal-1 { color: #C8A84B; }
.medal-2 { color: #A0A0A0; }
.medal-3 { color: #CD7F32; }

/* ── SKELETON ───────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── TOAST ──────────────────────────────────── */
.toast-container {
  position: fixed; bottom: calc(var(--bottomnav-h) + 12px); left: 50%;
  transform: translateX(-50%); z-index: 300; pointer-events: none;
}
@media (min-width: 768px) { .toast-container { bottom: 20px; } }
.toast {
  background: var(--text-1); color: #fff; padding: 10px 18px;
  border-radius: var(--radius-md); font-size: 13px; font-weight: 500;
  white-space: nowrap; opacity: 0; transition: opacity 0.2s;
}
.toast.show { opacity: 1; }
.toast-sucesso { background: var(--success); }
.toast-erro    { background: var(--danger); }

/* ── VIDEO MODAL ─────────────────────────────── */
.video-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.80);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; padding: 16px;
}
.video-modal {
  position: relative; width: 100%; max-width: 800px;
  background: #000; border-radius: var(--radius-md);
}
.video-modal-close {
  position: absolute; top: -40px; right: 0;
  background: none; border: none; color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 8px;
}

/* ── COLORS ─────────────────────────────────── */
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-muted   { color: var(--text-3); }
.text-primary { color: var(--color-primary); }

/* ── BONUS CAMPAIGN CARD ─────────────────────── */
.bonus-campaign-card { border-top-width: 3px; }

/* Mobile: 2 linhas separadas */
.bonus-metrics-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
}
.bonus-metrics-bottom {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
}

/* Desktop: tudo em uma linha só */
@media (min-width: 768px) {
  .bonus-metrics-row { display: flex; border-top: 1px solid var(--border); }
  .bonus-metrics-top  { border-top: none; border-right: 1px solid var(--border); }
  .bonus-metrics-bottom { border-top: none; flex: 1; }
}

.bonus-metric {
  padding: 14px 12px;
  text-align: center;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.bonus-metric:last-child { border-right: none; }

.bonus-metric--main { padding: 18px 16px; }

.bonus-metric--clickable { cursor: pointer; transition: background 0.15s; }
.bonus-metric--clickable:hover { background: var(--surface-2); }

.bonus-metric-label {
  font-size: 10px; font-weight: 600; color: var(--text-3);
  letter-spacing: 0.03em; text-transform: uppercase; line-height: 1.3;
}
.bonus-metric-value {
  font-size: 20px; font-weight: 700; color: var(--text-1); line-height: 1;
}
.bonus-metric-value--main { font-size: 26px; }
.bonus-metric-action {
  font-size: 10px; margin-top: 2px; font-weight: 500;
}
.btn-link-small {
  font-size: 12px; font-weight: 500; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 10px;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
}
.btn-link-small:hover { background: var(--surface-3); }
