:root {
  --ink: #062c66;
  --ink-2: #0a397c;
  --teal: #00a9b7;
  --teal-dark: #028391;
  --wash: #f5f8fa;
  --panel: #ffffff;
  --panel-soft: #f8fbfc;
  --chip: #e6f7f9;
  --line: #dce5ea;
  --muted: #64727f;
  --text: #132737;
  --danger: #b42318;
  --warning: #b54708;
  --success: #067647;
  --sidebar-bg: #061b2f;
  --sidebar-ink: #ecf7fb;
  --sidebar-muted: rgba(236, 247, 251, 0.68);
  --appbar-bg: rgba(245, 248, 250, 0.94);
  --panel-overlay: rgba(255, 255, 255, 0.98);
  --shadow: 0 18px 42px rgba(6, 44, 102, 0.12);
  --shadow-strong: 0 24px 70px rgba(6, 44, 102, 0.18);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e5f6ff;
  --ink-2: #b7edf5;
  --teal: #20c7d5;
  --teal-dark: #71e4eb;
  --wash: #07111d;
  --panel: #0e1c2b;
  --panel-soft: #122338;
  --chip: rgba(32, 199, 213, 0.14);
  --line: #24384d;
  --muted: #9eb0c3;
  --text: #edf6fb;
  --danger: #ffb4ab;
  --warning: #f7b267;
  --success: #86efac;
  --sidebar-bg: #06111f;
  --sidebar-ink: #edf8fc;
  --sidebar-muted: rgba(237, 248, 252, 0.66);
  --appbar-bg: rgba(7, 17, 29, 0.92);
  --panel-overlay: rgba(14, 28, 43, 0.98);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  --shadow-strong: 0 28px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--wash);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(6, 44, 102, 0.92), rgba(2, 131, 145, 0.82)),
    url("/assets/brand/facilityos-logo-square.png") center/720px no-repeat,
    var(--ink);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.55fr);
  width: min(1080px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.login-panel {
  padding: clamp(32px, 6vw, 72px);
  background: rgba(255, 255, 255, 0.82);
}

.login-logo {
  width: min(420px, 100%);
  height: auto;
  margin-bottom: 36px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.login-panel h1 {
  max-width: 660px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1;
  letter-spacing: 0;
}

.login-copy {
  max-width: 590px;
  margin: 22px 0 0;
  color: #384957;
  font-size: 18px;
  line-height: 1.55;
}

.login-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.login-stat-row span {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.login-card {
  display: grid;
  align-content: center;
  gap: 20px;
  padding: clamp(28px, 5vw, 46px);
  background: #fff;
}

.login-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 32px;
  letter-spacing: 0;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: #344653;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfdbe2;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(0, 169, 183, 0.14);
}

.fineprint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.app-body {
  display: block;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: none;
  flex-direction: column;
  height: 100vh;
  padding: 20px;
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}

.brand strong,
.user-chip strong {
  display: block;
  font-size: 15px;
}

.brand small,
.user-chip small {
  display: block;
  margin-top: 2px;
  color: var(--sidebar-muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.nav-group {
  margin: 16px 0 2px;
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(236, 247, 251, 0.82);
  font-size: 14px;
  font-weight: 800;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(0, 169, 183, 0.18);
  color: #fff;
}

.nav-link svg {
  display: block;
}

.sidebar-footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.user-chip > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
}

.main {
  min-width: 0;
  padding: 14px 14px 92px;
}

.mobile-appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -14px -14px 16px;
  padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--appbar-bg);
  backdrop-filter: blur(12px);
}

.mobile-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.mobile-brand img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.mobile-brand strong,
.mobile-brand small {
  display: block;
}

.mobile-brand strong {
  color: var(--ink);
  font-size: 15px;
}

.mobile-brand small {
  max-width: 190px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

.topbar-logo {
  width: min(260px, 28vw);
  height: auto;
}

.grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(146px, 1fr));
  margin-bottom: 20px;
}

.stat-card,
.panel,
.detail-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 20px;
}

.stat-card span,
.stat-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin: 10px 0 6px;
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 20px;
}

.panel {
  padding: 22px;
}

