/* reynolds.css */

/* =========================
   1) Typography: ARIAL ONLY
   ========================= */
* {
  font-family: Arial, sans-serif !important;
}

/* =========================
   2) Approved Palette Tokens
   First 3 dominate
   ========================= */
:root {
  /* Dominant brand colors */
  --imperial-blue: #0E2961; /* 1 */
  --steel-azure:  #004E9D; /* 2 */
  --fresh-sky:    #00AFEA; /* 3 */

  /* Secondary (sparingly) */
  --tiger-orange:  #EE7B00;
  --amber-flame:   #FAB800;
  --jade-green:    #4EAE46;
  --yellow-green:  #AEC909;
  --indigo-velvet: #583088;
  --fuchsia-flame: #E62380;

  /* App mapping (dominated by first 3) */
  --accent: var(--imperial-blue);
  --accent-2: var(--steel-azure);
  --accent-3: var(--fresh-sky);

  /* Neutrals */
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --text: #0B1220;
  --muted: #64748B;
  --border: rgba(14, 41, 97, 0.12);

  /* UI shape/elevation */
  --radius: 10px;
  --shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
}

html, body {
  background: var(--bg);
  color: var(--text);
}

/* =========================
   3) Shell / Layout
   ========================= */
.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 16px 28px;
}

/* =========================
   4) Header (logo always visible)
   ========================= */
