:root {
  color-scheme: light;
  --theme-page: #f5f7fb;
  --theme-page-glow-a: radial-gradient(1000px 520px at top left, rgba(236, 36, 44, 0.08), transparent 55%);
  --theme-page-glow-b: radial-gradient(900px 480px at bottom right, rgba(59, 130, 246, 0.08), transparent 52%);
  --theme-surface: rgba(255, 255, 255, 0.92);
  --theme-surface-strong: #ffffff;
  --theme-surface-muted: #f8fafc;
  --theme-border: #e5e7eb;
  --theme-border-strong: #d1d5db;
  --theme-text: #111214;
  --theme-text-soft: #5f6673;
  --theme-shadow: 0 24px 70px rgba(17, 18, 20, 0.12);
  --theme-accent-soft: rgba(236, 36, 44, 0.12);
}

html.dark {
  color-scheme: dark;
  --theme-page: #08111b;
  --theme-page-glow-a: radial-gradient(920px 480px at top left, rgba(236, 36, 44, 0.14), transparent 56%);
  --theme-page-glow-b: radial-gradient(980px 520px at bottom right, rgba(45, 212, 191, 0.08), transparent 58%);
  --theme-surface: rgba(12, 20, 33, 0.94);
  --theme-surface-strong: #111d30;
  --theme-surface-muted: #162338;
  --theme-border: #20324a;
  --theme-border-strong: #314765;
  --theme-text: #f3f6fb;
  --theme-text-soft: #b7c4d8;
  --theme-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
  --theme-accent-soft: rgba(236, 36, 44, 0.16);
}

body.login-page,
body.app-page {
  background-color: var(--theme-page) !important;
  background-image: var(--theme-page-glow-a), var(--theme-page-glow-b) !important;
  color: var(--theme-text) !important;
}

.brand-logo-link {
  display: inline-grid;
  place-items: center;
}

.brand-logo-image {
  grid-area: 1 / 1;
  display: block;
}

.brand-logo-image--dark,
html.dark .brand-logo-image--light {
  opacity: 0;
  visibility: hidden;
}

html.dark .brand-logo-image--dark {
  opacity: 1;
  visibility: visible;
}

.login-hero-panel {
  position: relative;
}

.login-card-panel {
  position: relative;
}

.status-badge,
.status-check-indicator {
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.status-check-item {
  min-height: 1.875rem;
}

.status-check-indicator {
  border: 1px solid transparent;
  box-shadow: inset 0 0 0 1px transparent;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 2.75rem;
  min-height: 2.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(17, 18, 20, 0.12);
  background: rgba(255, 255, 255, 0.82);
  padding: 0;
  font-size: 0.875rem;
  font-weight: 800;
  color: #111214;
  box-shadow: 0 12px 30px rgba(17, 18, 20, 0.08);
  backdrop-filter: blur(12px);
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(236, 36, 44, 0.16);
}

html.dark .theme-toggle {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(11, 19, 31, 0.78);
  color: var(--theme-text);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

#homeActions button span.text-sm,
#homeActions button .text-sm,
#homeView .text-neutral-600 {
  color: var(--theme-text-soft);
}

#appLoadingView .animate-spin {
  animation-duration: 900ms;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

html.dark .login-page .login-card-panel {
  background:
    linear-gradient(180deg, rgba(18, 31, 50, 0.96), rgba(15, 26, 43, 0.96)) !important;
}

.view-enter-start {
  opacity: 0;
  transform: translateY(12px);
}

.view-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 220ms ease, transform 220ms ease;
}

html.dark .login-page section,
html.dark .app-page header,
html.dark .app-page #homeView,
html.dark .app-page #issueForm > section,
html.dark .app-page #sidePanel > section,
html.dark .app-page #milestonesView,
html.dark .app-page #tasksView,
html.dark .app-page #permissionsView,
html.dark .app-page #approvalsView,
html.dark .app-page #previewModal > div,
html.dark .app-page #confirmModal > div {
  background: var(--theme-surface) !important;
  border-color: var(--theme-border) !important;
  box-shadow: var(--theme-shadow) !important;
}

