:root {
  /* Dark Theme (Default) */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-surface: #0a0f1e;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: rgba(148, 163, 184, 0.15);
  --sidebar-bg: linear-gradient(to bottom, #1e293b, #0f172a);
  --header-bg: #0a0f1e;
  --card-bg: #1e293b;
  --nav-hover: #1f2937;
  --bg-gradient: radial-gradient(circle at top right, #1e293b, #0f172a);
  --logo-filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.6)) drop-shadow(0 0 25px rgba(37, 99, 235, 0.4));
  --splash-overlay: linear-gradient(to bottom, rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.95));
}

html.light {
  /* White Off Theme (Grayscale Refined, Darkened & Black Font) */
  --bg-primary: #c8c8c8;      /* Mid-gray background */
  --bg-secondary: #d8d8d8;    /* Lighter gray for cards */
  --bg-surface: #b4b4b4;      /* Darker gray for inputs/surfaces */
  --text-main: #000000;       /* Pure black text */
  --text-muted: #333333;      /* Dark gray muted text */
  --border-color: #999999;    /* defined gray border */
  --sidebar-bg: linear-gradient(to bottom, #d8d8d8, #c8c8c8);
  --header-bg: #d8d8d8;
  --card-bg: #d8d8d8;
  --nav-hover: #b8b8b8;
  --table-border: #888888;
  --bg-gradient: radial-gradient(circle at top right, #d8d8d8, #c8c8c8);
  --logo-filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.25));
  --splash-overlay: linear-gradient(to bottom, rgba(200, 200, 200, 0.85), rgba(180, 180, 180, 0.95));
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
}

/* Fix for visibility of selections and autofill */
::selection {
  background-color: #10b981 !important; /* Evergreen Tech Green */
  color: #ffffff !important;
}

::-moz-selection {
  background-color: #10b981 !important;
  color: #ffffff !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  -webkit-text-fill-color: #f1f5f9 !important;
  -webkit-box-shadow: 0 0 0px 1000px #0a0f1e inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* ---- Sidebar ---- */
.sidebar {
  width: 240px;
  background: var(--sidebar-bg) !important;
  border-right: 1px solid var(--border-color);
  display: flex !important;
  flex-direction: column;
  z-index: 40;
  /* High z-index */
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.sidebar.collapsed {
  width: 72px;
}

.sidebar.collapsed .sidebar-text {
  opacity: 0;
  pointer-events: none;
  width: 0;
  white-space: nowrap;
}

.sidebar .sidebar-text {
  transition: opacity 0.2s ease, width 0.2s ease;
}

.sidebar.collapsed #sidebar-toggle-icon {
  transform: rotate(180deg);
}

.sidebar.mobile-open {
  transform: translateX(0) !important;
}

@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
    width: 240px !important;
  }
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.625rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.nav-link:hover {
  background: var(--nav-hover);
  color: var(--text-main);
}

.nav-link-highlight {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, transparent 100%);
  border-left: 3px solid #10b981 !important;
  position: relative;
  overflow: hidden;
}

.nav-link-highlight::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.05), transparent);
  transform: translateX(-100%);
  animation: shimmer-nav 3s infinite;
}

@keyframes shimmer-nav {
  100% {
    transform: translateX(100%);
  }
}

.nav-link.active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.nav-link.active .nav-icon {
  color: #10b981;
}

.nav-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* ---- Main content offset ---- */
.main-content {
  margin-left: 240px;
  background-color: var(--bg-primary);
}

.sidebar.collapsed~.main-content,
.main-content.collapsed {
  margin-left: 72px;
}

@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%) !important;
    width: 240px !important;
  }

  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  .main-content {
    margin-left: 0 !important;
  }
}

/* ---- Page views ---- */
.page-view {
  display: none;
}

.page-view.active {
  display: block;
}

html.login-active,
body.login-active {
  overflow: hidden !important;
  height: 100vh !important;
  width: 100vw !important;
  position: fixed !important;
  background-image: linear-gradient(to bottom, rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.9)), url('../background.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

#page-login.active {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  height: 100vh !important;
  width: 100vw !important;
  position: fixed !important;
  top: 0;
  left: 0;
  z-index: 1000;
}

