/* === View-specific styles === */

.summary-card .value.positive,
.guide-projected.positive {
  color: #1a8a4a;
}

.summary-card .value.negative,
.guide-projected.negative {
  color: #d44332;
}

.guide-table-wrap {
  overflow-x: auto;
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.guide-table {
  min-width: 1280px;
}

.guide-date-head {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-light);
}

.guide-store-cell,
.guide-total-cell,
.guide-day-cell {
  vertical-align: top;
}

.guide-store-name {
  font-weight: 700;
  color: var(--text);
}

.guide-store-sub,
.guide-forecast-line {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.35;
}

.guide-projected {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.guide-projected-btn {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.guide-projected-btn:hover {
  text-decoration: underline;
}

.guide-projected-btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  border-radius: 4px;
}

.guide-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  min-height: 20px;
}

.guide-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mid);
  white-space: nowrap;
}

.guide-diagnostics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
}

.guide-diagnostic-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
}

.guide-explain-modal {
  max-width: 560px;
}

.guide-explain-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 18px;
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(200,16,46,0.10), transparent 36%),
    linear-gradient(135deg, #fffaf5, #fff);
  border: 1px solid var(--cream-dark);
}

.guide-explain-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 6px;
}

.guide-explain-store {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.guide-explain-date {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-mid);
}

.guide-explain-projected-wrap {
  min-width: 150px;
  text-align: right;
}

.guide-explain-projected {
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
  color: var(--red);
}

.guide-explain-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.guide-explain-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
}

.guide-explain-chip.muted {
  background: #f7f7f7;
  border-color: #ececec;
}

.guide-explain-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.guide-explain-cards-summary {
  margin-bottom: 10px;
}

.guide-explain-stat {
  padding: 14px;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.guide-explain-stat.accent {
  background: #fff8f6;
  border-color: rgba(200,16,46,0.18);
}

.guide-explain-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.guide-explain-value {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.guide-explain-sub {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-mid);
}

.guide-explain-formula {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-mid);
}

@media (max-width: 720px) {
  .guide-explain-hero {
    flex-direction: column;
  }

  .guide-explain-projected-wrap {
    text-align: left;
  }

  .guide-explain-cards {
    grid-template-columns: 1fr;
  }
}

/* === Drilldown === */
.drilldown-container {
  background: var(--white);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.4s ease both;
}

.drilldown-container h2 {

  font-size: 20px;
  margin-bottom: 4px;
  color: var(--text);
}

/* Store switcher in drilldown */
.store-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}

.store-switcher-select {
  padding: 6px 28px 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 20px;
  font-weight: 600;
  font-family: inherit;
  background: var(--cream);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.store-switcher-select:hover {
  border-color: var(--red);
}

.store-switcher-select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(200,16,46,0.12);
}

.store-switcher-select option {
  background: var(--white);
  color: var(--text);
  font-size: 14px;
}

.drilldown-week-label {
  margin: 2px 0 16px;
  color: var(--text-light, #888);
  font-size: 13px;
  font-weight: 500;
}

/* === Day History === */
.dayhistory-container {
  background: var(--white);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.4s ease both;
}

/* === Upload Modal === */
.upload-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  animation: fadeInUp 0.2s ease both;
}

.upload-modal {
  background: var(--white);
  border-radius: 20px;
  padding: 36px;
  max-width: 640px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.35s ease both;
}

.upload-modal h2 {

  margin-bottom: 8px;
  font-size: 20px;
  color: var(--text);
}

.upload-modal > p {
  color: var(--text-mid);
  font-size: 14px;
  margin-bottom: 20px;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
  color: var(--text-light);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.drop-zone:hover {
  border-color: var(--red);
  background: var(--red-pale);
}

.drop-zone.dragover {
  border-color: var(--red);
  background: var(--red-pale);
  border-style: solid;
  box-shadow: 0 0 0 3px rgba(200,16,46,0.12);
}

.drop-zone .drop-icon {
  display: block;
  margin: 0 auto 12px;
  opacity: 0.5;
}

.drop-zone p {
  margin: 6px 0;
  font-size: 14px;
}

.drop-zone p strong {
  color: var(--red);
}

.file-list {
  margin-top: 20px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--cream);
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--cream-dark);
  transition: all 0.2s;
}

.file-item:hover {
  border-color: var(--border);
}

.file-item .file-icon {
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--cream-dark);
  border-radius: 8px;
  flex-shrink: 0;
}

