/* Apollo Supply Command Center - core theme foundation
   Adapted from the SpyderNet SOE engine's light/dark CSS-variable
   mechanism (soe-core.css), copied and re-skinned for this project -
   this file has no dependency on the SpyderNet folder at runtime.

   Accent palette is NOT invented here - it's ported from the source
   Apps Script's own APOLLO_COMMAND_CENTER.COLORS (Dashboard Module),
   which already assigned meaning per color (blue/green/yellow/red/
   purple/cyan/orange). Dark mode uses those values directly. Light
   mode uses deepened variants of the same hues for text contrast
   (never reuse a dark-tuned hex as body text on a light surface).
*/
:root {
  --apollo-bg:#eef1f5;
  --apollo-surface:rgba(255,255,255,.66);
  --apollo-surface-solid:#f7f9fb;
  --apollo-header:#ffffff;
  --apollo-card:#ffffff;
  --apollo-text:#0f1b28;
  --apollo-muted:#4b5f72;
  --apollo-line:rgba(15,27,40,.12);
  --apollo-shadow:0 18px 40px rgba(15,23,42,.08);

  --apollo-blue:#1d6fe0;
  --apollo-green:#1e9e52;
  --apollo-yellow:#c98a00;
  --apollo-red:#d93636;
  --apollo-purple:#7c3aed;
  --apollo-cyan:#0891b2;
  --apollo-orange:#d97706;
}

html[data-apollo-theme="dark"] {
  --apollo-bg:#061321;
  --apollo-surface:#0e2940;
  --apollo-surface-solid:#0e2940;
  --apollo-header:#081d31;
  --apollo-card:#12334d;
  --apollo-text:#d9e7f3;
  --apollo-muted:#92a9bc;
  --apollo-line:#2a5578;
  --apollo-shadow:0 18px 40px rgba(0,0,0,.35);

  --apollo-blue:#4c9aff;
  --apollo-green:#2ecc71;
  --apollo-yellow:#f4b942;
  --apollo-red:#ff5b5b;
  --apollo-purple:#af7cff;
  --apollo-cyan:#45d1d8;
  --apollo-orange:#f39c12;
}

* { box-sizing:border-box; }

html { min-height:100%; background:var(--apollo-bg); }

body {
  margin:0;
  min-height:100vh;
  color:var(--apollo-text);
  background:var(--apollo-bg);
  font-family:Inter, "Segoe UI", Arial, sans-serif;
  overflow-x:hidden;
}

a { color:inherit; }

.apollo-content {
  width:min(1500px, calc(100% - 48px));
  margin:22px auto;
}

.apollo-header {
  background:var(--apollo-header);
  border-bottom:2px solid var(--apollo-blue);
}

.apollo-header-inner {
  width:min(1500px, calc(100% - 48px));
  margin:0 auto;
  padding:14px 0;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:12px 16px;
}

.apollo-header-brand-link {
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  width:fit-content;
}
.apollo-header-brand-link:hover .apollo-header-title {
  color:var(--apollo-blue);
}

.apollo-header-logo {
  height:40px;
  width:40px;
  border-radius:50%;
}

.apollo-header-title {
  font-size:22px;
  font-weight:800;
  color:var(--apollo-text);
}

.apollo-header-subtitle {
  font-size:12px;
  font-weight:700;
  letter-spacing:.04em;
  color:var(--apollo-blue);
}

.apollo-header-live {
  text-align:center;
  line-height:1.2;
}
.apollo-clock-time {
  font-size:20px;
  font-weight:800;
  font-variant-numeric:tabular-nums;
  color:var(--apollo-text);
}
.apollo-clock-date {
  font-size:11px;
  color:var(--apollo-muted);
}
.apollo-weather-line {
  font-size:11px;
  color:var(--apollo-muted);
  margin-top:2px;
}