.welcome-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.welcome-card h2,
.welcome-card p {
  margin: 0;
}

.welcome-card h2 {
  color: var(--ink);
  font-size: clamp(26px, 7vw, 42px);
  line-height: 1.05;
}

.welcome-card p:not(.eyebrow) {
  max-width: 680px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h2,
.form-section h3,
.empty h3,
.detail-hero h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 900;
}

.btn.primary {
  background: var(--ink);
  color: #fff;
}

.btn.primary:hover {
  background: var(--ink-2);
}

.btn.secondary {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.flash {
  margin-bottom: 16px;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 800;
}

.flash.success {
  border: 1px solid rgba(6, 118, 71, 0.2);
  background: #ecfdf3;
  color: var(--success);
}

.flash.danger {
  border: 1px solid rgba(180, 35, 24, 0.2);
  background: #fef3f2;
  color: var(--danger);
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.mobile-list {
  display: grid;
  gap: 12px;
}

.list-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.list-card strong,
.list-card small,
.list-card p {
  display: block;
  margin: 0;
}

.list-card strong {
  color: var(--ink);
}

.list-card small,
.list-card p {
  color: var(--muted);
}

.desktop-table {
  display: none;
}

.empty.compact {
  padding: 16px;
}

.empty p {
  max-width: 560px;
  margin: 8px 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.table-title {
  color: var(--ink);
  font-weight: 900;
}

.pill,
.status-large {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--chip);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
}

.pill {
  padding: 6px 10px;
}

.status-large {
  padding: 10px 14px;
}

.blueprint {
  background: #061b2f;
  color: #f6fbfd;
}

.blueprint h2 {
  color: #fff;
}

.blueprint .eyebrow {
  color: #65d7df;
}

.check-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  padding-left: 24px;
  position: relative;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
}

.filter-bar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.filter-bar label {
  min-width: 200px;
}

.form-panel {
  max-width: 1120px;
}

.form-section {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.form-section h3 {
  margin-bottom: 14px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

.field-stack {
  margin-top: 14px;
}

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

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

.module-card {
  display: grid;
  gap: 10px;
  min-height: 148px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.module-card:hover {
  border-color: rgba(0, 169, 183, 0.45);
  box-shadow: 0 14px 30px rgba(6, 44, 102, 0.1);
}

.module-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--chip);
  color: var(--teal-dark);
}

.module-card strong,
.module-card small {
  display: block;
}

.module-card strong {
  color: var(--ink);
  font-size: 16px;
}

.module-card small {
  color: var(--muted);
  line-height: 1.45;
}

.module-section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.module-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.module-section h3 {
  margin: 0 0 12px;
  color: var(--ink);
}

.module-hero {
  align-items: flex-start;
}

.module-action-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 20px;
}

.action-card h3,
.action-card p {
  margin: 0;
}

.action-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.action-card p {
  color: var(--muted);
  line-height: 1.5;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.role-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.role-card.allowed {
  border-color: rgba(0, 169, 183, 0.35);
  background: var(--chip);
}

.role-card strong,
.role-card small {
  display: block;
}

.role-card small {
  margin-top: 4px;
  color: var(--muted);
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 2px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--panel-overlay);
  box-shadow: 0 -12px 30px rgba(6, 44, 102, 0.12);
  backdrop-filter: blur(12px);
}

.bottom-nav a {
  display: grid;
  min-height: 54px;
  place-items: center;
  gap: 3px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.bottom-nav a:hover,
.bottom-nav a.active {
  background: var(--chip);
  color: var(--teal-dark);
}

.service-option {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: var(--panel);
}

.service-option input {
  width: 18px;
  min-height: 18px;
}

.service-option strong,
.service-option small {
  display: block;
}

.service-option small {
  margin-top: 3px;
  color: var(--muted);
  text-transform: capitalize;
}

.detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 28px;
}

.detail-hero h2 {
  font-size: clamp(30px, 5vw, 48px);
}

.detail-hero p {
  margin: 10px 0 0;
  color: var(--muted);
}

.facility-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
  font-weight: 800;
}

.service-list,
.timeline {
  display: grid;
  gap: 12px;
}

