/* ==========================================================================
   DIGONTO HORIZON — MIDNIGHT INDUSTRIAL THEME (SHARED ACROSS ALL SQ HUES)
   ========================================================================== */
:root {
  color-scheme: dark;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;

  --horizon-rgb: 225, 85, 102;
  --horizon-hex: #e15566;

  --bg-sky: #040711;
  --bg-ground: #060a16;
  --surface-glass: rgba(11, 17, 32, 0.64);
  --surface-glass-hover: rgba(16, 24, 44, 0.86);
  --surface-pill: rgba(255, 255, 255, 0.05);
  --surface-input: rgba(4, 7, 17, 0.58);
  --surface-modal: rgba(9, 14, 28, 0.96);

  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --shadow-card: 0 22px 54px -16px rgba(0, 0, 0, 0.72);
}

html {
  scrollbar-gutter: stable;
}

html, body {
  min-height: 100%;
  font-family: var(--font-sans) !important;
  background-color: var(--bg-sky) !important;
  color: var(--text-primary) !important;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#horizonCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.horizon-stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Floating Horizon Topbar */
.hz-topbar {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 16px 24px 8px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.hz-topbar .hz-brand {
  justify-self: start;
}
.hz-topbar .hz-nav-strip {
  justify-self: center;
}

.hz-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.hz-brand-orb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 36%, rgba(148, 163, 184, 0.35) 0%, transparent 16%),
    radial-gradient(circle at 62% 58%, rgba(100, 116, 139, 0.28) 0%, transparent 20%),
    radial-gradient(circle at 46% 24%, rgba(148, 163, 184, 0.22) 0%, transparent 12%),
    radial-gradient(circle at 34% 32%, #ffffff 0%, #f1f5f9 45%, #cbd5e1 78%, #64748b 100%);
  box-shadow:
    0 0 16px rgba(248, 250, 252, 0.4),
    0 0 32px rgba(var(--horizon-rgb), 0.35),
    inset -5px -4px 8px rgba(15, 23, 42, 0.55);
}

.hz-nav-strip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-pill);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-x: auto;
}

.hz-nav-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 9px;
  border-radius: 999px;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
}

.hz-nav-pill:hover {
  color: var(--text-primary);
}

.hz-nav-pill.is-active {
  background: rgba(var(--horizon-rgb), 0.16);
  color: var(--horizon-hex);
  box-shadow: inset 0 0 0 1px rgba(var(--horizon-rgb), 0.38);
}

.hz-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-pill);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.hz-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* Midnight Glassmorphic Surface Adaptations (Preserving Printable Sheets!) */
.horizon-stage main .bg-white:not(.excel-sheet-wrapper):not(.sticker-card):not(.excel-sheet-wrapper *),
.horizon-stage main [class*="bg-white/"]:not(.excel-sheet-wrapper):not(.sticker-card):not(.excel-sheet-wrapper *),
.horizon-stage footer.bg-white,
.horizon-stage .fixed > .bg-white:not(.excel-sheet-wrapper) {
  background: var(--surface-glass) !important;
  border-color: var(--border-subtle) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-card);
  color: var(--text-primary) !important;
}

.horizon-stage main .bg-slate-50:not(.excel-sheet-wrapper *):not(.sticker-card *),
.horizon-stage main [class*="bg-slate-50/"]:not(.excel-sheet-wrapper *):not(.sticker-card *),
.horizon-stage main .bg-slate-100:not(.excel-sheet-wrapper *):not(.sticker-card *),
.horizon-stage main [class*="bg-slate-100/"]:not(.excel-sheet-wrapper *):not(.sticker-card *),
.horizon-stage main .bg-slate-200:not(.excel-sheet-wrapper *):not(.sticker-card *),
.horizon-stage .fixed .bg-slate-50:not(.excel-sheet-wrapper *),
.horizon-stage .fixed .bg-slate-100:not(.excel-sheet-wrapper *) {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: var(--border-subtle) !important;
  color: #cbd5e1 !important;
}

.horizon-stage main .bg-emerald-50:not(.excel-sheet-wrapper *),
.horizon-stage main [class*="bg-emerald-50/"]:not(.excel-sheet-wrapper *),
.horizon-stage .fixed .bg-emerald-50:not(.excel-sheet-wrapper *) {
  background: rgba(16, 185, 129, 0.14) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  color: #34d399 !important;
}

