/* ═══════════════════════════════════════════════════
   COMPRA BONIFICADA — Editorial Dashboard
   ═══════════════════════════════════════════════════ */

:root {
  /* Core palette — matched to queroviajarnafaixa.com.br */
  --c-forest: #3a7bd5;
  --c-forest-dark: #232d35;
  --c-forest-light: #5a9de0;
  --c-mint: #dce9f5;
  --c-mint-strong: #c4daf0;
  --c-text: #111;
  --c-text-muted: #6c757d;
  --c-text-light: #999;
  --c-bg: #f5f7fa;
  --c-white: #fff;
  --c-border: #dee2e6;
  --c-border-light: #e9ecef;
  --c-danger: #c0392b;
  --c-warning: #fff3cd;
  --c-warning-border: #ffc107;
  --c-row-hover: #edf3fa;

  /* Type scale */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji";
  --font-mono: "SF Mono", "Cascadia Code", "Fira Code", Menlo, Consolas, monospace;
  --fs-xs: 0.7rem;
  --fs-sm: 0.78rem;
  --fs-base: 0.85rem;
  --fs-md: 0.95rem;
  --fs-lg: 1.15rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2rem;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-8: 48px;

  /* Radius */
  --r-sm: 3px;
  --r-md: 6px;
  --r-lg: 10px;
}

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

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Masthead ───────────────────────────────── */
.masthead {
  background: var(--c-forest);
  color: var(--c-white);
  padding: var(--sp-5) var(--sp-6);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.masthead-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
}

.masthead-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.masthead-overline {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  opacity: 0.7;
  font-weight: 500;
}

.masthead-title {
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.1;
}

.masthead-rule {
  width: 48px;
  height: 3px;
  background: var(--c-mint);
  margin-top: var(--sp-1);
  border-radius: 2px;
}

.masthead-stats {
  display: flex;
  gap: var(--sp-3);
}

.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-4);
  min-width: 72px;
  backdrop-filter: blur(4px);
}

.stat-value {
  font-size: var(--fs-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.75;
}

/* ── Filters Bar ────────────────────────────── */
.filters-bar {
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border);
  padding: var(--sp-3) var(--sp-6);
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.filters-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.filter-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--c-text-muted);
  white-space: nowrap;
}

.filter-checks {
  display: flex;
  gap: var(--sp-1);
}

.check-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 3px 10px;
  border: 1px solid var(--c-border);
  border-radius: 100px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
  background: var(--c-white);
}

.check-pill:hover {
  border-color: var(--c-forest-light);
  background: var(--c-mint);
}

.check-pill input {
  accent-color: var(--c-forest);
  width: 13px;
  height: 13px;
}

.filter-select {
  font-family: var(--font);
  font-size: var(--fs-sm);
  padding: 5px 28px 5px 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-white);
  color: var(--c-text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 110px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--c-forest-light);
  box-shadow: 0 0 0 2px rgba(58,123,213,0.15);
}

.filter-group--search {
  flex: 1;
  min-width: 180px;
}

.search-wrap {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--c-text-light);
  pointer-events: none;
}

.filter-input {
  font-family: var(--font);
  font-size: var(--fs-sm);
  width: 100%;
  padding: 5px 10px 5px 30px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-white);
  color: var(--c-text);
}

.filter-input:focus {
  outline: none;
  border-color: var(--c-forest-light);
  box-shadow: 0 0 0 2px rgba(58,123,213,0.15);
}

.filter-input::placeholder {
  color: var(--c-text-light);
}

/* Filter extra — row on desktop */
.filter-extra {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

/* Filter toggle — hidden on desktop, shown on mobile */
.filter-toggle {
  display: none;
  font-family: var(--font);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-forest);
  background: transparent;
  border: 1px solid var(--c-forest-light);
  border-radius: var(--r-md);
  padding: 5px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.filter-toggle:hover {
  background: var(--c-mint);
}

.filter-count {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  white-space: nowrap;
  margin-left: auto;
}

.filter-count strong {
  color: var(--c-forest);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Content ────────────────────────────────── */
.content {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-6) var(--sp-8);
}

/* ── Section ────────────────────────────────── */
.section {
  margin-bottom: var(--sp-8);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 3px solid var(--c-forest);
}

.section-title {
  font-size: var(--fs-md);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-forest-dark);
}

