:root {
  --font-base: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  --color-bg: #f4f6fb;
  --color-surface: #ffffff;
  --color-muted: #4b5563;
  --color-strong: #0f172a;
  --color-primary: #2563eb;
  --color-primary-alt: #1d4ed8;
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  --color-border: #e5e7eb;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-2xl: 24px;
  --shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 46px rgba(37, 99, 235, 0.16);
  --shadow-executive-lg: 0 24px 58px rgba(37, 99, 235, 0.2);
  --gradient-premium: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

* {
  box-sizing: border-box;
  letter-spacing: 0 !important;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-actions.hero-cta {
  align-items: stretch;
}

.btn-cta {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 190px;
  padding: 0.85rem 1.2rem;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-cta .cta-sub {
  font-size: 0.85rem;
  opacity: 0.9;
}

.btn-cta.ghost {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  backdrop-filter: blur(6px);
}

/* Page Header Hero */
.page-header-hero {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-radius: var(--radius-2xl);
  padding: 2rem 2.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.page-header-hero::before {
  display: none;
}

.page-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.75rem;
  font-weight: 800;
  color: white;
  margin: 0 0 0.5rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.page-title i {
  color: rgba(255, 255, 255, 0.95);
}

.page-subtitle {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

.btn-hero-cta {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-hero-cta:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Labs Grid */
.labs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.lab-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.2s ease;
}

.lab-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.lab-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lab-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  display: grid;
  place-items: center;
  color: white;
  font-size: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.lab-status {
  display: flex;
  align-items: center;
}

.badge-status {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.badge-status.active {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.badge-status.inactive {
  background: rgba(107, 114, 128, 0.12);
  color: #4b5563;
}

.lab-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-strong);
  margin: 0;
}

.lab-code {
  font-size: 0.9rem;
  color: var(--color-muted);
  font-weight: 600;
}

.lab-description {
  color: var(--color-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lab-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.lab-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.lab-meta-item i {
  color: var(--color-primary);
  font-size: 1rem;
}

.lab-stats {
  display: flex;
  gap: 1rem;
}

.lab-stat {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.lab-stat i {
  color: var(--color-primary);
}

.lab-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
}

.lab-actions .btn {
  flex: 1;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 2rem;
}

.spinner-container {
  position: relative;
  width: 100px;
  height: 100px;
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 4px solid transparent;
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
  border-top-color: var(--color-success);
  animation-delay: -0.5s;
}

.spinner-ring:nth-child(3) {
  border-top-color: var(--color-warning);
  animation-delay: -1s;
}

.spinner-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: var(--color-primary);
  animation: pulse 1.5s ease-in-out infinite;
}

.loading-text {
  color: var(--color-muted);
  font-size: 1.1rem;
  font-weight: 500;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@media (max-width: 768px) {
  .labs-grid {
    grid-template-columns: 1fr;
  }

  .page-header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .lab-actions {
    flex-direction: column;
  }

  .lab-actions .btn {
    width: 100%;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-strong);
  line-height: 1.6;
  direction: rtl;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--color-bg);
}

.sidebar {
  width: 250px;
  background: #0b1533;
  color: #e5e7eb;
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  align-self: flex-start;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0 0.5rem;
}

.brand {
  font-weight: 800;
  font-size: 1.1rem;
}

.brand-sub {
  font-size: 0.85rem;
  color: #cbd5e1;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0.75rem 0.5rem;
}

.sidebar-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  color: #94a3b8;
  padding: 0.5rem 0.8rem 0.25rem;
  margin-top: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  color: #e5e7eb;
  transition: all 0.2s ease;
  font-weight: 600;
}

.sidebar-link i {
  font-size: 1.1rem;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(37, 99, 235, 0.16);
  color: #fff;
  transform: translateX(-2px);
}

.sidebar-footer {
  margin-top: auto;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: #cbd5e1;
}

.badge-soft {
  display: inline-flex;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.06), transparent 34%),
    linear-gradient(315deg, rgba(217, 119, 6, 0.06), transparent 30%),
    var(--color-bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.04)), var(--color-surface);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  color: var(--color-primary);
}

.topbar-title-text {
  font-size: 1rem;
}

.topbar-subtitle {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.user-name {
  font-weight: 700;
}

.user-role {
  font-size: 0.85rem;
  color: var(--color-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.user-role:hover {
  color: var(--color-primary);
}

.user-role i {
  font-size: 0.9rem;
}

.ghost-btn {
  border: none;
  background: transparent;
  color: var(--color-primary);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
}

.content-shell {
  padding: 1.5rem;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.card-surface,
.card,
.surface-card {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.12), rgba(255, 255, 255, 0.92));
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(37, 99, 235, 0.22);
  position: relative;
  overflow: hidden;
}

.card::before,
.card-surface::before,
.surface-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #0f766e, #d97706, #365486);
  opacity: 0.9;
  pointer-events: none;
}

.card > *,
.card-surface > *,
.surface-card > * {
  position: relative;
  z-index: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

.btn-primary {
  background: var(--gradient-premium);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: #0f172a;
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.form-label {
  font-weight: 700;
  color: var(--color-strong);
  margin-bottom: 0.3rem;
}

.form-control,
.form-select {
  border-radius: 12px;
  border: 1.5px solid var(--color-border);
  background: #f8fafc;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.16);
}

.table-modern {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-modern thead {
  background: var(--gradient-premium);
  color: #fff;
}

.table-modern th,
.table-modern td {
  padding: 0.85rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid var(--color-border);
}

.table-modern tbody tr:hover {
  background: #f8fafc;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.1);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.85rem;
}

/* Auth + account management */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 35%),
    linear-gradient(315deg, rgba(217, 119, 6, 0.06), transparent 32%),
    var(--color-bg);
}

.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: min(960px, 100%);
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-executive-lg);
  padding: 2.25rem;
  border: 1px solid var(--color-border);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--gradient-premium);
  color: #fff;
  margin: 0 auto 0.75rem;
  box-shadow: var(--shadow-lg);
  font-size: 1.6rem;
}

.auth-title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 800;
}

.auth-subtitle {
  margin: 0.35rem 0 0;
  color: var(--color-muted);
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.auth-panel {
  background: #f8fafc;
  border-radius: var(--radius-xl, 18px);
  padding: 1.25rem;
  border: 1px solid var(--color-border);
}

.auth-links {
  display: grid;
  gap: 0.75rem;
}

.auth-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  color: var(--color-primary);
  font-weight: 700;
  transition: all 0.2s ease;
}

.auth-link:hover {
  background: rgba(79, 70, 229, 0.08);
  color: #4338ca;
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-muted);
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--color-border);
}

.form-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.account-management-container {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.account-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
}

.account-main-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
}

.account-main-title i {
  color: var(--color-primary);
}

.account-subtitle {
  margin: 0;
  color: var(--color-muted);
}

.account-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
}

.account-sidebar {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  position: sticky;
  top: 1.5rem;
  height: fit-content;
}

.account-content {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.manage-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  margin-bottom: 0.4rem;
  transition: all 0.2s ease;
  color: var(--color-muted);
  font-weight: 600;
}

.manage-nav .nav-link:hover {
  background: rgba(79, 70, 229, 0.08);
  color: var(--color-primary);
  transform: translateX(-2px);
}

.manage-nav .nav-link.active {
  background: var(--gradient-premium);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.manage-nav .nav-link i {
  font-size: 1.2rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.surface-card {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.12), rgba(255, 255, 255, 0.92));
  border-radius: 14px;
  padding: 1rem;
  border: 1px solid rgba(37, 99, 235, 0.22);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.surface-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #0f766e, #d97706, #365486);
  opacity: 0.9;
  pointer-events: none;
}

.surface-card > * {
  position: relative;
  z-index: 1;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #0f766e;
  font-weight: 700;
}

.table-compact {
  width: 100%;
  border-collapse: collapse;
}

.table-compact th,
.table-compact td {
  padding: 0.65rem;
  border-bottom: 1px solid var(--color-border);
  text-align: right;
}