.apollo-header-nav {
  display:flex;
  gap:8px;
}
.apollo-header-nav a {
  background:var(--apollo-surface-solid);
  color:var(--apollo-text);
  border:1px solid var(--apollo-line);
  border-radius:10px;
  padding:8px 14px;
  font-size:12px;
  font-weight:700;
  text-decoration:none;
}
.apollo-header-nav a:hover {
  border-color:var(--apollo-blue);
  color:var(--apollo-blue);
}

.apollo-theme-toggle {
  background:var(--apollo-surface-solid);
  color:var(--apollo-text);
  border:1px solid var(--apollo-line);
  border-radius:10px;
  padding:8px 14px;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}

.apollo-theme-toggle:hover {
  border-color:var(--apollo-blue);
  color:var(--apollo-blue);
}

.apollo-card {
  background:var(--apollo-card);
  color:var(--apollo-text);
  border:1px solid var(--apollo-line);
  border-radius:16px;
  box-shadow:var(--apollo-shadow);
  padding:20px;
  margin:16px 0;
}

.apollo-card h2 {
  margin:0 0 12px;
  color:var(--apollo-blue);
  font-size:20px;
}

.apollo-footer {
  width:min(1500px, calc(100% - 48px));
  margin:24px auto 0;
  padding:14px 0 18px;
  display:flex;
  justify-content:center;
  border-top:1px solid var(--apollo-line);
  color:var(--apollo-muted);
  font-size:12px;
}

.apollo-blue { color:var(--apollo-blue); }
.apollo-green { color:var(--apollo-green); }
.apollo-yellow { color:var(--apollo-yellow); }
.apollo-red { color:var(--apollo-red); }
.apollo-purple { color:var(--apollo-purple); }
.apollo-cyan { color:var(--apollo-cyan); }
.apollo-orange { color:var(--apollo-orange); }

.apollo-btn {
  display:inline-block;
  background:var(--apollo-blue);
  color:#ffffff;
  border:none;
  border-radius:10px;
  padding:9px 16px;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
  text-decoration:none;
}
.apollo-btn:hover { filter:brightness(1.08); }
.apollo-btn-secondary {
  background:var(--apollo-surface-solid);
  color:var(--apollo-text);
  border:1px solid var(--apollo-line);
}
.apollo-btn-danger { background:var(--apollo-red); }
.apollo-btn-sm { padding:5px 10px; font-size:11px; border-radius:8px; }

.apollo-combobox {
  position:relative;
  width:200px;
}
.apollo-combobox-input {
  width:100%;
  background:var(--apollo-surface-solid);
  color:var(--apollo-text);
  border:1px solid var(--apollo-line);
  border-radius:8px;
  padding:8px 28px 8px 10px;
  font-size:13px;
  font-family:inherit;
}
/* Standing pattern: every search/filter input gets an [x] clear
   button - shown only once there's text to clear (toggled via JS). */
.apollo-combobox-clear {
  display:none;
  position:absolute;
  top:50%;
  right:6px;
  transform:translateY(-50%);
  width:20px;
  height:20px;
  border:none;
  border-radius:50%;
  background:transparent;
  color:var(--apollo-muted);
  font-size:15px;
  line-height:1;
  cursor:pointer;
  padding:0;
}
.apollo-combobox-clear:hover {
  background:var(--apollo-line);
  color:var(--apollo-text);
}
.apollo-combobox-clear.apollo-combobox-clear-visible { display:block; }
.apollo-combobox-dropdown {
  display:none;
  position:absolute;
  top:calc(100% + 4px);
  left:0;
  right:0;
  max-height:240px;
  overflow-y:auto;
  background:var(--apollo-card);
  border:1px solid var(--apollo-line);
  border-radius:8px;
  box-shadow:var(--apollo-shadow);
  z-index:30;
}
.apollo-combobox-dropdown.apollo-combobox-open { display:block; }
.apollo-combobox-option {
  padding:7px 10px;
  font-size:12px;
  cursor:pointer;
  color:var(--apollo-text);
}
.apollo-combobox-option:hover,
.apollo-combobox-option.apollo-combobox-active {
  background:var(--apollo-surface-solid);
  color:var(--apollo-blue);
}
.apollo-combobox-empty {
  padding:7px 10px;
  font-size:12px;
  color:var(--apollo-muted);
}