html.dark .app-page .bg-white,
html.dark .app-page .bg-white\/95,
html.dark .app-page .bg-neutral-50,
html.dark .app-page .bg-neutral-50\/70,
html.dark .app-page .bg-neutral-100,
html.dark .app-page [role="listbox"],
html.dark .app-page [data-role-menu],
html.dark .app-page details,
html.dark .app-page table,
html.dark .app-page article,
html.dark .login-page .bg-white {
  background-color: var(--theme-surface-strong) !important;
}

html.dark .app-page header {
  background: rgba(11, 19, 31, 0.92) !important;
}

html.dark #appLoadingView .rounded-lg,
html.dark #homeView aside section,
html.dark #homeActions button,
html.dark #sidePanel > section,
html.dark #milestonesView section,
html.dark #tasksView section,
html.dark #permissionsView .rounded-lg,
html.dark #approvalsView .rounded-lg {
  background-color: var(--theme-surface-strong) !important;
}

html.dark .app-page [role="listbox"] {
  background: #111d30 !important;
  border-color: var(--theme-border-strong) !important;
}

html.dark .app-page [role="listbox"] .combobox-option,
html.dark .app-page [role="listbox"] [role="option"] {
  color: var(--theme-text) !important;
}

html.dark .app-page [role="listbox"] .combobox-option:hover,
html.dark .app-page [role="listbox"] .combobox-option:focus,
html.dark .app-page [role="listbox"] .combobox-option.bg-neutral-100,
html.dark .app-page [role="listbox"] [role="option"]:hover,
html.dark .app-page [role="listbox"] [role="option"]:focus,
html.dark .app-page [role="listbox"] [role="option"][aria-selected="true"] {
  background: rgba(255, 255, 255, 0.07) !important;
  color: var(--theme-text) !important;
}

html.dark .app-page [role="listbox"] .combobox-option:hover span,
html.dark .app-page [role="listbox"] .combobox-option:focus span,
html.dark .app-page [role="listbox"] .combobox-option.bg-neutral-100 span,
html.dark .app-page [role="listbox"] [role="option"]:hover span,
html.dark .app-page [role="listbox"] [role="option"]:focus span,
html.dark .app-page [role="listbox"] [role="option"][aria-selected="true"] span {
  color: var(--theme-text) !important;
}

html.dark .app-page [role="listbox"] svg.text-level {
  color: #ff3340 !important;
}

html.dark .app-page #appTopNav > div {
  background: rgba(17, 29, 48, 0.9) !important;
  border-color: rgba(49, 71, 101, 0.9) !important;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28) !important;
}

html.dark .app-page .border-neutral-100,
html.dark .app-page .border-neutral-200,
html.dark .app-page .border-neutral-300,
html.dark .app-page .border-neutral-900,
html.dark .login-page .border-neutral-200,
html.dark .login-page .border-neutral-300 {
  border-color: var(--theme-border) !important;
}

html.dark .app-page .hover\:border-neutral-400:hover,
html.dark .login-page .hover\:border-neutral-400:hover {
  border-color: var(--theme-border-strong) !important;
}

html.dark .app-page .text-ink,
html.dark .app-page .text-neutral-950,
html.dark .app-page .text-neutral-900,
html.dark .app-page .text-neutral-800,
html.dark .login-page .text-ink,
html.dark .login-page .text-neutral-950,
html.dark .login-page .text-neutral-900,
html.dark .login-page .text-neutral-800 {
  color: var(--theme-text) !important;
}

html.dark .app-page .text-neutral-700,
html.dark .app-page .text-neutral-600,
html.dark .app-page .text-neutral-500,
html.dark .app-page .text-neutral-400,
html.dark .login-page .text-neutral-700,
html.dark .login-page .text-neutral-600,
html.dark .login-page .text-neutral-500,
html.dark .login-page .text-neutral-400 {
  color: var(--theme-text-soft) !important;
}

html.dark .app-page input,
html.dark .app-page textarea,
html.dark .app-page select,
html.dark .login-page input,
html.dark .login-page textarea,
html.dark .login-page select {
  color: var(--theme-text) !important;
}