.service-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.service-row > span {
  color: var(--teal);
}

.service-row strong,
.service-row small,
.timeline strong,
.timeline small {
  display: block;
}

.service-row small,
.timeline small {
  margin-top: 3px;
  color: var(--muted);
  text-transform: capitalize;
}

.timeline div {
  padding-left: 16px;
  border-left: 3px solid var(--teal);
}

.progress-track {
  display: block;
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.progress-track.small {
  height: 8px;
  min-width: 110px;
  margin-top: 6px;
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--ink));
}

.setup-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.setup-task {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.setup-task.complete {
  border-color: rgba(6, 118, 71, 0.25);
  background: rgba(6, 118, 71, 0.06);
}

.task-status {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
}

.setup-task.complete .task-status {
  background: var(--success);
  color: #fff;
}

.setup-task strong,
.setup-task small {
  display: block;
}

.setup-task strong {
  color: var(--ink);
}

.setup-task small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.table-progress {
  display: grid;
  min-width: 130px;
  gap: 2px;
}

.table-progress strong {
  color: var(--ink);
}

button {
  color: inherit;
}

button.icon-button,
button.shell-button,
button.drawer-theme {
  cursor: pointer;
}

.icon-button:hover,
.shell-button:hover,
.drawer-theme:hover {
  border-color: rgba(0, 169, 183, 0.45);
  background: var(--chip);
}

.icon-button:focus-visible,
.shell-button:focus-visible,
.drawer-theme:focus-visible,
.nav-link:focus-visible,
.btn:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(0, 169, 183, 0.28);
  outline-offset: 3px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(5, 16, 27, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.mobile-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: min(356px, calc(100vw - 34px));
  transform: translateX(-102%);
  transition: transform 220ms ease;
}

.drawer-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-strong);
}

.drawer-open {
  overflow: hidden;
}

.drawer-open .drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.drawer-open .mobile-drawer {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand.compact {
  min-width: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.brand.compact strong {
  color: var(--ink);
}

.brand.compact small {
  color: var(--muted);
}

.brand.compact small,
.drawer-user small {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.drawer-user strong,
.drawer-user small {
  display: block;
}

.drawer-user strong {
  color: var(--ink);
}

.drawer-user small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.drawer-theme {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 10px 12px;
  font-weight: 900;
}

.drawer-nav {
  margin-top: 0;
}

.drawer-nav .nav-group {
  color: var(--muted);
}

.drawer-nav .nav-link {
  color: var(--text);
}

.drawer-nav .nav-link:hover,
.drawer-nav .nav-link.active {
  background: var(--chip);
  color: var(--ink);
}

.drawer-logout {
  margin-top: auto;
  color: var(--danger);
}

.mobile-menu-button {
  flex: 0 0 auto;
}

.mobile-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.mobile-actions .icon-button {
  width: 38px;
  height: 38px;
}

.has-badge {
  position: relative;
}

.badge-dot,
.badge-number {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.badge-dot {
  position: absolute;
  top: -7px;
  right: -7px;
  border: 2px solid var(--panel);
}

.avatar {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ink), var(--teal));
  color: #fff;
  font-size: 13px;
  font-weight: 950;
}

.avatar.mini {
  width: 30px;
  height: 30px;
  font-size: 11px;
}

.avatar.large {
  width: 54px;
  height: 54px;
  font-size: 16px;
}

.avatar-button {
  padding: 0;
}

.theme-icon-dark {
  display: none;
}

html[data-theme="dark"] .theme-icon-light {
  display: none;
}

html[data-theme="dark"] .theme-icon-dark {
  display: inline-grid;
}

.topbar-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 18px;
}

.shell-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.shell-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 900;
}

.profile-trigger-text {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-panels {
  position: relative;
  z-index: 80;
}

.popover-panel {
  position: fixed;
  top: 86px;
  right: 16px;
  z-index: 85;
  display: none;
  width: min(400px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-overlay);
  box-shadow: var(--shadow-strong);
  padding: 16px;
  backdrop-filter: blur(16px);
}

.popover-panel.panel-open {
  display: block;
}

.popover-head,
.profile-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.popover-head h2,
.profile-popover-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
}