.apollo-form-row {
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-bottom:12px;
}
.apollo-form-row label {
  font-size:11px;
  font-weight:700;
  color:var(--apollo-muted);
  text-transform:uppercase;
  letter-spacing:.03em;
}
.apollo-form-row input,
.apollo-form-row select,
.apollo-form-row textarea {
  background:var(--apollo-surface-solid);
  color:var(--apollo-text);
  border:1px solid var(--apollo-line);
  border-radius:8px;
  padding:8px 10px;
  font-size:13px;
  font-family:inherit;
}
.apollo-form-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(160px, 1fr));
  gap:10px 14px;
}
.apollo-form-actions {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:8px;
}

.apollo-notice {
  padding:10px 14px;
  border-radius:10px;
  font-size:12px;
  font-weight:700;
  margin-bottom:14px;
}
.apollo-notice-success { background:rgba(30,158,82,.14); color:var(--apollo-green); }
.apollo-notice-error { background:rgba(217,54,54,.14); color:var(--apollo-red); }

.apollo-launcher-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));
  gap:14px;
}
.apollo-launcher-card {
  display:block;
  background:var(--apollo-card);
  border:1px solid var(--apollo-line);
  border-radius:16px;
  padding:20px;
  text-decoration:none;
  color:var(--apollo-text);
}
.apollo-launcher-card:hover { border-color:var(--apollo-blue); }
.apollo-launcher-card h3 { margin:0 0 6px; font-size:16px; }
.apollo-launcher-card p { margin:0; font-size:12px; color:var(--apollo-muted); }

.apollo-roster-card {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  background:var(--apollo-card);
  border:2px solid var(--apollo-line);
  border-radius:16px;
  padding:18px 12px;
  cursor:pointer;
  user-select:none;
  text-align:center;
  transition:border-color .12s ease, background .12s ease;
}
.apollo-roster-card:hover { border-color:var(--apollo-blue); }
.apollo-roster-present {
  border-color:var(--apollo-green);
  background:rgba(30,158,82,.14);
}
html[data-apollo-theme="dark"] .apollo-roster-present {
  background:rgba(46,204,113,.16);
}
.apollo-roster-name { font-size:15px; font-weight:800; color:var(--apollo-text); }
.apollo-roster-type { font-size:11px; color:var(--apollo-muted); text-transform:uppercase; }
.apollo-roster-present .apollo-roster-type { color:var(--apollo-green); }

.apollo-roster-blue {
  border-color:var(--apollo-blue);
  background:rgba(29,111,224,.10);
}
html[data-apollo-theme="dark"] .apollo-roster-blue {
  background:rgba(76,154,255,.12);
}
.apollo-roster-empty {
  border-style:dashed;
  border-color:var(--apollo-line);
  background:transparent;
}
.apollo-roster-empty .apollo-roster-name { color:var(--apollo-muted); font-weight:600; }

.apollo-roster-inline {
  display:none;
  flex-direction:column;
  gap:6px;
  width:100%;
  margin-top:8px;
}
.apollo-roster-inline.apollo-roster-inline-open { display:flex; }
.apollo-roster-inline input[type="text"] {
  width:100%;
  background:var(--apollo-surface-solid);
  color:var(--apollo-text);
  border:1px solid var(--apollo-line);
  border-radius:8px;
  padding:6px 8px;
  font-size:12px;
  font-family:inherit;
}

.apollo-roster-columns {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
@media (max-width:900px) {
  .apollo-roster-columns { grid-template-columns:1fr; }
}

@media (max-width:980px) {
  .apollo-content,
  .apollo-footer {
    width:calc(100% - 24px);
  }
  .apollo-header-inner {
    width:calc(100% - 24px);
  }
}

@media (max-width:640px) {
  .apollo-header-live {
    display:none;
  }
  .apollo-header-inner {
    justify-content:center;
  }
  .apollo-header-titles {
    width:100%;
    text-align:center;
  }
}