@media (max-width: 992px) {
  .auth-card {
    padding: 1.5rem;
  }

  .account-shell {
    grid-template-columns: 1fr;
  }

  .account-sidebar {
    position: static;
  }
}

@media (max-width: 992px) {
  .sidebar {
    width: 220px;
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(0);
  }
  .main-area {
    margin-right: 220px;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  /* Hide the checkbox */
  .mobile-menu-checkbox {
    display: none;
  }
  
  .sidebar {
    position: fixed;
    transform: translateX(-110%);
    transition: transform 0.3s ease;
    z-index: 1001;
  }
  
  /* Show sidebar when checkbox is checked */
  .mobile-menu-checkbox:checked ~ .sidebar {
    transform: translateX(0);
  }
  
  .main-area {
    margin-right: 0;
  }
  
  .content-shell {
    padding: 1rem;
  }
  
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--color-strong);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    margin-left: 0.5rem;
  }
  
  .mobile-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
  }
  
  .mobile-menu-toggle i {
    font-size: 1.5rem;
  }
  
  .mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
  }
  
  .mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  
  .mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
  }
  
  /* Show overlay when checkbox is checked */
  .mobile-menu-checkbox:checked ~ .mobile-menu-overlay {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
  
  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .topbar-title {
    flex: 1;
  }
  
  .topbar-subtitle {
    display: none;
  }
  
  .user-pill {
    flex-wrap: wrap;
  }
  
  .user-meta {
    display: none;
  }
  
  /* Close menu when clicking a link */
  .sidebar-link {
    position: relative;
  }
  
  .sidebar-link::after {
    content: '';
    position: absolute;
    inset: 0;
  }
}

/* Hide hamburger on desktop */
@media (min-width: 769px) {
  .mobile-menu-checkbox {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: none;
  }
  
  .mobile-menu-close {
    display: none;
  }
  
  .mobile-menu-overlay {
    display: none !important;
  }
}

/* ============================================
   LABDICS MODERN EXPERIENCE LAYER
   ============================================ */

:root {
  --color-bg: #f5f7f6;
  --color-surface: #ffffff;
  --color-muted: #56616c;
  --color-strong: #172126;
  --color-primary: #0f766e;
  --color-primary-alt: #115e59;
  --color-accent: #365486;
  --color-success: #159a6c;
  --color-danger: #dc2626;
  --color-warning: #d97706;
  --color-border: #dde5e1;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --radius-2xl: 8px;
  --shadow-sm: 0 1px 2px rgba(23, 33, 38, 0.06), 0 8px 20px rgba(23, 33, 38, 0.04);
  --shadow-md: 0 10px 30px rgba(23, 33, 38, 0.08);
  --shadow-lg: 0 18px 46px rgba(17, 94, 89, 0.16);
  --shadow-executive-lg: 0 22px 54px rgba(17, 94, 89, 0.18);
  --gradient-premium: linear-gradient(135deg, #0f766e 0%, #365486 58%, #8a5a20 100%);
  --motion-fast: 160ms cubic-bezier(.2, .8, .2, 1);
  --motion-base: 260ms cubic-bezier(.2, .8, .2, 1);
  --motion-slow: 720ms cubic-bezier(.2, .8, .2, 1);
}

@keyframes ld-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ld-scale-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ld-slide-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes ld-sheen {
  from {
    transform: translateX(115%);
  }
  to {
    transform: translateX(-115%);
  }
}

@keyframes ld-breathe {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.14);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(15, 118, 110, 0);
  }
}

body {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .055), transparent 34%),
    linear-gradient(315deg, rgba(217, 119, 6, .06), transparent 32%),
    #f5f7f6;
  color: var(--color-strong);
}

body::selection {
  background: rgba(15, 118, 110, .22);
}

.app-shell {
  background:
    linear-gradient(90deg, rgba(15, 118, 110, .04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(54, 84, 134, .035) 1px, transparent 1px),
    var(--color-bg);
  background-size: 44px 44px;
}

.main-area {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(245, 247, 246, .92)),
    linear-gradient(135deg, rgba(15, 118, 110, .08), transparent 42%),
    linear-gradient(315deg, rgba(217, 119, 6, .055), transparent 34%);
}

.content-shell {
  animation: ld-rise var(--motion-slow) both;
}

.sidebar {
  width: 272px;
  background: linear-gradient(180deg, #102326 0%, #182c34 52%, #20302d 100%);
  border-left: 1px solid rgba(255, 255, 255, .08);
  box-shadow: -16px 0 40px rgba(23, 33, 38, .12);
}

.sidebar::before {
  content: "";
  display: block;
  height: 3px;
  margin: -1.5rem -1rem 1rem;
  background: linear-gradient(90deg, #0f766e, #d97706, #365486);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: 1.2rem;
}

.brand::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(135deg, #40c6b5, #dba050);
  box-shadow: 0 0 0 4px rgba(64, 198, 181, .12);
}

.sidebar-link {
  border-radius: 8px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: transform var(--motion-fast), color var(--motion-fast), background var(--motion-fast);
}

.sidebar-link::before {
  content: "";
  position: absolute;
  inset-block: .55rem;
  right: 0;
  width: 3px;
  border-radius: 4px;
  background: #48d3c2;
  transform: scaleY(0);
  transform-origin: center;
  transition: transform var(--motion-base);
}

.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(255, 255, 255, .095);
  color: #fff;
  transform: translateX(-3px);
}

.sidebar-link.active::before {
  transform: scaleY(1);
}

.sidebar-link i {
  width: 1.35rem;
  text-align: center;
  transition: transform var(--motion-base);
}

.sidebar-link:hover i,
.sidebar-link.active i {
  transform: translateY(-1px) scale(1.08);
}

.sidebar-footer {
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .08);
}

.topbar {
  background: rgba(255, 255, 255, .82);
  border-bottom: 1px solid rgba(221, 229, 225, .9);
  box-shadow: 0 10px 32px rgba(23, 33, 38, .06);
  backdrop-filter: blur(18px);
}

.topbar-title > i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--gradient-premium);
  animation: ld-breathe 2.8s ease-in-out infinite;
}

.user-pill {
  background: rgba(255, 255, 255, .78);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.ghost-btn,
.user-role {
  color: var(--color-primary);
}

.hero-section,
.hero-welcome,
.page-header-hero,
.executive-banner {
  position: relative;
  overflow: hidden;
  border-radius: 8px !important;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .96), rgba(54, 84, 134, .94) 58%, rgba(138, 90, 32, .92)) !important;
  box-shadow: var(--shadow-executive-lg) !important;
}

.hero-section::after,
.hero-welcome::after,
.page-header-hero::after,
.executive-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, .16), transparent);
  transform: translateX(115%);
  animation: ld-sheen 6s ease-in-out infinite;
  pointer-events: none;
}

.hero-section,
.hero-welcome {
  padding: 1.35rem 1.5rem !important;
  margin-bottom: 1.25rem;
}

.hero-title {
  line-height: 1.35;
}

.hero-badge,
.badge-soft {
  border-radius: 8px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(10px);
}

.floating-icon {
  border-radius: 8px !important;
  animation: ld-scale-in .8s both, ld-breathe 3.2s ease-in-out infinite !important;
}

.card-surface,
.card,
.surface-card,
.lab-card,
.stats-card,
.quick-action-card,
.activity-item,
.auth-card,
.account-content,
.account-sidebar {
  position: relative;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, .88) !important;
  border: 1px solid rgba(221, 229, 225, .92) !important;
  box-shadow: var(--shadow-sm) !important;
  overflow: hidden;
  transition: transform var(--motion-base), box-shadow var(--motion-base), border-color var(--motion-base), background var(--motion-base);
}

.card-surface::before,
.card::before,
.surface-card::before,
.stats-card::before,
.lab-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #0f766e, #d97706, #365486);
  opacity: .9;
  pointer-events: none;
}

.card-surface:hover,
.card:hover,
.surface-card:hover,
.lab-card:hover,
.stats-card:hover,
.quick-action-card:hover,
.activity-item:hover {
  transform: translateY(-4px);
  border-color: rgba(15, 118, 110, .34) !important;
  box-shadow: var(--shadow-md) !important;
}

