/* TOFS Console layout on top of the TCAMS landing tokens. */
html, body, .dash-app, #tofs-root {
  font-family: "Times New Roman", Times, serif !important;
}

.tofs-shell {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 8% -10%, rgba(15, 90, 166, 0.22), transparent 55%),
    radial-gradient(900px 420px at 92% 0%, rgba(15, 118, 110, 0.14), transparent 50%),
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 240px),
    var(--bg-page);
  color: var(--text-primary);
  background-attachment: fixed;
}

@keyframes tofs-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tofs-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

.tofs-animate {
  animation: tofs-fade-up 0.55s ease both;
}

.tofs-kpis .tofs-kpi:nth-child(2) { animation-delay: 0.04s; }
.tofs-kpis .tofs-kpi:nth-child(3) { animation-delay: 0.08s; }
.tofs-kpis .tofs-kpi:nth-child(4) { animation-delay: 0.12s; }
.tofs-kpis .tofs-kpi:nth-child(5) { animation-delay: 0.16s; }
.tofs-kpis .tofs-kpi:nth-child(6) { animation-delay: 0.2s; }
.tofs-kpis .tofs-kpi:nth-child(7) { animation-delay: 0.24s; }
.tofs-kpis .tofs-kpi:nth-child(8) { animation-delay: 0.28s; }

.tofs-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}

.tofs-brand-copy small {
  display: block;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.tofs-login {
  width: min(440px, 100%);
  margin: 0;
  padding: 28px 28px 22px;
  box-sizing: border-box;
}

.tofs-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 140px;
}

.tofs-login-btn:disabled {
  opacity: 0.75;
  cursor: progress;
}

.tofs-btn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: tofs-btn-spin 0.7s linear infinite;
}

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

.tofs-desk-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}

.tofs-desk {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  font-size: 0.9rem;
}

.tofs-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 18px 0 24px;
}

.tofs-kpi {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent), var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tofs-kpi:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 90, 166, 0.45);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.tofs-kpi .label {
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tofs-kpi .value {
  font-size: 1.55rem;
  font-weight: 700;
  margin-top: 6px;
}

.tofs-kpi .hint {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-top: 4px;
}

.tofs-link-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font-family: "Times New Roman", Times, serif;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
}

a.tofs-link-btn,
a.tofs-btn {
  text-decoration: none;
  color: inherit;
}

a.tofs-btn {
  color: #fff;
}

.tofs-download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.tofs-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tofs-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.tofs-modal-panel {
  position: relative;
  z-index: 1;
  width: min(1100px, 96vw);
  max-height: 86vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 18px 20px 20px;
}

.tofs-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.tofs-modal-head h3 {
  margin: 0;
}

.tofs-company-summary-panel {
  width: min(1080px, 96vw);
}

.tofs-company-summary-body {
  overflow: auto;
  max-height: 70vh;
  display: grid;
  gap: 18px;
  padding-right: 4px;
}

.tofs-summary-section h4 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.tofs-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px 14px;
}

.tofs-summary-kv {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.tofs-theme-light .tofs-summary-kv {
  background: #f7f8fa;
}

.tofs-summary-k {
  font-size: 12px;
  opacity: 0.72;
}

.tofs-summary-v {
  font-size: 13px;
  word-break: break-word;
}

.tofs-alerts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
  margin: 4px 0 12px;
}

.tofs-alert {
  border-radius: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
}

.tofs-alert strong {
  display: block;
  font-size: 13px;
  line-height: 1.3;
}

.tofs-alert p {
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.35;
}

.tofs-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
  gap: 8px;
  margin: 0 0 14px;
}

.tofs-note {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  min-width: 0;
}

.tofs-note strong {
  display: block;
  font-size: 13px;
  line-height: 1.3;
  margin-bottom: 2px;
}

.tofs-note p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text-secondary);
}

