/* ─────────────────────────────────────────────
   Report Lab - luva.bet — Design System v3
   Modern dashboard UI, purple palette
   ───────────────────────────────────────────── */

:root {
  color-scheme: light;

  /* Backgrounds */
  --bg:        #f5f4fc;
  --surface:   #ffffff;
  --surface-2: #f7f5fc;
  --surface-3: #f0edf8;

  /* Borders */
  --line:        #e4dff2;
  --line-strong: #cec7e8;

  /* Text */
  --text:    #12102a;
  --muted:   #6b6589;
  --muted-2: #9c95b5;

  /* Sidebar / nav */
  --nav:      #0f0c27;
  --nav-2:    #1a1545;
  --nav-3:    #231e55;
  --nav-text: #c9c4e8;
  --nav-dim:  #7870a8;

  /* Purple brand */
  --purple:      #7c3aed;
  --purple-dark: #5b21b6;
  --purple-soft: #ede9ff;
  --purple-mid:  #c4b5fd;
  --purple-accent: #9333ea;
  --purple-rgb:      124, 58, 237;
  --purple-dark-rgb: 109, 40, 217;

  /* Semantic */
  --green:      #16a34a;
  --green-soft: #dcfce7;
  --amber:      #b45309;
  --amber-soft: #fef3c7;
  --red:        #dc2626;
  --red-soft:   #fee2e2;

  /* Effects */
  --shadow-sm:  0 1px 3px rgba(15, 12, 39, 0.06), 0 4px 12px rgba(15, 12, 39, 0.04);
  --shadow:     0 2px 8px rgba(15, 12, 39, 0.08), 0 12px 32px rgba(15, 12, 39, 0.06);
  --shadow-lg:  0 8px 24px rgba(15, 12, 39, 0.12), 0 32px 64px rgba(15, 12, 39, 0.08);

  /* Shape */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: #0a0818;
  color: var(--text);
}

button, input, textarea { font: inherit; }
button { border: 0; cursor: pointer; }

/* ─── Shell layout ──────────────────────────────── */

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 308px;
  gap: 0;
  padding: 10px 10px 10px 0;
}

/* ─── Sidebar ───────────────────────────────────── */

.sidebar {
  border-radius: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(var(--purple-rgb),0.35) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 110% 80%, rgba(var(--purple-dark-rgb),0.2) 0%, transparent 65%),
    var(--sidebar-base, linear-gradient(160deg, #130f2a 0%, #0a0818 60%, #0d0b1e 100%));
  color: var(--nav-text);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  position: sticky;
  top: 0;
  width: 64px;
  height: 100vh;
  overflow: hidden;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}

.sidebar:hover {
  width: 264px;
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.55);
}

/* Brand / logo */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  white-space: nowrap;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--purple);
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(var(--purple-rgb),0.45);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.brand-title {
  font-weight: 800;
  font-size: 15px;
  color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--nav-dim);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

/* Nav */
.nav-section {
  padding: 20px 8px 0;
}

.nav-section + .nav-section {
  padding-top: 16px;
}

.nav-section-label {
  color: var(--nav-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 4px;
  margin-bottom: 6px;
  display: block;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s;
}

.sidebar:hover .nav-section-label {
  opacity: 1;
  transition: opacity 0.2s 0.05s;
}

.main-nav {
  display: grid;
  gap: 2px;
}

.nav-button {
  width: 100%;
  min-height: 44px;
  border-radius: var(--radius-sm);
  color: var(--nav-text);
  background: transparent;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
  transition: background 0.15s;
}

.nav-button.active .nav-icon {
  background: rgba(var(--purple-rgb),0.25);
  color: var(--purple-mid);
}

.nav-button:hover .nav-icon {
  background: rgba(255,255,255,0.1);
}

/* User account */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  cursor: default;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(var(--purple-rgb),0.4);
}