.card > *,
.card-surface > *,
.surface-card > * {
  position: relative;
  z-index: 1;
}

.lab-grid,
.labs-grid,
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.lab-card {
  animation: ld-scale-in var(--motion-slow) both;
}

.lab-card:nth-child(2n) {
  animation-delay: 70ms;
}

.lab-card:nth-child(3n) {
  animation-delay: 140ms;
}

.lab-icon,
.stats-card-icon,
.quick-action-icon,
.activity-icon,
.auth-icon {
  border-radius: 8px !important;
  background: var(--gradient-premium) !important;
  box-shadow: 0 10px 22px rgba(15, 118, 110, .18);
}

.lab-card:hover .lab-icon,
.quick-action-card:hover .quick-action-icon,
.stats-card:hover .stats-card-icon {
  transform: rotate(-3deg) scale(1.06);
}

.lab-icon,
.quick-action-icon,
.stats-card-icon {
  transition: transform var(--motion-base);
}

.lab-card-actions,
.lab-actions,
.hero-actions {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.stats-card {
  position: relative;
  min-height: 116px;
  animation: ld-scale-in var(--motion-slow) both;
}

.stats-card.compact {
  min-height: auto;
  padding: .95rem;
}

.stats-card-value {
  color: var(--color-strong);
}

.stats-card-label {
  color: var(--color-muted);
}

.btn,
.btn-enterprise,
.action-btn,
.ghost-btn {
  border-radius: 8px !important;
  transition: transform var(--motion-fast), box-shadow var(--motion-fast), background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast);
}

.btn-primary,
.btn-enterprise,
.manage-nav .nav-link.active {
  background: var(--gradient-premium) !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(15, 118, 110, .18) !important;
}

.btn-outline {
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(15, 118, 110, .42);
  color: var(--color-primary);
}

.btn:hover,
.btn-enterprise:hover,
.action-btn:hover,
.ghost-btn:hover {
  transform: translateY(-2px);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.form-control,
.form-select,
select,
textarea,
input {
  border-radius: 8px !important;
}

.form-control,
.form-select {
  background: rgba(248, 250, 249, .92) !important;
  border: 1px solid rgba(199, 211, 205, .96) !important;
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast), background var(--motion-fast);
}

.form-control:focus,
.form-select:focus {
  outline: none;
  background: #fff !important;
  border-color: rgba(15, 118, 110, .68) !important;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .12) !important;
}

.badge-status {
  border-radius: 8px;
  border: 1px solid transparent;
}

.badge-status.active {
  background: rgba(21, 154, 108, .12);
  border-color: rgba(21, 154, 108, .22);
  color: #08734f;
}

.badge-status.warning {
  background: rgba(217, 119, 6, .13);
  border-color: rgba(217, 119, 6, .25);
  color: #9a4f00;
}

.badge-status.danger {
  background: rgba(220, 38, 38, .12);
  border-color: rgba(220, 38, 38, .22);
  color: #b91c1c;
}

.badge-status.inactive {
  background: rgba(86, 97, 108, .12);
  border-color: rgba(86, 97, 108, .22);
  color: #46515c;
}

.table-modern,
.data-table,
.table-container {
  border-radius: 8px !important;
}

.table-modern thead,
.data-table thead {
  background: linear-gradient(135deg, #173a3b, #365486) !important;
}

.data-table tbody tr,
.table-modern tbody tr {
  transition: background var(--motion-fast), transform var(--motion-fast);
}

.data-table tbody tr:hover,
.table-modern tbody tr:hover {
  background: rgba(15, 118, 110, .055) !important;
}

.empty-state {
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
  border: 1px dashed rgba(15, 118, 110, .32);
  box-shadow: var(--shadow-sm);
  animation: ld-rise var(--motion-slow) both;
}

.panel-header {
  border-color: rgba(221, 229, 225, .92) !important;
}

.panel-title i {
  color: var(--color-primary);
}

.activity-list,
.quick-actions-grid {
  display: grid;
  gap: .8rem;
}

.quick-action-card {
  min-height: 74px;
}

.spinner-ring {
  border-top-color: var(--color-primary);
}

.spinner-ring:nth-child(2) {
  border-top-color: var(--color-warning);
}

.spinner-ring:nth-child(3) {
  border-top-color: var(--color-accent);
}

.mobile-menu-toggle,
.mobile-menu-close {
  border-radius: 8px !important;
}

@media (max-width: 992px) {
  .sidebar {
    width: 236px;
  }

  .main-area {
    margin-right: 236px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: min(82vw, 300px);
  }

  .main-area {
    margin-right: 0;
  }

  .topbar {
    align-items: stretch;
  }

  .topbar-actions,
  .user-pill {
    width: 100%;
  }

  .stats-grid,
  .lab-grid,
  .labs-grid {
    grid-template-columns: 1fr;
  }

  .hero-section,
  .hero-welcome {
    padding: 1.1rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

/* ============================================
   LABDICS AURORA COMMAND THEME
   Premium operational skin generated from the UI Pro design brief.
   ============================================ */

:root {
  --ld-ink: #0c0a09;
  --ld-ink-2: #1c1917;
  --ld-muted: #57534e;
  --ld-paper: #fafaf9;
  --ld-panel: rgba(255, 255, 255, 0.82);
  --ld-panel-solid: #ffffff;
  --ld-line: rgba(68, 64, 60, 0.16);
  --ld-line-strong: rgba(28, 25, 23, 0.22);
  --ld-navy: #172033;
  --ld-teal: #0f766e;
  --ld-teal-soft: rgba(15, 118, 110, 0.11);
  --ld-gold: #ca8a04;
  --ld-gold-soft: rgba(202, 138, 4, 0.13);
  --ld-violet: #4f46e5;
  --ld-cyan: #0891b2;
  --ld-red: #dc2626;
  --ld-green: #059669;
  --ld-radius: 8px;
  --ld-shadow-sm: 0 1px 1px rgba(12, 10, 9, 0.04), 0 12px 34px rgba(12, 10, 9, 0.06);
  --ld-shadow-md: 0 16px 54px rgba(12, 10, 9, 0.1);
  --ld-shadow-lg: 0 26px 80px rgba(12, 10, 9, 0.16);
  --ld-command-gradient: linear-gradient(135deg, #121826 0%, #17383b 46%, #7c4b12 100%);
  --ld-action-gradient: linear-gradient(135deg, #0f766e 0%, #0891b2 54%, #ca8a04 100%);
  --ld-glass: saturate(1.12) blur(18px);
  --color-bg: var(--ld-paper);
  --color-surface: var(--ld-panel-solid);
  --color-muted: var(--ld-muted);
  --color-strong: var(--ld-ink);
  --color-primary: var(--ld-teal);
  --color-primary-alt: #0d5f59;
  --color-accent: var(--ld-gold);
  --color-success: var(--ld-green);
  --color-danger: var(--ld-red);
  --color-warning: var(--ld-gold);
  --color-border: rgba(68, 64, 60, 0.18);
  --radius-sm: var(--ld-radius);
  --radius-md: var(--ld-radius);
  --radius-lg: var(--ld-radius);
  --radius-2xl: var(--ld-radius);
  --shadow-sm: var(--ld-shadow-sm);
  --shadow-md: var(--ld-shadow-md);
  --shadow-lg: var(--ld-shadow-lg);
  --shadow-executive-lg: var(--ld-shadow-lg);
  --gradient-premium: var(--ld-action-gradient);
}

@keyframes ld-aurora-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ld-panel-glint {
  0%,
  54% {
    transform: translateX(120%);
  }
  100% {
    transform: translateX(-120%);
  }
}

@keyframes ld-pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.36);
  }
  55% {
    box-shadow: 0 0 0 7px rgba(20, 184, 166, 0);
  }
}

html {
  background: var(--ld-paper);
}

body {
  background:
    linear-gradient(90deg, rgba(12, 10, 9, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(12, 10, 9, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, rgba(15, 118, 110, 0.1), transparent 38%),
    linear-gradient(315deg, rgba(202, 138, 4, 0.09), transparent 36%),
    var(--ld-paper) !important;
  background-size: 38px 38px, 38px 38px, auto, auto, auto;
  color: var(--ld-ink);
}

.aurora-shell,
.app-shell {
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.72), rgba(250, 250, 249, 0.94)),
    linear-gradient(90deg, rgba(15, 118, 110, 0.075), transparent 32%, rgba(202, 138, 4, 0.07)) !important;
}

.command-main,
.main-area {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(250, 250, 249, 0.92)),
    linear-gradient(135deg, rgba(8, 145, 178, 0.08), transparent 36%),
    linear-gradient(315deg, rgba(202, 138, 4, 0.07), transparent 42%) !important;
}

.command-content-shell,
.content-shell {
  animation: ld-aurora-enter 520ms cubic-bezier(.2, .8, .2, 1) both;
  max-width: 1680px;
}

.command-sidebar,
.sidebar {
  width: 292px;
  padding: 1rem;
  color: rgba(255, 255, 255, 0.9);
  background:
    linear-gradient(180deg, rgba(18, 24, 38, 0.98), rgba(23, 44, 52, 0.98) 54%, rgba(56, 39, 22, 0.98)),
    #121826 !important;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -24px 0 60px rgba(12, 10, 9, 0.18);
}

.command-sidebar::before,
.sidebar::before {
  height: 0 !important;
  margin: 0 !important;
}

.sidebar-brand-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--ld-radius);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: var(--ld-glass);
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--ld-radius);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.95), rgba(202, 138, 4, 0.92));
  color: #fff;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.brand-mark span {
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 5px;
}