.section-count {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Table ──────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
}

.data-table th {
  background: var(--c-forest);
  color: var(--c-white);
  font-weight: 600;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  border-right: 1px solid rgba(255,255,255,0.1);
  position: relative;
}

.data-table th:last-child {
  border-right: none;
}

.data-table th:hover {
  background: var(--c-forest-dark);
}

.data-table th .sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 9px;
  opacity: 0.5;
  vertical-align: middle;
}

.data-table th.sort-active .sort-arrow {
  opacity: 1;
}

.data-table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--c-border-light);
  vertical-align: top;
  line-height: 1.4;
}

.data-table tbody tr {
  transition: background 0.1s;
}

.data-table tbody tr:hover {
  background: var(--c-row-hover);
}

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

/* Row states */
.data-table tbody tr.row-excelente {
  background: var(--c-mint);
}

.data-table tbody tr.row-excelente:hover {
  background: var(--c-mint-strong);
}

.data-table tbody tr.row-regular {
  color: var(--c-text-muted);
}

/* Column widths */
.col-programa { width: 75px; }
.col-loja { width: 130px; }
.col-categoria { width: 90px; max-width: 120px; overflow-wrap: break-word; word-break: normal; }
.col-promo { width: 65px; text-align: center; }
.col-avaliacao { width: 85px; text-align: center; }
.col-ate { width: 65px; text-align: center; }
.col-comentario { min-width: 280px; }
.col-forma { width: 100px; }
.col-link { width: 50px; text-align: center; }

.cat-more {
  display: inline-block;
  font-size: var(--fs-xs);
  color: var(--c-text-light);
  font-weight: 600;
}

/* Truncate long comments in the table */
.comment-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--fs-xs);
  line-height: 1.5;
}

/* Cell badges */
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 100px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-excelente {
  background: var(--c-forest);
  color: var(--c-white);
}

.badge-boa {
  background: var(--c-mint);
  color: var(--c-forest);
  border: 1px solid var(--c-forest-light);
}

.badge-regular {
  background: var(--c-border-light);
  color: var(--c-text-muted);
}

.badge-programa {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-programa--livelo { color: #7b2d8e; }
.badge-programa--esfera { color: #e63946; }
.badge-programa--azul { color: #005baa; }

.promo-value {
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--c-forest-dark);
}

.date-expired {
  color: var(--c-danger);
  font-weight: 600;
}

.date-warning {
  background: var(--c-warning);
  padding: 1px 6px;
  border-radius: var(--r-sm);
  font-weight: 600;
}

.date-none {
  color: var(--c-text-light);
  font-style: italic;
}

.link-cell a {
  color: var(--c-forest);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.link-cell a:hover {
  text-decoration: underline;
  color: var(--c-forest-dark);
}

/* ── Detail Expansion Row ───────────────────── */
.detail-row td {
  padding: 0 !important;
  border-bottom: 2px solid var(--c-forest-light) !important;
}

.detail-panel {
  padding: var(--sp-4) var(--sp-5);
  background: var(--c-row-hover);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-4);
  animation: slideDown 0.15s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 500px; }
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--c-text-muted);
}

.detail-value {
  font-size: var(--fs-sm);
  color: var(--c-text);
}

.detail-termos {
  grid-column: 1 / -1;
  max-height: 120px;
  overflow-y: auto;
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  line-height: 1.6;
  padding: var(--sp-2);
  background: rgba(255,255,255,0.6);
  border-radius: var(--r-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--c-forest);
  color: var(--c-white);
}

.btn-primary:hover {
  background: var(--c-forest-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--c-forest);
  border: 1px solid var(--c-forest-light);
}

.btn-ghost:hover {
  background: var(--c-mint);
}

/* Cupom copy */
.cupom-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  background: var(--c-forest);
  color: var(--c-white);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.cupom-tag:hover {
  background: var(--c-forest-dark);
}

/* ── Auto-rated indicator ───────────────────── */
.auto-rated-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c-border);
  color: var(--c-text-muted);
  font-size: 9px;
  font-weight: 700;
  cursor: help;
  margin-left: 3px;
  vertical-align: middle;
}