.horizon-stage main .bg-rose-50:not(.excel-sheet-wrapper *),
.horizon-stage main [class*="bg-rose-50/"]:not(.excel-sheet-wrapper *),
.horizon-stage .fixed .bg-rose-50:not(.excel-sheet-wrapper *) {
  background: rgba(244, 63, 94, 0.14) !important;
  border-color: rgba(244, 63, 94, 0.3) !important;
  color: #fda4af !important;
}

/* Map page accent classes (teal/blue/indigo/amber/violet) to each page's Horizon signature hue */
.horizon-stage main .bg-teal-50:not(.excel-sheet-wrapper *),
.horizon-stage main [class*="bg-teal-50/"]:not(.excel-sheet-wrapper *),
.horizon-stage main .bg-blue-50:not(.excel-sheet-wrapper *),
.horizon-stage main [class*="bg-blue-50/"]:not(.excel-sheet-wrapper *),
.horizon-stage main .bg-indigo-50:not(.excel-sheet-wrapper *),
.horizon-stage main [class*="bg-indigo-50/"]:not(.excel-sheet-wrapper *),
.horizon-stage main .bg-amber-50:not(.excel-sheet-wrapper *),
.horizon-stage main [class*="bg-amber-50/"]:not(.excel-sheet-wrapper *),
.horizon-stage .fixed .bg-blue-50:not(.excel-sheet-wrapper *),
.horizon-stage .fixed .bg-teal-50:not(.excel-sheet-wrapper *) {
  background: rgba(var(--horizon-rgb), 0.14) !important;
  border-color: rgba(var(--horizon-rgb), 0.35) !important;
  color: var(--horizon-hex) !important;
}
.horizon-stage main .border-teal-200:not(.excel-sheet-wrapper *),
.horizon-stage main .border-teal-300:not(.excel-sheet-wrapper *),
.horizon-stage main .border-teal-400:not(.excel-sheet-wrapper *),
.horizon-stage main .border-blue-200:not(.excel-sheet-wrapper *),
.horizon-stage main .border-indigo-200:not(.excel-sheet-wrapper *),
.horizon-stage main .border-amber-200:not(.excel-sheet-wrapper *) {
  border-color: rgba(var(--horizon-rgb), 0.38) !important;
}
.horizon-stage main .text-teal-900:not(.excel-sheet-wrapper *),
.horizon-stage main .text-teal-800:not(.excel-sheet-wrapper *),
.horizon-stage main .text-teal-700:not(.excel-sheet-wrapper *),
.horizon-stage main .text-teal-600:not(.excel-sheet-wrapper *),
.horizon-stage main .text-blue-700:not(.excel-sheet-wrapper *),
.horizon-stage main .text-blue-600:not(.excel-sheet-wrapper *),
.horizon-stage main .text-indigo-700:not(.excel-sheet-wrapper *),
.horizon-stage main .text-indigo-600:not(.excel-sheet-wrapper *),
.horizon-stage .fixed .text-blue-600:not(.excel-sheet-wrapper *),
.horizon-stage .fixed .text-blue-700:not(.excel-sheet-wrapper *) {
  color: var(--horizon-hex) !important;
}
.horizon-stage main .bg-teal-600:not(.excel-sheet-wrapper *),
.horizon-stage main .bg-blue-600:not(.excel-sheet-wrapper *),
.horizon-stage .fixed .bg-blue-600:not(.excel-sheet-wrapper *) {
  background-color: var(--horizon-hex) !important;
  color: #030712 !important;
}
.horizon-stage main .bg-teal-600:hover:not(.excel-sheet-wrapper *),
.horizon-stage main .bg-blue-600:hover:not(.excel-sheet-wrapper *) {
  filter: brightness(1.08);
}

/* Dark Glassmorphic Data Tables (PFP Release & AOP Chalan) */
.horizon-stage .release-table th,
.horizon-stage .aop-table th {
  background-color: rgba(15, 23, 42, 0.94) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}
.horizon-stage .release-table th.pink-th {
  background-color: rgba(244, 63, 94, 0.16) !important;
  border-color: rgba(244, 63, 94, 0.28) !important;
  color: #fda4af !important;
}
.horizon-stage .release-table td,
.horizon-stage .aop-table td {
  background-color: rgba(11, 17, 32, 0.55) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}