/* ---- Cards ---- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.875rem;
  transition: all 0.2s ease;
}

.card:hover {
  border-color: rgba(249, 115, 22, 0.3);
}

.card-interactive {
  cursor: pointer;
}

.card-interactive:hover {
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.2), 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ---- Priority badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-critical {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-high {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.badge-medium {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-low {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ---- Status badges ---- */
.status-open {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.status-in-progress {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-closed {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-shore {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.status-materials {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.status-overdue {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.status-pending {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

/* ---- Stat counters ---- */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 0.875rem;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.6rem 0.875rem;
  font-size: 0.875rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
  font-family: 'Inter', sans-serif;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

select option {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
  padding: 8px;
}

.form-select option {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  font-family: 'Inter', sans-serif;
}

.btn-primary {
  background: #f97316;
  color: white;
}

.btn-primary:hover {
  background: #ea6b0e;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.btn-secondary {
  background: #1f2937;
  color: #e2e8f0;
  border: 1px solid #374151;
}

.btn-secondary:hover {
  background: #374151;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-icon-admin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon-admin:hover {
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.4);
  color: #fb923c;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.1);
}

/* ---- Table ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #1f2937;
}

.data-table td {
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* ---- TAG chip ---- */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.25);
  color: #fb923c;
  padding: 0.15rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  transition: all 0.15s;
}

.tag-chip:hover {
  background: rgba(249, 115, 22, 0.2);
}

/* ---- Timeline ---- */
.timeline-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 1.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 1.5rem;
  bottom: 0;
  width: 2px;
  background: #1f2937;
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 0.25rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid;
  background: var(--bg-surface);
}

.timeline-event {
  border-color: #f97316;
}

.timeline-inspection {
  border-color: #6366f1;
}

.timeline-alert {
  border-color: #ef4444;
}

.timeline-material {
  border-color: #10b981;
}

.timeline-note {
  border-color: #f59e0b;
}

/* ---- Filter bar ---- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.filter-chip {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #334155;
  background: transparent;
  color: #94a3b8;
  transition: all 0.15s;
}

.filter-chip:hover,
.filter-chip.active {
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.35);
  color: #fb923c;
}

/* ---- Alert pulse ---- */
@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.pulse-alert {
  animation: pulse-ring 2s infinite;
}

/* ---- Toast ---- */
.toast {
  pointer-events: auto;
  padding: 0.875rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.3s ease;
}

@keyframes toast-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.toast-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.toast-info {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

/* ---- Empty state ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: #64748b;
}

.empty-state svg {
  opacity: 0.3;
  margin-bottom: 1rem;
}

/* ---- Page header ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f8fafc;
}

.page-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.15rem;
}

/* ---- Logo Effects ---- */
.logo-hero {
  filter: var(--logo-filter) !important;
  animation: pulse-grayscale 4s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
  transition: transform 0.4s ease;
  will-change: filter, transform;
}

@keyframes pulse-grayscale {
  0% {
    filter: var(--logo-filter) !important;
    transform: scale(1);
  }

  100% {
    filter: var(--logo-filter) drop-shadow(0 0 20px rgba(0, 0, 0, 0.05)) !important;
    transform: scale(1.05);
  }
}

.logo-hero:hover {
  transform: scale(1.1) rotate(2deg);
  animation-play-state: paused;
}

/* ---- EPIC SPLASH SCREEN ---- */
#splash-screen {
  background-image: var(--splash-overlay), url('../background.png');
  background-size: cover;
  background-position: center;
  transition: opacity 0.8s ease-in-out, visibility 0.8s;
  z-index: 9999;
}

#splash-screen.splash-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Ensure animation starts fresh when shown */
#splash-screen:not(.splash-hidden) #splash-logo {
  animation: splash-grow 2.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

#splash-logo {
  max-width: 66vw;
  filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.8)) drop-shadow(0 0 40px rgba(37, 99, 235, 0.6));
  will-change: transform, opacity, width;
}