.sidebar-user-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-user-info strong {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-info span {
  font-size: 10.5px;
  color: var(--nav-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Collapsed: hide all text, show only icons */
.sidebar:not(:hover) .nav-button > span:not(.nav-icon),
.sidebar:not(:hover) .nav-badge,
.sidebar:not(:hover) .brand-title,
.sidebar:not(:hover) .brand-subtitle {
  opacity: 0;
  transition: opacity 0.1s;
}

.sidebar:hover .nav-button > span:not(.nav-icon),
.sidebar:hover .nav-badge,
.sidebar:hover .brand-title,
.sidebar:hover .brand-subtitle {
  opacity: 1;
  transition: opacity 0.2s 0.08s;
}

.nav-button .lucide {
  opacity: 0.65;
  transition: opacity 0.15s;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-button:hover .lucide {
  opacity: 0.9;
}

.nav-button.active {
  background: linear-gradient(90deg, rgba(var(--purple-rgb),0.5) 0%, rgba(var(--purple-rgb),0.15) 100%);
  color: #ffffff;
  font-weight: 600;
  border-left: 2px solid var(--purple-accent);
  box-shadow: inset 0 0 20px rgba(var(--purple-rgb),0.1);
}

.sidebar:not(:hover) .nav-button.active {
  border-left-color: transparent;
}

.nav-button.active .lucide {
  opacity: 1;
}

.nav-badge {
  min-width: 24px;
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.6;
  white-space: nowrap;
}

.nav-button.active .nav-badge {
  background: rgba(255, 255, 255, 0.22);
}

/* Sidebar footer */
.sidebar-watermark {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  pointer-events: none;
}
.sidebar-watermark img {
  width: 260px;
  opacity: 0.7;
  transform: rotate(-90deg);
  object-fit: contain;
}
.sidebar:hover .sidebar-watermark img {
  display: none;
}

.sidebar-bottom {
  /* margin-top handled by .sidebar-watermark flex:1 above */
}

.sidebar-footer-icons {
  padding: 12px 0 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar:hover .sidebar-footer-icons {
  display: none;
}

.footer-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--nav-text);
  cursor: default;
  flex-shrink: 0;
}

.footer-icon-btn .lucide {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.footer-user-mini {
  background: linear-gradient(135deg, var(--purple), var(--purple-accent));
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 2px 8px rgba(var(--purple-rgb),0.4);
}

.sidebar-footer {
  display: none;
  padding: 16px 12px 20px;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.sidebar:hover .sidebar-footer {
  display: grid;
}

.sidebar-footer label {
  color: var(--nav-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Language switcher ── */
.lang-switcher {
  display: flex;
  gap: 4px;
  margin-bottom: 2px;
}

.lang-btn {
  flex: 1;
  padding: 4px 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--nav-dim);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  line-height: 1;
}

.lang-btn:hover {
  color: var(--nav-text);
  border-color: rgba(255, 255, 255, 0.2);
}

.lang-btn.active {
  color: #fff;
  background: rgba(var(--purple-rgb), 0.35);
  border-color: rgba(var(--purple-rgb), 0.5);
}

/* ── RTL support ── */
[dir="rtl"] .sidebar {
  border-right: none;
  border-left: 1px solid var(--line);
}

[dir="rtl"] .nav-button {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-badge {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .day-strip {
  direction: rtl;
}

[dir="rtl"] .section-title {
  flex-direction: row-reverse;
}

[dir="rtl"] .daily-footer {
  flex-direction: row-reverse;
}

[dir="rtl"] .topbar-left {
  text-align: right;
}

[dir="rtl"] .toolbar {
  flex-direction: row-reverse;
}

[dir="rtl"] .summary-card-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .week-panel {
  border-left: none;
  border-right: 1px solid var(--line);
}

.text-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: 0;
  height: 38px;
  padding: 0 11px;
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sidebar .text-input {
  background: var(--nav-2);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 13px;
  color-scheme: dark;
}

.sidebar .text-input::placeholder { color: var(--nav-dim); }

.text-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(var(--purple-rgb),0.18);
}

.save-panel {
  min-height: 50px;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #e8eef6;
  font-size: 13px;
  font-weight: 500;
}

.save-panel span {
  display: block;
  margin-top: 1px;
  color: var(--nav-dim);
  font-size: 11px;
  font-weight: 400;
}

.save-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
  transition: background 0.2s, box-shadow 0.2s;
}

.save-dot.saving {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.2);
}

.save-dot.error {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

/* ─── Workspace ─────────────────────────────────── */

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 55% 35% at 95% 0%, rgba(var(--purple-rgb),0.07) 0%, transparent 65%),
    radial-gradient(ellipse 40% 30% at 5% 100%, rgba(139,92,246,0.05) 0%, transparent 65%),
    var(--bg);
  border-radius: 20px 0 0 20px;
  overflow: hidden;
  margin-left: 10px;
}

/* Topbar */
.topbar {
  height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(var(--purple-rgb),0.08);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left { display: flex; flex-direction: column; gap: 2px; }

.topbar h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

.topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Buttons */
.icon-button,
.primary-button,
.secondary-button,
.danger-button,
.small-button,
.day-button,
.segment-button {
  border-radius: var(--radius-sm);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  font-weight: 500;
  font-size: 13.5px;
}

.icon-button {
  width: 36px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--surface);
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface-2);
}

.icon-button.danger:hover {
  color: var(--red);
  border-color: #fca5a5;
  background: var(--red-soft);
}

.primary-button {
  min-width: 132px;
  padding: 0 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--purple), var(--purple-accent));
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(var(--purple-rgb),0.35);
}

.primary-button:hover {
  background: var(--purple-dark);
  box-shadow: 0 4px 16px rgba(var(--purple-rgb),0.4);
  transform: translateY(-1px);
}

.primary-button:active { transform: translateY(0); }

.primary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.secondary-button, .small-button {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
}

.secondary-button { padding: 0 14px; }

.secondary-button:hover, .small-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

.small-button {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
  color: var(--purple-dark);
  border-color: var(--purple-mid);
  background: var(--purple-soft);
}

.small-button:hover {
  background: var(--purple-soft) !important;
  border-color: var(--purple) !important;
  color: var(--purple) !important;
  box-shadow: 0 2px 8px rgba(var(--purple-rgb),0.15);
}

.danger-button {
  padding: 0 14px;
  background: var(--red);
  color: #ffffff;
  font-weight: 600;
}

.danger-button:hover {
  background: #b91c1c;
}

/* Content */
.content {
  padding: 24px 28px 40px;
  flex: 1;
}

.view-stack { display: grid; gap: 16px; }

/* ─── Day strip container ───────────────────────── */
.day-strip-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-strip-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 100% 50%, rgba(var(--purple-rgb),0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* Week navigation row */
.week-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.week-nav-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
  flex: 1;
}

.week-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  cursor: pointer;
}