.app-header {
  background: var(--accent);
  color: #fff;
  padding: 14px 16px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-title {
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.6px;
}

.app-subtitle {
  font-size: 12px;
  opacity: 0.92;
  font-weight: 600;
}

/* Ensures the logo reads on dark header */
.app-header img {
  display: block;
}

/* Bigger Reynolds logo (was 28px) */
.reynolds-logo {
  display: block;
  height: 52px;   /* bigger per request */
  max-height: 52px;
  width: auto;
  object-fit: contain;
}

/* =========================
   4b) Sticky Action Bar
   ========================= */
.action-bar {
  position: sticky;
  top: 10px;
  z-index: 50;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.action-bar-right {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* =========================
   5) Sections
   ========================= */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
}

.section-title {
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.3px;
  margin: 0 0 10px 0;
}

/* Comments */
.comment,
.card-comment {
  color: var(--accent-2);
  font-weight: 600;
  font-size: 12px;
  line-height: 1.35;
  margin-top: -4px;
  margin-bottom: 10px;
  opacity: 0.95;
}

/* =========================
   6) Inputs
   ========================= */
label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
.Select-control {
  border: 1px solid rgba(14, 41, 97, 0.18) !important;
  border-radius: var(--radius) !important;
  padding: 8px 10px !important;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus {
  outline: none !important;
  border-color: rgba(0, 175, 234, 0.85) !important;
  box-shadow: 0 0 0 3px rgba(0, 175, 234, 0.18) !important;
}

/* Restore Bootstrap Switch / Checkbox — undo any global input overrides */
.form-check-input {
  border: 1px solid #adb5bd !important;
  border-radius: 0.25em !important;
  padding: 0 !important;
  width: 1em !important;
  height: 1em !important;
  cursor: pointer;
  box-shadow: none !important;
}

.form-switch .form-check-input {
  width: 2em !important;
  height: 1.1em !important;
  border-radius: 2em !important;
}

/* =========================
   7) Buttons
   ========================= */
.btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  font-weight: 900 !important;
  font-size: 12px !important;
  letter-spacing: 0.4px;
  border-radius: var(--radius) !important;
  padding: 10px 16px !important;
}

.btn-primary:hover {
  background: var(--accent-2) !important;
  border-color: var(--accent-2) !important;
}

.btn-secondary {
  background: #fff !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  font-weight: 800 !important;
  font-size: 12px !important;
  border-radius: var(--radius) !important;
}

/* =========================
   8) Status banners
   ========================= */
.status-success,
.status-danger {
  background: rgba(0, 175, 234, 0.10);
  border: 1px solid rgba(0, 175, 234, 0.30);
  color: var(--accent);
  font-weight: 700;
  padding: 10px 12px;
  border-radius: var(--radius);
}

#global-bounds-msg .status-success,
#global-bounds-msg .status-danger {
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

/* =========================
   9) KPI cards (clean vertical layout)
   Title top, value centered, sub pinned bottom
   ========================= */
.kpi-row {
  display: grid;
  /* Keep them together, but make them responsive and readable */
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 10px 0 12px 0;
}

.kpi {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 12px 10px 12px;
  background: #fff;
  box-shadow: var(--shadow);
  min-height: 128px;            /* gives breathing room */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Title at the top */
.kpi-label {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  line-height: 1.2;
}

/* Main value centered vertically */
.kpi-value {
  flex: 1;
  display: flex;
  align-items: center;          /* vertical centering */
  padding: 8px 0;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.05;
  color: var(--accent);         /* Imperial Blue to look cleaner */
}

/* Subtext pinned to the bottom */
.kpi-sub {
  margin-top: auto;             /* pins to bottom */
  padding-top: 8px;
  border-top: 1px solid rgba(14, 41, 97, 0.10);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  line-height: 1.25;
  white-space: normal;          /* allow wrapping */
}


/* =========================
   10) DataTable styling
   ========================= */
.dash-table-container .dash-spreadsheet-container {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.dash-table-container .dash-spreadsheet-container th {
  background: linear-gradient(180deg, var(--imperial-blue), #0b214e);
  color: #fff !important;
  border: none !important;
  font-weight: 800 !important;
}

.dash-table-container .dash-spreadsheet-container tr:nth-child(even) td {
  background-color: rgba(14, 41, 97, 0.03);
}

.dash-table-container .dash-spreadsheet-container tr:hover td {
  background-color: rgba(0, 175, 234, 0.08) !important;
  transition: background-color 120ms ease;
}

/* =========================
   11) Footer
   ========================= */
.app-footer {
  margin-top: 14px;
  padding: 10px 2px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left {
  display: block;
}

.footer-right {
  display: block;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

/* =========================
   12) Simple table alignment helpers (dbc.Table)
   ========================= */
.table-center {
  text-align: center;
  vertical-align: middle;
}

.table-right {
  text-align: right;
  vertical-align: middle;
}

.table-left {
  text-align: left;
  vertical-align: middle;
}

/* =========================
   13) Visualization (Tabs + Chart Cards)
   ========================= */

.viz-wrap {
  margin-top: 10px;
}

.chart-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 10px 10px 2px 10px;
}

/* Make tab bar match brand */
.viz-tabs .nav-tabs {
  border-bottom: 1px solid var(--border);
  gap: 6px;
}

.viz-tabs .nav-link {
  font-weight: 800;
  font-size: 12px;
  color: var(--accent);
  border-radius: 10px 10px 0 0;
  border: 1px solid transparent;
  padding: 10px 12px;
}

.viz-tabs .nav-link:hover {
  background: rgba(0, 175, 234, 0.08);
  border-color: rgba(0, 175, 234, 0.20);
}

.viz-tabs .nav-link.active {
  color: #fff !important;
  background: linear-gradient(180deg, var(--imperial-blue), #0b214e) !important;
  border-color: rgba(14, 41, 97, 0.20) !important;
}

.viz-tabs .tab-content {
  padding-top: 10px;
}

/* Hide slider output number (Dash auto-renders a value div next to slider) */
.budget-slider ~ div { display: none !important; }

/* =========================
   Sticky Run Bar
   ========================= */
.sticky-run-bar {
  position: sticky;
  bottom: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border-top: 2px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 12px 16px;
  margin-top: 8px;
  box-shadow: 0 -4px 16px rgba(14, 41, 97, 0.08);
  gap: 16px;
}

.sticky-bar-left {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  min-width: 0;
}

.sticky-bar-stat {
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.sticky-bar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sticky-bar-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.sticky-bar-value--warn {
  color: #dc2626;
}

.sticky-bar-delta {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sticky-bar-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 16px;
  flex-shrink: 0;
}

.sticky-run-btn {
  flex-shrink: 0;
  height: 40px !important;
  min-width: 180px !important;
  font-size: 13px !important;
  letter-spacing: 0.04em !important;
}

/* Centre status area */
.sticky-bar-status {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

/* Inline result pill */
.sticky-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.sticky-status--success {
  background: rgba(22, 163, 74, 0.10);
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.25);
}

.sticky-status--error {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.20);
}

/* Responsive: stack on small screens */
@media (max-width: 576px) {
  .sticky-run-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .sticky-bar-left {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .sticky-bar-status {
    justify-content: center;
  }
  .sticky-run-btn {
    width: 100% !important;
  }
}

/* =========================
   14) Table inputs — compact, no inflate
   ========================= */

/* Any input inside a <td> gets compact treatment — exclude checkboxes (Switch/Checkbox use type="checkbox") */
td input:not([type="checkbox"]),
td .dash-input {
  padding: 3px 6px !important;
  border-radius: 4px !important;
  height: 30px !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
}

/* Percentage inputs in table cells: center-aligned */
td input[type="number"]:not([type="checkbox"]) {
  text-align: center !important;
}

/* Currency/text inputs in table cells: right-aligned */
td input[type="text"] {
  text-align: right !important;
}


/* Vertically align all table cells to middle */
table td, table th {
  vertical-align: middle !important;
}

/* Global bounds inputs (not in td) stay readable but center-aligned */
#global-lb, #global-ub {
  text-align: center !important;
  padding: 6px 8px !important;
  border-radius: 6px !important;
}