.brand-copy {
  min-width: 0;
}

.brand {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 950;
}

.brand::before {
  display: none !important;
}

.brand-sub {
  margin-top: 0.12rem;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0 !important;
}

.sidebar-command-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.9rem 0;
  padding: 0.72rem 0.78rem;
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: var(--ld-radius);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(202, 138, 4, 0.1));
}

.sidebar-command-chip strong,
.sidebar-command-chip small {
  display: block;
}

.sidebar-command-chip strong {
  color: #fff;
  font-size: 0.86rem;
}

.sidebar-command-chip small {
  color: rgba(255, 255, 255, 0.66);
  margin-top: 0.12rem;
}

.pulse-dot {
  width: 0.6rem;
  height: 0.6rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #2dd4bf;
  animation: ld-pulse-dot 1.8s ease-in-out infinite;
}

.command-nav,
.sidebar-nav {
  gap: 0.85rem;
}

.nav-cluster {
  display: grid;
  gap: 0.22rem;
}

.sidebar-section-title {
  margin: 0.42rem 0 0.25rem;
  color: rgba(255, 255, 255, 0.48) !important;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sidebar-link {
  min-height: 42px;
  border-radius: var(--ld-radius) !important;
  color: rgba(255, 255, 255, 0.74);
  background: transparent;
}

.sidebar-link i {
  width: 1.4rem;
  color: rgba(255, 255, 255, 0.64);
}

.sidebar-link:hover,
.sidebar-link.active {
  color: #fff !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.07)) !important;
  transform: translateX(-3px);
}

.sidebar-link.active {
  box-shadow: inset -3px 0 0 #2dd4bf, 0 10px 24px rgba(0, 0, 0, 0.13);
}

.sidebar-link::before {
  display: none;
}

.command-footer,
.sidebar-footer {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 0.85rem;
  border-radius: var(--ld-radius) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.075) !important;
}

.footer-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.74rem;
}

.footer-metric strong {
  color: #fff;
  font-size: 0.86rem;
}

.command-topbar,
.topbar {
  min-height: 78px;
  gap: 1rem;
  padding: 0.85rem 1.05rem;
  background: rgba(255, 255, 255, 0.74) !important;
  border-bottom: 1px solid rgba(68, 64, 60, 0.14) !important;
  box-shadow: 0 16px 42px rgba(12, 10, 9, 0.07) !important;
  backdrop-filter: var(--ld-glass);
}

.topbar-leading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.topbar-title > i {
  border-radius: var(--ld-radius) !important;
  background: var(--ld-command-gradient) !important;
  animation: none !important;
}

.topbar-title-text {
  color: var(--ld-ink);
  font-weight: 950;
}

.topbar-subtitle {
  color: var(--ld-muted);
}

.topbar-command-strip {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.3rem;
  border: 1px solid rgba(68, 64, 60, 0.13);
  border-radius: var(--ld-radius);
  background: rgba(250, 250, 249, 0.7);
}

.topbar-command-strip a {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 36px;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  color: var(--ld-muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.topbar-command-strip a:hover {
  color: var(--ld-ink);
  background: rgba(15, 118, 110, 0.1);
  transform: translateY(-1px);
}

.command-user-pill,
.user-pill {
  background: rgba(255, 255, 255, 0.74) !important;
  border: 1px solid rgba(68, 64, 60, 0.13) !important;
  border-radius: var(--ld-radius) !important;
  box-shadow: var(--ld-shadow-sm) !important;
}

.ghost-btn {
  border: 1px solid rgba(68, 64, 60, 0.12);
  border-radius: var(--ld-radius) !important;
  background: rgba(250, 250, 249, 0.72);
}

.page-header-hero,
.dashboard-header,
.alerts-hero,
.reports-hero,
.operations-hero,
.inventory-hero,
.care-hero,
.safety-hero,
.laboratory-hero,
.material-form-hero,
.equipment-form-hero,
.care-form-hero,
.safety-form-hero {
  position: relative;
  border-radius: var(--ld-radius) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  background:
    linear-gradient(135deg, rgba(18, 24, 38, 0.96), rgba(23, 56, 59, 0.94) 48%, rgba(124, 75, 18, 0.92)) !important;
  color: #fff !important;
  box-shadow: var(--ld-shadow-lg) !important;
}

.page-header-hero h1,
.dashboard-header h1,
.alerts-hero h1,
.reports-hero h1,
.operations-hero h1,
.inventory-hero h1,
.care-hero h1,
.safety-hero h1,
.laboratory-hero h1,
.material-form-hero h1,
.equipment-form-hero h1,
.care-form-hero h1,
.safety-form-hero h1,
.page-title,
.hero-title {
  color: #fff !important;
  text-shadow: none !important;
}

.page-header-hero p,
.dashboard-header p,
.alerts-hero p,
.reports-hero p,
.operations-hero p,
.inventory-hero p,
.care-hero p,
.safety-hero p,
.laboratory-hero p,
.material-form-hero p,
.equipment-form-hero p,
.care-form-hero p,
.safety-form-hero p,
.page-subtitle,
.hero-description {
  color: rgba(255, 255, 255, 0.78) !important;
}

.hero-badge,
.hero-eyebrow,
.badge-soft {
  width: fit-content;
  border-radius: var(--ld-radius) !important;
  color: #fff !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  backdrop-filter: blur(12px);
}

.card-surface,
.card,
.surface-card,
.lab-card,
.stats-card,
.quick-action-card,
.activity-item,
.form-section,
.summary-card,
.alert-filters,
.alert-list-panel,
.command-summary-panel,
.command-queue-panel,
.account-content,
.account-sidebar,
.table-container {
  border-radius: var(--ld-radius) !important;
  border: 1px solid rgba(68, 64, 60, 0.13) !important;
  background: var(--ld-panel) !important;
  box-shadow: var(--ld-shadow-sm) !important;
  backdrop-filter: var(--ld-glass);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.card-surface::before,
.card::before,
.surface-card::before,
.stats-card::before,
.lab-card::before,
.quick-action-card::before {
  height: 2px !important;
  background: linear-gradient(90deg, var(--ld-teal), var(--ld-cyan), var(--ld-gold)) !important;
}

.card-surface::after,
.stats-card::after,
.lab-card::after,
.quick-action-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transform: translateX(120%);
  animation: ld-panel-glint 7s ease-in-out infinite;
  pointer-events: none;
  opacity: 0.42;
}

.card-surface:hover,
.card:hover,
.surface-card:hover,
.lab-card:hover,
.stats-card:hover,
.quick-action-card:hover,
.activity-item:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 118, 110, 0.28) !important;
  box-shadow: var(--ld-shadow-md) !important;
}