.file-item .file-icon svg {
  width: 18px;
  height: 18px;
  color: var(--text-mid);
}

.file-item .file-info {
  flex: 1;
  min-width: 0;
}

.file-item .file-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item .file-week {
  font-size: 13px;
  color: var(--text-mid);
}

.file-item .file-replace {
  font-size: 12px;
  color: var(--amber);
  font-weight: 500;
}

.file-item .file-conflict {
  font-size: 12px;
  color: var(--danger);
  font-weight: 600;
}

.file-item .file-remove {
  cursor: pointer;
  color: #b0aaa2;
  font-size: 18px;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-item .file-remove:hover {
  color: var(--danger);
  background: var(--red-pale);
}

.upload-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* Upload progress bar */
.upload-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--cream-dark);
  margin-top: 16px;
  overflow: hidden;
}

.upload-progress .progress-bar {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--red), #e8445a, var(--red));
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  width: 100%;
}

/* === Settings === */
.settings-container {
  max-width: 720px;
}

.settings-section {
  background: var(--white);
  border-radius: 16px;
  padding: 26px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  animation: fadeInUp 0.4s ease both;
}

.settings-section h3 {

  font-size: 16px;
  color: var(--text);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--cream-dark);
}

.store-setting-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 6px;
  transition: background 0.15s;
}

.store-setting-row:hover {
  background: var(--cream);
}

.store-setting-row:last-child {
  margin-bottom: 0;
}

.store-setting-row .store-label {
  flex: 1;
  font-weight: 600;
  color: var(--text);
}

.store-setting-row input[type="number"] {
  width: 80px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  text-align: center;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.2s;
}

.store-setting-row input[type="number"]:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(200,16,46,0.12);
}

/* Settings store table */
.settings-table {
  table-layout: fixed;
}

.settings-store-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.settings-store-active {
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(22,163,74,0.15);
}

.settings-store-inactive {
  background: #ccc;
}

.settings-threshold {
  width: 64px;
  padding: 5px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.2s;
}

.settings-threshold:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(200,16,46,0.12);
}

.store-delete-btn {
  background: none;
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-sm);
  color: #c0bab3;
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.15s ease;
}

.store-delete-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--red-pale);
}

/* === Trends === */
.trends-container {
  background: var(--white);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.4s ease both;
}

.trends-container canvas {
  max-width: 100%;
}

.trends-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.trends-controls button {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-mid);
  transition: all 0.2s ease;
}

.trends-controls button:hover:not(.active) {
  border-color: #ccc6bc;
  color: var(--text);
}