.profile-popover-head {
  justify-content: flex-start;
}

.profile-popover-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.notification-item:hover {
  border-color: rgba(0, 169, 183, 0.5);
  box-shadow: 0 10px 24px rgba(6, 44, 102, 0.08);
}

.notification-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--teal);
}

.notification-item.warning .notification-dot {
  background: var(--warning);
}

.notification-item.success .notification-dot {
  background: var(--success);
}

.notification-item strong,
.notification-item small,
.notification-item em {
  display: block;
}

.notification-item strong {
  color: var(--ink);
  font-size: 14px;
}

.notification-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.notification-item em {
  margin-top: 8px;
  color: var(--teal-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.panel-link {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.mini-detail-list {
  display: grid;
  gap: 9px;
  margin: 0;
}

.mini-detail-list div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.mini-detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.mini-detail-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.account-grid,
.preference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.account-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.account-card h3,
.account-card p {
  margin: 0;
}

.account-card h3 {
  color: var(--ink);
  font-size: 18px;
}

.account-card p {
  color: var(--muted);
  line-height: 1.5;
}

.account-card .module-icon {
  width: 46px;
  height: 46px;
}

.workspace-list {
  display: grid;
  gap: 10px;
}

.workspace-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.workspace-item strong,
.workspace-item small {
  display: block;
}

.workspace-item strong {
  color: var(--ink);
}

.workspace-item small {
  color: var(--muted);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--panel-soft);
  color: var(--text);
}

html[data-theme="dark"] .login-shell,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .login-panel,
html[data-theme="dark"] .login-stat-row span {
  background: var(--panel-overlay);
}

html[data-theme="dark"] .login-copy,
html[data-theme="dark"] label span {
  color: var(--muted);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  border-color: var(--line);
}

html[data-theme="dark"] .blueprint {
  background: #081524;
}

html[data-theme="dark"] .flash.success {
  background: rgba(6, 118, 71, 0.14);
}

html[data-theme="dark"] .flash.danger {
  background: rgba(180, 35, 24, 0.14);
}

@media (max-width: 980px) {
  .login-shell,
  .app-body,
  .split,
  .stats-grid,
  .form-grid.two,
  .form-grid.three,
  .form-grid.four,
  .service-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-side {
    display: none;
  }

  .topbar-logo {
    display: none;
  }

  .span-2 {
    grid-column: span 1;
  }
}

@media (min-width: 760px) {
  .desktop-table {
    display: block;
  }

  .mobile-list {
    display: none;
  }
}

@media (min-width: 981px) {
  .app-body {
    display: grid;
    grid-template-columns: 284px minmax(0, 1fr);
  }

  .sidebar {
    display: flex;
  }

  .main {
    padding: 28px;
  }

  .mobile-appbar,
  .bottom-nav {
    display: none;
  }

  .popover-panel {
    top: 104px;
    right: 28px;
  }
}

@media (max-width: 620px) {
  .login-body,
  .main {
    padding: 16px;
  }

  .login-shell {
    display: block;
  }

  .login-panel,
  .login-card,
  .panel,
  .detail-hero {
    padding: 20px;
  }

  .panel-head,
  .detail-hero {
    display: grid;
  }

  .filter-bar {
    display: grid;
  }

  .filter-bar label {
    min-width: 0;
  }

  .detail-list div {
    grid-template-columns: 1fr;
  }

  .mobile-appbar {
    gap: 8px;
  }

  .mobile-brand img {
    width: 36px;
    height: 36px;
  }

  .mobile-brand small {
    max-width: 126px;
  }

  .mobile-actions {
    gap: 4px;
  }

  .mobile-actions .icon-button {
    width: 36px;
    height: 36px;
  }

  .popover-panel {
    top: 76px;
    right: 10px;
    width: calc(100vw - 20px);
    max-height: calc(100vh - 94px);
    overflow-y: auto;
  }

  .profile-actions,
  .mini-detail-list div {
    grid-template-columns: 1fr;
  }

  .account-grid,
  .preference-grid {
    grid-template-columns: 1fr;
  }
}