.stats-card {
  min-height: 118px;
  display: grid;
  align-content: center;
  gap: 0.24rem;
}

.stats-card-value {
  color: var(--ld-ink) !important;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  font-weight: 950;
}

.stats-card-label {
  color: var(--ld-muted) !important;
  font-weight: 800;
}

.panel-title {
  color: var(--ld-ink);
  font-weight: 950;
}

.panel-title i {
  color: var(--ld-teal) !important;
}

.btn,
.btn-enterprise,
.action-btn,
.ghost-btn {
  border-radius: var(--ld-radius) !important;
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.btn-primary,
.btn-enterprise,
.manage-nav .nav-link.active {
  background: var(--ld-action-gradient) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.19) !important;
}

.btn-outline {
  color: var(--ld-ink) !important;
  border: 1px solid rgba(15, 118, 110, 0.28) !important;
  background: rgba(255, 255, 255, 0.68) !important;
}

.btn-outline:hover {
  color: #fff !important;
  border-color: transparent !important;
  background: linear-gradient(135deg, rgba(23, 32, 51, 0.94), rgba(15, 118, 110, 0.9)) !important;
}

.btn:hover,
.btn-enterprise:hover,
.action-btn:hover,
.ghost-btn:hover {
  transform: translateY(-2px);
}

.form-control,
.form-select,
select,
textarea,
input {
  border-radius: var(--ld-radius) !important;
}

.input-shell,
.asset-option,
.type-option,
.status-option,
.toggle-card {
  border-radius: var(--ld-radius) !important;
}

.form-control,
.form-select,
.input-shell {
  background: rgba(255, 255, 255, 0.76) !important;
  border-color: rgba(68, 64, 60, 0.18) !important;
}

.form-control:focus,
.form-select:focus,
.input-shell:focus-within {
  border-color: rgba(15, 118, 110, 0.58) !important;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1) !important;
}

.badge-status,
.badge,
.queue-meta small {
  border-radius: var(--ld-radius) !important;
  font-weight: 900;
}

.badge-status.active,
.badge-success {
  background: rgba(5, 150, 105, 0.12) !important;
  border-color: rgba(5, 150, 105, 0.2) !important;
  color: #047857 !important;
}

.badge-status.warning,
.badge-warning {
  background: rgba(202, 138, 4, 0.14) !important;
  border-color: rgba(202, 138, 4, 0.26) !important;
  color: #92400e !important;
}

.badge-status.danger,
.badge-danger {
  background: rgba(220, 38, 38, 0.12) !important;
  border-color: rgba(220, 38, 38, 0.22) !important;
  color: #b91c1c !important;
}

.badge-status.inactive {
  background: rgba(87, 83, 78, 0.12) !important;
  border-color: rgba(87, 83, 78, 0.18) !important;
  color: #57534e !important;
}

.lab-icon,
.stats-card-icon,
.quick-action-icon,
.activity-icon,
.summary-icon,
.asset-icon {
  border-radius: var(--ld-radius) !important;
  background: var(--ld-action-gradient) !important;
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.18) !important;
}

.table-modern,
.data-table,
.table-container {
  border-radius: var(--ld-radius) !important;
  overflow: hidden;
}

.table-modern thead,
.data-table thead {
  background: var(--ld-command-gradient) !important;
}

.table-modern th,
.data-table th {
  color: #fff !important;
}

.table-modern tbody tr,
.data-table tbody tr {
  transition: background 160ms ease;
}

.table-modern tbody tr:hover,
.data-table tbody tr:hover {
  background: rgba(15, 118, 110, 0.06) !important;
}

.dashboard-shell {
  gap: 1.05rem;
}

.dashboard-header {
  min-height: 220px;
}

.command-grid,
.dashboard-grid {
  gap: 1rem;
}

.command-queue-line,
.dashboard-line,
.equipment-alert,
.alert-row,
.quick-action-card {
  border-radius: var(--ld-radius) !important;
}

.loading-state {
  border-radius: var(--ld-radius);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(68, 64, 60, 0.12);
  backdrop-filter: var(--ld-glass);
}

.spinner-ring {
  border-top-color: var(--ld-teal) !important;
}

.spinner-ring:nth-child(2) {
  border-top-color: var(--ld-gold) !important;
}

.spinner-ring:nth-child(3) {
  border-top-color: var(--ld-cyan) !important;
}

@media (max-width: 1180px) {
  .topbar-command-strip {
    order: 3;
    width: 100%;
    justify-content: stretch;
  }

  .topbar-command-strip a {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 992px) {
  .command-sidebar,
  .sidebar {
    width: 260px;
  }

  .main-area {
    margin-right: 260px;
  }
}

@media (max-width: 768px) {
  .command-sidebar,
  .sidebar {
    width: min(86vw, 320px);
  }

  .main-area {
    margin-right: 0;
  }

  .command-topbar,
  .topbar {
    align-items: stretch;
  }

  .topbar-leading,
  .topbar-actions,
  .user-pill {
    width: 100%;
  }

  .topbar-title {
    min-width: 0;
  }

  .topbar-command-strip {
    overflow-x: auto;
  }

  .topbar-command-strip a {
    min-width: 88px;
  }

  .dashboard-header {
    min-height: auto;
  }
}

/* Operational QR Passports */
.operational-passport {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(340px, 1.35fr) minmax(188px, 220px);
  gap: 1rem;
  align-items: stretch;
  margin: 1rem 0;
  padding: clamp(1rem, 2vw, 1.45rem);
  overflow: hidden;
  border: 1px solid rgba(68, 64, 60, 0.13);
  border-radius: var(--ld-radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.8)),
    repeating-linear-gradient(135deg, rgba(15, 118, 110, 0.06) 0 1px, transparent 1px 16px);
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.08);
}

.card-surface.operational-passport::before,
.card-surface.operational-passport::after {
  display: none;
}

.operational-passport.active {
  border-color: rgba(22, 163, 74, 0.32);
}

.operational-passport.warning {
  border-color: rgba(202, 138, 4, 0.36);
}

.operational-passport.danger {
  border-color: rgba(220, 38, 38, 0.32);
}

.passport-main,
.scan-decision-grid,
.passport-qr-panel,
.passport-signal-grid {
  position: relative;
  z-index: 1;
}

.passport-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.9rem;
}

.passport-eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.62rem;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 800;
}

.passport-main h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.25rem, 2vw, 1.85rem);
  font-weight: 950;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.passport-main p {
  margin: 0;
  color: #57534e;
  font-size: 0.94rem;
  line-height: 1.85;
}

.passport-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.scan-decision-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.scan-decision-card {
  display: flex;
  min-height: 128px;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.9rem;
  border: 1px solid rgba(68, 64, 60, 0.12);
  border-right: 4px solid rgba(15, 118, 110, 0.55);
  border-radius: var(--ld-radius);
  background: rgba(255, 255, 255, 0.72);
}

.scan-decision-card.danger {
  border-right-color: rgba(220, 38, 38, 0.7);
}

.scan-decision-card.access {
  border-right-color: rgba(37, 99, 235, 0.68);
}

.scan-decision-card.action {
  border-right-color: rgba(202, 138, 4, 0.78);
}

.scan-decision-card span,
.passport-signal span {
  color: #78716c;
  font-size: 0.76rem;
  font-weight: 850;
}

.scan-decision-card strong {
  color: #0f172a;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.scan-decision-card small,
.passport-signal small {
  color: #57534e;
  font-size: 0.78rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.passport-qr-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--ld-radius);
  background: rgba(255, 255, 255, 0.84);
}

.qr-frame {
  display: grid;
  min-height: 172px;
  place-items: center;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: calc(var(--ld-radius) - 2px);
  background: #fff;
}

.qr-frame svg {
  width: min(100%, 160px);
  height: auto;
}

.passport-qr-panel strong {
  display: block;
  color: #0f172a;
  font-weight: 950;
}