@keyframes splash-grow {
  0% {
    transform: scale(0.1);
    opacity: 0;
    width: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
    width: 66vw;
  }
}

.splash-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none;
}

/* Header Logo Highlights */
.header-logo-highlight {
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.5)) drop-shadow(0 2px 12px rgba(0, 0, 0, 0.7)) !important;
  transition: transform 0.3s ease;
}

.header-logo-highlight:hover {
  transform: scale(1.15);
  filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.8)) drop-shadow(0 4px 16px rgba(0, 0, 0, 0.6)) !important;
}

/* ---- Custom Backgrounds ---- */
.main-content {
  background: var(--bg-gradient);
}

header.sticky {
  background-color: var(--header-bg) !important;
  /* Solid topbar */
}

/* ---- Section divider ---- */
.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #1f2937;
}

/* ---- Search highlight ---- */
.highlight {
  background: rgba(249, 115, 22, 0.25);
  color: #fb923c;
  border-radius: 2px;
  padding: 0 2px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .main-content {
    margin-left: 0;
  }

  #page-container {
    padding: 1rem;
  }
}

/* ---- Misc ---- */
.divider {
  border: none;
  border-top: 1px solid #1f2937;
  margin: 1.25rem 0;
}

.text-tag {
  color: #fb923c;
  font-family: 'Courier New', monospace;
  font-weight: 700;
}

.overdue {
  color: #f87171;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Media Upload & Gallery ---- */
.media-dropzone {
  border: 2px dashed #334155;
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.4);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  margin-bottom: 1rem;
}

.media-dropzone:hover,
.media-dropzone.drag-over {
  border-color: #f97316;
  background: rgba(249, 115, 22, 0.05);
}

.media-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.media-preview-item {
  width: 50px;
  height: 50px;
  border-radius: 0.5rem;
  overflow: hidden;
  position: relative;
  background: #0f172a;
  border: 1px solid #334155;
}

.media-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-preview-item .remove-btn {
  position: absolute;
  top: 1px;
  right: 1px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  cursor: pointer;
}

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.gallery-thumb {
  width: 42px;
  height: 42px;
  border-radius: 0.375rem;
  cursor: zoom-in;
  transition: transform 0.2s, border-color 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
  object-fit: cover;
}

.gallery-thumb:hover {
  transform: scale(1.1);
  border-color: #f97316;
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 2rem;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  border-radius: 0.5rem;
}

/* Reports & Charts */
.report-wrapper {
  color: #0f172a;
  line-height: 1.5;
}

.report-chart-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.5rem;
}

.font-signature {
  font-family: 'Dancing Script', cursive;
}

@media print {
  body * {
    visibility: hidden;
  }

  #report-output-container,
  #report-output-container * {
    visibility: visible;
  }

  #report-output-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white !important;
  }

  .report-wrapper {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .btn,
  #sidebar,
  header,
  .page-header,
  .page-subtitle,
  .card:not(.report-wrapper) {
    display: none !important;
  }
}

/* ---- Utilities ---- */
.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Toggle Switch ---- */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #94a3b8;
  transition: .4s;
}

input:checked + .slider {
  background-color: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: #22c55e;
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}
/* ---- Critical Pulse (5 min interval) ---- */
.critical-pulse {
  animation: pulse-red 300s infinite;
}

@keyframes pulse-red {
  0%, 1.6% { /* First 5 seconds of 300s (5 min) */
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    transform: scale(1);
  }
  0.6%, 1% {
    box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    transform: scale(1.1);
  }
  2%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    transform: scale(1);
  }
}

/* ---- PREMIUM HUD DESIGN SYSTEM ---- */
:root {
  --hud-glass: rgba(15, 23, 42, 0.65);
  --hud-border: rgba(255, 255, 255, 0.08);
  --hud-glow-orange: 0 0 15px rgba(249, 115, 22, 0.3);
  --hud-glow-red: 0 0 15px rgba(239, 68, 68, 0.3);
  --hud-accent: #38bdf8;
}

.glass-card {
  background: var(--hud-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--hud-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 48px 0 rgba(0, 0, 0, 0.5);
}

.hud-frame {
  position: relative;
  overflow: hidden;
}

.hud-frame::before, .hud-frame::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--hud-accent);
  opacity: 0.5;
  pointer-events: none;
}