.tofs-alert.is-high {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.tofs-alert.is-medium {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
}

.tofs-alert.is-info {
  border-color: var(--accent-primary);
  background: var(--accent-primary-light);
}

.tofs-section {
  margin: 28px 0;
}

.tofs-section-block {
  margin: 0 0 22px;
}

.tofs-desk-body > .tofs-card,
.tofs-desk-body > .tofs-split,
.tofs-desk-body > .tofs-kpis,
.tofs-desk-body > .tofs-report,
.tofs-desk-body > .tofs-alerts {
  margin-bottom: 22px;
}

.tofs-split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
}

.tofs-split > .tofs-card {
  margin-bottom: 0;
}

.tofs-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), transparent 40%), var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 22px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tofs-card:hover {
  border-color: rgba(127, 179, 255, 0.28);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
}

.tofs-livebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 18px;
  margin: 18px 0 8px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(127, 179, 255, 0.22);
  background: linear-gradient(90deg, rgba(15, 90, 166, 0.18), rgba(15, 118, 110, 0.10));
  backdrop-filter: blur(8px);
  text-align: center;
}

.tofs-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
}

.tofs-live-dot.is-live {
  background: #22c55e;
  animation: tofs-pulse 1.8s ease-out infinite;
}

.tofs-live-dot.is-stale {
  background: #fbbf24;
}

.tofs-live-dot.is-refresh {
  background: #38bdf8;
  animation: tofs-pulse 1.1s ease-out infinite;
}

.tofs-live-status {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.tofs-livebar-copy {
  display: grid;
  gap: 2px;
  text-align: center;
  justify-items: center;
}

.tofs-livebar-copy strong {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.tofs-live-stamp {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.tofs-live-meta {
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.12);
}

.tofs-forecast-panel {
  overflow: hidden;
}

.tofs-forecast-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin: 4px 0 14px;
}

.tofs-forecast-note {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 90, 166, 0.08);
}

.tofs-forecast-note h4 {
  margin: 0 0 6px;
  font-size: 0.9rem;
}

.tofs-forecast-note p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.35;
}

