/* Forecast UI theme (decisions/0167) -- the Dashboard's theme.css
   header rules (decisions/0149), same dark navy + orange visual language
   as every module (decisions/0044).
*/

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #0d1f35;
  color: #d0e4f4;
}

/* Suite-wide dark scrollbar (decisions/0088) -- the default OS/browser
   scrollbar (light grey) looks out of place against every module's dark
   background; same light-on-transparent style applied identically in
   Portal/eMapp/Documents/Vulani's own theme files. */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.4); }

a { color: #f5a623; }

/* ── App header / global nav ── */
#app-header {
  background: linear-gradient(135deg, #0d1f35 0%, #1a3a5c 100%);
  color: white; padding: 10px 18px 8px;
  border-bottom: 2px solid #f5a623;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
#app-header .brand { display: flex; align-items: center; gap: 12px; }
#app-header .logo {
  width: 36px; height: 36px; border-radius: 50%; background: #f5a623;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #0d1f35; flex-shrink: 0;
}
#app-header h1 { font-size: .95rem; font-weight: 700; margin: 0; }
#app-header .back-link { font-size: .75rem; color: #8aaac8; text-decoration: none; }
#app-header .back-link:hover { color: #f5a623; }
#app-header nav { display: flex; gap: 14px; flex-wrap: wrap; }
#app-header nav a { font-size: .8rem; color: #b8d0e8; text-decoration: none; }
#app-header nav a:hover, #app-header nav a.active { color: #f5a623; }
#app-header .session-info { font-size: .75rem; color: #cdd5e0; text-align: right; }

/* decisions/0077: when embedded in Portal this module's own header is
   redundant; standalone access keeps it. */
.vs-embedded #app-header { display: none; }
/* Signed out inside Portal: the loading screen covers the wait for Portal's
   sign-in token; the standalone "Sign in" prompt never shows there. */
.vs-embedded .fc-signin { display: none; }


/* David: a real, hand-bumped version visible on screen at all times, even
   embedded (deliberately outside #app-header so the hide rule above
   doesn't take it down too) -- so a stale tab/iframe is distinguishable
   from a genuinely updated one without opening devtools. Top-right:
   bottom-right collides with the ambient Vulani bubble (decisions/0074). */
#forecast-version {
  position: fixed; right: 6px; top: 4px; z-index: 900;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: .62rem; letter-spacing: .06em;
  color: #6b7f94; opacity: .75; pointer-events: none;
}