.hud-frame::before { top: 0; left: 0; border-top: 2px solid; border-left: 2px solid; }
.hud-frame::after { bottom: 0; right: 0; border-bottom: 2px solid; border-right: 2px solid; }

.hud-corner-br { bottom: 0; right: 0; border-bottom: 2px solid; border-right: 2px solid; }

.hud-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}


.hud-stat-value {
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   PRODUCTION SUPERVISOR MODULE — Gray Premium Theme
   Applied when body[data-module="supervisor"]
   ============================================================ */

body[data-module="supervisor"] .nav-link.active {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

body[data-module="supervisor"] .nav-link.active .nav-icon {
  color: #94a3b8;
}

body[data-module="supervisor"] .nav-link:hover {
  background: #1f2937;
  color: #e2e8f0;
}

body[data-module="supervisor"] .btn-primary {
  background: #475569;
  color: #f1f5f9;
}

body[data-module="supervisor"] .btn-primary:hover {
  background: #334155;
  box-shadow: 0 4px 12px rgba(71, 85, 105, 0.4);
}

body[data-module="supervisor"] .filter-chip:hover,
body[data-module="supervisor"] .filter-chip.active {
  background: rgba(100, 116, 139, 0.2);
  border-color: rgba(100, 116, 139, 0.4);
  color: #cbd5e1;
}

body[data-module="supervisor"] .form-input:focus,
body[data-module="supervisor"] .form-select:focus,
body[data-module="supervisor"] .form-textarea:focus {
  border-color: #64748b;
  box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.15);
}

body[data-module="supervisor"] .card:hover {
  border-color: rgba(100, 116, 139, 0.3);
}

body[data-module="supervisor"] .card-interactive:hover {
  box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.25), 0 4px 24px rgba(0, 0, 0, 0.3);
}

body[data-module="supervisor"] .sidebar {
  background: linear-gradient(to bottom, #1a2333, #0f172a) !important;
  border-right: 1px solid rgba(71, 85, 105, 0.2);
}

body[data-module="supervisor"] ::selection {
  background-color: #475569 !important;
  color: #ffffff !important;
}

body[data-module="supervisor"] .main-content {
  background: radial-gradient(circle at top right, #1a2333, #0f172a);
}

/* Supervisor module switcher — Premium Highlight */
#module-switcher {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #f1f5f9;
  border-radius: 0.75rem;
  padding: 0.45rem 1rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  appearance: none; /* Hide default arrow to use custom styling potential */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.85rem;
  padding-right: 2.5rem;
}

#module-switcher:hover {
  border-color: rgba(249, 115, 22, 0.5);
  background-color: rgba(30, 41, 59, 0.9);
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.2);
  transform: translateY(-1px);
}

#module-switcher:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

/* Custom highlight based on active module */
body[data-module="supervisor"] #module-switcher {
  border-color: rgba(100, 116, 139, 0.5);
  color: #cbd5e1;
}

body[data-module="supervisor"] #module-switcher:hover {
  box-shadow: 0 0 15px rgba(100, 116, 139, 0.3);
  border-color: #94a3b8;
}

/* Annual Calendar Scale */
.cal-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.cal-month-box {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
}

.cal-month-title {
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--slate-400);
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cal-weekday {
    font-size: 8px;
    font-weight: 800;
    color: var(--slate-600);
    text-align: center;
    padding-bottom: 4px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 600;
    color: var(--slate-500);
    border-radius: 4px;
    transition: all 0.2s;
}

.cal-day-onboard {
    background: rgba(249, 115, 22, 0.15);
    color: var(--orange-400);
    border: 1px solid rgba(249, 115, 22, 0.2);
    box-shadow: inset 0 0 10px rgba(249, 115, 22, 0.05);
}

.cal-day-vacation {
    background: rgba(245, 158, 11, 0.2);
    color: var(--amber-400);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.cal-day-today {
    outline: 1px solid var(--white);
    color: var(--white);
    font-weight: 900;
}
