/* Infection Control Dashboard Portal shared styles, adapted from the OHS visual system. */

:root,
[data-bs-theme="light"] {
  --font-sans: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  --primary: #803040;
  --primary-dark: #622431;
  --primary-light: #a65a6c;
  --secondary: #e0b040;
  --sidebar-bg: #101322;
  --surface: #ffffff;
  --surface-low: #f3f6ff;
  --surface-mid: #eff2fc;
  --background: #f5f7fc;
  --on-surface: #0b1220;
  --body-color: #33354d;
  --text-muted: #71758c;
  --border: #d8deea;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --cyan: #0ea5b7;
  --indigo: #803040;
  --glass-bg: rgba(255, 255, 255, 0.76);
  --glass-bg-strong: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-shadow: 0 1rem 2.5rem rgba(11, 15, 25, 0.08), 0 0.25rem 0.75rem rgba(11, 15, 25, 0.04);
  --radius-lg: 8px;
  --radius-xl: 16px;
  --sidebar-width: 286px;
  --focus-ring: rgba(128, 48, 64, 0.22);
  color-scheme: light;
}

[data-bs-theme="dark"] {
  --primary: #f2c8d2;
  --primary-dark: #d991a5;
  --primary-light: #f6dbe2;
  --secondary: #e0b040;
  --sidebar-bg: #090d18;
  --surface: #151923;
  --surface-low: #1d2330;
  --surface-mid: #283143;
  --background: #0b0f19;
  --on-surface: #ffffff;
  --body-color: #d9deea;
  --text-muted: #a8afc2;
  --border: rgba(255, 255, 255, 0.14);
  --glass-bg: rgba(21, 25, 35, 0.74);
  --glass-bg-strong: rgba(21, 25, 35, 0.9);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.32), 0 0.25rem 0.75rem rgba(0, 0, 0, 0.22);
  --focus-ring: rgba(242, 200, 210, 0.24);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--body-color);
  background-color: var(--background);
  background-image: url("../img/menu_bg.png");
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
  font-family: var(--font-sans);
  letter-spacing: 0;
}

[data-bs-theme="dark"] body {
  background-image:
    linear-gradient(135deg, rgba(11, 15, 25, 0.76), rgba(11, 15, 25, 0.9)),
    url("../img/menu_bg.png");
}

body,
button,
input,
select,
textarea {
  font-family: var(--font-sans);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-dark);
}

.material-symbols-outlined {
  font-size: 1.25rem;
  line-height: 1;
  vertical-align: middle;
}

.ohs-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 18px 12px;
  overflow-y: auto;
  background:
    radial-gradient(circle at top left, rgba(138, 49, 77, 0.28), transparent 34%),
    var(--sidebar-bg);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
}

.brand-logo {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  padding: 5px;
  object-fit: contain;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 0.5rem 1.125rem rgba(11, 15, 25, 0.06);
}

.brand-title {
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.18;
}

.brand-sub {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
  line-height: 1.25;
}

.sidebar-nav {
  flex: 1;
  padding: 2px 0;
}

.ohs-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0.62rem 0.75rem;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: color 0.16s ease, background 0.16s ease;
}

.ohs-sidebar .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.ohs-sidebar .nav-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(138, 49, 77, 0.9), rgba(138, 49, 77, 0.45));
  box-shadow: 0 0.275rem 0.75rem -0.0625rem rgba(0, 0, 0, 0.2);
}

.sidebar-footer {
  padding-top: 14px;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.user-avatar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  background: #803040;
  border-radius: 50%;
}

.user-name {
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
}

.user-role {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
}

.theme-switch-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px 12px;
}