/* ── Footer ─────────────────────────────────── */
.footer {
  background: var(--c-white);
  border-top: 1px solid var(--c-border);
  padding: var(--sp-4) var(--sp-6);
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

.footer-sep {
  opacity: 0.3;
}

/* ── Mobile Card List ────────────────────────── */
.card-list {
  display: none; /* hidden on desktop */
}

.card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.card + .card {
  margin-top: var(--sp-2);
}

.card:active {
  background: var(--c-row-hover);
}

.card--excelente {
  background: var(--c-mint);
  border-color: var(--c-mint-strong);
}

.card--regular {
  opacity: 0.7;
}

.card--expanded {
  border-color: var(--c-forest-light);
  box-shadow: 0 2px 8px rgba(58,123,213,0.12);
}

.card-top {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.card-loja {
  flex: 1;
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--c-text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-mid {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  flex-wrap: wrap;
}

.card-ate {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

.card-forma {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-left: auto;
}

.card-comment {
  margin-top: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card--expanded .card-comment {
  -webkit-line-clamp: unset;
}

.card-detail {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border-light);
  animation: slideDown 0.15s ease-out;
}

.card-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2) var(--sp-3);
}

.card-detail-grid .detail-field {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.card-detail-grid .detail-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--c-text-muted);
}

.card-detail-grid .detail-value {
  font-size: var(--fs-xs);
  color: var(--c-text);
  word-break: break-word;
}

.card-termos {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border-light);
}

.card-termos .detail-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--c-text-muted);
}

.card-termos-text {
  margin-top: var(--sp-1);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  line-height: 1.6;
  max-height: 120px;
  overflow-y: auto;
}

.card-btn {
  margin-top: var(--sp-3);
  width: 100%;
  justify-content: center;
  padding: 8px 16px;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 1200px) {
  .filter-count {
    display: none;
  }
}

@media (max-width: 1024px) {
  .masthead { padding: var(--sp-4); }
  .filters-bar { padding: var(--sp-3) var(--sp-4); }
  .content { padding: var(--sp-4); }
  .footer { padding: var(--sp-3) var(--sp-4); }
}

@media (max-width: 768px) {
  .masthead-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-3);
  }

  .masthead-inner {
    gap: var(--sp-2);
  }

  .masthead-title {
    font-size: var(--fs-lg);
  }

  .masthead-actions {
    width: 100%;
    justify-content: space-between;
  }

  .user-email {
    display: none;
  }

  .masthead-stats {
    width: 100%;
    justify-content: space-between;
    gap: var(--sp-2);
  }

  .stat-pill {
    flex: 1;
    min-width: 0;
    padding: var(--sp-1) var(--sp-2);
  }

  .stat-value {
    font-size: var(--fs-md);
  }

  .stat-label {
    font-size: 0.6rem;
  }

  .filters-inner {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-2);
    padding: 0;
  }

  .filter-group--search {
    order: -1;
    flex: unset;
  }

  .filter-group--search .filter-label {
    display: none;
  }

  .filter-toggle {
    display: block;
    order: 0;
  }

  .filter-extra {
    display: none;
    flex-direction: column;
    gap: var(--sp-2);
  }

  .filter-extra.open {
    display: flex;
  }

  .filter-group {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-1);
  }

  .filter-group--programa {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .filter-select,
  .filter-input {
    width: 100%;
  }

  .filter-count {
    display: block;
    margin-left: 0;
    text-align: center;
    padding: var(--sp-1) var(--sp-4);
  }

  .masthead {
    position: static;
    padding: var(--sp-3) var(--sp-4);
  }

  .masthead-overline {
    display: none;
  }

  .masthead-rule {
    display: none;
  }

  .filters-bar {
    position: static;
    padding: 0;
    border-bottom: none;
    box-shadow: none;
    background: transparent;
  }

  /* Sticky search row on mobile */
  .filter-group--search {
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--c-white);
    padding: var(--sp-2) var(--sp-4);
    border-bottom: 1px solid var(--c-border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    margin: 0 calc(-1 * var(--sp-4));
    width: calc(100% + var(--sp-4) * 2);
  }

  .filter-toggle,
  .filter-extra,
  .filter-count {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }

  .section-header {
    flex-direction: column;
    gap: var(--sp-1);
  }

  .detail-panel {
    grid-template-columns: 1fr;
  }

  /* Hide desktop table, show mobile cards */
  .table-wrap {
    display: none;
  }

  .card-list {
    display: block;
  }
}