.trends-controls button.active {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

/* === Models View === */
.models-section { margin-bottom: 24px; }
.models-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--cream-dark); color: var(--text); border-radius: 12px 12px 0 0; border-bottom: 2px solid var(--red); justify-content: space-between; }
.models-title { font-size: 16px; font-weight: 700; }
.models-week-label { font-size: 13px; color: var(--text-light); }
.models-section .table-wrapper { border-radius: 0 0 12px 12px; overflow: hidden; }
.models-table { font-size: 13px; table-layout: fixed; width: 100%; }
.models-table th { font-size: 12px; padding: 6px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.models-table td { padding: 6px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.models-budget-col { display: none; }
.models-show-budget .models-budget-col { display: table-cell; }
.models-l4l-col { display: none; }
.models-show-l4l .models-l4l-col { display: table-cell; }
.models-budget-toggle { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 12px 0 16px; font-size: 13px; color: var(--text-light); font-weight: 500; }
.models-budget-toggle .toggle-switch { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
.models-budget-toggle .toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.models-budget-toggle .toggle-track { position: absolute; inset: 0; background: #d1d5db; border-radius: 20px; cursor: pointer; transition: background 0.2s; }
.models-budget-toggle .toggle-track::after { content: ''; position: absolute; width: 14px; height: 14px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: transform 0.2s; }
.models-budget-toggle input:checked + .toggle-track { background: var(--red); }
.models-budget-toggle input:checked + .toggle-track::after { transform: translateX(16px); }
.models-total-row { border-top: 2px solid var(--border); }
.models-total-row td { font-weight: 600; background: var(--cream-dark); }

/* === L4L View === */
.l4l-table th { background: var(--cream-dark); color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 1px solid var(--border); }
.l4l-table th:first-child { color: var(--text); }
.l4l-table td { border-bottom: 1px solid var(--cream-dark); }
.l4l-table .l4l-store-row td { background: var(--white); color: var(--text); }
.l4l-table .l4l-store-row.l4l-store-alt td { background: var(--cream); }
.l4l-table .l4l-store-row:hover td { background: var(--cream-dark); }
.l4l-table .l4l-store-name { padding-left: 22px !important; color: var(--text-mid); font-weight: 500; }
.l4l-table .l4l-area-row td { background: #ebe8e2; font-weight: 700; color: var(--text); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.l4l-table .l4l-area-count { font-weight: 400; color: var(--text-light); font-size: 11px; margin-left: 4px; text-transform: none; letter-spacing: 0; }
.l4l-table .l4l-total-row td { background: var(--cream-dark); font-weight: 700; color: var(--text); border-top: 2px solid var(--red); border-bottom: none; font-size: 13px; }

/* === Accuracy View === */
.acc-container {
  background: var(--white);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.4s ease both;
}

.acc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 20px;
}

.acc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

.acc-table th {
  text-align: center;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--cream-border);
  background: var(--cream-dark);
}

.acc-table .acc-store-col { text-align: left; min-width: 140px; position: sticky; left: 0; z-index: 1; }

.acc-table tbody tr:hover td { background: var(--cream); }
.acc-table tbody tr:hover td.acc-green { background: #dcfce7; }
.acc-table tbody tr:hover td.acc-amber { background: #fef3c7; }
.acc-table tbody tr:hover td.acc-red { background: #fee2e2; }

.acc-store-name {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--cream-dark);
  white-space: nowrap;
  background: var(--white);
  position: sticky;
  left: 0;
  z-index: 1;
}

.acc-region-row td { border-top: 2px solid var(--border); }
.acc-region-row .acc-region-label { color: var(--text-mid); font-style: italic; background: var(--cream-dark); }
.acc-region-row .acc-cell { background: var(--cream-dark); }

.acc-cell {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid var(--cream-dark);
  min-width: 90px;
}

.acc-total {
  border-left: 2px solid var(--cream-border);
  font-weight: 600;
}

.acc-actual {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.acc-forecast {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.acc-var {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-top: 3px;
}

.acc-pending { color: var(--text-light); }

.acc-upcoming {
  background: var(--cream-dark);
  background-image: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 6px,
    rgba(0,0,0,0.04) 6px,
    rgba(0,0,0,0.04) 12px
  );
}

.acc-upcoming-header { color: var(--text-light); }

.acc-upcoming-forecast {
  font-size: 11px;
  color: var(--text-light);
  font-style: italic;
}

.acc-green { background: var(--green-pale); }
.acc-green .acc-var { color: var(--green); background: #dcfce7; }
.acc-amber { background: #fffbeb; }
.acc-amber .acc-var { color: var(--amber); background: #fef3c7; }
.acc-red { background: #fff1f0; }
.acc-red .acc-var { color: var(--danger); background: #fee2e2; }

/* === Compare View === */
.compare-selectors {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.compare-week-wrap {
  width: 220px;
}
.compare-week-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
.compare-swap {
  font-size: 20px;
  color: var(--text-light);
  user-select: none;
  margin-top: 18px;
}
.compare-store {
  background: var(--white);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  animation: fadeInUp 0.4s ease both;
}
.compare-store-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.compare-store-name {
  font-weight: 700;
  font-size: 15px;
}
.compare-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.compare-badge.positive {
  background: #e8f5e9;
  color: #1a8a4a;
}
.compare-badge.negative {
  background: #fce4e4;
  color: #d44332;
}
.compare-table {
  margin-bottom: 8px;
}
.compare-table th:first-child,
.compare-table td:first-child {
  text-align: left;
  width: 12%;
}
.compare-diff-row {
  border-top: 2px solid var(--border);
}
.compare-results {
  animation: fadeInUp 0.3s ease both;
}

/* ── Drill view ─────────────────────────────────────────── */
.drill-container {
  max-width: 900px;
  margin: 24px auto;
  padding: 0 16px;
}

.drill-day-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.drill-day-btn {
  padding: 6px 18px;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: #fff;
  color: var(--colour-dark-navy);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.drill-day-btn:hover {
  border-color: var(--colour-tan);
  color: var(--colour-tan);
}

.drill-day-btn.active {
  background: var(--colour-dark-navy);
  border-color: var(--colour-dark-navy);
  color: #fff;
  font-weight: 600;
}

.drill-list {
  display: flex;
  flex-direction: column;
  border: 1px solid #e8e0d8;
  border-radius: 8px;
  overflow: hidden;
}

.drill-row {
  display: grid;
  grid-template-columns: 130px 160px 1fr 80px;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #f0ebe4;
  background: #fff;
}

.drill-row:last-child {
  border-bottom: none;
}

.drill-row-dim {
  opacity: 0.45;
}

.drill-row-total {
  background: #faf7f4;
  border-top: 2px solid #e8e0d8;
  font-weight: 700;
}

.drill-store {
  font-weight: 600;
  font-size: 13px;
  color: var(--colour-dark-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drill-values {
  display: flex;
  gap: 12px;
}

.drill-value-pair {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 64px;
}

.drill-value-label {
  font-size: 10px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.drill-value-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--colour-dark-navy);
}

.drill-value-prev {
  color: #888;
  font-weight: 400;
}

.drill-bar-wrap {
  padding: 0 4px;
}

.drill-bar-track {
  position: relative;
  height: 10px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}

.drill-bar-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 2px;
}

.drill-bar-pos {
  background: #1a8a4a;
  left: 50%;
}

.drill-bar-neg {
  background: #d44332;
  right: 50%;
}

.drill-bar-center {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  background: #bbb;
}

.drill-diff {
  text-align: right;
  font-weight: 700;
  font-size: 13px;
}

.drill-export-btn {
  margin-left: auto;
  padding: 6px 16px;
  background: var(--colour-dark-navy);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.drill-export-btn:hover {
  background: var(--colour-tan);
}

.export-bar {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.export-bar .drill-export-btn {
  margin-left: 0;
}

/* Holidays tab */
.holidays-banner {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--cream-border);
  border-left: 3px solid var(--red);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.holiday-highlight {
  background: rgba(200, 16, 46, 0.05);
}

.holiday-highlight-header {
  background: rgba(200, 16, 46, 0.08);
}

.historical-input {
  width: 70px;
  padding: 4px 6px;
  font-size: 13px;
  text-align: right;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  font-family: inherit;
}

.historical-input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.ev-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.ev-badge-gov {
  background: #e8f4fd;
  color: #1a73e8;
}

.ev-badge-computed {
  background: #f0fdf4;
  color: #16a34a;
}

.ev-badge-manual {
  background: #fef3cd;
  color: #856404;
}

/* === Lock Panel (Dashboard) === */
.lock-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--red-pale);
  border: 1.5px solid #f5b8c0;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
}
.lock-panel-icon { font-size: 22px; flex-shrink: 0; }
.lock-panel-text { flex: 1; }
.lock-panel-title { font-weight: 700; font-size: 13px; color: var(--text); }
.lock-panel-sub { font-size: 12px; color: var(--text-mid); margin-top: 2px; }
.lock-panel-sub-muted { font-size: 12px; color: var(--text-light); margin-top: 2px; font-style: italic; }

.locked-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 16px;
}
.locked-banner-text { flex: 1; }
.locked-banner-title { font-weight: 700; font-size: 13px; color: var(--green); }
.locked-banner-sub { font-size: 11px; color: var(--text-mid); margin-top: 1px; }
.btn-unlock {
  font-size: 11px; color: var(--text-light);
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px 10px; cursor: pointer;
}
.btn-unlock:hover { background: var(--cream-dark); }

/* === vs Mon view === */
.vsmon-locked-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f0fdf4; border: 1px solid #86efac;
  border-radius: 20px; padding: 4px 14px;
  font-size: 11px; font-weight: 600; color: var(--green);
  margin-bottom: 18px;
}
.vsmon-section-header {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-light);
  margin: 20px 0 8px;
}
.vsmon-table-wrap { border: 1px solid var(--cream-border); border-radius: var(--radius); overflow: hidden; margin-bottom: 4px; }
.vsmon-store-card { border: 1px solid var(--cream-border); border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; }
.vsmon-store-hdr {
  background: var(--cream-dark); padding: 8px 14px;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--cream-border);
}
.vsmon-flag { font-size: 11px; padding: 2px 9px; border-radius: 10px; font-weight: 600; }
.vsmon-flag-warn { background: #fff3cd; color: #856404; }
.vsmon-flag-ok { background: #d1fae5; color: #065f46; }
.vsmon-flag-mix { background: #e0f2fe; color: #075985; }

.vsmon-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.vsmon-table th {
  background: var(--cream-dark); padding: 7px 10px;
  text-align: center; font-size: 11px; font-weight: 700;
  color: var(--text-mid); border-bottom: 2px solid var(--cream-border);
  white-space: nowrap;
}
.vsmon-table th:first-child { text-align: left; }
.vsmon-table td { padding: 7px 10px; border-bottom: 1px solid var(--cream-border); text-align: center; vertical-align: middle; }
.vsmon-table td:first-child { text-align: left; font-size: 11px; color: var(--text-light); white-space: nowrap; }
.vsmon-table tr:last-child td { border-bottom: none; }
.vsmon-table .today-th { background: var(--colour-orange-bg); color: var(--colour-orange); }
.vsmon-table .today-td { background: #fff8f0; }
.vsmon-table .past-th { opacity: 0.65; }
.vsmon-table .past-td { opacity: 0.65; }
.vsmon-table .total-row td { background: var(--cream-dark); font-weight: 700; border-top: 2px solid var(--cream-border); }

.vsmon-delta-pos { color: var(--danger); font-weight: 700; }
.vsmon-delta-neg { color: var(--green); font-weight: 700; }
.vsmon-fc-pos    { color: var(--green); font-weight: 700; }
.vsmon-fc-neg    { color: var(--danger); font-weight: 700; }
.vsmon-no-change { color: var(--text-light); }

.vsmon-empty {
  text-align: center; padding: 48px 24px;
  color: var(--text-light); font-size: 14px;
}
.vsmon-empty strong { display: block; font-size: 16px; color: var(--text-mid); margin-bottom: 6px; }

/* === Actual View === */
.actual-section {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.actual-section-header {
  padding: 14px 18px;
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.actual-section-header:hover {
  background: var(--cream);
}
.actual-section-header .actual-toggle {
  color: var(--text-light);
  font-size: 12px;
  transition: transform 0.2s;
}
.actual-section.collapsed .actual-section-header {
  border-bottom: none;
}
.actual-section.collapsed .actual-toggle {
  transform: rotate(-90deg);
}
.actual-section.collapsed .actual-section-body {
  display: none;
}
.actual-section-body {
  overflow-x: auto;
}
.actual-compact {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 12px;
}
.actual-compact th {
  padding: 6px 10px;
  text-align: right;
  font-weight: 600;
  color: var(--text-mid);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.actual-compact th:first-child {
  text-align: left;
  width: 220px;
}
.actual-compact td {
  padding: 5px 10px;
  text-align: right;
  color: var(--navy);
  border-bottom: 1px solid #f5f0eb;
  white-space: nowrap;
  font-size: 12px;
}
.actual-compact td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--text);
}
.actual-compact tr:last-child td {
  border-bottom: none;
}
.actual-compact .total-col {
  font-weight: 700;
}
.actual-compact tr.section-header td {
  background: var(--cream-dark, #f0ebe4);
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 10px 10px 6px;
  border-bottom: none;
}
.actual-compact tr.rag-row td:first-child {
  padding-left: 20px;
  font-weight: 400;
  font-size: 11px;
  color: var(--text);
  background: #fff !important;
  position: relative;
  z-index: 1;
}
.actual-compact tr.var-row td:first-child {
  padding-left: 20px;
  font-weight: 400;
  font-size: 11px;
  color: var(--text-light);
}
.actual-compact .forecast-day {
  font-style: italic;
  color: #b0aaa2 !important;
}
.actual-compact .diff {
  font-weight: 600;
  font-size: 12px;
}
.actual-compact .diff.positive {
  color: var(--green);
}
.actual-compact .diff.negative {
  color: var(--danger);
}

.acc-date-range {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-mid);
  margin-bottom: 16px;
  padding: 0 4px;
}
.acc-legend {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 24px;
  padding: 0 4px;
}
.acc-legend-text {
  font-size: 11px;
  color: var(--text-light);
}

@media (max-width: 768px) {
  .compare-selectors {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .compare-week-wrap {
    width: 100%;
  }
  .compare-swap {
    text-align: left;
    padding: 0;
  }

  .drilldown-container,
  .dayhistory-container,
  .settings-section,
  .upload-modal {
    padding: 20px;
  }
}

.weather-row td { color: var(--text-light); font-size: 13px; }
.weather-row td:first-child { font-weight: 600; }