.horizon-stage .release-table tr:hover td,
.horizon-stage .aop-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.06) !important;
}
.horizon-stage .release-table tr.selected-row td {
  background-color: rgba(var(--horizon-rgb), 0.18) !important;
}
.horizon-stage .aop-table tfoot td {
  background-color: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #f8fafc !important;
}

.horizon-stage main .text-slate-900:not(.excel-sheet-wrapper *):not(.sticker-card *),
.horizon-stage main .text-slate-800:not(.excel-sheet-wrapper *):not(.sticker-card *),
.horizon-stage main .text-slate-700:not(.excel-sheet-wrapper *):not(.sticker-card *),
.horizon-stage .fixed .text-slate-900:not(.excel-sheet-wrapper *),
.horizon-stage .fixed .text-slate-800:not(.excel-sheet-wrapper *),
.horizon-stage .fixed .text-slate-700:not(.excel-sheet-wrapper *) {
  color: #f8fafc !important;
}

.horizon-stage main .text-slate-600:not(.excel-sheet-wrapper *):not(.sticker-card *),
.horizon-stage main .text-slate-500:not(.excel-sheet-wrapper *):not(.sticker-card *),
.horizon-stage main .text-slate-400:not(.excel-sheet-wrapper *):not(.sticker-card *),
.horizon-stage .fixed .text-slate-600:not(.excel-sheet-wrapper *),
.horizon-stage .fixed .text-slate-500:not(.excel-sheet-wrapper *),
.horizon-stage footer {
  color: #94a3b8 !important;
}

.horizon-stage main .border-slate-100:not(.excel-sheet-wrapper *),
.horizon-stage main .border-slate-200:not(.excel-sheet-wrapper *),
.horizon-stage main .border-slate-300:not(.excel-sheet-wrapper *),
.horizon-stage footer.border-t {
  border-color: var(--border-subtle) !important;
}

.horizon-stage main input:not([type="checkbox"]):not([type="radio"]):not(.excel-sheet-wrapper *),
.horizon-stage main select:not(.excel-sheet-wrapper *),
.horizon-stage main textarea:not(.excel-sheet-wrapper *),
.horizon-stage .fixed input:not([type="checkbox"]):not([type="radio"]),
.horizon-stage .fixed select,
.horizon-stage .fixed textarea {
  background-color: var(--surface-input) !important;
  border-color: var(--border-subtle) !important;
  color: #f8fafc !important;
}

.horizon-stage main input::placeholder,
.horizon-stage main textarea::placeholder,
.horizon-stage .fixed input::placeholder,
.horizon-stage .fixed textarea::placeholder {
  color: rgba(148, 163, 184, 0.32) !important;
  font-weight: 400 !important;
  opacity: 1 !important;
}

.horizon-stage main select option,
.horizon-stage .fixed select option {
  background-color: #0b1120;
  color: #f8fafc;
}

.horizon-stage main input:focus,
.horizon-stage main select:focus,
.horizon-stage main textarea:focus {
  border-color: var(--horizon-hex) !important;
  outline: none;
}

/* Unified Clean Drop Stage (Solid Release, Solid Manual, Sticker) */
.hz-drop-card {
  position: relative;
  background: transparent;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  border-radius: 1.5rem;
  transition: transform 0.25s ease;
}
.hz-drop-card:hover {
  transform: translateY(-2px);
}

/* Full-Screen Drop Overlay */
#globalDropOverlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(4, 7, 17, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: stretch;
  justify-content: stretch;
  padding: 18px;
  pointer-events: none;
}
#globalDropOverlay.active {
  display: flex;
}
.hz-drop-overlay-frame {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  border-radius: 24px;
  border: 2.5px dashed var(--horizon-hex);
  background: rgba(var(--horizon-rgb), 0.08);
  box-shadow: inset 0 0 80px -10px rgba(var(--horizon-rgb), 0.25);
  text-align: center;
}

@media (max-width: 1024px) {
  .hz-nav-strip { display: none; }
}

@media print {
  :root {
    color-scheme: light !important;
  }

  html {
    scrollbar-gutter: auto;
  }

  html, body {
    color-scheme: light !important;
    background: #ffffff !important;
    color: #000000 !important;
  }

  @page {
    background: #ffffff;
  }

  #horizonCanvas, .no-print, .hz-topbar {
    display: none !important;
  }
}