.week-nav-btn:hover {
  border-color: var(--purple-mid);
  color: var(--purple);
  background: var(--purple-soft);
}

.week-nav-btn .lucide {
  width: 14px;
  height: 14px;
}

/* Semana button variant */
.day-button-semana {
  background: linear-gradient(135deg, rgba(var(--purple-rgb),0.08), rgba(var(--purple-rgb),0.04));
  border-color: var(--purple-mid);
  color: var(--purple-dark);
  font-weight: 600;
}

.day-button-semana.active {
  background: linear-gradient(135deg, var(--purple), var(--purple-accent));
  color: #fff;
  border-color: transparent;
}

.day-filled-count {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(var(--purple-rgb),0.15);
  color: var(--purple-dark);
}

.day-button-semana.active .day-filled-count {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* Week summary table */
.week-summary-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
  font-size: 13px;
}

.week-summary-table th {
  height: 34px;
  padding: 0 12px;
  text-align: right;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to right, var(--surface-2), var(--surface));
  white-space: nowrap;
}

.week-summary-table th:first-child { text-align: left; }

.week-summary-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.week-summary-table td:first-child { text-align: left; }
.week-summary-table tr:last-child td { border-bottom: 0; }

.week-row-empty td { opacity: 0.45; }

.week-row-val.empty { color: var(--muted-2); }

.week-row-day {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.week-summary-table tbody tr:hover td { background: var(--purple-soft); cursor: pointer; }

.week-row-total td {
  background: linear-gradient(to right, rgba(var(--purple-rgb),0.06), rgba(var(--purple-rgb),0.02));
  font-weight: 700;
  border-top: 1px solid var(--purple-mid);
}

.status-dot.partial { background: var(--amber); }

/* ─── Day strip ─────────────────────────────────── */

.day-strip, .segment-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.day-button {
  min-width: 96px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}

.day-button:hover {
  border-color: var(--purple-mid);
  color: var(--purple-dark);
  background: var(--purple-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.day-button.active {
  background: linear-gradient(135deg, var(--purple), var(--purple-accent));
  color: #fff;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(var(--purple-rgb),0.35);
}

.day-button.complete .status-dot { background: var(--green); }
.day-button.active .status-dot   { background: rgba(255,255,255,0.7); }

.day-button .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
}

.day-button.complete:not(.active) { border-color: #bbf7d0; }
.day-button.complete:not(.active) .status-dot { background: var(--green); }

/* ─── Sections / Cards ──────────────────────────── */

.section {
  border: none;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
}

.section::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--purple-rgb),0.07) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.section-header {
  min-height: 58px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(to right, rgba(var(--purple-rgb),0.04), transparent);
  position: relative;
  z-index: 1;
}

.section-body { position: relative; z-index: 1; }

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--purple-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(var(--purple-rgb),0.08);
}

.section-icon-box .lucide {
  width: 17px;
  height: 17px;
  color: var(--purple);
}

.section-title h2 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.section-title span {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 1px;
  display: block;
}

.section-body { padding: 20px; }

/* ─── KPI grid ──────────────────────────────────── */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-group {
  border: 1px solid var(--line);
  border-top: 2px solid var(--purple-mid);
  border-radius: var(--radius);
  background: linear-gradient(160deg, #fdfbff 0%, var(--surface) 100%);
  overflow: hidden;
  transition: box-shadow 0.2s, border-top-color 0.2s;
  position: relative;
}

.metric-group::after {
  content: '';
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--purple-rgb),0.06) 0%, transparent 70%);
  pointer-events: none;
}