.mode-switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 178px;
  padding: 0.52rem 1rem;
  color: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.mode-switch input {
  width: 2.875rem;
  height: 1.5rem;
  margin: 0;
  cursor: pointer;
  background-color: #803040;
  background-image: radial-gradient(circle, #fff 0 0.45rem, transparent 0.48rem);
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 1.5rem 1.5rem;
  border: 0;
  border-radius: 999px;
  appearance: none;
  transition: background-position 0.2s ease-in-out;
}

.mode-switch input:checked {
  background-position: right center;
}

.ohs-sidebar .logout-link {
  color: rgba(255, 255, 255, 0.62);
}

.ohs-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.ohs-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
  padding: 0 28px;
  background: var(--glass-bg-strong);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 0.125rem 0.5rem rgba(11, 15, 25, 0.03);
  backdrop-filter: blur(18px) saturate(155%);
  -webkit-backdrop-filter: blur(18px) saturate(155%);
}

.topbar-title {
  color: var(--on-surface);
  font-size: 1.08rem;
  font-weight: 800;
}

.topbar-subtitle {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ohs-content {
  flex: 1;
  width: 100%;
  padding: 28px;
}

.ohs-card,
.kpi-card,
.dashboard-card,
.assignment-card,
.empty-state {
  color: var(--body-color);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.ohs-card {
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header-ohs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(243, 246, 255, 0.58);
  border-bottom: 1px solid var(--border);
}

.card-title {
  margin: 0;
  color: var(--on-surface);
  font-size: 0.96rem;
  font-weight: 800;
}

.card-subtitle {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.card-body-ohs {
  padding: 20px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
}

.kpi-icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
}

.kpi-icon.blue { color: var(--cyan); background: rgba(14, 165, 183, 0.12); }
.kpi-icon.green { color: var(--success); background: rgba(34, 197, 94, 0.12); }
.kpi-icon.amber { color: var(--warning); background: rgba(245, 158, 11, 0.14); }
.kpi-icon.red { color: var(--danger); background: rgba(239, 68, 68, 0.12); }
.kpi-icon.primary,
.kpi-icon.indigo { color: #803040; background: rgba(128, 48, 64, 0.12); }

.kpi-value {
  margin-bottom: 4px;
  color: var(--on-surface);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}

.kpi-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-ohs-primary,
.btn-ohs-ghost,
.btn-ohs-danger,
.btn-ohs-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.48rem 1rem;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border-radius: var(--radius-lg);
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.btn-ohs-primary {
  color: #fff;
  background: #803040;
  border: 1px solid #803040;
  box-shadow: 0 0.5rem 1.125rem -0.5rem rgba(128, 48, 64, 0.9);
}

.btn-ohs-primary:hover {
  color: #fff;
  background: #622431;
  border-color: #622431;
}

.btn-ohs-ghost {
  color: var(--primary);
  background: transparent;
  border: 1px solid var(--border);
}

.btn-ohs-ghost:hover {
  color: var(--primary-dark);
  background: rgba(138, 49, 77, 0.06);
  border-color: rgba(138, 49, 77, 0.22);
}

.btn-ohs-danger {
  color: #fff;
  background: var(--danger);
  border: 1px solid var(--danger);
}

.btn-ohs-success {
  color: #fff;
  background: var(--success);
  border: 1px solid var(--success);
}

.btn-sm-ohs {
  min-height: 30px;
  padding: 0.3rem 0.72rem;
  font-size: 0.76rem;
}

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

.form-grid .full {
  grid-column: 1 / -1;
}

.form-group {
  margin-bottom: 16px;
}

label,
.ohs-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--on-surface);
  font-size: 0.78rem;
  font-weight: 700;
}

.form-control,
.form-select,
textarea {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 0.625rem 0.875rem;
  color: var(--on-surface);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.35;
  outline: 0;
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
  border-color: rgba(128, 48, 64, 0.55);
  box-shadow: 0 0 0 0.25rem var(--focus-ring);
}

.form-help {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.ohs-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  color: var(--body-color);
  font-size: 0.84rem;
}

.ohs-table th {
  padding: 0.72rem 0.9rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-align: left;
  text-transform: uppercase;
  background: var(--surface-low);
  border-bottom: 1px solid var(--border);
}

.ohs-table td {
  padding: 0.82rem 0.9rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.ohs-table tr:last-child td {
  border-bottom: 0;
}

.ohs-table tr:hover td {
  background: rgba(138, 49, 77, 0.035);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.badge-ohs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.25rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 999px;
}

.badge-approved { color: #146c43; background: rgba(34, 197, 94, 0.14); }
.badge-not_started { color: var(--text-muted); background: var(--surface-mid); }
.badge-admin { color: #622431; background: rgba(138, 49, 77, 0.12); }
.badge-pending { color: #9a6700; background: rgba(245, 158, 11, 0.16); }
.badge-info { color: #0e7490; background: rgba(14, 165, 183, 0.12); }

.alert-ohs {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 16px;
  font-size: 0.84rem;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
}

.alert-ohs-warning { color: #9a6700; background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.2); }
.alert-ohs-danger { color: #b42318; background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.2); }
.alert-ohs-info { color: #0e7490; background: rgba(14, 165, 183, 0.12); border-color: rgba(14, 165, 183, 0.18); }
.alert-ohs-success { color: #047857; background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.22); }

.portal-hero {
  margin-bottom: 24px;
  padding: 30px 34px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 34%),
    linear-gradient(132deg, rgba(128, 48, 64, 0.98) 0%, rgba(158, 72, 89, 0.96) 52%, rgba(178, 124, 45, 0.94) 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-xl);
  box-shadow: 0 1.25rem 3rem rgba(128, 48, 64, 0.24);
}

.portal-hero-kicker {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-hero h1 {
  margin: 0 0 8px;
  font-size: 1.7rem;
  line-height: 1.14;
  font-weight: 900;
}

.portal-hero p {
  max-width: 780px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  line-height: 1.55;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.dashboard-accordion-list {
  display: grid;
  gap: 16px;
}

.dashboard-accordion {
  overflow: hidden;
  color: var(--body-color);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.dashboard-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  background: rgba(243, 246, 255, 0.58);
  border-bottom: 1px solid transparent;
}

.dashboard-accordion-summary::-webkit-details-marker {
  display: none;
}

.dashboard-accordion[open] .dashboard-accordion-summary {
  border-bottom-color: var(--border);
}

.dashboard-accordion-title,
.dashboard-accordion-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.dashboard-accordion-title {
  min-width: 0;
  color: var(--on-surface);
  font-size: 0.98rem;
  font-weight: 850;
}

.dashboard-accordion-title .material-symbols-outlined {
  color: var(--primary);
}

.dashboard-accordion-meta {
  flex-shrink: 0;
}

.accordion-chevron {
  color: var(--text-muted);
  transition: transform 0.18s ease;
}

.dashboard-accordion[open] .accordion-chevron {
  transform: rotate(180deg);
}

.dashboard-accordion-body {
  padding: 18px;
}

.dashboard-card {
  display: flex;
  flex-direction: column;
  min-height: 235px;
  padding: 20px;
}

.dashboard-category {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 14px;
}

.dashboard-card h2 {
  margin: 0 0 8px;
  color: var(--on-surface);
  font-size: 1.05rem;
  line-height: 1.3;
}

.dashboard-card p {
  flex: 1;
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.assignment-layout {
  display: grid;
  grid-template-columns: minmax(220px, 310px) 1fr;
  gap: 20px;
  align-items: start;
}

.assignment-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: rgba(243, 246, 255, 0.58);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.assignment-select-all {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--on-surface);
  font-size: 0.86rem;
  font-weight: 800;
}

.assignment-select-all input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.assignment-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.assignment-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 14px;
}

.assignment-card input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
}

.assignment-title {
  color: var(--on-surface);
  font-size: 0.92rem;
  font-weight: 800;
}

.assignment-desc {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.empty-state {
  padding: 34px;
  text-align: center;
}

.empty-state .material-symbols-outlined {
  width: 52px;
  height: 52px;
  padding: 13px;
  margin-bottom: 12px;
  color: var(--cyan);
  background: rgba(14, 165, 183, 0.12);
  border-radius: 16px;
}

.empty-state h2 {
  margin: 0 0 8px;
  color: var(--on-surface);
  font-size: 1.05rem;
}

.empty-state p {
  max-width: 560px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}

.login-shell {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 28px;
  align-items: stretch;
  width: 100%;
  max-width: 980px;
}

.login-hero,
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(18, 24, 38, 0.08);
}

.login-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 44px;
  isolation: isolate;
  background:
    linear-gradient(135deg, rgba(128, 48, 64, 0.1), rgba(224, 176, 64, 0.08) 48%, rgba(14, 165, 183, 0.08)),
    var(--surface);
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(128, 48, 64, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 48, 64, 0.1) 1px, transparent 1px);
  background-size: 38px 38px;
  animation: login-grid-drift 18s linear infinite;
}

.login-hero::after {
  content: "";
  position: absolute;
  right: -45%;
  bottom: 92px;
  z-index: 0;
  width: 150%;
  height: 86px;
  background: linear-gradient(90deg, transparent, rgba(128, 48, 64, 0.14), transparent);
  transform: rotate(-9deg);
  animation: login-light-sweep 7s ease-in-out infinite;
}

.login-hero > * {
  position: relative;
  z-index: 2;
}

.login-hero-visual {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.infection-shield {
  position: absolute;
  right: 30px;
  bottom: 40px;
  width: 196px;
  height: 196px;
  opacity: 0.44;
  filter: drop-shadow(0 16px 30px rgba(128, 48, 64, 0.1));
}

.shield-ring,
.shield-body,
.shield-check {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shield-ring {
  stroke: rgba(224, 176, 64, 0.42);
  stroke-width: 3;
  stroke-dasharray: 16 12;
  transform-origin: center;
  animation: containment-spin 14s linear infinite;
}

.shield-body {
  fill: rgba(255, 255, 255, 0.54);
  stroke: #803040;
  stroke-width: 4;
  backdrop-filter: blur(8px);
}

.shield-check {
  stroke: #803040;
  stroke-width: 11;
  stroke-dasharray: 112;
  stroke-dashoffset: 112;
  animation: shield-check-draw 3.8s ease-in-out infinite;
}

.containment-ring {
  position: absolute;
  border: 1px solid rgba(128, 48, 64, 0.22);
  border-radius: 50%;
  box-shadow: inset 0 0 34px rgba(128, 48, 64, 0.05);
  animation: containment-breathe 8s ease-in-out infinite;
}

.ring-a {
  top: 64px;
  right: 72px;
  width: 240px;
  height: 240px;
}

.ring-b {
  top: 118px;
  right: -18px;
  width: 330px;
  height: 330px;
  animation-delay: -2.8s;
}

.ring-c {
  left: 28px;
  bottom: 88px;
  width: 180px;
  height: 180px;
  border-color: rgba(224, 176, 64, 0.24);
  animation-delay: -5.2s;
}

.microbe {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 34%, rgba(255, 255, 255, 0.72), transparent 12px),
    radial-gradient(circle at 60% 62%, rgba(128, 48, 64, 0.26), transparent 10px),
    rgba(128, 48, 64, 0.18);
  box-shadow:
    inset 0 0 0 2px rgba(128, 48, 64, 0.22),
    0 12px 26px rgba(128, 48, 64, 0.1);
  opacity: 0.34;
  animation: microbe-drift 10s ease-in-out infinite;
}

.microbe::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(128, 48, 64, 0.34) 0 8deg, transparent 8deg 22deg);
  -webkit-mask: radial-gradient(circle, transparent 0 58%, #000 59% 63%, transparent 64%);
  mask: radial-gradient(circle, transparent 0 58%, #000 59% 63%, transparent 64%);
}

.microbe::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: rgba(224, 176, 64, 0.28);
  box-shadow:
    12px -9px 0 -5px rgba(128, 48, 64, 0.34),
    -13px 8px 0 -6px rgba(128, 48, 64, 0.3);
}

.microbe-a {
  top: 82px;
  right: 94px;
}

.microbe-b {
  top: 182px;
  right: 252px;
  width: 34px;
  height: 34px;
  opacity: 0.26;
  animation-delay: -3.4s;
}

.microbe-c {
  left: 66px;
  bottom: 126px;
  width: 42px;
  height: 42px;
  opacity: 0.24;
  animation-delay: -6.2s;
}

.microbe-d {
  right: 48px;
  bottom: 186px;
  width: 28px;
  height: 28px;
  opacity: 0.24;
  animation-delay: -8.6s;
}

.login-hero-copy {
  position: relative;
  max-width: 560px;
}

.login-hero-copy::before {
  content: "";
  position: absolute;
  inset: -26px -44px -30px -26px;
  z-index: -1;
  background:
    radial-gradient(ellipse at left center, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.82) 52%, rgba(255, 255, 255, 0) 78%);
  border-radius: 18px;
}

@keyframes login-grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 38px 38px, 38px 38px; }
}

@keyframes login-light-sweep {
  0%, 100% { transform: translateX(-8%) rotate(-9deg); opacity: 0.25; }
  50% { transform: translateX(8%) rotate(-9deg); opacity: 0.52; }
}

@keyframes containment-spin {
  to { transform: rotate(360deg); }
}

@keyframes containment-breathe {
  0%, 100% { transform: scale(0.96); opacity: 0.42; }
  50% { transform: scale(1.05); opacity: 0.72; }
}

@keyframes shield-check-draw {
  0% { stroke-dashoffset: 112; opacity: 0; }
  18% { opacity: 1; }
  48%, 78% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

@keyframes microbe-drift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  40% { transform: translate3d(-18px, 14px, 0) rotate(18deg); }
  70% { transform: translate3d(10px, -16px, 0) rotate(-12deg); }
}

.login-brand-word {
  max-width: 440px;
  margin-bottom: 34px;
  color: var(--primary-dark);
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-hero h1 {
  margin: 0 0 12px;
  color: var(--on-surface);
  font-size: 34px;
  line-height: 1.08;
  font-weight: 900;
}

.login-hero p {
  max-width: 520px;
  margin: 0;
  color: #4b5368;
  font-size: 15px;
  line-height: 1.55;
}

.login-footnote {
  color: #4b5368;
  font-size: 12px;
}

.login-card-footnote {
  display: none;
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.login-card {
  width: 100%;
  padding: 36px;
}

.login-card-logo {
  width: 62px;
  height: 62px;
  object-fit: contain;
  margin-bottom: 16px;
}

.login-card h2 {
  margin: 0 0 2px;
  color: var(--on-surface);
  font-size: 22px;
  font-weight: 900;
}

.login-sub {
  margin-bottom: 28px;
  color: var(--text-muted);
  font-size: 13px;
}

.login-mode {
  position: fixed;
  top: 18px;
  right: 18px;
  min-width: auto;
  color: var(--body-color);
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 8px 24px rgba(18, 24, 38, 0.08);
}

.login-mode span:first-child {
  color: var(--on-surface);
}

.login-mode span:last-child {
  color: var(--text-muted);
}

.mobile-menu-btn {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 64px;
  color: var(--primary);
  cursor: pointer;
  background: var(--surface);
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 0.125rem 0.4rem rgba(11, 15, 25, 0.05);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: none;
  pointer-events: none;
  background: rgba(11, 15, 25, 0.58);
  opacity: 0;
  transition: opacity 0.24s ease;
}

.sidebar-overlay.active {
  pointer-events: auto;
  opacity: 1;
}

[data-bs-theme="dark"] .card-header-ohs,
[data-bs-theme="dark"] .dashboard-accordion-summary,
[data-bs-theme="dark"] .assignment-toolbar,
[data-bs-theme="dark"] .ohs-topbar,
[data-bs-theme="dark"] .mobile-menu-btn {
  background: rgba(21, 25, 35, 0.9);
  border-color: var(--border);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] textarea {
  background: var(--surface-low);
  border-color: var(--border);
}

[data-bs-theme="dark"] .badge-admin {
  color: var(--primary-light);
}

[data-bs-theme="dark"] .ohs-table tr:hover td {
  background: rgba(255, 255, 255, 0.035);
}

[data-bs-theme="dark"] .login-hero {
  background:
    linear-gradient(135deg, rgba(128, 48, 64, 0.2), rgba(224, 176, 64, 0.11) 48%, rgba(14, 165, 183, 0.1)),
    var(--surface);
}

[data-bs-theme="dark"] .login-hero::before {
  opacity: 0.35;
}

[data-bs-theme="dark"] .shield-body {
  fill: rgba(21, 25, 35, 0.62);
  stroke: #f2c8d2;
}

[data-bs-theme="dark"] .shield-check {
  stroke: #f2c8d2;
}

[data-bs-theme="dark"] .microbe {
  background:
    radial-gradient(circle at 36% 34%, rgba(255, 255, 255, 0.38), transparent 12px),
    radial-gradient(circle at 60% 62%, rgba(242, 200, 210, 0.24), transparent 10px),
    rgba(242, 200, 210, 0.16);
  box-shadow:
    inset 0 0 0 2px rgba(242, 200, 210, 0.2),
    0 12px 26px rgba(0, 0, 0, 0.16);
}

[data-bs-theme="dark"] .microbe::before {
  background: repeating-conic-gradient(from 0deg, rgba(242, 200, 210, 0.3) 0 8deg, transparent 8deg 22deg);
}

[data-bs-theme="dark"] .login-brand-word {
  color: var(--primary-light);
}

[data-bs-theme="dark"] .login-hero-copy::before {
  background:
    radial-gradient(ellipse at left center, rgba(21, 25, 35, 0.95) 0%, rgba(21, 25, 35, 0.76) 54%, rgba(21, 25, 35, 0) 78%);
}

[data-bs-theme="dark"] .login-hero p,
[data-bs-theme="dark"] .login-footnote {
  color: #c8cedb;
}

@media (prefers-reduced-motion: reduce) {
  .login-hero::before,
  .login-hero::after,
  .shield-ring,
  .shield-check,
  .containment-ring,
  .microbe {
    animation: none;
  }
}

@media (max-width: 900px) {
  .login-shell {
    max-width: 480px;
    grid-template-columns: 1fr;
  }

  .login-hero {
    display: none;
  }

  .login-card-logo {
    display: block;
    margin-right: auto;
    margin-left: auto;
  }

  .login-card h2,
  .login-sub {
    text-align: center;
  }

  .login-card-footnote {
    display: block;
  }
}

@media (max-width: 768px) {
  body {
    background-attachment: scroll;
  }

  .ohs-sidebar {
    z-index: 1100;
    transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
  }

  .ohs-sidebar.open {
    transform: translateX(0);
    box-shadow: 0.625rem 0 2rem rgba(0, 0, 0, 0.28);
  }

  .sidebar-overlay {
    display: block;
  }

  .sidebar-brand {
    order: 1;
  }

  .sidebar-footer {
    order: 2;
    padding: 0 0 14px;
    margin-top: 0;
    border-top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sidebar-nav {
    order: 3;
    flex: 1;
    padding-top: 10px;
  }

  .ohs-main {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .ohs-topbar {
    min-height: 64px;
    padding: 0 16px 0 80px;
  }

  .topbar-title {
    font-size: 0.96rem;
  }

  .topbar-subtitle {
    display: none;
  }

  .ohs-content {
    padding: 16px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .kpi-card {
    gap: 10px;
    padding: 14px 12px;
  }

  .kpi-value {
    font-size: 1.35rem;
  }

  .card-header-ohs {
    flex-wrap: wrap;
    gap: 8px;
  }

  .dashboard-accordion-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid,
  .assignment-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .ohs-sidebar {
    width: min(var(--sidebar-width), 88vw);
  }

  .ohs-content {
    padding: 12px;
  }

  .ohs-topbar {
    padding: 0 12px 0 76px;
  }

  .kpi-grid,
  .dashboard-grid,
  .assignment-list {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 28px 22px;
  }

  .login-mode {
    top: 10px;
    right: 10px;
  }

  .portal-hero {
    padding: 24px 20px;
  }

  .portal-hero h1 {
    font-size: 1.35rem;
  }
}