.passport-qr-panel span {
  display: block;
  margin-top: 0.35rem;
  color: #78716c;
  direction: ltr;
  font-size: 0.72rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-align: left;
}

.passport-signal-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 0.65rem;
}

.passport-signal {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.22rem 0.55rem;
  min-width: 0;
  padding: 0.72rem;
  border: 1px solid rgba(68, 64, 60, 0.1);
  border-radius: var(--ld-radius);
  background: rgba(255, 255, 255, 0.68);
}

.passport-signal i {
  grid-row: span 3;
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: calc(var(--ld-radius) - 2px);
  background: rgba(15, 118, 110, 0.1);
  color: #0f766e;
}

.passport-signal.warning i {
  background: rgba(202, 138, 4, 0.12);
  color: #92400e;
}

.passport-signal.danger i {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.passport-signal.inactive i {
  background: rgba(87, 83, 78, 0.1);
  color: #57534e;
}

.passport-signal strong {
  min-width: 0;
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 950;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.scope-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.scope-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.28rem 0.65rem;
  align-items: center;
  min-height: 92px;
  padding: 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: var(--ld-radius);
  background: rgba(255, 255, 255, 0.82);
  color: #334155;
  cursor: pointer;
  text-align: right;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.scope-option:hover {
  transform: translateY(-1px);
  border-color: rgba(20, 184, 166, 0.45);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.scope-option i {
  grid-row: span 2;
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: calc(var(--ld-radius) - 2px);
  background: rgba(148, 163, 184, 0.14);
  color: #475569;
  font-size: 1rem;
}

.scope-option strong {
  color: #0f172a;
  font-weight: 950;
}

.scope-option span {
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.65;
}

.scope-option.selected {
  border-color: rgba(20, 184, 166, 0.55);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.14), rgba(255, 255, 255, 0.95));
  box-shadow: 0 16px 36px rgba(20, 184, 166, 0.13);
}

.scope-option.selected i {
  background: #0f766e;
  color: #fff;
}

.scope-option.private.selected {
  border-color: rgba(99, 102, 241, 0.45);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(255, 255, 255, 0.95));
  box-shadow: 0 16px 36px rgba(79, 70, 229, 0.12);
}

.scope-option.private.selected i {
  background: #4f46e5;
}

.scope-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  margin-top: 0.45rem;
  padding: 0.34rem 0.58rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.9);
  color: #334155;
  font-size: 0.78rem;
  font-weight: 850;
}

.visibility-consent-card {
  display: grid;
  gap: 0.8rem;
  padding: 0.85rem;
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: var(--ld-radius);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(255, 255, 255, 0.94));
}

.visibility-consent-heading {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.visibility-consent-heading i,
.locked-consent-lab i {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: calc(var(--ld-radius) - 2px);
  background: rgba(99, 102, 241, 0.14);
  color: #4f46e5;
}

.visibility-consent-heading strong {
  display: block;
  color: #0f172a;
  font-weight: 950;
}

.visibility-consent-heading span,
.reporting-lab-line {
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.65;
}

.locked-consent-lab {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: fit-content;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: calc(var(--ld-radius) - 2px);
  background: rgba(255, 255, 255, 0.72);
  color: #334155;
  font-weight: 850;
}

.privacy-check {
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  color: #334155;
  line-height: 1.75;
}

.reporting-lab-line {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.42rem;
}

.reporting-lab-line i {
    color: #0f766e;
}

.knowledge-shell {
    max-width: 1320px;
    margin: 0 auto;
}

.knowledge-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.knowledge-hero-actions,
.knowledge-filters,
.knowledge-record-actions,
.knowledge-linked-items,
.knowledge-share-check,
.form-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}

.knowledge-stats {
    margin-bottom: 1rem;
}

.sharing-governance-panel {
    display: grid;
    gap: .85rem;
    margin-bottom: 1rem;
}

.sharing-governance-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.sharing-governance-card {
    display: grid;
    gap: .35rem;
    min-width: 0;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: .85rem;
    background: #fff;
}

.sharing-governance-card.warning {
    border-color: rgba(217, 119, 6, .28);
    background: rgba(217, 119, 6, .06);
}

.sharing-governance-card.danger {
    border-color: rgba(220, 38, 38, .25);
    background: rgba(220, 38, 38, .06);
}

.sharing-governance-card.inactive {
    background: rgba(100, 116, 139, .07);
}

.sharing-governance-card i {
    color: var(--color-primary);
    font-size: 1.2rem;
}

.sharing-governance-card strong {
    color: var(--color-strong);
    font-size: 1.6rem;
    line-height: 1.1;
}

.sharing-governance-card span {
    color: var(--color-strong);
    font-weight: 900;
}

.sharing-governance-card small {
    color: var(--color-muted);
    line-height: 1.6;
}

.knowledge-layout {
    display: grid;
    grid-template-columns: minmax(360px, .88fr) minmax(0, 1.12fr);
    gap: 1rem;
    align-items: start;
}

.knowledge-form-panel {
    padding: 1rem;
}

.knowledge-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

.form-field {
    display: grid;
    gap: .35rem;
}

.form-field > span {
    color: var(--color-strong);
    font-size: .9rem;
    font-weight: 800;
}

.form-field.wide {
    grid-column: 1 / -1;
}

.knowledge-share-check {
    align-items: flex-start;
    margin: 1rem 0;
    padding: .85rem;
    border: 1px solid rgba(15, 118, 110, .18);
    border-radius: 8px;
    background: rgba(15, 118, 110, .07);
    color: var(--color-text);
    font-weight: 700;
    line-height: 1.7;
}

.knowledge-quality-panel {
    display: grid;
    gap: .75rem;
    margin: .85rem 0 1rem;
    padding: .85rem;
    border: 1px solid rgba(59, 130, 246, .18);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(239, 246, 255, .9), rgba(240, 253, 250, .9));
}

.knowledge-quality-head,
.knowledge-quality-items {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    flex-wrap: wrap;
}

.knowledge-quality-head strong {
    display: block;
    margin-top: .15rem;
    color: var(--color-strong);
    font-size: .98rem;
}

.knowledge-quality-items {
    justify-content: flex-start;
}

.knowledge-quality-items.compact {
    gap: .45rem;
}

.knowledge-quality-items .badge-status {
    gap: .35rem;
}

.knowledge-sharing-card {
    display: grid;
    gap: .6rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: .8rem;
    background: rgba(255, 255, 255, .78);
}

.knowledge-sharing-card.draft {
    margin: .25rem 0 1rem;
}

.knowledge-sharing-card.active {
    border-color: rgba(15, 118, 110, .24);
    background: rgba(15, 118, 110, .06);
}

.knowledge-sharing-card.warning {
    border-color: rgba(217, 119, 6, .28);
    background: rgba(217, 119, 6, .06);
}

.knowledge-sharing-card.danger {
    border-color: rgba(220, 38, 38, .25);
    background: rgba(220, 38, 38, .06);
}

.knowledge-sharing-card.inactive {
    background: rgba(100, 116, 139, .07);
}

.sharing-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    flex-wrap: wrap;
}

.sharing-card-head span {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--color-muted);
    font-weight: 900;
}

.sharing-card-head strong {
    color: var(--color-strong);
}

.knowledge-sharing-card p {
    margin: 0;
    color: var(--color-text);
    line-height: 1.7;
}

.sharing-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .55rem;
}

.sharing-preview-grid span {
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    padding: .55rem;
    color: var(--color-muted);
    background: rgba(248, 250, 252, .72);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.sharing-preview-grid strong {
    color: var(--color-strong);
    font-weight: 850;
}

.compact-alert {
    margin: 0;
    padding: .7rem .85rem;
}

.knowledge-list-panel {
    display: grid;
    gap: 1rem;
}

.knowledge-filters {
    justify-content: space-between;
    padding: .85rem;
}

.compact-select {
    width: auto;
    min-width: 180px;
}

.compact-empty {
    padding: 1.5rem;
}

.knowledge-record-grid {
    display: grid;
    gap: 1rem;
}

.knowledge-record-card {
    display: grid;
    gap: .85rem;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
}

.knowledge-record-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.knowledge-record-head h3 {
    margin: .25rem 0 0;
    color: var(--color-strong);
    font-size: 1.05rem;
    line-height: 1.6;
}

.record-type {
    color: var(--color-primary);
    font-size: .82rem;
    font-weight: 900;
}

.knowledge-record-card p {
    margin: 0;
    color: var(--color-text);
    line-height: 1.8;
}

.knowledge-record-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
    color: var(--color-muted);
    font-size: .88rem;
}