.metric-group:hover {
  box-shadow: var(--shadow);
  border-top-color: var(--purple);
}

.metric-group-title {
  height: 38px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to right, var(--purple-soft), var(--surface-2));
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 800;
  color: var(--purple-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-group-title .lucide {
  opacity: 0.5;
  width: 14px;
  height: 14px;
}

.metric-fields {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric-fields.one { grid-template-columns: minmax(0, 1fr); }

.field { display: grid; gap: 5px; }

.field-money { position: relative; }
.field-money::before {
  content: "R$";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-2);
  pointer-events: none;
  z-index: 1;
}
.field-money .metric-input {
  padding-left: 28px;
  text-align: left;
}

.field label {
  min-height: 22px;
  display: flex;
  align-items: flex-end;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-input, .textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  outline: 0;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  font-size: 13.5px;
}

.metric-input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.metric-input.text-left { text-align: left; font-weight: 400; }

.metric-display {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 40px;
  padding: 0 10px;
  border: 1px dashed var(--purple-mid);
  border-radius: var(--radius-sm);
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  user-select: none;
}

.metric-input:focus, .textarea:focus {
  border-color: var(--purple);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(var(--purple-rgb),0.12);
}

.textarea {
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
  width: 100%;
}

.daily-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

/* ─── Segment strip ─────────────────────────────── */

.segment-strip {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  width: fit-content;
  gap: 2px;
}

.segment-button {
  min-width: 128px;
  padding: 0 16px;
  color: var(--muted);
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
}

.segment-button:hover {
  color: var(--text);
  background: rgba(var(--purple-rgb),0.06);
}

.segment-button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple-accent));
  box-shadow: 0 2px 10px rgba(var(--purple-rgb),0.3);
  font-weight: 600;
}

/* ─── Data table ────────────────────────────────── */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th {
  height: 36px;
  padding: 0 12px;
  text-align: left;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to right, var(--surface-2), var(--surface));
}

.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.data-table tr:last-child td { border-bottom: 0; }

.data-table tbody tr:hover td {
  background: var(--purple-soft);
}

.rank-number {
  width: 34px;
  text-align: center;
  font-weight: 800;
  font-size: 11px;
  color: var(--purple-dark);
  opacity: 0.6;
}

/* ─── Provider tabs ─────────────────────────────── */

.provider-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.provider-tab {
  min-height: 52px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
  font-size: 12.5px;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}

.provider-tab:hover {
  border-color: var(--purple-mid);
  color: var(--purple-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.provider-tab.active {
  border-color: var(--purple);
  border-top: 2px solid var(--purple);
  background: var(--purple-soft);
  color: var(--purple-dark);
  box-shadow: 0 4px 12px rgba(var(--purple-rgb),0.15);
}

.provider-tab strong {
  display: block;
  color: inherit;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-tab span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  opacity: 0.75;
}

/* ─── Split / summary grids ─────────────────────── */

.split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 720px), 1fr));
  gap: 14px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-card {
  min-height: 96px;
  border-radius: 14px;
  border: none;
  background: var(--surface);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(15,12,39,0.06), 0 4px 16px rgba(15,12,39,0.04);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.summary-card:hover {
  box-shadow: 0 4px 20px rgba(15,12,39,0.1);
  transform: translateY(-1px);
}

.summary-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  background: rgba(var(--purple-rgb),0.1);
  color: var(--purple);
  flex-shrink: 0;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.summary-card-header span {
  min-width: 0;
}

.delta-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.delta-badge.up { color: var(--green); }
.delta-badge.down { color: var(--red); }

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
}

