/* Daily BC dashboard - styled after models.fief.ru (site.css) */

@font-face { font-family: 'Gilroy'; font-weight: 400; font-display: swap;
  src: local("Gilroy Regular"), url("/fonts/Gilroy-Regular.woff") format("woff"); }
@font-face { font-family: 'Gilroy'; font-weight: 500; font-display: swap;
  src: local("Gilroy Medium"), url("/fonts/Gilroy-Medium.woff") format("woff"); }
@font-face { font-family: 'Gilroy'; font-weight: 600; font-display: swap;
  src: local("Gilroy Bold"), url("/fonts/Gilroy-Bold.woff") format("woff"); }

:root {
  --fief-blue: #018fd3;
  --fief-deep: #046fa8;
  --fief-ink: #1a1a1a;
  --fief-muted: #2c3640;
  --fief-line: #e6eef4;
  --fief-soft: #f3f8fb;
  --fief-orange: #e88c30;
}

body {
  font-family: 'Gilroy', 'Open Sans', Arial, sans-serif;
  font-weight: 500;
  color: var(--fief-ink);
  background:
    radial-gradient(1200px 480px at 12% -10%, rgba(1, 143, 211, 0.10), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(232, 140, 48, 0.06), transparent 55%),
    #fff;
  padding-top: 72px;
}

a { color: var(--fief-blue); }
a:hover { color: var(--fief-deep); }

/* header ---------------------------------------------------------------- */
.fief-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1030;
  background: #fff; border-bottom: 1px solid var(--fief-line);
  min-height: 64px;
}
.fief-header .inner {
  max-width: 1180px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px;
}
.fief-header img { width: 150px; height: auto; display: block; }
.fief-header nav { display: flex; gap: 22px; flex-wrap: wrap; }
.fief-header nav a { color: var(--fief-ink); text-decoration: none; font-weight: 500; }
.fief-header nav a:hover { color: var(--fief-blue); }

/* page ------------------------------------------------------------------ */
.fief-page { max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; }

.fief-hero { padding: 24px 0 6px; animation: fief-rise 0.5s ease-out both; }
.fief-hero h1 { margin: 0 0 10px; font-size: 2.0em; line-height: 1.25; color: var(--fief-blue); font-weight: 600; }
.fief-hero .lead { max-width: 52em; margin: 0 0 6px; font-size: 1.1em; line-height: 1.45; color: var(--fief-muted); }
.fief-hero .meta { margin: 0; color: #7a8792; font-size: 0.95em; }

/* KPI tiles -------------------------------------------------------------- */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px;
  margin: 18px 0 24px;
}
.kpi {
  padding: 14px 16px; background: var(--fief-soft); border: 1px solid var(--fief-line);
  animation: fief-rise 0.55s ease-out both;
}
.kpi .label {
  font-size: 0.95em; font-weight: 600; color: var(--fief-ink); line-height: 1.3;
  padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid #d9e6ee;
}
.kpi .value { font-size: 1.9em; font-weight: 600; line-height: 1.15; color: var(--fief-ink); }
.kpi .value.up { color: var(--fief-deep); }
.kpi .value.down { color: #c0631a; }
.kpi .sub { font-size: 0.92em; color: var(--fief-muted); margin-top: 4px; }
.kpi.accent { background: linear-gradient(135deg, #018fd3 0%, #046fa8 60%, #0a5f8f 100%); border-color: transparent; }
.kpi.accent .label { color: #fff; border-bottom-color: rgba(255,255,255,0.3); }
.kpi.accent .sub { color: rgba(255,255,255,0.9); }
.kpi.accent .value { color: #fff; }

/* tabs -------------------------------------------------------------------- */
.nav-tabs { border-bottom: 1px solid var(--fief-line); gap: 4px; }
.nav-tabs .nav-link {
  border: none; border-bottom: 3px solid transparent; color: var(--fief-muted);
  font-weight: 500; padding: 10px 14px; background: transparent;
}
.nav-tabs .nav-link:hover { color: var(--fief-blue); border-bottom-color: var(--fief-line); }
.nav-tabs .nav-link.active {
  color: var(--fief-blue); border: none; border-bottom: 3px solid var(--fief-blue); background: transparent;
}
.tab-content { padding-top: 18px; }

/* panels and controls ------------------------------------------------------ */
.fief-panel { padding: 14px 16px; background: var(--fief-soft); border: 1px solid var(--fief-line); margin-bottom: 16px; }
.fief-panel h3 {
  margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid #d9e6ee;
  font-size: 1.02em; font-weight: 600; color: var(--fief-ink);
}
.fief-panel p, .fief-panel li { color: var(--fief-muted); line-height: 1.45; }
.fief-panel p:last-child { margin-bottom: 0; }

.controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 28px; margin-bottom: 8px; }
.controls .form-group { margin-bottom: 0; }
.controls > .form-group > .control-label, .controls > .shiny-input-container > .control-label {
  display: block; font-size: 0.85em; font-weight: 600; color: #7a8792; text-transform: uppercase;
  letter-spacing: 0.03em; margin-bottom: 4px;
}
.controls .form-check-label, .controls .radio-inline { color: var(--fief-ink); font-weight: 500; }
.controls .form-check-input:checked { background-color: var(--fief-blue); border-color: var(--fief-blue); }
.btn-group-toggle .btn, .radio-inline, .form-check-inline { font-weight: 500; }

.chart-note { color: #7a8792; font-size: 0.92em; margin: 6px 0 18px; }

.btn-fief, .btn-fief:focus {
  display: inline-block; padding: 8px 14px; border: 1px solid var(--fief-blue); border-radius: 0;
  background: #fff; color: var(--fief-deep); font-weight: 600; text-decoration: none;
}
.btn-fief:hover { background: var(--fief-blue); color: #fff; }

div.fief-table table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
div.fief-table table th {
  text-align: right; font-weight: 600; color: var(--fief-muted); border-bottom: 2px solid var(--fief-line);
  padding: 6px 10px;
}
div.fief-table table th:first-child, div.fief-table table td:first-child { text-align: left; }
div.fief-table table td { text-align: right; padding: 6px 10px; border-bottom: 1px solid var(--fief-line); }
div.fief-table table tr.now td { color: var(--fief-deep); font-weight: 600; }

.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
.two-col > * { min-width: 0; }
div.fief-table { overflow-x: auto; }
.prose { max-width: 60em; color: var(--fief-muted); line-height: 1.55; font-size: 1.02em; }
.prose h3 { color: var(--fief-blue); font-weight: 600; font-size: 1.2em; margin: 22px 0 8px; }

.fief-footer {
  margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--fief-line);
  color: #7a8792; font-size: 0.93em;
}

@keyframes fief-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 991px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 575px) {
  body { padding-top: 64px; }
  .fief-header img { width: 120px; }
  .fief-header nav { gap: 12px; font-size: 0.92em; }
  .fief-header nav a:not(:first-child) { display: none; }
  div.fief-table table { font-size: 0.9em; }
  div.fief-table table th, div.fief-table table td { padding: 5px 6px; }
  .fief-hero h1 { font-size: 1.5em; }
  .kpi-grid { grid-template-columns: 1fr; }
}