.tofs-horizon {
  display: grid;
  gap: 6px;
  justify-items: end;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tofs-horizon-radio label {
  margin-right: 10px !important;
  color: var(--text-primary) !important;
  font-size: 0.9rem !important;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}

.tofs-detail {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.tofs-detail dt {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tofs-detail dd {
  margin: 0 0 10px;
  color: var(--text-primary);
}

.tofs-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 12px 0 16px;
}

.tofs-login input,
.tofs-toolbar input,
.tofs-card input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(0,0,0,0.25);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
}

.Select-control, .Select-menu-outer, .VirtualizedSelectOption {
  font-family: "Times New Roman", Times, serif !important;
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td,
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th {
  font-family: "Times New Roman", Times, serif !important;
}

/* Keep filter/export text readable on navy and light desks */
.dash-spreadsheet-container .dash-spreadsheet-inner input.dash-filter--case,
.dash-spreadsheet-container .dash-spreadsheet-inner .dash-filter input,
.dash-table-container .dash-spreadsheet .dash-filter input,
.tofs-table-card .dash-filter input,
.tofs-modal .dash-filter input {
  color: #f5f7fb !important;
  background-color: #0b1220 !important;
  caret-color: #f5f7fb !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 4px !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #f5f7fb !important;
}

.dash-spreadsheet-container .dash-spreadsheet-inner .dash-filter input::placeholder,
.tofs-table-card .dash-filter input::placeholder,
.tofs-modal .dash-filter input::placeholder {
  color: rgba(245, 247, 251, 0.6) !important;
  opacity: 1 !important;
  -webkit-text-fill-color: rgba(245, 247, 251, 0.6) !important;
}

.tofs-theme-light .dash-spreadsheet-container .dash-spreadsheet-inner .dash-filter input,
.tofs-theme-light .tofs-table-card .dash-filter input,
.tofs-theme-light .tofs-modal .dash-filter input {
  color: #1f2937 !important;
  background-color: #ffffff !important;
  caret-color: #1f2937 !important;
  border: 1px solid #d9dce1 !important;
  -webkit-text-fill-color: #1f2937 !important;
}

.tofs-theme-light .dash-spreadsheet-container .dash-spreadsheet-inner .dash-filter input::placeholder,
.tofs-theme-light .tofs-table-card .dash-filter input::placeholder {
  color: rgba(31, 41, 55, 0.45) !important;
  -webkit-text-fill-color: rgba(31, 41, 55, 0.45) !important;
}

.dash-spreadsheet-menu,
.dash-spreadsheet-menu button,
.export,
.dash-table-container .export {
  color: var(--text-primary) !important;
  font-family: "Times New Roman", Times, serif !important;
}

.tofs-table-tools {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.tofs-table-count {
  color: var(--text-muted);
  white-space: nowrap;
}

/* Selection / focus must keep readable contrast (Dash defaults to light pink/white). */
.dash-spreadsheet-inner table {
  --selected-background: #1e3a5f !important;
  --selected-color: #f8fafc !important;
  --accent: #3b82f6 !important;
  --text-color: #f5f7fb !important;
  --hover: #243556 !important;
}

.tofs-theme-light .dash-spreadsheet-inner table {
  --selected-background: #dbeafe !important;
  --selected-color: #0f172a !important;
  --text-color: #1f2937 !important;
  --hover: #e8f0fe !important;
}

.dash-table-container .dash-spreadsheet-inner td.cell--selected,
.dash-table-container .dash-spreadsheet-inner td.focused,
.dash-table-container .dash-spreadsheet-inner tr:has(input[type="checkbox"]:checked) td {
  background-color: #1e3a5f !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}

.dash-table-container .dash-spreadsheet-inner td.cell--selected *,
.dash-table-container .dash-spreadsheet-inner td.focused *,
.dash-table-container .dash-spreadsheet-inner tr:has(input[type="checkbox"]:checked) td * {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}

.tofs-theme-light .dash-table-container .dash-spreadsheet-inner td.cell--selected,
.tofs-theme-light .dash-table-container .dash-spreadsheet-inner td.focused,
.tofs-theme-light .dash-table-container .dash-spreadsheet-inner tr:has(input[type="checkbox"]:checked) td {
  background-color: #dbeafe !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

.tofs-theme-light .dash-table-container .dash-spreadsheet-inner td.cell--selected *,
.tofs-theme-light .dash-table-container .dash-spreadsheet-inner td.focused *,
.tofs-theme-light .dash-table-container .dash-spreadsheet-inner tr:has(input[type="checkbox"]:checked) td * {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

.dash-table-container .dash-spreadsheet-inner td input.dash-cell-value {
  background-color: #0b1220 !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  caret-color: #f8fafc !important;
}

.tofs-theme-light .dash-table-container .dash-spreadsheet-inner td input.dash-cell-value {
  background-color: #ffffff !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a !important;
}

.dash-table-container .dash-spreadsheet-inner tr:hover td {
  outline: 1px solid rgba(127, 179, 255, 0.28);
  outline-offset: -1px;
}

.dash-table-container .dash-spreadsheet-inner .dash-cell-value::selection,
.dash-table-container .dash-spreadsheet-inner td::selection {
  background: #2563eb !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.tofs-crumb {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 8px 0 4px;
}

.tofs-card table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
.tofs-card th, .tofs-card td {
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  padding: 0.4rem 0.55rem;
  vertical-align: top;
}
.tofs-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tofs-report { margin: 28px 0 36px; }
.tofs-report h2 { margin: 0 0 6px; font-size: 1.25rem; }

.tofs-btn {
  display: inline-block;
  margin: 8px 0;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  color: #fff;
  font-family: "Times New Roman", Times, serif;
  font-size: 1rem;
  cursor: pointer;
}

.tofs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 12px 22px 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent), var(--bg-card);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.tofs-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  padding-right: 4px;
}

.tofs-header-actions .tofs-crumb {
  margin: 0;
}

.tofs-signout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  margin: 0 4px 0 8px;
  padding: 8px 16px;
  border: 1px solid rgba(127, 179, 255, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(15, 90, 166, 0.22);
  color: #f5f7fb !important;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none !important;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.tofs-signout:hover {
  background: rgba(15, 90, 166, 0.4);
  border-color: rgba(127, 179, 255, 0.65);
  transform: translateY(-1px);
}

.tofs-theme-light .tofs-signout {
  background: rgba(15, 90, 166, 0.12);
  border-color: rgba(15, 90, 166, 0.35);
  color: #1f2937 !important;
}

.tofs-brand-copy {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tofs-login input,
.tofs-toolbar input,
.tofs-card input {
  width: 100%;
  padding: 10px 12px;
  margin: 6px 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-section);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
}

.tofs-popover { position: relative; }
.tofs-popover-btn {
  list-style: none;
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--accent-primary-light);
  color: var(--text-primary);
}
.tofs-popover-btn::-webkit-details-marker { display: none; }
.tofs-popover-panel {
  position: absolute;
  right: 0;
  top: 110%;
  z-index: 20;
  width: 320px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  color: var(--text-secondary);
}

.tofs-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 18px 48px;
}

.tofs-theme-bar {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
}

html:has(.tofs-theme-light),
body:has(.tofs-theme-light),
.tofs-theme-light {
  --bg-page: #f5f6f8;
  --bg-section: #eef1f6;
  --bg-card: #ffffff;
  --bg-card-hover: #f7f8fa;
  --border-subtle: #e3e6eb;
  --border-strong: #d9dce1;
  --text-primary: #1f2937;
  --text-secondary: #44403c;
  --text-muted: #78716c;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.10);
  background: #f5f6f8 !important;
  color: #1f2937;
}

.tofs-theme-light .tofs-livebar {
  background: #ffffff;
  border-color: #e3e6eb;
}

.tofs-theme-light .tofs-forecast-note {
  background: rgba(15, 90, 166, 0.06);
}

.tofs-theme-light .tofs-live-meta {
  background: rgba(255, 255, 255, 0.55);
}

.dash-spreadsheet-container,
.dash-table-container {
  max-width: 100%;
  overflow-x: auto;
}

.js-plotly-plot,
.plot-container.plotly {
  max-width: 100%;
}

.dash-spreadsheet-menu {
  flex-wrap: wrap !important;
  max-width: 100%;
}

#page-chrome:has(.tofs-login) {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 32px 16px 80px;
  box-sizing: border-box;
}
.tofs-shell:has(.tofs-login) {
  min-height: 100vh;
}
.tofs-shell:has(.tofs-login) .tofs-main {
  display: none;
}
.tofs-login h1 {
  margin: 14px 0 8px;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.tofs-login > p {
  margin: 0 0 18px;
  color: var(--text-secondary);
  line-height: 1.45;
}
.tofs-login label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 700;
  color: var(--text-primary);
}
.tofs-login input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 4px;
  min-height: 42px;
  background: #fff;
  color: #1f2937;
}
.tofs-theme-navy .tofs-login input {
  background: #0e1a33;
  color: #f5f7fb;
  border-color: rgba(255, 255, 255, 0.18);
}
.tofs-login-btn {
  width: 100%;
  margin-top: 16px;
  height: 42px;
}
.tofs-login-hints {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.tofs-login-hints p {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 13px;
}
.tofs-theme-light .tofs-login {
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

@media (max-width: 900px) {
  .tofs-split { grid-template-columns: 1fr; }
  .tofs-login { padding: 22px 18px 16px; }
  .tofs-header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
  }
  .tofs-header-actions {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    gap: 8px;
  }
  .tofs-main,
  .tofs-main:has(.tofs-finance-erp) { padding: 0 12px 64px; }
  .tofs-desk-body h1 { font-size: 22px; margin-top: 14px; }
  .tofs-erp-head { align-items: flex-start; }
  .tofs-erp-frame { height: 78vh; min-height: 0; }
  .tofs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tofs-kpi { padding: 10px 12px; }
  .tofs-card:not(.tofs-login) { padding: 12px; margin-bottom: 12px; }
  .tofs-modal { padding: 8px; }
  .tofs-modal-panel {
    width: min(1100px, 100%);
    max-height: calc(100vh - 16px);
    padding: 12px;
  }
  .tofs-popover-panel { width: min(320px, calc(100vw - 24px)); }
  .tofs-theme-bar { right: 12px; left: auto; bottom: 12px; }
  .tofs-horizon { justify-items: start; }
  .tofs-incident-tag { margin-left: 0; }
  .tofs-card .tofs-incident-controls input { flex-basis: 100%; max-width: none; }
}

@media (max-width: 520px) {
  .tofs-notes,
  .tofs-alerts { grid-template-columns: 1fr; }
  .tofs-kpi .value { font-size: 1.15rem; }
  .tofs-signout { min-width: 0; padding: 7px 12px; }
  .tofs-live-stamp { font-size: 0.95rem; }
  .tofs-crumb { font-size: 0.85rem; }
}

/* Desk shell: same left icon rail and card presentation as CP-ERP. */
.tofs-shell:has(.tofs-side) {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  align-content: start;
  min-height: 100vh;
  background: #141414;
  color: #F5F5F7;
}
.tofs-shell:has(.tofs-side) > #page-chrome,
.tofs-chrome { display: contents; }
.tofs-side {
  grid-column: 1;
  grid-row: 1 / span 12;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: #191919;
  border-right: 1px solid #2A2A2A;
  padding: 18px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 40;
}
.tofs-side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.tofs-side .brand b { display: block; font-size: 18px; font-weight: 800; color: #fff; letter-spacing: -0.02em; line-height: 1.1; }
.tofs-side .brand span { font-size: 11.5px; color: #7A7A7A; }
.tofs-side .ngroup { margin-top: 10px; }
.tofs-side .nlabel { padding: 6px 10px; font-size: 11px; font-weight: 600; color: #7A7A7A; letter-spacing: 0.04em; }
.tofs-side .nlink {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #B3B3B3;
  font-size: 13.5px;
  font-weight: 500;
  margin: 1px 0;
  text-decoration: none;
}
.tofs-side .nlink:hover { background: #202020; color: #fff; }
.tofs-side .nlink.on { background: #fff; color: #102347; font-weight: 600; }
.tofs-side .nlink.on .ic { background: #E86B40; }
.tofs-side .side-foot { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid #2A2A2A; }
.tofs-side .side-out { color: #B3B3B3; font-size: 13px; text-decoration: none; }
.tofs-side .side-out:hover { color: #fff; }
.tofs-scrim { display: none; }
.tofs-top {
  grid-column: 2;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 28px;
  background: rgba(20, 20, 20, 0.94);
  border-bottom: 1px solid #2A2A2A;
}
.tofs-top .crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #7A7A7A; min-width: 0; }
.tofs-top .crumb b { color: #F5F5F7; font-weight: 600; }
.tofs-top .top-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tofs-top .me {
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 99px;
  background: #202020;
  border: 1px solid #333;
}
.tofs-hamb { display: none; border: 1px solid #333; background: #202020; color: #F5F5F7; width: 34px; height: 34px; border-radius: 8px; place-items: center; cursor: pointer; }
.tofs-shell:has(.tofs-side) > #live-bar,
.tofs-shell:has(.tofs-side) > #page-main,
.tofs-shell:has(.tofs-side) > #ops-incident-wrap,
.tofs-shell:has(.tofs-side) > #cs-incident-wrap {
  grid-column: 2;
  width: 100%;
  max-width: 1480px;
  margin: 0;
  padding-left: 28px;
  padding-right: 28px;
}
.tofs-shell:has(.tofs-side) > #page-main { padding-bottom: 88px; }
.tofs-ph { margin: 8px 0 18px; }
.tofs-phase { font-size: 11.5px; font-weight: 600; color: #B3B3B3; margin-bottom: 8px; }
.tofs-ph h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.025em; color: #fff; line-height: 1.15; }
.tofs-ph p { margin: 6px 0 0; color: #B3B3B3; font-size: 14px; max-width: 72ch; }
.tofs-shell:has(.tofs-side) .tofs-report { scroll-margin-top: 72px; }
.tofs-shell:has(.tofs-side) .tofs-report h2 { color: #fff; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.tofs-shell:has(.tofs-side) #cs-lookup,
.tofs-shell:has(.tofs-side) [id$="-sec"] { scroll-margin-top: 72px; }
.tofs-shell:has(.tofs-side) .tofs-card,
.tofs-shell:has(.tofs-side) .tofs-kpi,
.tofs-shell:has(.tofs-side) .tofs-note {
  background: #fff;
  color: #1F2937;
  border: 1px solid #E3E6EB;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.tofs-shell:has(.tofs-side) .tofs-card h3,
.tofs-shell:has(.tofs-side) .tofs-kpi .value,
.tofs-shell:has(.tofs-side) .tofs-note strong { color: #102347; }
.tofs-shell:has(.tofs-side) .tofs-kpi .label,
.tofs-shell:has(.tofs-side) .tofs-kpi .hint,
.tofs-shell:has(.tofs-side) .tofs-note p,
.tofs-shell:has(.tofs-side) .tofs-card .tofs-muted { color: #6B7280; }
.tofs-shell:has(.tofs-side) .tofs-kpi .value { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.tofs-shell:has(.tofs-side) .tofs-alerts { display: flex; flex-direction: column; gap: 10px; }
.tofs-shell:has(.tofs-side) .tofs-alert { color: #fff; border: 0; border-radius: 10px; padding: 13px 16px; }
.tofs-shell:has(.tofs-side) .tofs-alert.is-high { background: #C85757; }
.tofs-shell:has(.tofs-side) .tofs-alert.is-medium { background: #D9A33F; color: #102347; }
.tofs-shell:has(.tofs-side) .tofs-alert.is-info { background: #4A7B9D; }
.tofs-shell:has(.tofs-side) .tofs-alert p,
.tofs-shell:has(.tofs-side) .tofs-alert strong { color: inherit; }
.tofs-shell:has(.tofs-side) .tofs-alert p { opacity: 0.9; }
.tofs-shell.tofs-theme-light:has(.tofs-side) { background: #F5F6F8; color: #1F2937; }
.tofs-shell.tofs-theme-light:has(.tofs-side) .tofs-top { background: rgba(255,255,255,.94); border-bottom-color: #E3E6EB; }
.tofs-shell.tofs-theme-light:has(.tofs-side) .tofs-top .crumb b,
.tofs-shell.tofs-theme-light:has(.tofs-side) .tofs-ph h1,
.tofs-shell.tofs-theme-light:has(.tofs-side) .tofs-report h2 { color: #102347; }
.tofs-shell.tofs-theme-light:has(.tofs-side) .tofs-top .me { background: #F1F3F6; border-color: #D9DCE1; color: #102347; }
.ic {
  width: 17px;
  height: 17px;
  display: inline-block;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: var(--m) center / contain no-repeat;
  mask: var(--m) center / contain no-repeat;
}
.ic-home { --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z'/></svg>"); }
.ic-search { --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>"); }
.ic-users { --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'><path d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/><circle cx='9' cy='7' r='4'/><path d='M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/></svg>"); }
.ic-inbox { --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M22 12h-6l-2 3h-4l-2-3H2'/><path d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/></svg>"); }
.ic-lock { --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'><rect x='4' y='11' width='16' height='10' rx='2'/><path d='M8 11V7a4 4 0 0 1 8 0v4'/></svg>"); }
.ic-target { --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'><circle cx='12' cy='12' r='9'/><circle cx='12' cy='12' r='5'/><circle cx='12' cy='12' r='1'/></svg>"); }
.ic-file { --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'><path d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/><path d='M14 2v6h6M8 13h8M8 17h5'/></svg>"); }
.ic-bank { --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'><path d='M3 21h18M5 21v-9M19 21v-9M9.5 21v-9M14.5 21v-9M2 10l10-6 10 6z'/></svg>"); }
.ic-shield { --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'><path d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/><path d='m9 12 2 2 4-4'/></svg>"); }
.ic-percent { --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'><path d='M19 5 5 19'/><circle cx='6.5' cy='6.5' r='2.5'/><circle cx='17.5' cy='17.5' r='2.5'/></svg>"); }
.ic-chart { --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'><path d='M3 3v18h18'/><path d='m7 14 4-4 4 4 5-6'/></svg>"); }
.ic-alert { --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'><path d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/><path d='M12 9v4M12 17h.01'/></svg>"); }
.ic-receipt { --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'><path d='M4 2v20l3-2 3 2 3-2 3 2 3-2 1 1V2l-1 1-3-1-3 1-3-1-3 1-3-1z'/><path d='M8 8h8M8 12h8M8 16h5'/></svg>"); }
.ic-zap { --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'><path d='M13 2 3 14h9l-1 8 10-12h-9z'/></svg>"); }
.ic-chev { --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'><path d='m9 6 6 6-6 6'/></svg>"); }
.ic-menu { --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'><path d='M3 6h18M3 12h18M3 18h18'/></svg>"); }

@media (max-width: 900px) {
  .tofs-shell:has(.tofs-side) { grid-template-columns: minmax(0, 1fr); }
  .tofs-side {
    position: fixed;
    width: 252px;
    transform: translateX(-110%);
    transition: transform 0.2s ease;
  }
  .tofs-shell.side-open .tofs-side { transform: none; }
  .tofs-shell.side-open .tofs-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35; }
  .tofs-hamb { display: grid; }
  .tofs-top,
  .tofs-shell:has(.tofs-side) > #live-bar,
  .tofs-shell:has(.tofs-side) > #page-main,
  .tofs-shell:has(.tofs-side) > #ops-incident-wrap,
  .tofs-shell:has(.tofs-side) > #cs-incident-wrap { grid-column: 1; }
  .tofs-shell:has(.tofs-side) > #page-main,
  .tofs-shell:has(.tofs-side) > #live-bar { padding-left: 16px; padding-right: 16px; }
}

/* White cards keep dark text in both themes. Page chrome follows the theme. */
.tofs-theme-navy .tofs-theme-bar { color: #F5F5F7; background: #191919; }
.tofs-shell:has(.tofs-side) .tofs-card .tofs-link-btn,
.tofs-shell:has(.tofs-side) .tofs-kpi .tofs-link-btn,
.tofs-shell:has(.tofs-side) .tofs-download-row .tofs-link-btn {
  color: #102347;
  background: #fff;
  border-color: #D9DCE1;
}
.tofs-shell:has(.tofs-side) .tofs-table-tools,
.tofs-shell:has(.tofs-side) .tofs-table-count {
  color: #374151;
  background: #F7F8FA;
  border-color: #E3E6EB;
}
.tofs-shell:has(.tofs-side) .dash-spreadsheet-menu,
.tofs-shell:has(.tofs-side) .dash-spreadsheet-menu button,
.tofs-shell:has(.tofs-side) .export {
  color: #102347 !important;
}
.tofs-shell:has(.tofs-side) .tofs-forecast-note { background: #F7F8FA; border-color: #E3E6EB; }
.tofs-shell:has(.tofs-side) .tofs-forecast-note h4 { color: #102347; }
.tofs-shell:has(.tofs-side) .tofs-forecast-note p { color: #374151; }
.tofs-shell:has(.tofs-side) .tofs-card input:not(.dash-cell-value),
.tofs-shell:has(.tofs-side) .tofs-toolbar input:not(.dash-cell-value),
.tofs-shell:has(.tofs-side) .Select-control,
.tofs-shell:has(.tofs-side) .Select-value-label,
.tofs-shell:has(.tofs-side) .Select-placeholder,
.tofs-shell:has(.tofs-side) .Select-input input {
  background: #fff !important;
  color: #102347 !important;
  -webkit-text-fill-color: #102347 !important;
  border-color: #D9DCE1 !important;
}
.tofs-shell:has(.tofs-side) .tofs-card input:not(.dash-cell-value)::placeholder,
.tofs-shell:has(.tofs-side) .tofs-toolbar input:not(.dash-cell-value)::placeholder {
  color: #6B7280;
  -webkit-text-fill-color: #6B7280;
}
.tofs-shell:has(.tofs-side) .tofs-livebar {
  background: #102347;
  border-color: rgba(255,255,255,.12);
}
.tofs-shell:has(.tofs-side) .tofs-live-stamp { color: #fff; }
.tofs-shell:has(.tofs-side) .tofs-live-status,
.tofs-shell:has(.tofs-side) .tofs-livebar-copy strong,
.tofs-shell:has(.tofs-side) .tofs-live-meta { color: #D6DCE8; }
.tofs-theme-navy .dash-spreadsheet-inner td,
.tofs-theme-navy .dash-spreadsheet-inner th {
  background-color: #102347 !important;
  color: #f5f7fb !important;
  -webkit-text-fill-color: #f5f7fb !important;
}
.tofs-theme-navy .dash-spreadsheet-inner td .dash-cell-value {
  background-color: transparent !important;
  color: #f5f7fb !important;
  -webkit-text-fill-color: #f5f7fb !important;
}
.tofs-theme-navy .dash-spreadsheet-inner tbody tr:nth-child(even) td {
  background-color: #17305d !important;
}
.tofs-theme-navy .dash-spreadsheet-inner thead th {
  background-color: #0b1a36 !important;
}
.tofs-theme-navy .dash-spreadsheet-inner td.cell--selected,
.tofs-theme-navy .dash-spreadsheet-inner td.focused,
.tofs-theme-navy .dash-spreadsheet-inner tr:has(input[type="checkbox"]:checked) td {
  background-color: #1e3a5f !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}
.tofs-theme-light .dash-spreadsheet-inner td,
.tofs-theme-light .dash-spreadsheet-inner th,
.tofs-theme-light .dash-spreadsheet-inner td .dash-cell-value {
  color: #1f2937;
  -webkit-text-fill-color: #1f2937;
}
.tofs-theme-navy .modebar-btn path,
.tofs-theme-navy .modebar-btn svg { fill: #f5f7fb !important; }
.tofs-theme-light .modebar-btn path,
.tofs-theme-light .modebar-btn svg { fill: #102347 !important; }
.tofs-shell.tofs-theme-light:has(.tofs-side) .tofs-phase,
.tofs-shell.tofs-theme-light:has(.tofs-side) .tofs-ph p,
.tofs-shell.tofs-theme-light:has(.tofs-side) .tofs-top .crumb { color: #4B5563; }
.tofs-shell.tofs-theme-light:has(.tofs-side) .tofs-livebar {
  background: #fff;
  border-color: #E3E6EB;
}
.tofs-shell.tofs-theme-light:has(.tofs-side) .tofs-live-stamp { color: #102347; }
.tofs-shell.tofs-theme-light:has(.tofs-side) .tofs-live-status,
.tofs-shell.tofs-theme-light:has(.tofs-side) .tofs-livebar-copy strong,
.tofs-shell.tofs-theme-light:has(.tofs-side) .tofs-live-meta { color: #4B5563; }
.tofs-shell.tofs-theme-light:has(.tofs-side) .tofs-top .me,
.tofs-shell.tofs-theme-light:has(.tofs-side) .tofs-signout { color: #102347; }