.summary-card.teal {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  box-shadow: 0 4px 20px rgba(var(--purple-rgb),0.3);
}
.summary-card.teal .summary-card-icon { background: rgba(255,255,255,0.15); color: #fff; }
.summary-card.teal span { color: rgba(255,255,255,0.7); }
.summary-card.teal strong { color: #fff; }
.summary-card.teal .delta-badge.up { color: rgba(255,255,255,0.85); }
.summary-card.teal .delta-badge.down { color: rgba(255,255,255,0.7); }

.summary-card.green-soft {
  background: #A7EA95;
  border: 1px solid #8fdc7d;
}
.summary-card.green-soft .summary-card-icon { background: rgba(22,163,74,0.12); color: #15803d; }
.summary-card.green-soft span { color: #15803d; }
.summary-card.green-soft strong { color: #14532d; }
.summary-card.green-soft .delta-badge.up { color: #15803d; }
.summary-card.green-soft .delta-badge.down { color: #dc2626; }

.summary-card.wide { grid-column: 1 / -1; }

/* ─── Split breakdown ───────────────────────────── */

.split-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.breakdown-casino  { border-top: 3px solid var(--purple); }
.breakdown-sportsbook { border-top: 3px solid #2563eb; }

.breakdown-casino .section-header { background: rgba(var(--purple-rgb),0.04); }
.breakdown-casino .section-title h2 { color: var(--purple); }
.breakdown-casino .section-title .lucide { color: var(--purple); }

.breakdown-sportsbook .section-header { background: rgba(37,99,235,0.04); }
.breakdown-sportsbook .section-title h2 { color: #2563eb; }
.breakdown-sportsbook .section-title .lucide { color: #2563eb; }

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.breakdown-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.breakdown-card span {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.breakdown-card strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
}

.muted-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ─── Chart box ─────────────────────────────────── */

.chart-box {
  width: 100%;
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.chart-box svg {
  width: 100%;
  height: 260px;
  display: block;
}

/* ─── Right / week panel ────────────────────────── */

.week-panel {
  border-left: 1px solid var(--line);
  background: var(--bg);
  border-radius: 0 20px 20px 0;
  padding: 14px 12px;
  display: grid;
  align-content: start;
  gap: 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.panel-block {
  border: none;
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15,12,39,0.06), 0 4px 16px rgba(15,12,39,0.04);
  margin-bottom: 10px;
}

.panel-block-header {
  padding: 12px 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

/* Legacy .panel-heading support */
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--surface-3);
}

.panel-heading strong { color: var(--purple); font-size: 12px; font-weight: 800; }

.panel-block > .progress-track { margin-top: 4px; }

.progress-track {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line);
  margin: 0 14px 4px;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--purple), var(--purple-accent));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin: 10px 14px 14px;
}

.week-day {
  min-height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--muted-2);
  background: var(--surface);
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 500;
  transition: all 0.15s;
}

.week-day:hover { border-color: var(--line-strong); color: var(--text); }

.week-day.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--purple), var(--purple-accent));
  border-color: #7c3aed;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(var(--purple-rgb),0.55);
}

.week-day.complete {
  color: var(--green);
  background: var(--green-soft);
  border-color: #86efac;
}

/* Side KPIs */
.side-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
}

.side-kpi {
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 3px solid transparent;
}

.side-kpi span {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.side-kpi strong {
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--muted);
}

.side-kpi--purple { background: rgba(var(--purple-rgb),0.07); border-left-color: #7c3aed; }
.side-kpi--blue   { background: rgba(37,99,235,0.07);  border-left-color: #2563eb; }
.side-kpi--amber  { background: rgba(180,83,9,0.07);   border-left-color: #d97706; }
.side-kpi--green  { background: rgba(22,163,74,0.08);  border-left-color: #16a34a; }
.side-kpi--indigo { background: rgba(79,70,229,0.07);  border-left-color: #4f46e5; }

/* Rankings */
.ranking-health {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.health-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 8px;
}

.health-row:nth-child(odd) { background: var(--surface-2); }

.health-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.health-row span {
  font-size: 11.5px;
  color: var(--muted);
}

.health-row strong {
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.health-bar {
  height: 4px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}

.health-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* ─── Status badges ─────────────────────────────── */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.status-pill.complete {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.pending {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill.empty {
  background: var(--surface-3);
  color: var(--muted-2);
}

/* ─── Modal ─────────────────────────────────────── */

.modal {
  width: min(420px, calc(100vw - 32px));
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-lg);
}

.modal::backdrop {
  background: rgba(15, 12, 39, 0.5);
  backdrop-filter: blur(4px);
}

.modal form { padding: 24px; }

.modal-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--red);
  background: var(--red-soft);
}

.modal h2 {
  margin: 14px 0 6px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}

/* ─── Toast ─────────────────────────────────────── */

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  min-width: 260px;
  max-width: min(400px, calc(100vw - 40px));
  border-radius: var(--radius);
  background: var(--nav);
  color: #ffffff;
  padding: 13px 16px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  z-index: 200;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Icons ─────────────────────────────────────── */

.lucide {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  flex-shrink: 0;
}

.brand-mark .lucide { width: 18px; height: 18px; stroke-width: 2; color: #fff; }
.primary-button .lucide { width: 15px; height: 15px; }
.nav-button .lucide { width: 16px; height: 16px; }
.section-title .lucide { width: 15px; height: 15px; color: var(--purple); }

/* ─── Hero mode (hide topbar + right panel) ─────── */

body.hero-mode .topbar     { display: none; }
body.hero-mode .week-panel { display: none; }
body.hero-mode .content    { padding: 0; }
body.hero-mode .app-shell  { grid-template-columns: 64px minmax(0, 1fr) 0; padding-right: 0; }

/* ─── Hero view ─────────────────────────────────── */

.hero-view {
  position: relative;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f6f6fa;
  background-image:
    radial-gradient(ellipse 70% 55% at 15% 40%, rgba(124,58,237,.07) 0%, transparent 65%),
    radial-gradient(ellipse 55% 70% at 85% 65%, rgba(61,179,26,.05) 0%, transparent 65%);
}

.hero-glow { display: none; }

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 28px 40px 56px;
  max-width: 700px;
  width: 100%;
}

.hero-logotype-img {
  width: 280px;
  object-fit: contain;
}

.hero-tagline {
  font-size: 16px;
  font-weight: 400;
  color: #6b7280;
  letter-spacing: .01em;
  margin-top: 2px;
}

.hero-desc {
  font-size: 14px;
  color: #9ca3af;
  line-height: 1.7;
  max-width: 500px;
}

.hero-brands {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
  margin-top: 28px;
}

.hero-brand-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 28px 44px;
  border-radius: 24px;
  border: none;
  cursor: pointer;
  overflow: hidden;
  transition: transform .25s cubic-bezier(.2,.8,.3,1), box-shadow .25s, filter .2s;
}
.hero-brand-card[data-hero-brand="luva"] {
  background: linear-gradient(145deg, #7c3aed, #5b21b6);
  box-shadow: 0 8px 32px rgba(124,58,237,.5), 0 2px 8px rgba(0,0,0,.1);
}
.hero-brand-card[data-hero-brand="f12"] {
  background: linear-gradient(145deg, #3DB31A, #2d9114);
  box-shadow: 0 8px 32px rgba(61,179,26,.5), 0 2px 8px rgba(0,0,0,.1);
}
.hero-brand-card:hover {
  transform: translateY(-5px) scale(1.02);
  filter: brightness(1.1);
}

.hero-brand-card img {
  max-height: 56px;
  max-width: 160px;
  object-fit: contain;
}
.hero-brand-card[data-hero-brand="f12"] img {
  max-height: 200px;
  max-width: 260px;
}

.hero-brand-cta {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,.45);
  letter-spacing: .05em;
}

.hero-footer {
  font-size: 11px;
  color: #d1d5db;
  letter-spacing: .03em;
  margin-top: 12px;
}

/* ─── Splash screen ─────────────────────────────── */

@keyframes splash-spin     { to { transform: rotate(360deg); } }
@keyframes splash-spin-rev { to { transform: rotate(-360deg); } }
@keyframes splash-pulse {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.05); }
}
@keyframes splash-dot-pulse {
  0%, 100% { transform: translate(-50%,-50%) scale(0.8); opacity: .6; }
  50%      { transform: translate(-50%,-50%) scale(1.2); opacity: 1; }
}

@keyframes splash-fade-out {
  to { opacity: 0; visibility: hidden; }
}

#splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#splash.splash-done {
  animation: splash-fade-out 0.55s ease forwards;
  pointer-events: none;
}

.splash-ring {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
}
.splash-ring::before,
.splash-ring::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}
/* Outer comet — luva purple */
.splash-ring::before {
  inset: 0;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    rgba(124,58,237,.15) 20%,
    #9333ea 55%,
    #7c3aed 70%,
    transparent 80%
  );
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), black calc(100% - 5px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), black calc(100% - 5px));
  animation: splash-spin 1.1s linear infinite;
  filter: drop-shadow(0 0 6px rgba(124,58,237,.7));
}
/* Inner comet — f12 green, opposite direction */
.splash-ring::after {
  inset: 22px;
  background: conic-gradient(
    from 90deg,
    transparent 0%,
    rgba(61,179,26,.15) 20%,
    #4ade80 55%,
    #3DB31A 70%,
    transparent 80%
  );
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), black calc(100% - 5px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), black calc(100% - 5px));
  animation: splash-spin-rev 1.5s linear infinite;
  filter: drop-shadow(0 0 6px rgba(61,179,26,.7));
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 1;
}