html.dark .app-page input::placeholder,
html.dark .app-page textarea::placeholder,
html.dark .login-page input::placeholder,
html.dark .login-page textarea::placeholder {
  color: var(--theme-text-soft) !important;
}

html.dark .app-page button[class*="border-neutral-300"][class*="bg-white"],
html.dark .app-page a[class*="border-neutral-300"][class*="bg-white"],
html.dark .app-page label[class*="border-neutral-300"][class*="bg-white"],
html.dark .login-page a[href="/auth/login"] {
  border-color: var(--theme-border) !important;
}

html.dark .app-page button[class*="bg-neutral-950"],
html.dark .app-page button[class*="border-neutral-900"][class*="bg-neutral-900"],
html.dark .app-page #appTopNav button.bg-neutral-950 {
  background-color: #f4f7fb !important;
  border-color: #f4f7fb !important;
  color: #0b1220 !important;
}

html.dark .app-page #appTopNav button:not(.bg-neutral-950):not(.text-white),
html.dark .app-page #appTopNav button:not(.bg-neutral-950):not(.text-white) i {
  color: #a7b3c7 !important;
}

html.dark .app-page #appTopNav button:hover:not(.bg-neutral-950) {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #f3f6fb !important;
}

html.dark .app-page button.disabled\:bg-neutral-300:disabled,
html.dark .app-page .disabled\:bg-neutral-300:disabled {
  background-color: #334155 !important;
  color: #94a3b8 !important;
}

html.dark .app-page table thead,
html.dark .app-page table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.035) !important;
}

html.dark .app-page table tbody tr,
html.dark .app-page table td,
html.dark .app-page table th {
  border-color: var(--theme-border) !important;
}

html.dark .app-page tbody tr,
html.dark .app-page .divide-neutral-100 > :not([hidden]) ~ :not([hidden]),
html.dark .app-page .divide-neutral-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--theme-border) !important;
}

html.dark .app-page #previewModalBody,
html.dark .app-page #previewModalFooter,
html.dark .app-page #confirmModal,
html.dark .app-page #confirmModal textarea,
html.dark .app-page #permissionsList > div,
html.dark .app-page #approvalsList > div {
  border-color: var(--theme-border) !important;
}

html.dark .app-page #previewModalBody,
html.dark .app-page #confirmModal textarea,
html.dark .app-page #permissionsList > div,
html.dark .app-page #approvalsList > div {
  background-color: var(--theme-surface-strong) !important;
}

html.dark .app-page #previewModalBody .prose,
html.dark .app-page #previewModalBody p,
html.dark .app-page #previewModalBody li,
html.dark .app-page #permissionsList .text-neutral-500,
html.dark .app-page #approvalsList .text-neutral-500 {
  color: var(--theme-text-soft) !important;
}

html.dark .app-page #previewModalBody strong,
html.dark .app-page #previewModalBody h1,
html.dark .app-page #previewModalBody h2,
html.dark .app-page #previewModalBody h3,
html.dark .app-page #permissionsList strong,
html.dark .app-page #approvalsList strong {
  color: var(--theme-text) !important;
}

html.dark .status-badge--pending {
  background: rgba(40, 57, 87, 0.7) !important;
  color: #b7c3d7 !important;
}

html.dark .status-badge--ready {
  background: rgba(6, 95, 70, 0.28) !important;
  color: #86efac !important;
}

html.dark .status-check-label {
  color: var(--theme-text-soft);
}

html.dark .status-check-indicator--pending {
  background: rgba(18, 31, 50, 0.88) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: rgba(148, 163, 184, 0.78) !important;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.06);
}

html.dark .status-check-indicator--done {
  background: linear-gradient(180deg, #10b981, #059669) !important;
  border-color: rgba(16, 185, 129, 0.24) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(5, 150, 105, 0.28);
}

html.dark .app-page code,
html.dark .login-page code {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #d7e0ec !important;
}

html.dark .app-page .shadow-soft,
html.dark .login-page .shadow-soft {
  box-shadow: var(--theme-shadow) !important;
}

html.dark .app-page ::selection,
html.dark .login-page ::selection {
  background: rgba(236, 36, 44, 0.32);
  color: #ffffff;
}
