/**
 * Portable Solution Estimator Suite – Shell styles.
 * Layout: header, nav, main (panels), footer. Only one panel visible at a time.
 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /*
   * Shell pilot: active tab top/bottom inset + .main-content left stripe (Consumables + Pharmaceuticals).
   * Consumables: violet — clear of in-sheet greens/sky/amber.
   * Pharmaceuticals: vivid cyan — contrast vs violet; if revisiting, try in order:
   *   #0891b2 (deeper cyan), #65a30d (lime), #0f172a (ink), #ea580c (orange), #9a3412 (copper),
   *   #155e75 (dark cyan, earlier pick).
   * If extending to other calcs, pick hues that skip scenario/deployment/requirement/UCD colors in each sheet.
   */
  --shell-accent-consumables: #6d28d9;
  --shell-accent-pharmaceuticals: #06b6d4;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: #1a1a1a;
  background: #f5f5f5;
}

.shell-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header --- */
.shell-header {
  background: #1e3a5f;
  color: #fff;
  padding: 0.75rem 1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.shell-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.shell-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.shell-nav-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.shell-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.shell-nav-btn.active {
  background: #fff;
  color: #1e3a5f;
  border-color: #fff;
}

/* Pilot: active tab top + bottom bars = same color as panel stripe (Consumables + Pharmaceuticals only) */
.shell-nav-btn[data-panel="panel-consumables"].active {
  box-shadow:
    inset 0 3px 0 0 var(--shell-accent-consumables),
    inset 0 -3px 0 0 var(--shell-accent-consumables);
}

.shell-nav-btn[data-panel="panel-medications"].active {
  box-shadow:
    inset 0 3px 0 0 var(--shell-accent-pharmaceuticals),
    inset 0 -3px 0 0 var(--shell-accent-pharmaceuticals);
}

/* Pilot: content panel left stripe (scrolls with calc body; hidden in print) */
#panel-consumables:not([hidden]) > .calc-app > .main-content {
  border-left: 5px solid var(--shell-accent-consumables);
}

#panel-medications:not([hidden]) > .container > .main-content {
  border-left: 5px solid var(--shell-accent-pharmaceuticals);
}

/* --- UCD buttons (Consumables + Medicines; single source) --- */
.btn-ucd {
  /* UC Davis CA: Aggie Blue (readable blue), Aggie Gold #FFBF00 */
  background: #0d4a87;
  color: #ffffff;
  border: 2px solid #FFBF00;
  font-weight: 700;
}
.btn-ucd:hover {
  background: #0a3d70;
  color: #ffffff;
  border-color: #FFBF00;
}
.btn-ucd.active {
  background: #0a3d70;
  color: #ffffff;
  box-shadow: inset 0 0 0 2px #FFBF00;
}

/* --- Main (panels) --- */
.shell-main {
  flex: 1;
  padding: 1rem;
  overflow: auto;
  scrollbar-gutter: stable;
}

.calc-panel {
  display: none;
  max-width: 1200px;
  margin: 0 auto;
}

.calc-panel[hidden] {
  display: none !important;
}

.calc-panel:not([hidden]) {
  display: block;
}


/* Suite build line in each calc panel footer (Portable-Solution-Estimator-Suite only — light type) */
.shell-main .shell-suite-build[data-suite-version] {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.35;
  color: #9a9a9a;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* --- Shell toast (optional shared) --- */
.shell-toast {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  max-width: 90vw;
}

.shell-toast[hidden] {
  display: none !important;
}

.shell-toast--info {
  background: #1e3a5f;
  color: #fff;
}

.shell-toast--success {
  background: #0d6b4c;
  color: #fff;
}

.shell-toast--error {
  background: #b91c1c;
  color: #fff;
}

.shell-toast--warn {
  background: #b45309;
  color: #fff;
}

/* --- Shell modal dialog --- */
.shell-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.shell-modal-overlay[hidden] { display: none !important; }

.shell-modal-panel {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  padding: 22px 26px 18px;
  min-width: 320px;
  max-width: 480px;
  width: 100%;
  animation: shell-modal-enter 0.15s ease-out;
}

@keyframes shell-modal-enter {
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.shell-modal-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e3a5f;
}

.shell-modal-message {
  margin: 0 0 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #334155;
  word-wrap: break-word;
}

.shell-modal-input {
  display: block;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 16px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
}

.shell-modal-input:focus {
  border-color: #1e3a5f;
  box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.15);
}

.shell-modal-input[hidden] { display: none !important; }

.shell-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.shell-modal-btn {
  padding: 7px 18px;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.shell-modal-btn--cancel {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

.shell-modal-btn--cancel:hover { background: #e2e8f0; }

.shell-modal-btn--ok {
  background: #1e3a5f;
  color: #fff;
}

.shell-modal-btn--ok:hover { background: #163050; }
.shell-modal-btn--ok:focus-visible { box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.4); }

@media (max-width: 480px) {
  .shell-modal-panel { min-width: auto; padding: 18px 16px 14px; }
  .shell-modal-actions { flex-direction: column-reverse; }
  .shell-modal-btn { width: 100%; text-align: center; }
}

@media print {
  .shell-modal-overlay { display: none !important; }
  .shell-header,
  .shell-toast { display: none !important; }

  .shell-main { padding: 0; }

  .calc-panel[hidden] { display: none !important; }

  .calc-panel:not([hidden]) {
    display: block !important;
    max-width: 100%;
  }

  #panel-consumables:not([hidden]) > .calc-app > .main-content,
  #panel-medications:not([hidden]) > .container > .main-content {
    border-left: none !important;
  }
}