.splash-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: conic-gradient(#7c3aed, #3DB31A);
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  animation: splash-dot-pulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(124,58,237,.6), 0 0 20px rgba(61,179,26,.4);
}

.splash-logo {
  width: 110px;
  object-fit: contain;
  animation: splash-pulse 2s ease-in-out infinite;
}

/* ─── Hamburger button (mobile nav trigger) ─────── */

.hamburger-btn {
  display: none;
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.hamburger-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.hamburger-btn .lucide { width: 18px; height: 18px; }

/* ─── Sidebar overlay backdrop ──────────────────── */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active { display: block; }

/* ─── Topbar title group ─────────────────────────── */

.topbar-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ─── Responsive ────────────────────────────────── */

@media (max-width: 1400px) {
  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .week-panel {
    position: static;
    height: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ─── Mobile: sidebar drawer ─────────────────────── */

@media (max-width: 768px) {
  .hamburger-btn { display: flex; }

  .app-shell {
    grid-template-columns: 1fr;
    padding: 0;
    min-height: 100dvh;
  }

  /* Sidebar becomes a fixed left drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: 264px;
    z-index: 100;
    border-radius: 0;
    transform: translateX(-110%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    /* disable hover-expand on touch */
    overflow: hidden;
  }

  .sidebar:hover {
    width: 264px;
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.6);
  }

  /* Show expanded sidebar content when drawer is open */
  .sidebar.open .sidebar-footer-icons { display: none; }
  .sidebar.open .sidebar-footer { display: grid; }
  .sidebar.open .nav-section-label { opacity: 1; }
  .sidebar.open .nav-button > span:not(.nav-icon),
  .sidebar.open .nav-badge,
  .sidebar.open .brand-title,
  .sidebar.open .brand-subtitle { opacity: 1; }
  .sidebar.open .nav-button.active { border-left-color: var(--purple-accent); }
  .sidebar.open .sidebar-watermark img { display: none; }

  .workspace {
    margin-left: 0;
    border-radius: 0;
    min-height: 100dvh;
  }

  .week-panel { display: none; }

  body.hero-mode .app-shell {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .topbar {
    height: auto;
    min-height: 60px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    flex-wrap: wrap;
    border-radius: 0;
  }

  .topbar-left {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .topbar-title-group { gap: 1px; }
  .topbar-title-group h1 { font-size: 16px; }
  .topbar-title-group p { font-size: 11px; }

  .toolbar { gap: 4px; }

  .content { padding: 14px 16px 32px; }

  .kpi-grid, .split-grid, .summary-grid { grid-template-columns: 1fr; }

  .split-breakdown { grid-template-columns: 1fr; }
  .breakdown-grid { grid-template-columns: repeat(2, 1fr); }

  .metric-fields { grid-template-columns: 1fr 1fr; }
  .metric-fields.one { grid-template-columns: 1fr; }

  .provider-tabs { grid-template-columns: repeat(3, 1fr); }

  .day-button, .segment-button { flex: 1 1 100px; }

  .hero-inner { padding: 20px 20px 40px; }
  .hero-brands { grid-template-columns: 1fr; gap: 12px; }
  .hero-logotype-img { width: 200px; }
  .hero-brand-card { height: 180px; padding: 20px 24px; }
  .hero-brand-card img { max-height: 68px; max-width: 180px; }
  .hero-brand-card[data-hero-brand="f12"] img { max-height: 160px; max-width: 240px; }

  .daily-footer { flex-direction: column; gap: 8px; }
  .daily-footer .primary-button { width: 100%; }
}

/* ─── Mobile bottom navigation ──────────────────── */

.mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 200;
    background: var(--nav, #1a1730);
    border-top: 1px solid rgba(255,255,255,0.08);
    height: 60px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
  }

  .mbn-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 6px 4px;
    position: relative;
    transition: color 0.15s;
  }

  .mbn-btn svg {
    width: 20px; height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.15s;
  }

  .mbn-btn.active {
    color: var(--purple-accent, #a78bfa);
  }

  .mbn-btn.active svg {
    transform: translateY(-1px);
  }

  .mbn-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    background: var(--purple, #7c3aed);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 99px;
    min-width: 14px;
    text-align: center;
    line-height: 1.4;
  }

  .content { padding-bottom: 80px !important; }
  body.hero-mode .content { padding-bottom: 60px !important; }
}

@media (max-width: 480px) {
  .content { padding: 10px 12px 80px; }
  .topbar { padding: 10px 12px; }
  .metric-fields { grid-template-columns: 1fr; }
  .provider-tabs { grid-template-columns: 1fr 1fr; }
  .summary-card strong { font-size: 20px; }
  .secondary-button span { display: none; }
  .secondary-button { padding: 0 10px; }
}

/* ── Brand pills ──────────────────────────────── */
.brand-logos {
  gap: 10px;
  padding: 22px 14px 20px;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.brand-pill {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 6px;
  border: none;
  cursor: pointer;
  transition: opacity .2s, box-shadow .2s;
  opacity: .3;
}
.brand-pill[data-brand="luva"] {
  background: #7c3aed;
  box-shadow: 0 4px 14px rgba(124,58,237,0.45);
}
.brand-pill[data-brand="f12"] {
  background: #3DB31A;
  box-shadow: 0 4px 14px rgba(61,179,26,0.45);
  padding: 2px;
}
.brand-pill.active {
  opacity: 1;
}
.brand-pill:not(.active):hover {
  opacity: .6;
}
.brand-pill img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

/* ── Ghost button ───────────────────────────────────────────────────────── */
.ghost-button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color .15s, border-color .15s, background .15s;
}
.ghost-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

/* ── Loading state ───────────────────────────────────────────────────────── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 24px;
  color: var(--muted);
  font-size: 13px;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Monthly report ──────────────────────────────────────────────────────── */

/* Picker */
.monthly-picker-view {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 24px;
}
.monthly-picker-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--purple);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow);
}
.monthly-picker-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}
.monthly-picker-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.monthly-picker-input-row .text-input { flex: 1; }
.monthly-history { margin-top: 24px; }
.monthly-history-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted-2);
  margin-bottom: 10px;
}
.month-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 6px;
  transition: background .15s, border-color .15s, transform .1s;
  width: 100%;
  text-align: left;
}
.month-history-item:hover {
  background: var(--purple-soft);
  border-color: var(--purple-mid);
  transform: translateX(2px);
}
.mhi-label { font-weight: 600; color: var(--text); font-size: 13px; }
.mhi-date  { font-size: 11px; color: var(--muted-2); }