@media (max-width: 480px) {
  .masthead-title {
    font-size: var(--fs-lg);
  }

  .data-table {
    font-size: var(--fs-xs);
  }

  .data-table th,
  .data-table td {
    padding: var(--sp-1) var(--sp-2);
  }
}

/* ── Scrollbar ──────────────────────────────── */
.table-wrap::-webkit-scrollbar,
.detail-termos::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.table-wrap::-webkit-scrollbar-thumb,
.detail-termos::-webkit-scrollbar-thumb {
  background: var(--c-border);
  border-radius: 3px;
}

.table-wrap::-webkit-scrollbar-thumb:hover,
.detail-termos::-webkit-scrollbar-thumb:hover {
  background: var(--c-text-light);
}

/* ── Loading / Empty State ──────────────────── */
.loading-state,
.empty-state {
  text-align: center;
  padding: var(--sp-8) var(--sp-5);
  color: var(--c-text-muted);
}

.loading-state::before {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-forest);
  border-radius: 50%;
  margin: 0 auto var(--sp-3);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── PDF Export Button ──────────────────────── */
.btn-export {
  background: rgba(255,255,255,0.15);
  color: var(--c-white);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 16px;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-export:hover {
  background: rgba(255,255,255,0.25);
}

/* ── Clickable rows ─────────────────────────── */
.data-table tbody tr {
  cursor: pointer;
}

/* ── Login Screen ──────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg);
  padding: var(--sp-5);
}

.login-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-8) var(--sp-6);
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.login-brand {
  text-align: center;
  margin-bottom: var(--sp-6);
}

.login-overline {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--c-text-muted);
  font-weight: 500;
}

.login-title {
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--c-forest);
}

.login-rule {
  width: 48px;
  height: 3px;
  background: var(--c-forest);
  margin: var(--sp-2) auto 0;
  border-radius: 2px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.login-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--c-text-muted);
}

.login-input {
  font-family: var(--font);
  font-size: var(--fs-base);
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-white);
  color: var(--c-text);
  width: 100%;
}

.login-input:focus {
  outline: none;
  border-color: var(--c-forest-light);
  box-shadow: 0 0 0 3px rgba(58,123,213,0.15);
}

.login-btn {
  width: 100%;
  padding: 10px 16px;
  justify-content: center;
  font-size: var(--fs-sm);
}

.login-message {
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
  text-align: center;
  min-height: 1.4em;
}

.login-message--success {
  color: var(--c-forest);
}

.login-message--error {
  color: var(--c-danger);
}

/* ── User Info / Logout ────────────────────── */
.masthead-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.user-email {
  font-size: var(--fs-xs);
  opacity: 0.8;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: rgba(255,255,255,0.1);
  color: var(--c-white);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.2);
}

/* ── Parity History Chart ──────────────────── */
.chart-container {
  grid-column: 1 / -1;
  padding: var(--sp-3) 0;
}

.chart-container canvas {
  max-height: 200px;
}

.chart-unavailable {
  grid-column: 1 / -1;
  font-size: var(--fs-xs);
  color: var(--c-text-light);
  font-style: italic;
  text-align: center;
  padding: var(--sp-3) 0;
}

/* Admin nav link in masthead — needed by index.html */
.admin-link {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-white);
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.1);
  transition: all 0.15s;
}

.admin-link:hover {
  background: rgba(255,255,255,0.2);
  color: var(--c-white);
}