/* ── Page body ── */
/* The grid fills what is left of the window; the page itself never scrolls. */
.fc-page { padding: 0 18px 12px; display: flex; flex-direction: column; height: calc(100vh - 58px); }
.vs-embedded .fc-page { height: 100vh; }
.fc-title-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 10px 0 6px; }
.fc-page h1 { font-size: 1.1rem; color: #f5a623; margin: 0; }
.fc-subtitle { font-size: .75rem; color: #8aaac8; text-transform: uppercase; letter-spacing: .08em; }
.fc-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; margin-right: 56px; }

select, input[type="text"] {
  background: #1a3a5c; border: 1px solid #2a5a8a; color: #d0e4f4;
  padding: 4px 8px; border-radius: 3px; font-size: 12px;
}
select:focus, input[type="text"]:focus { outline: none; border-color: #f5a623; }
.context-picker select { min-width: 280px; height: 27px; }

/* The status line: read-only text, not a control. */
.fc-status { font-size: .82rem; padding: 7px 12px; border-radius: 4px; margin: 0 0 6px;
  background: #112235; border: 1px solid #2a5a8a; color: #d0e4f4; }
.fc-status:empty { display: none; }
.fc-status strong { color: #f5a623; }
.fc-status-closed { border-color: #6b7f94; }
.fc-status-closed strong { color: #b8c8d8; }
.fc-status-saved { border-color: #2ea866; }
.fc-status-saved strong { color: #3cc47a; }
.fc-error { color: #ff8a8a; font-size: .82rem; margin: 0 0 6px; }
.fc-error:empty { display: none; }

.fc-grid { flex: 1; min-height: 300px; width: 100%; }

/* Excel, as eMapp's (decisions/0125): green, same height as the picker. */
.excel-export-btn {
  height: 27px; min-width: 90px; padding: 0 12px; line-height: 25px;
  background: #1d7a46; border: 1px solid #2ea866; border-radius: 4px;
  color: #fff; font-weight: 700; font-size: 13px; white-space: nowrap;
}
.excel-export-btn:hover:not(:disabled) { background: #2ea866; border-color: #3cc47a; color: #fff; }
/* Submit: an acting control, a real button in every state (amber, as eMapp's Run). */
.fc-submit {
  height: 27px; padding: 0 14px; background: #f5a623; border: 1px solid #f5a623; border-radius: 4px;
  color: #0d1f35; font-weight: 700; font-size: 13px; white-space: nowrap;
}
.fc-submit:hover:not(:disabled) { background: #ffc04d; border-color: #ffc04d; color: #0d1f35; }

/* ── The grid, eMapp's dark AG Grid (Modules/eMapp/app/static/theme.css) ── */
.ag-theme-alpine {
  --ag-header-background-color: #1a3a5c;
  --ag-header-foreground-color: #e8f0f8;
  --ag-foreground-color: #1a2b3c;
  --ag-background-color: #ffffff;
  --ag-row-hover-color: rgba(31, 77, 122, .12);
  --ag-border-color: #c9d6e2;
  --ag-row-height: 24px;
  --ag-header-height: 34px;
  --ag-font-size: 12px;
}
.ag-theme-alpine .ag-root-wrapper { border: none; }
html .ag-theme-alpine .ag-root-wrapper { background-color: #0d1f35; }
.ag-theme-alpine .ag-header, .ag-theme-alpine .ag-header-row { background: #1a3a5c !important; }
.ag-theme-alpine .ag-header { border-bottom: 2px solid #f5a623; }
.ag-theme-alpine .ag-header-cell-label { color: #e8f0f8 !important; font-size: 11.5px; font-weight: 600; white-space: normal; line-height: 1.15; }
.ag-theme-alpine .ag-pinned-left-header { background: #152d4a !important; }
.ag-theme-alpine .ag-cell { font-size: 12px; padding-top: 2px; padding-bottom: 2px; font-variant-numeric: tabular-nums; }

/* Where a person types: yellow, as the Excel FC tool's input cells. */
.ag-theme-alpine .ag-cell.fc-typeable, .fc-typeable { background: #fff2cc; cursor: text; }
.ag-theme-alpine .ag-cell.fc-typeable:hover { outline: 1px solid #f5a623; outline-offset: -1px; }
.ag-theme-alpine .ag-cell.fc-actual { color: #4a5a6a; }
.ag-theme-alpine .ag-cell.fc-comment { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-descr { display: inline-flex; align-items: center; gap: 4px; }
.fc-inactive { color: #d00000; font-weight: 800; }
.fc-dup { color: #c06000; font-weight: 800; }

/* The submit question, in the page (no browser dialog). */
.fc-confirm { position: fixed; inset: 0; background: rgba(5, 12, 22, .65); z-index: 1000;
  display: flex; align-items: center; justify-content: center; }
.fc-confirm-box { background: #13283f; border: 1px solid #f5a623; border-radius: 6px; padding: 18px 20px;
  max-width: 440px; color: #d0e4f4; font-size: .9rem; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.fc-confirm-box p { margin: 0 0 16px; line-height: 1.45; }
.fc-confirm-buttons { display: flex; justify-content: flex-end; gap: 10px; }

.fc-signin p { font-size: .9rem; }

button {
  padding: 5px 14px; border: 1px solid #3a5a7a; border-radius: 3px;
  cursor: pointer; font-size: 12px; background: #1e3a58; color: #b8d0e8;
  transition: all .15s;
}
button:hover:not(:disabled) { background: #254870; color: white; border-color: #5a7a9a; }
button:disabled { opacity: .4; cursor: default; }