/* Mode select */
.monthly-mode-select { padding: 32px 24px; }
.monthly-mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}
.monthly-mode-header h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}
.monthly-mode-desc {
  color: var(--muted);
  margin-bottom: 28px;
  font-size: 13px;
}
.monthly-mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 600px;
}
.monthly-mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 24px 22px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  text-align: left;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.monthly-mode-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--purple-accent));
  opacity: 0;
  transition: opacity .15s;
}
.monthly-mode-card:hover {
  border-color: var(--purple-mid);
  box-shadow: var(--shadow), 0 0 0 1px var(--purple-mid);
  transform: translateY(-2px);
}
.monthly-mode-card:hover::before { opacity: 1; }
.monthly-mode-card .mode-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(var(--purple-rgb), .1);
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.monthly-mode-card .mode-card-icon .lucide { width: 20px; height: 20px; }
.monthly-mode-card strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: block;
}
.monthly-mode-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* View header (manual + aggregated) */
.monthly-manual-view,
.monthly-aggregated-view { padding: 20px 24px 32px; }

.monthly-view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.monthly-view-header h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.monthly-view-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Mode badge */
.monthly-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--purple-soft);
  color: var(--purple-dark);
}
.monthly-mode-badge.aggregated {
  background: var(--green-soft);
  color: var(--green);
}