.knowledge-record-meta span,
.knowledge-linked-items a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.knowledge-linked-items a {
    color: var(--color-primary);
    font-weight: 800;
    text-decoration: none;
}

.knowledge-record-details {
    display: grid;
    gap: .55rem;
    margin: 0;
}

.knowledge-record-details div {
    display: grid;
    gap: .2rem;
}

.knowledge-record-details dt {
    color: var(--color-muted);
    font-size: .8rem;
    font-weight: 900;
}

.knowledge-record-details dd {
    margin: 0;
    color: var(--color-text);
    line-height: 1.7;
}

.danger-outline {
    border-color: rgba(220, 38, 38, .25);
    color: #b91c1c;
}

.danger-outline:hover {
    background: rgba(220, 38, 38, .08);
    border-color: rgba(220, 38, 38, .45);
    color: #991b1b;
}

.safety-check-shell {
    max-width: 1320px;
    margin: 0 auto;
}

.safety-check-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.safety-check-actions,
.safety-check-form-grid,
.safety-selection-grid,
.form-actions,
.decision-metrics,
.finding-tags {
    display: flex;
    gap: .7rem;
    flex-wrap: wrap;
}

.safety-check-stats {
    margin-bottom: 1rem;
}

.safety-check-layout {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(0, .9fr);
    gap: 1rem;
    align-items: start;
}

.safety-check-form-panel,
.operational-checklist-panel,
.findings-panel,
.recent-checks {
    padding: 1rem;
}

.safety-check-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.safety-check-form-grid .wide {
    grid-column: 1 / -1;
}

.safety-selection-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.selection-panel {
    display: grid;
    gap: .75rem;
    min-width: 0;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: .85rem;
    background: rgba(248, 250, 252, .76);
}

.selection-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    color: var(--color-strong);
}

.selection-panel-head > div {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-width: 0;
}

.selection-panel-head span {
    color: var(--color-primary);
    font-size: .86rem;
    font-weight: 900;
    white-space: nowrap;
}

.compact-search {
    width: 100%;
    min-width: 0;
}

.selection-list {
    display: grid;
    gap: .45rem;
    max-height: 420px;
    overflow: auto;
    padding-left: .2rem;
}

.selection-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: .65rem;
    min-height: 58px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: .65rem;
    background: var(--color-surface);
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.selection-row:hover,
.selection-row.selected {
    border-color: rgba(15, 118, 110, .42);
    background: rgba(15, 118, 110, .07);
}

.selection-row input {
    margin-top: .25rem;
}

.selection-row span {
    display: grid;
    gap: .18rem;
    min-width: 0;
}

.selection-row strong {
    color: var(--color-strong);
    overflow-wrap: anywhere;
}

.selection-row small {
    color: var(--color-muted);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.safety-check-result-column {
    display: grid;
    gap: 1rem;
}

.decision-panel {
    display: grid;
    gap: .8rem;
    padding: 1.1rem;
    border-width: 2px;
}

.decision-panel.active {
    border-color: rgba(22, 163, 74, .28);
    background: rgba(22, 163, 74, .06);
}

.decision-panel.warning {
    border-color: rgba(217, 119, 6, .3);
    background: rgba(217, 119, 6, .07);
}

.decision-panel.danger {
    border-color: rgba(220, 38, 38, .28);
    background: rgba(220, 38, 38, .07);
}

.decision-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.decision-head span {
    color: var(--color-muted);
    font-size: .86rem;
    font-weight: 900;
}

.decision-head h2 {
    margin: .2rem 0 0;
    color: var(--color-strong);
    font-size: 1.45rem;
}

.decision-head i {
    color: var(--color-primary);
    font-size: 2.1rem;
}

.decision-panel p,
.decision-placeholder p {
    margin: 0;
    color: var(--color-text);
    line-height: 1.8;
}

.decision-metrics span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: .3rem .55rem;
    background: rgba(255, 255, 255, .75);
    color: var(--color-muted);
    font-weight: 800;
}

.decision-placeholder {
    display: grid;
    gap: .6rem;
    padding: 1.5rem;
    text-align: center;
}

.decision-placeholder i {
    color: var(--color-primary);
    font-size: 2.4rem;
}

.decision-placeholder h2 {
    margin: 0;
    color: var(--color-strong);
    font-size: 1.2rem;
}

.finding-list,
.operational-checklist-list,
.recent-check-list {
    display: grid;
    gap: .75rem;
}

.operational-checklist-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: .75rem;
    background: rgba(255, 255, 255, .82);
}

.operational-checklist-item.warning {
    border-color: rgba(217, 119, 6, .28);
    background: rgba(217, 119, 6, .06);
}

.operational-checklist-item.danger {
    border-color: rgba(220, 38, 38, .24);
    background: rgba(220, 38, 38, .06);
}

.checklist-step-index {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(15, 118, 110, .1);
    color: var(--color-primary);
    font-weight: 950;
}

.checklist-step-body {
    display: grid;
    gap: .2rem;
    min-width: 0;
}

.checklist-step-body strong {
    color: var(--color-strong);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.checklist-step-body small {
    color: var(--color-muted);
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.operational-checklist-item > i {
    color: var(--color-primary);
    font-size: 1.2rem;
}

.finding-card {
    display: grid;
    gap: .55rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: .8rem;
    background: var(--color-surface);
}

.finding-card.warning {
    border-color: rgba(217, 119, 6, .26);
    background: rgba(217, 119, 6, .06);
}

.finding-card.danger {
    border-color: rgba(220, 38, 38, .24);
    background: rgba(220, 38, 38, .06);
}

.finding-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
}

.finding-head strong {
    color: var(--color-strong);
    line-height: 1.6;
}

.finding-card p,
.finding-card small {
    margin: 0;
    color: var(--color-text);
    line-height: 1.7;
}

.finding-card small {
    color: var(--color-muted);
}

.finding-tags span,
.finding-tags a {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: .2rem .45rem;
    background: rgba(255, 255, 255, .75);
    color: var(--color-muted);
    font-size: .8rem;
    font-weight: 800;
    text-decoration: none;
}

.finding-tags a {
    color: var(--color-primary);
}

.recent-check-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .25rem .65rem;
    align-items: center;
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: .7rem;
    background: var(--color-surface);
    cursor: pointer;
    text-align: right;
    transition: border-color .2s ease, background .2s ease;
}

.recent-check-row:hover {
    border-color: rgba(15, 118, 110, .4);
    background: rgba(15, 118, 110, .06);
}

.recent-check-row strong {
    color: var(--color-strong);
    overflow-wrap: anywhere;
}

.recent-check-row small {
    grid-column: 2;
    color: var(--color-muted);
}

.supervisor-approval-box {
    margin-top: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: .9rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .75rem;
    align-items: center;
    background: var(--color-surface);
}

.supervisor-approval-box.pending {
    border-color: rgba(245, 158, 11, .45);
}

.supervisor-approval-box.approved {
    border-color: rgba(22, 163, 74, .5);
}

.supervisor-approval-box > i {
    color: var(--color-primary);
    font-size: 1.35rem;
}

.supervisor-approval-box strong,
.supervisor-approval-box small {
    display: block;
}

.supervisor-approval-box small {
    margin-top: .25rem;
    color: var(--color-muted);
}

.approval-notes-input {
    grid-column: 1 / -1;
    min-height: 72px;
}

.supervisor-approval-box .btn {
    grid-column: 1 / -1;
    width: max-content;
}