/* KPI grid (manual form) */
.monthly-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

/* Notes block */
.monthly-notes-block {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.monthly-notes-label {
  height: 36px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  background: linear-gradient(to right, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.monthly-notes-block .textarea {
  border: none;
  border-radius: 0;
  background: var(--surface);
  padding: 14px;
  min-height: 80px;
}
.monthly-notes-block .textarea:focus {
  box-shadow: none;
  border: none;
  outline: none;
}

/* AI synopsis */
.ai-synopsis-block {
  background: var(--purple-soft);
  border: 1px solid var(--purple-mid);
  border-left: 4px solid var(--purple);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 18px;
  margin-top: 20px;
}
.ai-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--purple-dark);
  margin-bottom: 8px;
}
.ai-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}

/* Aggregated table */
.monthly-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

/* Reuse week-summary-table pattern */
.monthly-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}
.monthly-breakdown-table th {
  height: 34px;
  padding: 0 12px;
  text-align: right;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to right, var(--surface-2), var(--surface));
  white-space: nowrap;
}
.monthly-breakdown-table th:first-child { text-align: left; }
.monthly-breakdown-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.monthly-breakdown-table td:first-child {
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
}
.monthly-breakdown-table tbody tr:hover td { background: var(--purple-soft); }
.monthly-breakdown-table tfoot td {
  background: linear-gradient(to right, rgba(var(--purple-rgb),.07), rgba(var(--purple-rgb),.02));
  font-weight: 700;
  border-top: 1px solid var(--purple-mid);
  border-bottom: 0;
}
.monthly-breakdown-table tfoot td:first-child { color: var(--purple-dark); }

/* Empty state */
.monthly-empty {
  padding: 64px 24px;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

/* Monthly rankings block */
.monthly-rankings-block {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--purple-mid);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.monthly-rankings-header {
  height: 44px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  background: linear-gradient(to right, var(--purple-soft), var(--surface-2));
  border-bottom: 1px solid var(--line);
}
.monthly-rankings-block .segment-strip {
  margin: 12px 16px;
}
.monthly-rankings-block > .section,
.monthly-rankings-block > div > .section,
.monthly-rankings-block > .split-grid {
  margin: 0 16px 16px;
}

@media (max-width: 640px) {
  .monthly-mode-cards { grid-template-columns: 1fr; }
  .monthly-manual-view, .monthly-aggregated-view { padding: 16px; }
  .monthly-kpi-grid { grid-template-columns: 1fr; }
}