@media (max-width: 1100px) {
    .safety-check-layout,
    .safety-selection-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .safety-check-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .safety-check-form-grid {
        grid-template-columns: 1fr;
    }

    .decision-head,
    .finding-head {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 980px) {
    .knowledge-layout,
    .sharing-governance-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .knowledge-hero,
    .knowledge-filters,
    .knowledge-quality-head,
    .knowledge-record-head {
        align-items: stretch;
        flex-direction: column;
    }

    .knowledge-form-grid,
    .knowledge-record-meta,
    .sharing-preview-grid {
        grid-template-columns: 1fr;
    }

    .compact-select {
        width: 100%;
    }
}

.reporting-lab-line.muted i {
  color: #64748b;
}

@media (max-width: 1180px) {
  .operational-passport {
    grid-template-columns: minmax(220px, 0.9fr) minmax(300px, 1.2fr);
  }

  .passport-qr-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 180px 1fr;
    align-items: center;
  }
}

@media (max-width: 760px) {
  .operational-passport,
  .scan-decision-grid,
  .passport-qr-panel {
    grid-template-columns: 1fr;
  }

  .scan-decision-card {
    min-height: 108px;
  }

  .qr-frame {
    min-height: 156px;
  }

  .scope-picker {
    grid-template-columns: 1fr;
  }
}

/* Mobile navigation stability layer */
html,
body {
  overflow-x: hidden;
}

.app-shell,
.main-area,
.content-shell,
.topbar,
.topbar-leading,
.topbar-title {
  min-width: 0;
}

.sidebar-mobile-auth {
  display: none;
}

@media (max-width: 992px) {
  .command-sidebar,
  .sidebar {
    display: flex;
    flex-direction: column;
    position: fixed !important;
    inset: 0 0 0 auto !important;
    width: 260px !important;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    z-index: 1001;
  }

  .command-nav,
  .sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 1rem;
    scrollbar-width: thin;
  }

  .main-area {
    margin-right: 260px !important;
    margin-left: 0 !important;
    width: auto;
  }
}

@media (max-width: 768px) {
  .app-shell {
    display: block;
    width: 100%;
  }

  .command-sidebar,
  .sidebar {
    width: min(92vw, 340px) !important;
    gap: 0.46rem;
    padding: 0.62rem !important;
    transform: translateX(104%) !important;
    transition: transform 260ms cubic-bezier(.2, .8, .2, 1), box-shadow 260ms ease;
    box-shadow: -28px 0 70px rgba(12, 10, 9, 0.34) !important;
    will-change: transform;
  }

  .mobile-menu-checkbox:checked ~ .command-sidebar,
  .mobile-menu-checkbox:checked ~ .sidebar {
    transform: translateX(0) !important;
  }

  .mobile-menu-overlay {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(12, 10, 9, 0.42);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, visibility 220ms ease;
    z-index: 1000;
  }

  .mobile-menu-checkbox:checked ~ .mobile-menu-overlay {
    opacity: 1 !important;
    visibility: visible;
    pointer-events: auto;
  }

  .main-area {
    margin-right: 0 !important;
    width: 100%;
  }

  .command-topbar,
  .topbar {
    z-index: 900;
    flex-wrap: wrap;
    align-items: stretch !important;
    width: 100%;
    padding: 0.75rem;
  }

  .topbar-leading {
    width: 100%;
    align-items: center;
  }

  .topbar-title {
    flex: 1 1 auto;
  }

  .topbar-title-text {
    font-size: 0.92rem;
    line-height: 1.35;
    white-space: normal;
  }

  .mobile-menu-toggle {
    flex: 0 0 42px;
    width: 42px !important;
    height: 42px !important;
    margin: 0 0 0 0.35rem !important;
    border: 1px solid rgba(68, 64, 60, 0.14) !important;
    background: rgba(255, 255, 255, 0.72) !important;
    color: var(--ld-ink, var(--color-strong)) !important;
    box-shadow: 0 10px 22px rgba(12, 10, 9, 0.08);
  }

  .sidebar-brand-card {
    grid-template-columns: 34px minmax(0, 1fr) 36px;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .brand {
    font-size: 1rem;
    line-height: 1.2;
  }

  .brand-sub {
    font-size: 0.66rem;
  }

  .mobile-menu-close {
    width: 36px !important;
    height: 36px !important;
  }

  .sidebar-command-chip {
    margin: 0.18rem 0 0.08rem;
    padding: 0.42rem 0.56rem;
    gap: 0.48rem;
    border-radius: 8px;
  }

  .sidebar-command-chip strong {
    font-size: 0.78rem;
  }

  .sidebar-command-chip small {
    font-size: 0.7rem;
    line-height: 1.45;
  }

  .pulse-dot {
    width: 0.5rem;
    height: 0.5rem;
  }

  .command-nav,
  .sidebar-nav {
    gap: 0.24rem;
    padding: 0.08rem 0 0.36rem;
  }

  .nav-cluster {
    gap: 0.08rem;
  }

  .sidebar-section-title {
    margin: 0.1rem 0 0.08rem;
    padding: 0.18rem 0.7rem 0.08rem;
    font-size: 0.62rem;
  }

  .sidebar-link {
    min-height: 35px;
    padding: 0.36rem 0.68rem;
    border-radius: 8px !important;
    font-size: 0.88rem;
  }

  .sidebar-link i {
    width: 1.15rem;
    font-size: 1rem;
  }

  .brand-copy,
  .sidebar-command-chip > div,
  .sidebar-link span {
    min-width: 0;
  }

  .brand-sub,
  .sidebar-command-chip small,
  .sidebar-link span {
    overflow-wrap: anywhere;
  }

  .sidebar-link::after {
    display: none !important;
  }

  .sidebar-mobile-auth {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.52rem;
    flex: 0 0 auto;
    padding: 0.48rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background:
      linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(220, 38, 38, 0.08)),
      rgba(255, 255, 255, 0.07);
  }

  .sidebar-mobile-user {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 0.46rem;
    align-items: center;
    min-width: 0;
  }

  .sidebar-mobile-user > i {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
  }

  .sidebar-mobile-name {
    color: #fff;
    font-size: 0.76rem;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-mobile-link,
  .sidebar-mobile-login {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.68rem;
    font-weight: 800;
    text-decoration: none;
  }

  .sidebar-mobile-link:hover,
  .sidebar-mobile-login:hover {
    color: #fff;
  }

  .sidebar-mobile-logout-form {
    margin: 0;
  }

  .sidebar-mobile-logout,
  .sidebar-mobile-login {
    width: auto;
    min-width: 72px;
    min-height: 34px;
    padding: 0.35rem 0.58rem;
    justify-content: center;
    border: 1px solid rgba(248, 113, 113, 0.28);
    border-radius: 8px;
    color: #fff;
    background: rgba(220, 38, 38, 0.17);
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
  }

  .sidebar-mobile-login {
    border-color: rgba(45, 212, 191, 0.3);
    background: rgba(20, 184, 166, 0.14);
  }

  .sidebar-mobile-logout:hover,
  .sidebar-mobile-login:hover {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.13);
    transform: translateY(-1px);
  }

  .topbar-command-strip {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .topbar-command-strip::-webkit-scrollbar {
    display: none;
  }

  .topbar-actions,
  .user-pill {
    min-width: 0;
  }

  .content-shell {
    max-width: 100%;
    padding: 1rem;
    overflow-x: clip;
  }

  .command-footer,
  .sidebar-footer {
    display: none !important;
  }
}

@media (max-width: 768px) and (max-height: 720px) {
  .sidebar-command-chip {
    display: none;
  }

  .brand-sub {
    display: none;
  }

  .command-nav,
  .sidebar-nav {
    gap: 0.16rem;
  }

  .sidebar-link {
    min-height: 33px;
    padding-block: 0.32rem;
  }

  .sidebar-mobile-auth {
    padding: 0.42rem;
  }
}

@media (max-width: 380px) {
  .sidebar-mobile-auth {
    grid-template-columns: 1fr;
  }

  .sidebar-mobile-logout,
  .sidebar-mobile-login {
    width: 100%;
  }
}

@supports selector(:has(*)) {
  @media (max-width: 768px) {
    body:has(.mobile-menu-checkbox:checked) {
      overflow: hidden;
    }
  }
}
