:root {
  --bg: #edf2f6;
  --panel: #ffffff;
  --panel-2: #e2eaf0;
  --ink: #0f172a;
  --muted: #475569;
  --line: #b7c4cf;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --blue: #2563eb;
  --ki2-blue: #0046c7;
  --ki2-blue-dark: #003394;
  --ki2-blue-deep: #002466;
  --ki2-blue-soft: #e5efff;
  --amber: #b45309;
  --red: #dc2626;
  --green: #15803d;
  --violet: #6d28d9;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
  --radius: 8px;
}

:root[data-theme="dark"] {
  --bg: #111827;
  --panel: #1f2937;
  --panel-2: #263445;
  --ink: #f3f4f6;
  --muted: #b6c2cf;
  --line: #3b4757;
  --ki2-blue-soft: #26335f;
  --shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

.login-view {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 28px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='260' viewBox='0 0 420 260'%3E%3Cg transform='rotate(-14 210 130)'%3E%3Ctext x='210' y='142' text-anchor='middle' font-family='Aptos Display, Segoe UI, Arial, sans-serif' font-size='92' font-weight='700' letter-spacing='10' fill='none' stroke='%2393c5fd' stroke-opacity='.17' stroke-width='1.2'%3EK12%3C/text%3E%3Ctext x='210' y='142' text-anchor='middle' font-family='Aptos Display, Segoe UI, Arial, sans-serif' font-size='92' font-weight='700' letter-spacing='10' fill='%23dbeafe' fill-opacity='.035'%3EK12%3C/text%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, rgba(0, 70, 199, 0.96), rgba(0, 36, 102, 0.96)),
    #07111f;
  background-position: center, center, center;
  background-size: 420px 260px, auto, auto;
  overflow-y: auto;
}

:root[data-theme="dark"] .login-view {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='260' viewBox='0 0 420 260'%3E%3Cg transform='rotate(-14 210 130)'%3E%3Ctext x='210' y='142' text-anchor='middle' font-family='Aptos Display, Segoe UI, Arial, sans-serif' font-size='92' font-weight='700' letter-spacing='10' fill='none' stroke='%2393c5fd' stroke-opacity='.12' stroke-width='1.2'%3EK12%3C/text%3E%3Ctext x='210' y='142' text-anchor='middle' font-family='Aptos Display, Segoe UI, Arial, sans-serif' font-size='92' font-weight='700' letter-spacing='10' fill='%2360a5fa' fill-opacity='.03'%3EK12%3C/text%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, rgba(5, 8, 22, 0.98), rgba(15, 23, 42, 0.98)),
    #050816;
  background-position: center, center, center;
  background-size: 420px 260px, auto, auto;
}

.login-view.is-active {
  display: grid;
}

.login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 430px);
  width: min(1060px, 100%);
  min-height: min(620px, calc(100vh - 56px));
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
}

:root[data-theme="dark"] .login-shell {
  background: var(--panel);
}

.login-showcase {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 26px;
  min-height: 100%;
  padding: 34px;
  color: #ffffff;
  background:
    linear-gradient(160deg, rgba(0, 70, 199, 0.98), rgba(0, 36, 102, 0.98)),
    #002466;
  border-radius: 8px 0 0 8px;
}

.login-showcase-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-showcase-brand h1,
.login-showcase-brand p,
.login-brand h2,
.login-brand p,
.login-credit {
  margin: 0;
}

.login-showcase-brand h1 {
  font-family: "Ethnocentric", "Bahnschrift SemiBold", "Bahnschrift", "Aptos Display", "Segoe UI Black", "Arial Black", "Segoe UI", Arial, sans-serif;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
  letter-spacing: 0;
}

.login-showcase-brand p,
.login-credit {
  color: #dbeafe;
  font-size: 13px;
  font-weight: 700;
}

.login-signal-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 150px));
  gap: 10px;
}

.login-signal-grid span {
  min-height: 72px;
  padding: 14px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.login-credit {
  position: relative;
  z-index: 1;
}

.login-credit strong {
  color: #ffffff;
}

.login-panel {
  display: grid;
  align-content: center;
  gap: 16px;
  width: 100%;
  padding: 38px;
  color: var(--ink);
  background: #ffffff;
  border: 0;
  border-radius: 0 8px 8px 0;
  box-shadow: none;
}

:root[data-theme="dark"] .login-panel,
:root[data-theme="dark"] .search-box input,
:root[data-theme="dark"] .filter-strip select,
:root[data-theme="dark"] .filter-strip input,
:root[data-theme="dark"] .form-grid input,
:root[data-theme="dark"] .form-grid select,
:root[data-theme="dark"] .form-grid textarea,
:root[data-theme="dark"] .top-priority-form input,
:root[data-theme="dark"] .detail-form input,
:root[data-theme="dark"] .detail-form select,
:root[data-theme="dark"] .detail-form textarea,
:root[data-theme="dark"] .add-line-grid input,
:root[data-theme="dark"] .checkbox-field,
:root[data-theme="dark"] #repairQueueView td select,
:root[data-theme="dark"] #ecomQueueView td select,
:root[data-theme="dark"] .reactivation-item,
:root[data-theme="dark"] .reactivation-grid span,
:root[data-theme="dark"] .po-dialog {
  background: var(--panel);
}

:root[data-theme="dark"] .login-panel input {
  color: #0f172a;
  background: #ffffff;
  border-color: #cbd5e1;
}

:root[data-theme="dark"] .login-panel label {
  color: #e2e8f0;
}

.login-panel label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.login-panel input {
  min-height: 44px;
  padding: 10px 12px;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.login-panel input:focus {
  border-color: var(--ki2-blue);
  outline: 3px solid rgba(0, 70, 199, 0.16);
}

.login-panel input::placeholder {
  color: #475569;
  opacity: 1;
}

.login-panel .primary-button {
  min-height: 44px;
}

.bulk-lookup-panel {
  grid-column: 1 / -1;
}

.bulk-lookup-results {
  max-height: 320px;
  margin-top: 14px;
}

.lookup-match {
  display: grid;
  gap: 4px;
}

.lookup-match strong,
.lookup-match span {
  min-width: 0;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.form-help {
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(28, 108, 255, 0.28);
  background: rgba(28, 108, 255, 0.12);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill.is-current {
  border-color: rgba(22, 163, 74, 0.45);
  background: rgba(22, 163, 74, 0.14);
}

.status-pill.is-muted {
  border-color: rgba(148, 163, 184, 0.38);
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
}

.settings-identity {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.settings-identity strong {
  color: var(--text);
  font-size: 0.86rem;
}

.settings-identity span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.app-shell.is-locked {
  filter: blur(2px);
  pointer-events: none;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 100vh;
  background:
    linear-gradient(180deg, #f7fafc 0%, #e8eff5 100%);
}

.floating-settings {
  position: fixed;
  top: auto;
  bottom: 18px;
  right: 18px;
  z-index: 30;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.app-shell.is-dashboard-home .floating-settings {
  top: 18px;
  bottom: auto;
}

.settings-cog-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid #aab8c7;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(10px);
}

.settings-cog-button:hover,
.settings-cog-button:focus-visible {
  color: var(--ki2-blue);
  border-color: var(--ki2-blue);
}

.settings-cog-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.floating-settings-menu {
  display: grid;
  gap: 6px;
  width: 160px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #aab8c7;
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.floating-settings-menu button {
  min-height: 34px;
  padding: 7px 9px;
  color: var(--ink);
  text-align: left;
  background: #f8fafc;
  border: 1px solid #c3ced8;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.floating-settings-menu button:hover,
.floating-settings-menu button:focus-visible {
  color: var(--ki2-blue);
  background: var(--ki2-blue-soft);
  border-color: rgba(0, 70, 199, 0.36);
}

:root[data-theme="dark"] .settings-cog-button,
:root[data-theme="dark"] .floating-settings-menu {
  background: rgba(31, 41, 55, 0.94);
  border-color: rgba(148, 163, 184, 0.42);
}

:root[data-theme="dark"] .floating-settings-menu button {
  color: var(--ink);
  background: #111827;
  border-color: rgba(148, 163, 184, 0.34);
}

:root[data-theme="dark"] .app-shell {
  background:
    linear-gradient(180deg, #0f172a 0%, #111827 100%);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: none;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(240px, auto);
  grid-template-areas:
    "brand nav tools"
    "credit nav tools";
  align-items: center;
  gap: 10px 18px;
  min-height: 124px;
  height: auto;
  overflow: visible;
  padding: 14px 22px;
  color: #f8fafc;
  background:
    linear-gradient(135deg, rgba(0, 70, 199, 0.98), rgba(0, 36, 102, 0.98)),
    #07111f;
  border-right: 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.22);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.14);
}

.creator-credit {
  grid-area: credit;
  margin: 0;
  padding: 0 2px;
  color: #e2e8f0;
  background: transparent;
  border: 0;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  opacity: 0.92;
}

.creator-credit strong {
  display: inline;
  color: #ffffff;
  font-size: 10px;
}

.brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand > div:not(.brand-logo) {
  min-width: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 48px;
  flex: 0 0 68px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius);
  overflow: hidden;
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.section-heading h3,
.section-heading p {
  margin: 0;
}

.brand h1 {
  overflow-wrap: anywhere;
  font-family: "Ethnocentric", "Bahnschrift SemiBold", "Bahnschrift", "Aptos Display", "Segoe UI Black", "Arial Black", "Segoe UI", Arial, sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: 0;
}

.brand p {
  margin-top: 4px;
  color: #e1e5ff;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.brand-meta {
  display: grid;
  gap: 2px;
  margin-top: 5px;
  color: #e1e5ff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.18;
}

.brand-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-meta span:last-child {
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.login-brand h1 {
  font-size: 31px;
}

.nav-list {
  grid-area: nav;
  display: flex;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.nav-section {
  display: grid;
  gap: 6px;
  min-width: 148px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.nav-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  color: #dfe5ff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  list-style: none;
  text-transform: uppercase;
}

.nav-section summary::-webkit-details-marker {
  display: none;
}

.nav-section-items {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.app-shell.is-admin-nav .nav-list {
  gap: 10px;
}

.app-shell.is-admin-nav .nav-section {
  display: grid;
  gap: 7px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
}

.app-shell.is-admin-nav .nav-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  color: #dfe5ff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
  text-transform: uppercase;
}

.app-shell.is-admin-nav .nav-section summary::-webkit-details-marker {
  display: none;
}

.app-shell.is-admin-nav .nav-section summary::before {
  display: none;
}

.app-shell.is-admin-nav .nav-section[open] summary::before {
  transform: none;
}

.app-shell.is-admin-nav .nav-section summary span {
  margin-right: auto;
}

.app-shell.is-admin-nav .nav-section summary strong {
  min-width: 28px;
  padding: 2px 7px;
  text-align: center;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  font-size: 11px;
}

.app-shell.is-admin-nav .nav-section-items {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.app-shell.is-admin-nav .nav-section .nav-button {
  min-height: 32px;
  padding: 6px 9px;
}

.nav-button,
.tool-button,
.primary-button,
.subtle-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: var(--radius);
}

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 6px 9px;
  color: #eef2ff;
  background: rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.nav-button:hover,
.nav-button:focus-visible {
  background: rgba(255, 255, 255, 0.15);
}

.nav-button.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 18px rgba(15, 23, 42, 0.16);
}

.nav-button strong {
  min-width: 30px;
  padding: 2px 7px;
  text-align: center;
  color: inherit;
  background: rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  font-size: 12px;
}

.side-tools {
  grid-area: tools;
  display: grid;
  gap: 8px;
  align-self: stretch;
  margin-top: 0;
}

.tool-section {
  display: grid;
  gap: 7px;
  padding: 8px;
  color: #eef2ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
}

.tool-section summary {
  display: flex;
  align-items: center;
  min-height: 28px;
  color: #dfe5ff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
  text-transform: uppercase;
}

.tool-section summary::-webkit-details-marker {
  display: none;
}

.tool-section summary::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 140ms ease;
}

.tool-section[open] summary::before {
  transform: rotate(45deg);
}

.tool-section-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-section .tool-button {
  width: auto;
  padding-right: 10px;
  padding-left: 10px;
  text-align: left;
}

.system-tool-section {
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.07);
}

.system-tool-section .tool-section-items {
  display: grid;
  grid-template-columns: 1fr;
}

.system-tool-section .tool-button {
  width: 100%;
}

.user-chip {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 8px;
  color: #eef2ff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
}

.account-button {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 4px;
  color: #eef2ff;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
}

.account-button:hover,
.account-button:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.account-avatar {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #ffffff;
  background: var(--ki2-blue-deep);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
}

.account-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-avatar-large {
  width: 112px;
  height: 112px;
  color: var(--ki2-blue);
  background: var(--ki2-blue-soft);
  border-color: #c7d2fe;
  font-size: 30px;
}

.account-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.account-copy strong,
.account-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  color: #ffffff;
  font-size: 13px;
}

.account-copy small {
  color: #dfe5ff;
  font-size: 11px;
  font-weight: 700;
}

.account-menu {
  display: grid;
  gap: 4px;
}

.account-menu button {
  min-height: 32px;
  padding: 6px 8px;
  color: #eef2ff;
  text-align: left;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
}

.account-menu button:hover,
.account-menu button:focus-visible {
  background: rgba(255, 255, 255, 0.16);
}

.tool-button {
  min-height: 38px;
  color: #eef2ff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
}

.tool-button:hover,
.tool-button:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

.tool-button.danger {
  color: #fecaca;
}

.main-content {
  position: relative;
  min-width: 0;
  padding: 22px 28px 28px;
}

.app-shell.is-dashboard-home {
  grid-template-rows: minmax(0, 1fr);
}

.app-shell.is-dashboard-home .sidebar,
.app-shell.is-dashboard-home .topbar {
  display: none;
}

.app-shell.is-dashboard-home .main-content {
  display: grid;
  align-items: center;
  min-height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  padding: clamp(18px, 3vh, 34px) clamp(26px, 5vw, 64px);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='260' viewBox='0 0 420 260'%3E%3Cg transform='rotate(-14 210 130)'%3E%3Ctext x='210' y='142' text-anchor='middle' font-family='Aptos Display, Segoe UI, Arial, sans-serif' font-size='92' font-weight='700' letter-spacing='10' fill='none' stroke='%2393c5fd' stroke-opacity='.17' stroke-width='1.2'%3EK12%3C/text%3E%3Ctext x='210' y='142' text-anchor='middle' font-family='Aptos Display, Segoe UI, Arial, sans-serif' font-size='92' font-weight='700' letter-spacing='10' fill='%23dbeafe' fill-opacity='.035'%3EK12%3C/text%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, rgba(0, 70, 199, 0.96), rgba(0, 36, 102, 0.96)),
    #07111f;
  background-position: center, center, center;
  background-size: 420px 260px, auto, auto;
}

.app-shell.is-dashboard-home #dashboardView {
  position: relative;
  z-index: 1;
}

:root[data-theme="dark"] .app-shell.is-dashboard-home .main-content {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='260' viewBox='0 0 420 260'%3E%3Cg transform='rotate(-14 210 130)'%3E%3Ctext x='210' y='142' text-anchor='middle' font-family='Aptos Display, Segoe UI, Arial, sans-serif' font-size='92' font-weight='700' letter-spacing='10' fill='none' stroke='%2393c5fd' stroke-opacity='.12' stroke-width='1.2'%3EK12%3C/text%3E%3Ctext x='210' y='142' text-anchor='middle' font-family='Aptos Display, Segoe UI, Arial, sans-serif' font-size='92' font-weight='700' letter-spacing='10' fill='%2360a5fa' fill-opacity='.03'%3EK12%3C/text%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, rgba(5, 8, 22, 0.98), rgba(15, 23, 42, 0.98)),
    #050816;
  background-position: center, center, center;
  background-size: 420px 260px, auto, auto;
}

.nav-back-button {
  grid-column: 1;
  justify-self: start;
  min-width: 104px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(74px, 1fr) minmax(180px, auto) minmax(280px, 1fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

:root[data-theme="dark"] .topbar {
  background: transparent;
  border-color: rgba(75, 85, 99, 0.86);
}

.topbar > div {
  min-width: 0;
}

.topbar-title {
  grid-column: 2;
  justify-self: center;
  text-align: center;
}

.topbar-title .eyebrow {
  display: none;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar h2 {
  margin-top: 0;
  font-size: 30px;
  line-height: 1.15;
}

.topbar-actions {
  grid-column: 3;
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.search-box,
.filter-strip label,
.form-grid label,
.top-priority-form label,
.role-picker {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.role-picker {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.role-picker legend {
  padding: 0 4px;
}

.role-picker label {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.role-picker input {
  width: auto;
  min-height: 0;
}

.role-toggle-list {
  display: flex;
  max-width: 420px;
  flex-wrap: wrap;
  gap: 6px;
}

.role-toggle-list label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.role-toggle-list label.is-selected {
  color: var(--ki2-blue-dark);
  background: var(--ki2-blue-soft);
  border-color: rgba(0, 70, 199, 0.24);
}

.owner-lock-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 4px;
  padding: 3px 7px;
  color: #075985;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

:root[data-theme="dark"] .owner-lock-badge {
  color: #dbeafe;
  background: #1e3a8a;
  border-color: #2563eb;
}

.role-toggle-list input {
  width: auto;
  min-height: 0;
}

.search-box {
  position: relative;
  min-width: min(100%, 220px);
}

.top-data-menu {
  position: relative;
  align-self: end;
}

.top-data-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 13px;
  color: #ffffff;
  background: var(--ki2-blue);
  border: 1px solid rgba(0, 70, 199, 0.22);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  list-style: none;
}

.top-data-menu summary::-webkit-details-marker {
  display: none;
}

.top-data-menu-items {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 12;
  display: grid;
  gap: 6px;
  width: 190px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 42px rgba(23, 33, 43, 0.18);
}

.top-data-menu .tool-button {
  width: 100%;
  text-align: left;
}

:root[data-theme="dark"] .top-data-menu-items {
  background: var(--panel);
}

.search-box input,
.filter-strip select,
.filter-strip input,
.form-grid input,
.form-grid select,
.form-grid textarea,
.top-priority-form input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.search-box input {
  width: clamp(220px, 24vw, 340px);
  max-width: 100%;
}

.global-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  display: grid;
  gap: 6px;
  width: min(440px, calc(100vw - 32px));
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 42px rgba(23, 33, 43, 0.18);
}

.global-search-results[hidden] {
  display: none;
}

:root[data-theme="dark"] .global-search-results,
:root[data-theme="dark"] .subtle-button {
  background: var(--panel);
}

.search-result-button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  color: var(--ink);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
}

.search-result-button:hover,
.search-result-button:focus-visible {
  background: var(--ki2-blue-soft);
  border-color: #c7d2fe;
}

.search-result-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
}

.search-result-title span:first-child,
.search-result-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.primary-button,
.subtle-button {
  min-height: 38px;
  padding: 8px 12px;
  font-weight: 700;
}

.primary-button {
  color: #ffffff;
  background: var(--ki2-blue);
  border-color: var(--ki2-blue-dark);
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--ki2-blue-dark);
}

.subtle-button {
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line);
}

:root[data-theme="dark"] .icon-button {
  background: var(--panel);
}

.subtle-button:hover,
.subtle-button:focus-visible {
  background: #eef4f8;
}

:root[data-theme="dark"] .subtle-button:hover,
:root[data-theme="dark"] .subtle-button:focus-visible,
:root[data-theme="dark"] .search-result-button:hover,
:root[data-theme="dark"] .search-result-button:focus-visible {
  background: #334155;
}

.view {
  display: none;
}

.view.is-active {
  display: grid;
  gap: 16px;
}

#completedView.is-active {
  display: grid;
  gap: 14px;
}

#adminView.is-active {
  display: grid;
  gap: 14px;
}

.module-launcher-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 2px;
}

.app-shell.is-dashboard-home #dashboardView.is-active {
  --dashboard-tile-gap: clamp(12px, 2vh, 20px);
  --dashboard-tile-size: clamp(220px, min(28vh, 23vw), 360px);
  align-content: center;
  justify-items: center;
  gap: clamp(9px, 1.8vh, 18px);
  width: min(1280px, 100%);
  min-height: 0;
  height: 100%;
  margin: 0 auto;
}

.dashboard-brandmark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.8vw, 18px);
  width: min(640px, 100%);
  color: var(--ink);
  text-align: left;
}

.dashboard-brandmark img {
  width: clamp(70px, 8vw, 104px);
  height: clamp(50px, 5.6vw, 74px);
  object-fit: cover;
  background: #ffffff;
  border: 1px solid #aab8c7;
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
}

.dashboard-brandmark h1,
.dashboard-brandmark p,
.dashboard-created-by {
  margin: 0;
}

.dashboard-brandmark h1 {
  font-family: "Ethnocentric", "Bahnschrift SemiBold", "Bahnschrift", "Aptos Display", "Segoe UI Black", "Arial Black", "Segoe UI", Arial, sans-serif;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 0.95;
  letter-spacing: 0;
}

.dashboard-created-by {
  align-self: end;
  color: rgba(15, 23, 42, 0.34);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 0;
}

:root[data-theme="dark"] .dashboard-created-by {
  color: rgba(241, 245, 249, 0.34);
}

.app-shell.is-dashboard-home .business-overview-panel,
.app-shell.is-dashboard-home .aging-filter-row,
.app-shell.is-dashboard-home .dashboard-command-grid,
.app-shell.is-dashboard-home .dashboard-grid {
  display: none;
}

.module-launcher-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.module-launcher-heading h3,
.module-launcher-heading p {
  margin: 0;
}

.module-launcher-heading h3 {
  font-size: 22px;
  line-height: 1.15;
  font-weight: 850;
}

.module-launcher {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 180px));
  justify-content: start;
  gap: 14px;
}

.app-shell.is-dashboard-home .module-launcher-panel {
  width: 100%;
}

.app-shell.is-dashboard-home .module-launcher {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--dashboard-tile-gap);
  max-width: calc((var(--dashboard-tile-size) * 3) + (var(--dashboard-tile-gap) * 2));
  margin: 0 auto;
}

.module-tile {
  --module-accent: var(--ki2-blue);
  --module-soft: #eef5ff;
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 156px;
  max-width: 180px;
  aspect-ratio: 1 / 1;
  padding: 17px;
  color: var(--ink);
  text-align: left;
  background:
    linear-gradient(180deg, #ffffff, #f3f6f9);
  border: 1px solid #adbbc8;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.app-shell.is-dashboard-home .module-tile {
  flex: 0 1 var(--dashboard-tile-size);
  min-height: var(--dashboard-tile-size);
  max-width: 360px;
  padding: clamp(20px, min(2.4vh, 3vw), 38px);
}

.module-tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--module-accent);
}

.module-tile:hover,
.module-tile:focus-visible {
  border-color: color-mix(in srgb, var(--module-accent) 62%, var(--line));
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.module-tile-icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: var(--module-accent);
  background: var(--module-soft);
  border: 1px solid color-mix(in srgb, var(--module-accent) 22%, transparent);
  border-radius: 8px;
}

.app-shell.is-dashboard-home .module-tile-icon {
  width: clamp(64px, min(8vh, 7vw), 104px);
  height: clamp(64px, min(8vh, 7vw), 104px);
}

.module-tile-icon svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell.is-dashboard-home .module-tile-icon svg {
  width: clamp(34px, min(4.8vh, 4vw), 58px);
  height: clamp(34px, min(4.8vh, 4vw), 58px);
}

.module-tile-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.module-tile-copy strong {
  font-size: 20px;
  line-height: 1.1;
}

.app-shell.is-dashboard-home .module-tile-copy strong {
  font-size: clamp(27px, min(4.4vh, 3vw), 44px);
}

.module-tile-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.module-tile[data-module="audit"] {
  --module-accent: var(--ki2-blue);
  --module-soft: var(--ki2-blue-soft);
}

.module-tile[data-module="repair"] {
  --module-accent: #0f766e;
  --module-soft: #ecfdf5;
}

.module-tile[data-module="inventory"] {
  --module-accent: #7c3aed;
  --module-soft: #f5f3ff;
}

.module-tile[data-module="sales"] {
  --module-accent: #b45309;
  --module-soft: #fffbeb;
}

.module-tile[data-module="system"] {
  --module-accent: #334155;
  --module-soft: #f1f5f9;
}

:root[data-theme="dark"] .module-tile {
  background:
    linear-gradient(180deg, rgba(31, 41, 55, 0.98), rgba(17, 24, 39, 0.94));
  border-color: rgba(75, 85, 99, 0.92);
}

:root[data-theme="dark"] .module-tile-icon {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

:root[data-theme="dark"] .module-tile[data-module="system"] {
  --module-accent: #94a3b8;
}

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

.app-shell.is-dashboard-home .kpi-grid {
  width: min(1080px, 100%);
  grid-template-columns: repeat(5, minmax(118px, 1fr));
  gap: 10px;
}

.app-shell.is-dashboard-home .kpi-card {
  min-height: clamp(62px, 9vh, 88px);
  padding: 10px 12px;
  border-color: #acbac8;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
}

.app-shell.is-dashboard-home .kpi-card strong {
  font-size: clamp(20px, 3vh, 24px);
}

.app-shell.is-dashboard-home .kpi-card p {
  display: none;
}

.metric-progress {
  display: block;
  height: 7px;
  overflow: hidden;
  background: #d8e1e9;
  border-radius: 999px;
}

.metric-progress span {
  display: block;
  width: var(--metric-progress, 0%);
  height: 100%;
  background: var(--kpi-accent);
  border-radius: inherit;
}

:root[data-theme="dark"] .metric-progress {
  background: rgba(255, 255, 255, 0.14);
}

.kpi-card,
.queue-item,
.issue-item,
.log-item,
.priority-item,
.due-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.kpi-card {
  --kpi-accent: var(--ki2-blue);
  --kpi-bg: #f7f8ff;
  --kpi-border: #c7d2fe;
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 112px;
  padding: 14px 14px 13px 16px;
  color: var(--ink);
  text-align: left;
  background: linear-gradient(180deg, var(--kpi-bg), #ffffff 88%);
  border-color: var(--kpi-border);
  box-shadow: 0 10px 22px rgba(23, 33, 43, 0.07);
  overflow: hidden;
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--kpi-accent);
}

:root[data-theme="dark"] .kpi-card {
  --kpi-bg: #223047;
  --kpi-border: #3b4757;
  background: linear-gradient(180deg, var(--kpi-bg), var(--panel) 88%);
}

.kpi-card::after {
  content: "";
  position: absolute;
  top: 13px;
  right: 13px;
  width: 9px;
  height: 9px;
  background: var(--kpi-accent);
  border-radius: 999px;
  opacity: 0.85;
}

.kpi-card:hover,
.kpi-card:focus-visible {
  border-color: var(--kpi-accent);
  background: var(--kpi-bg);
  box-shadow: 0 14px 30px rgba(23, 33, 43, 0.11);
  transform: translateY(-1px);
}

.kpi-card.is-active-load {
  --kpi-accent: var(--green);
  --kpi-bg: #f0fdf4;
  --kpi-border: #bbf7d0;
}

.kpi-card.is-overdue {
  --kpi-accent: var(--red);
  --kpi-bg: #fef2f2;
  --kpi-border: #ef4444;
}

.kpi-card.is-due-soon {
  --kpi-accent: var(--amber);
  --kpi-bg: #fffbeb;
  --kpi-border: #fde68a;
}

.kpi-card.is-progress {
  --kpi-accent: var(--ki2-blue);
  --kpi-bg: var(--ki2-blue-soft);
  --kpi-border: #c7d2fe;
}

.kpi-card.is-warning {
  --kpi-accent: #c2410c;
  --kpi-bg: #fff7ed;
  --kpi-border: #fed7aa;
}

.aging-filter-row {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(140px, 1fr));
  align-items: stretch;
  gap: 8px;
  margin: 0 0 14px;
}

.aging-filter-row > span {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.age-filter-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  color: var(--ink);
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.age-filter-button strong {
  color: var(--red);
  font-size: 16px;
}

.age-filter-button span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.age-filter-button em {
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.age-filter-button.is-active,
.age-filter-button:hover,
.age-filter-button:focus-visible {
  background: #fef2f2;
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.16);
}

:root[data-theme="dark"] .age-filter-button.is-active,
:root[data-theme="dark"] .age-filter-button:hover,
:root[data-theme="dark"] .age-filter-button:focus-visible {
  background: #4a1515;
}

:root[data-theme="dark"] .kpi-card.is-active-load,
:root[data-theme="dark"] .kpi-card.is-overdue,
:root[data-theme="dark"] .kpi-card.is-due-soon,
:root[data-theme="dark"] .kpi-card.is-progress,
:root[data-theme="dark"] .kpi-card.is-warning {
  --kpi-bg: #223047;
  --kpi-border: #3b4757;
}

.kpi-card span {
  color: var(--kpi-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.kpi-card strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

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

.business-overview-panel {
  margin-bottom: 14px;
  border-left: 4px solid var(--ki2-blue);
}

.business-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.business-card {
  --business-accent: var(--ki2-blue);
  display: grid;
  gap: 7px;
  min-width: 0;
  min-height: 98px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--business-accent);
  border-radius: var(--radius);
}

button.business-card:hover,
button.business-card:focus-visible {
  background: var(--ki2-blue-soft);
  border-color: var(--business-accent);
  transform: translateY(-1px);
}

.business-card.is-active-load {
  --business-accent: var(--green);
}

.business-card.is-overdue,
.business-card.is-warning {
  --business-accent: var(--red);
}

.business-card.is-due-soon {
  --business-accent: var(--amber);
}

.business-card.is-progress {
  --business-accent: var(--ki2-blue);
}

.business-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.business-card strong {
  font-size: 26px;
  line-height: 1;
}

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

.dashboard-grid,
.dashboard-command-grid,
.queue-grid,
.quality-grid,
.admin-grid,
.repair-grid,
.sales-grid,
.inventory-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

#inventoryView.is-active {
  gap: 18px;
}

#inventoryView .kpi-grid {
  grid-template-columns: repeat(6, minmax(112px, 1fr));
}

.inventory-secondary-grid {
  align-items: start;
}

.supply-assignment-panel {
  border-top: 4px solid var(--ki2-blue);
}

.supply-assignment-list-panel {
  border-top: 4px solid var(--green);
}

.supply-assignment-item .subtle-button {
  width: fit-content;
}

.queue-grid:has(#suggestedQueuePanel[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

.surface-panel,
.table-panel,
.detail-panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.surface-panel {
  padding: 16px;
}

.surface-panel.full-width {
  width: 100%;
}

.top-priority-panel {
  margin-bottom: 14px;
  border-left: 4px solid var(--red);
}

.dashboard-command-grid {
  align-items: start;
  margin-bottom: 14px;
}

.dashboard-command-grid .top-priority-panel {
  margin-bottom: 0;
}

.offsite-audit-panel {
  border-left: 4px solid var(--ki2-blue);
}

.offsite-audit-panel .top-priority-form {
  grid-template-columns: minmax(130px, 170px) minmax(150px, 1fr) minmax(170px, 1fr) auto;
}

.top-priority-form {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
}

.section-heading h3 {
  font-size: 17px;
}

.section-heading p {
  max-width: 360px;
  min-width: min(100%, 180px);
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.bar-stack,
.product-mix,
.priority-list,
.top-priority-list,
.due-list,
.queue-list,
.issue-list,
.development-log,
.change-log {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  background: #e9eef2;
  border-radius: 999px;
}

:root[data-theme="dark"] .bar-track {
  background: #334155;
}

.bar-fill {
  width: var(--width);
  height: 100%;
  background: var(--bar-color);
}

.priority-item,
.due-item,
.queue-item,
.issue-item,
.development-entry,
.log-item {
  padding: 12px;
}

.admin-log-panel {
  max-height: 620px;
  overflow: auto;
}

.quickbase-sync-panel {
  border-left: 4px solid var(--ki2-blue);
}

.quickbase-sync-form {
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.quickbase-sync-status {
  display: grid;
  gap: 4px;
  min-height: 58px;
  margin: 0;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.quickbase-sync-status strong {
  color: var(--ink);
  font-size: 14px;
}

.quickbase-sync-status em,
.quickbase-sync-status span {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.quickbase-sync-status span {
  color: var(--red);
}

.development-entry {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--ki2-blue);
  border-radius: var(--radius);
}

.development-entry-head {
  display: flex;
  align-items: start;
  gap: 10px;
}

.development-entry-head > span {
  flex: 0 0 auto;
  min-width: 58px;
  padding: 4px 8px;
  color: #ffffff;
  background: var(--ki2-blue);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.development-entry-head strong {
  display: block;
  font-size: 15px;
}

.development-entry-head em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.development-entry p {
  margin: 10px 0 8px;
  color: var(--ink);
}

.development-entry ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.development-entry li + li {
  margin-top: 4px;
}

.compact-change-log {
  max-height: 420px;
  overflow: auto;
}

.top-priority-item {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
}

.offsite-audit-item {
  background: var(--ki2-blue-soft);
  border-color: rgba(0, 70, 199, 0.22);
}

:root[data-theme="dark"] .top-priority-item {
  background: #3a2b18;
  border-color: #8a5a20;
}

:root[data-theme="dark"] .offsite-audit-item {
  background: #1e2f58;
  border-color: #385595;
}

.top-priority-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.item-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.item-title {
  min-width: 0;
  font-weight: 800;
}

.item-title span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pill.overdue {
  color: #ffffff;
  background: #dc2626;
  border: 1px solid #b91c1c;
}

:root[data-theme="dark"] .pill.overdue {
  color: #ffffff;
  background: #ef4444;
  border-color: #f87171;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.18);
}

.pill.due-soon {
  color: #713f12;
  background: #fef3c7;
}

.pill.current {
  color: #064e3b;
  background: #d1fae5;
}

.pill.completed,
.pill.reported {
  color: #1e3a8a;
  background: #dbeafe;
}

.pill.work {
  color: #4c1d95;
  background: #ede9fe;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 13px;
}

.filter-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.product-match-panel {
  margin-bottom: 14px;
}

.product-match-list {
  display: grid;
  gap: 8px;
}

.product-match-row {
  display: grid;
  grid-template-columns: 90px 120px minmax(0, 1fr) 120px 86px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
}

:root[data-theme="dark"] .product-match-row,
:root[data-theme="dark"] .search-result-button,
:root[data-theme="dark"] .role-toggle-list label,
:root[data-theme="dark"] .lot-tabs,
:root[data-theme="dark"] .age-filter-button,
:root[data-theme="dark"] .due-schedule span,
:root[data-theme="dark"] .age-review-card,
:root[data-theme="dark"] .pasco-audit-note,
:root[data-theme="dark"] th,
:root[data-theme="dark"] tbody tr,
:root[data-theme="dark"] .detail-note,
:root[data-theme="dark"] .line-row {
  background: var(--panel-2);
}

.product-match-row strong,
.product-match-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-match-row button {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.browser-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(320px, 24vw, 380px);
  gap: 14px;
  align-items: start;
}

.table-panel {
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 220px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  table-layout: fixed;
}

#browserView table {
  min-width: 860px;
}

#completedView table {
  min-width: 760px;
}

#adminView table {
  min-width: 980px;
}

#inventoryView table {
  min-width: 960px;
}

#repairQueueView table,
#ecomQueueView table {
  min-width: 1080px;
}

.repair-table-panel {
  margin-top: 14px;
}

.inventory-table-panel {
  margin-top: 14px;
}

.compact-search {
  min-width: min(100%, 260px);
}

.repair-filters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

#repairQueueView td select,
#ecomQueueView td select {
  width: 100%;
  min-height: 34px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.parts-inventory-wrap {
  max-height: 360px;
}

.part-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.part-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  padding: 3px 8px;
  color: var(--ki2-blue-dark);
  background: var(--ki2-blue-soft);
  border: 1px solid rgba(0, 70, 199, 0.18);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  white-space: normal;
}

tbody tr.is-low-stock {
  background: #fff7ed;
}

tbody tr.is-low-stock td:first-child strong::after {
  content: "Low stock";
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 6px;
  color: #9a3412;
  background: #ffedd5;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

:root[data-theme="dark"] .part-chip {
  color: #dbeafe;
  background: #1e3a8a;
  border-color: #3159bf;
}

:root[data-theme="dark"] tbody tr.is-low-stock {
  background: #3b2f1f;
}

:root[data-theme="dark"] tbody tr.is-low-stock td:first-child strong::after {
  color: #fed7aa;
  background: #7c2d12;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
}

td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

tbody tr {
  background: #ffffff;
}

tbody tr[data-po-row],
tbody tr[data-completed-po] {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.is-selected {
  background: #ecfdf5;
}

:root[data-theme="dark"] tbody tr:hover,
:root[data-theme="dark"] tbody tr.is-selected {
  background: #183c34;
}

tbody tr button {
  width: 100%;
  padding: 0;
  color: inherit;
  background: none;
  border: 0;
  text-align: left;
}

.detail-panel {
  position: sticky;
  top: 24px;
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 220px);
  overflow: auto;
  overflow-x: hidden;
  padding: 16px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.detail-empty {
  color: var(--muted);
}

.detail-note {
  margin: 10px 0 0;
  padding: 10px;
  color: var(--ink);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
  white-space: normal;
}

.pasco-audit-note {
  display: inline-flex;
  max-width: 760px;
  margin: 8px 0 0;
  padding: 6px 9px;
  color: #334155;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 3px solid var(--ki2-blue);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.detail-header {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.detail-header h3 {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 22px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.detail-panel .item-topline {
  align-items: flex-start;
  flex-wrap: wrap;
}

.detail-panel .detail-actions > button {
  flex: 1 1 118px;
}

.detail-panel .item-meta {
  gap: 6px 10px;
}

.detail-form {
  display: grid;
  gap: 10px;
}

.detail-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-form input,
.detail-form select,
.detail-form textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.line-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.line-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.7fr) minmax(120px, 1.4fr) minmax(64px, 0.7fr) minmax(100px, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
}

.line-row.is-completed {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.line-row.is-highlighted {
  border-color: var(--ki2-blue);
  box-shadow: 0 0 0 3px rgba(0, 70, 199, 0.16);
}

:root[data-theme="dark"] .line-row.is-completed {
  background: #173327;
  border-color: #24543d;
}

.line-row strong,
.line-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-panel .line-row {
  grid-template-columns: 1fr;
  align-items: start;
}

.detail-panel .line-row strong,
.detail-panel .line-row span {
  white-space: normal;
  overflow-wrap: anywhere;
}

.detail-panel .line-estimate span,
.detail-panel .line-workflow span,
.detail-panel .line-workflow em,
.detail-panel .line-location span {
  white-space: normal;
}

.detail-panel .line-status {
  justify-self: start;
}

.line-status {
  justify-self: start;
  padding: 3px 8px;
  color: var(--muted);
  background: #eef2f7;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.line-status.is-completed {
  color: #166534;
  background: #dcfce7;
}

.line-assignee {
  color: var(--muted);
  font-weight: 700;
}

.line-estimate {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 6px;
}

.line-workflow {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 6px;
  align-items: center;
}

.line-workflow span,
.line-workflow em {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.line-workflow .is-done {
  color: #166534;
  background: #dcfce7;
}

.line-workflow .is-needed {
  color: #991b1b;
  background: #fee2e2;
}

.line-workflow em {
  color: var(--muted);
  background: #eef2f7;
}

.checkbox-field {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 7px 9px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 800;
}

.checkbox-field input {
  width: auto;
  min-height: 0;
  padding: 0;
}

.lot-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: #eef2f7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.lot-tabs button {
  min-height: 34px;
  padding: 6px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  font-size: 12px;
  font-weight: 800;
}

.lot-tabs button.is-active {
  color: var(--ki2-blue-dark);
  background: var(--panel);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.lot-tabs strong {
  margin-left: 4px;
}

.line-location {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 6px;
}

.line-location span {
  padding: 4px 8px;
  color: #1e3a8a;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: normal;
}

.line-editor {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.line-editor label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.line-editor input {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.due-schedule {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.due-schedule span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.due-schedule span.is-reached {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}

.due-schedule span.is-selected {
  border-color: var(--ki2-blue);
  box-shadow: 0 0 0 2px rgba(0, 70, 199, 0.18);
}

.age-review-card {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ki2-blue);
  border-radius: var(--radius);
}

.age-review-card.is-reached {
  border-left-color: var(--red);
}

.age-review-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.age-review-card strong {
  font-size: 16px;
}

.age-review-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.line-estimate span {
  padding: 4px 8px;
  color: #334155;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.line-actions {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 8px;
}

.line-assignment {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.line-assignment select {
  min-height: 30px;
  padding: 4px 8px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.queue-lots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.queue-lots span {
  padding: 4px 8px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.line-action {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.add-line-grid {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 90px 86px;
  gap: 8px;
}

.add-line-grid input {
  min-width: 0;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.queue-item {
  display: grid;
  gap: 8px;
}

.queue-item button {
  justify-self: start;
}

.issue-item p,
.log-item p,
.queue-item p,
.priority-item p,
.due-item p {
  margin: 0;
  color: var(--muted);
}

.po-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 28px 60px rgba(23, 33, 43, 0.22);
}

.wide-dialog {
  width: min(980px, calc(100% - 28px));
}

.reactivation-list {
  display: grid;
  gap: 10px;
  max-height: 52vh;
  overflow: auto;
  padding-right: 4px;
}

.reactivation-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.reactivation-item p {
  margin: 0;
}

.reactivation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.reactivation-grid span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 13px;
}

.reactivation-grid strong {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.po-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-header {
  margin-bottom: 16px;
}

.dialog-header h3 {
  margin: 0;
  font-size: 22px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: #ffffff;
  border-color: var(--line);
}

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

.form-grid.compact {
  gap: 10px;
}

.account-dialog {
  width: min(820px, calc(100% - 28px));
}

.account-settings-grid {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.profile-photo-panel,
.account-security-summary {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.profile-photo-panel {
  justify-items: center;
}

.profile-photo-actions {
  display: grid;
  width: 100%;
  gap: 8px;
}

.account-security-summary {
  margin-top: 12px;
}

.account-security-summary strong {
  font-size: 14px;
}

.account-security-summary span {
  color: var(--muted);
  font-size: 13px;
}

.account-security-summary button {
  justify-self: start;
}

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

.dialog-actions {
  margin-top: 16px;
  justify-content: end;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 340px;
  padding: 12px 14px;
  color: #ffffff;
  background: #17212b;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.compact-table {
  max-height: 460px;
}

.po-screen-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.po-screen-header h3,
.po-screen-header p {
  margin: 0;
}

.po-screen-header h3 {
  font-size: 28px;
  line-height: 1.1;
}

.po-screen-header > div:first-child p:last-child {
  margin-top: 4px;
  color: var(--muted);
}

.po-screen-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
}

.po-screen-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
  align-items: start;
}

/* Enterprise workspace interior */
.main-content {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0)),
    transparent;
}

:root[data-theme="dark"] .main-content {
  background:
    linear-gradient(180deg, rgba(31, 41, 55, 0.22), rgba(31, 41, 55, 0)),
    transparent;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
}

.topbar h2 {
  font-size: 30px;
  font-weight: 850;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--ki2-blue);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

:root[data-theme="dark"] .eyebrow {
  color: #93c5fd;
}

.surface-panel,
.table-panel,
.detail-panel,
.po-screen-header {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
  border: 1px solid rgba(203, 213, 225, 0.94);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

:root[data-theme="dark"] .surface-panel,
:root[data-theme="dark"] .table-panel,
:root[data-theme="dark"] .detail-panel,
:root[data-theme="dark"] .po-screen-header {
  background:
    linear-gradient(180deg, rgba(31, 41, 55, 0.98), rgba(31, 41, 55, 0.92));
  border-color: rgba(75, 85, 99, 0.92);
}

.surface-panel {
  padding: 18px;
}

.section-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

:root[data-theme="dark"] .section-heading {
  border-bottom-color: rgba(75, 85, 99, 0.72);
}

.section-heading h3 {
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0;
}

.section-heading p {
  color: #64748b;
}

.business-overview-panel,
.top-priority-panel,
.offsite-audit-panel,
.quickbase-sync-panel {
  border-left: 0;
}

.business-overview-panel::before,
.top-priority-panel::before,
.offsite-audit-panel::before,
.quickbase-sync-panel::before {
  content: "";
  display: block;
  height: 4px;
  margin: -18px -18px 14px;
  background: linear-gradient(90deg, var(--ki2-blue), #38bdf8);
}

.top-priority-panel::before {
  background: linear-gradient(90deg, var(--red), #f97316);
}

.kpi-grid {
  gap: 14px;
}

.kpi-card,
.business-card {
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.kpi-card {
  min-height: 126px;
  padding: 16px;
  background:
    linear-gradient(180deg, #ffffff, #f8fafc);
}

.kpi-card::before {
  width: 100%;
  height: 4px;
  inset: 0 0 auto;
}

.kpi-card::after {
  top: 16px;
  right: 16px;
}

.kpi-card span,
.business-card span {
  letter-spacing: 0.04em;
  font-weight: 900;
}

.kpi-card strong {
  font-size: 34px;
  font-weight: 850;
}

.business-card {
  min-height: 112px;
  padding: 15px;
  background:
    linear-gradient(180deg, #f8fafc, #eef5ff);
  border-left: 0;
}

.business-card strong {
  font-size: 30px;
  font-weight: 850;
}

.filter-strip {
  align-items: end;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

:root[data-theme="dark"] .filter-strip {
  background: rgba(31, 41, 55, 0.72);
  border-color: rgba(75, 85, 99, 0.86);
}

.search-box input,
.filter-strip select,
.filter-strip input,
.form-grid input,
.form-grid select,
.form-grid textarea,
.top-priority-form input,
.detail-form input,
.detail-form select,
.detail-form textarea,
.add-line-grid input {
  min-height: 42px;
  border-color: #cbd5e1;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.03);
}

.table-toolbar {
  min-height: 62px;
  padding: 14px 16px;
  background: #f8fafc;
}

:root[data-theme="dark"] .table-toolbar {
  background: #1f2937;
}

.table-toolbar strong {
  font-size: 14px;
  font-weight: 850;
}

th {
  height: 42px;
  color: #475569;
  background: #eef2f7;
  border-bottom: 1px solid #cbd5e1;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

td {
  height: 46px;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover,
tbody tr.is-selected {
  background: #eff6ff;
}

.detail-panel {
  top: 18px;
}

.detail-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-header h3,
.po-screen-header h3 {
  font-weight: 850;
}

.priority-item,
.due-item,
.queue-item,
.issue-item,
.development-entry,
.log-item,
.product-match-row,
.line-row {
  border-radius: 8px;
}

.priority-item,
.due-item,
.queue-item,
.issue-item,
.product-match-row,
.line-row {
  background: #f8fafc;
  border: 1px solid rgba(203, 213, 225, 0.86);
}

.queue-item,
.issue-item,
.priority-item,
.due-item {
  padding: 14px;
}

.item-title {
  font-weight: 850;
}

.pill {
  border-radius: 8px;
}

.po-screen-header {
  padding: 18px;
}

.po-screen-grid {
  gap: 16px;
}

:root[data-theme="dark"] .kpi-card,
:root[data-theme="dark"] .business-card {
  background:
    linear-gradient(180deg, #263445, #1f2937);
  border-color: rgba(75, 85, 99, 0.9);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .table-toolbar,
:root[data-theme="dark"] th {
  background: #263445;
}

:root[data-theme="dark"] th {
  color: #cbd5e1;
  border-bottom-color: #3b4757;
}

:root[data-theme="dark"] .priority-item,
:root[data-theme="dark"] .due-item,
:root[data-theme="dark"] .queue-item,
:root[data-theme="dark"] .issue-item,
:root[data-theme="dark"] .product-match-row,
:root[data-theme="dark"] .line-row {
  background: var(--panel-2);
  border-color: rgba(75, 85, 99, 0.9);
}

@media (max-width: 1400px) {
  .browser-layout {
    grid-template-columns: 1fr;
  }

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

  .offsite-audit-panel .top-priority-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    gap: 18px;
    grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
    grid-template-areas:
      "brand tools"
      "nav nav"
      "credit credit";
    padding: 16px;
  }

  .brand-logo {
    width: 64px;
    height: 46px;
    flex-basis: 64px;
  }

  .brand h1 {
    font-size: 21px;
  }

  .login-brand h1 {
    font-size: 29px;
  }

  .main-content {
    padding: 18px;
  }

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

  .detail-panel {
    padding: 14px;
  }
}

@media (max-height: 820px) {
  .sidebar {
    gap: 16px;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .main-content {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .topbar {
    margin-bottom: 14px;
  }

  .topbar h2,
  .po-screen-header h3 {
    font-size: 24px;
  }

  .kpi-card {
    min-height: 96px;
    padding: 12px 12px 11px 14px;
  }

  .kpi-card strong {
    font-size: 26px;
  }

  .table-wrap {
    max-height: calc(100vh - 180px);
  }
}

@media (max-width: 1180px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .browser-layout {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 1040px) {
  .login-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .login-showcase {
    min-height: 260px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "tools"
      "nav"
      "credit";
    height: auto;
    overflow: visible;
  }

  .nav-list {
    justify-content: stretch;
  }

  .nav-section {
    min-width: min(100%, 220px);
    flex: 1 1 220px;
  }

  .side-tools {
    grid-template-columns: 1fr;
  }

  .topbar,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    display: flex;
  }

  .topbar-title {
    text-align: left;
  }

  .section-heading p {
    text-align: left;
  }

  .search-box input {
    width: 100%;
  }

  .global-search-results {
    left: 0;
    right: auto;
    width: 100%;
  }

  .dashboard-grid,
  .dashboard-command-grid,
  .quickbase-sync-form,
  .queue-grid,
  .quality-grid,
  .admin-grid,
  .repair-grid,
  .sales-grid,
  .inventory-grid,
  .po-screen-grid,
  .account-settings-grid {
    grid-template-columns: 1fr;
  }

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

  .aging-filter-row {
    grid-template-columns: 1fr;
  }

  .reactivation-grid {
    grid-template-columns: 1fr;
  }

  .po-screen-header {
    grid-template-columns: 1fr;
  }

  .po-screen-status {
    justify-content: start;
  }
}

@media (max-width: 560px) {
  .login-view {
    padding: 16px;
  }

  .login-showcase,
  .login-panel {
    padding: 22px;
  }

  .login-signal-grid {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: 16px;
  }

  .kpi-grid,
  .module-launcher,
  .business-overview,
  .form-grid,
  .quickbase-sync-form,
  .top-priority-form,
  .offsite-audit-panel .top-priority-form,
  .filter-strip,
  .role-picker {
    grid-template-columns: 1fr;
  }

  .module-tile {
    min-height: 132px;
    max-width: none;
    aspect-ratio: auto;
  }

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

  .line-row {
    grid-template-columns: 1fr;
  }

  .line-editor {
    grid-template-columns: 1fr;
  }

  .lot-tabs {
    display: grid;
  }

  .product-match-row {
    grid-template-columns: 1fr;
  }

  .add-line-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 640px) {
  .login-view {
    place-items: start center;
    padding: 12px;
  }

  .login-panel {
    gap: 10px;
    margin: 0;
    padding: 16px;
  }

  .login-brand {
    margin-bottom: 0;
  }

  .login-brand h1 {
    font-size: 24px;
  }

  .login-panel input {
    min-height: 38px;
  }
}

/* Trackpoint command-center overhaul */
:root {
  --command-bg: #e8eef5;
  --command-panel: rgba(255, 255, 255, 0.92);
  --command-panel-strong: #ffffff;
  --command-line: rgba(15, 23, 42, 0.14);
  --command-glow: rgba(0, 70, 199, 0.24);
  --command-cyan: #0891b2;
  --command-amber: #d97706;
  --command-green: #16a34a;
  --command-red: #ef4444;
}

:root[data-theme="dark"] {
  --bg: #050914;
  --panel: #0d1626;
  --panel-2: #121e31;
  --ink: #f8fbff;
  --muted: #aebdd0;
  --line: rgba(130, 165, 210, 0.28);
  --command-bg: #050914;
  --command-panel: rgba(13, 22, 38, 0.82);
  --command-panel-strong: #101b2d;
  --command-line: rgba(130, 165, 210, 0.28);
  --command-glow: rgba(0, 154, 255, 0.28);
  --ki2-blue-soft: rgba(26, 86, 219, 0.22);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

body {
  background:
    radial-gradient(circle at 18% 8%, rgba(0, 111, 255, 0.16), transparent 34%),
    radial-gradient(circle at 86% 14%, rgba(6, 182, 212, 0.12), transparent 30%),
    linear-gradient(145deg, var(--command-bg), var(--bg));
}

:root[data-theme="dark"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(125, 211, 252, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black, transparent 76%);
  animation: commandGridDrift 22s linear infinite;
}

@keyframes commandGridDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(48px, 48px, 0); }
}

.app-shell:not(.is-locked) {
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 70, 199, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 260px);
}

:root[data-theme="dark"] .app-shell:not(.is-locked) {
  background:
    radial-gradient(circle at 18% 0%, rgba(0, 95, 255, 0.26), transparent 34%),
    radial-gradient(circle at 82% 10%, rgba(6, 182, 212, 0.12), transparent 28%),
    linear-gradient(180deg, #07101f 0%, #050914 100%);
}

.login-view {
  background:
    radial-gradient(circle at 18% 16%, rgba(56, 189, 248, 0.24), transparent 28%),
    radial-gradient(circle at 78% 12%, rgba(0, 70, 199, 0.32), transparent 32%),
    linear-gradient(135deg, #06152b, #020617 72%);
}

.login-shell {
  border-color: rgba(147, 197, 253, 0.3);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.44), 0 0 44px rgba(0, 70, 199, 0.18);
  animation: commandEnter 260ms ease-out both;
}

.login-showcase {
  background:
    linear-gradient(135deg, rgba(0, 70, 199, 0.94), rgba(3, 7, 18, 0.95)),
    #002466;
}

.login-signal-grid span,
.user-chip,
.tool-section,
.nav-section {
  backdrop-filter: blur(14px);
}

.login-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.98));
}

:root[data-theme="dark"] .login-panel {
  background:
    linear-gradient(180deg, rgba(16, 27, 45, 0.98), rgba(8, 15, 28, 0.98));
}

.login-panel input,
.search-box input,
.filter-strip select,
.filter-strip input,
.form-grid input,
.form-grid select,
.form-grid textarea,
.detail-form input,
.detail-form select,
.detail-form textarea,
.top-priority-form input {
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, transform 180ms ease;
}

.login-panel input:focus,
.search-box input:focus,
.filter-strip select:focus,
.filter-strip input:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.detail-form input:focus,
.detail-form select:focus,
.detail-form textarea:focus,
.top-priority-form input:focus {
  border-color: rgba(56, 189, 248, 0.82);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.17), 0 0 24px rgba(0, 70, 199, 0.16);
  outline: none;
}

:root[data-theme="dark"] .search-box input,
:root[data-theme="dark"] .filter-strip select,
:root[data-theme="dark"] .filter-strip input,
:root[data-theme="dark"] .form-grid input,
:root[data-theme="dark"] .form-grid select,
:root[data-theme="dark"] .form-grid textarea,
:root[data-theme="dark"] .detail-form input,
:root[data-theme="dark"] .detail-form select,
:root[data-theme="dark"] .detail-form textarea,
:root[data-theme="dark"] .top-priority-form input,
:root[data-theme="dark"] #repairQueueView td select,
:root[data-theme="dark"] #ecomQueueView td select {
  color: #f8fbff;
  background: rgba(5, 12, 24, 0.86);
  border-color: rgba(130, 165, 210, 0.34);
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: #7f91a8;
  opacity: 1;
}

.sidebar {
  background:
    linear-gradient(135deg, rgba(0, 70, 199, 0.95), rgba(2, 10, 28, 0.98)),
    #07111f;
  border-bottom-color: rgba(125, 211, 252, 0.2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.brand-logo,
.dashboard-brandmark img {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55), 0 18px 38px rgba(0, 0, 0, 0.24), 0 0 28px rgba(59, 130, 246, 0.28);
}

.nav-button,
.tool-button,
.primary-button,
.subtle-button,
.icon-button,
.module-tile,
.kpi-card,
.search-result-button,
tbody tr {
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease, opacity 180ms ease;
}

.nav-button:hover,
.nav-button:focus-visible,
.tool-button:hover,
.tool-button:focus-visible,
.subtle-button:hover,
.subtle-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 70, 199, 0.14);
}

.primary-button,
.top-data-menu summary {
  background: linear-gradient(135deg, #0058f0, #003394);
  border-color: rgba(96, 165, 250, 0.58);
  box-shadow: 0 12px 28px rgba(0, 70, 199, 0.26);
}

.primary-button:hover,
.primary-button:focus-visible,
.top-data-menu summary:hover,
.top-data-menu summary:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(0, 111, 255, 0.34), 0 0 20px rgba(56, 189, 248, 0.18);
}

.nav-button.is-active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(255, 255, 255, 0.14));
  border-color: rgba(125, 211, 252, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 22px rgba(56, 189, 248, 0.14);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 9;
  padding: 10px 0 14px;
  backdrop-filter: blur(18px);
}

.topbar h2 {
  color: var(--ink);
  text-shadow: 0 0 26px rgba(0, 70, 199, 0.18);
}

.main-content {
  animation: commandEnter 220ms ease-out both;
}

.view.is-active {
  animation: viewRise 220ms ease-out both;
}

@keyframes commandEnter {
  from { opacity: 0; transform: translate3d(0, 10px, 0) scale(0.99); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes viewRise {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.surface-panel,
.table-panel,
.detail-panel,
.po-dialog,
.top-data-menu-items,
.global-search-results {
  background: var(--command-panel);
  border-color: var(--command-line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
}

:root[data-theme="dark"] .surface-panel,
:root[data-theme="dark"] .table-panel,
:root[data-theme="dark"] .detail-panel,
:root[data-theme="dark"] .po-dialog,
:root[data-theme="dark"] .top-data-menu-items,
:root[data-theme="dark"] .global-search-results {
  background:
    linear-gradient(180deg, rgba(19, 32, 52, 0.92), rgba(9, 17, 31, 0.92));
}

.section-heading h3,
.table-toolbar strong,
.detail-header h3 {
  color: var(--ink);
  letter-spacing: 0;
}

.dashboard-brandmark {
  gap: clamp(18px, 3vw, 34px);
  margin-bottom: clamp(4px, 1vh, 12px);
  animation: commandEnter 300ms ease-out both;
}

.dashboard-brandmark img {
  width: clamp(180px, 22vw, 300px);
  height: clamp(128px, 15vw, 214px);
  border-radius: 10px;
}

.dashboard-brandmark h1 {
  font-size: clamp(54px, 8vw, 112px);
  line-height: 0.92;
  text-shadow: 0 0 28px rgba(0, 70, 199, 0.28);
}

.dashboard-brandmark p {
  color: var(--muted);
  font-size: clamp(12px, 1.3vw, 16px);
}

.app-shell.is-dashboard-home .module-launcher {
  gap: clamp(14px, 1.7vw, 24px);
}

.module-tile {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: rgba(96, 165, 250, 0.22);
}

.module-tile::after {
  content: "";
  position: absolute;
  inset: -40% auto auto -20%;
  z-index: -1;
  width: 70%;
  height: 180%;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: translateX(-120%) rotate(12deg);
  transition: transform 420ms ease;
}

.module-tile:hover::after,
.module-tile:focus-visible::after {
  transform: translateX(230%) rotate(12deg);
}

.module-tile:hover,
.module-tile:focus-visible {
  transform: translateY(-5px) scale(1.01);
  border-color: rgba(125, 211, 252, 0.58);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28), 0 0 34px rgba(0, 111, 255, 0.24);
}

.module-tile:hover .module-tile-icon,
.module-tile:focus-visible .module-tile-icon {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 0 32px rgba(56, 189, 248, 0.28);
}

.module-tile-icon {
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.kpi-card {
  overflow: hidden;
}

.kpi-card::after {
  animation: metricLoad 720ms ease-out both;
  transform-origin: left center;
}

@keyframes metricLoad {
  from { transform: scaleX(0); opacity: 0.35; }
  to { transform: scaleX(1); opacity: 1; }
}

.kpi-card:hover,
.kpi-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22), 0 0 24px var(--command-glow);
}

.filter-strip {
  padding: 12px;
  background: var(--command-panel);
  border: 1px solid var(--command-line);
  border-radius: var(--radius);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.09);
}

:root[data-theme="dark"] .filter-strip {
  background: rgba(8, 15, 28, 0.7);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
}

th {
  color: var(--muted);
  background: rgba(0, 70, 199, 0.08);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

:root[data-theme="dark"] th {
  color: #c8d7ec;
  background: rgba(18, 32, 54, 0.96);
}

tbody tr {
  background: rgba(255, 255, 255, 0.82);
}

:root[data-theme="dark"] tbody tr {
  background: rgba(12, 23, 39, 0.86);
}

tbody tr:hover {
  transform: translateX(2px);
  background: rgba(225, 244, 255, 0.98);
  box-shadow: inset 3px 0 0 rgba(8, 145, 178, 0.82);
}

tbody tr.is-selected {
  background: rgba(214, 239, 255, 0.98);
  box-shadow: inset 4px 0 0 #0046c7, 0 0 22px rgba(0, 70, 199, 0.12);
}

:root[data-theme="dark"] tbody tr:hover,
:root[data-theme="dark"] tbody tr.is-selected {
  background: rgba(19, 50, 79, 0.94);
  box-shadow: inset 4px 0 0 #38bdf8, 0 0 24px rgba(56, 189, 248, 0.12);
}

.pill {
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

:root[data-theme="dark"] .pill.current {
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.2);
}

:root[data-theme="dark"] .pill.due-soon {
  color: #fde68a;
  background: rgba(217, 119, 6, 0.22);
}

:root[data-theme="dark"] .pill.work {
  color: #ddd6fe;
  background: rgba(124, 58, 237, 0.24);
}

:root[data-theme="dark"] .pill.completed,
:root[data-theme="dark"] .pill.reported {
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.22);
}

.detail-panel {
  animation: detailPulse 220ms ease-out both;
}

@keyframes detailPulse {
  from { opacity: 0.7; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

.line-row,
.detail-note,
.pasco-audit-note,
.due-schedule span {
  border-color: var(--command-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.line-row {
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.line-row:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.48);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

.po-dialog {
  color: var(--ink);
  background: var(--command-panel-strong);
  animation: modalIn 180ms ease-out both;
}

:root[data-theme="dark"] .po-dialog {
  color: #f8fbff;
  background:
    linear-gradient(180deg, rgba(18, 32, 54, 0.98), rgba(7, 15, 29, 0.98));
}

.po-dialog::backdrop {
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

:root[data-theme="dark"] .reactivation-item,
:root[data-theme="dark"] .reactivation-grid span,
:root[data-theme="dark"] .account-security-summary,
:root[data-theme="dark"] .profile-photo-panel {
  color: #f8fbff;
  background: rgba(8, 15, 28, 0.86);
  border-color: rgba(130, 165, 210, 0.3);
}

.toast {
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26), 0 0 22px rgba(56, 189, 248, 0.18);
}

@media (max-width: 1180px) {
  .dashboard-brandmark img {
    width: clamp(150px, 28vw, 230px);
    height: clamp(106px, 20vw, 164px);
  }

  .dashboard-brandmark h1 {
    font-size: clamp(42px, 9vw, 76px);
  }
}

@media (max-width: 720px) {
  .dashboard-brandmark {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .dashboard-brandmark img {
    justify-self: center;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .top-data-menu,
  .top-data-menu summary,
  .top-data-menu-items {
    width: 100%;
  }
}

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

/* Dashboard orientation and global settings placement fixes */
.floating-settings {
  position: fixed;
  top: 16px;
  right: 18px;
  bottom: auto;
  z-index: 60;
}

.app-shell.is-dashboard-home .floating-settings {
  top: 16px;
  bottom: auto;
}

.settings-cog-button {
  width: 42px;
  height: 42px;
  color: #eaf6ff;
  background:
    linear-gradient(180deg, rgba(16, 27, 45, 0.94), rgba(5, 12, 24, 0.94));
  border-color: rgba(125, 211, 252, 0.38);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28), 0 0 18px rgba(56, 189, 248, 0.16);
}

.settings-cog-button:hover,
.settings-cog-button:focus-visible {
  color: #ffffff;
  transform: translateY(-1px) rotate(18deg);
  border-color: rgba(125, 211, 252, 0.78);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34), 0 0 26px rgba(56, 189, 248, 0.28);
}

.floating-settings-menu {
  transform-origin: top right;
  animation: settingsMenuIn 160ms ease-out both;
}

@keyframes settingsMenuIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.app-shell.is-dashboard-home .main-content {
  align-items: start;
  min-height: 100vh;
  max-height: none;
  overflow-y: auto;
  padding: clamp(54px, 7vh, 76px) clamp(18px, 4vw, 56px) clamp(28px, 5vh, 46px);
}

.app-shell.is-dashboard-home #dashboardView.is-active {
  --dashboard-card-width: clamp(190px, 18vw, 245px);
  --dashboard-gap: clamp(12px, 1.5vw, 20px);
  align-content: start;
  justify-items: center;
  gap: clamp(14px, 2.2vh, 22px);
  width: min(1040px, 100%);
  height: auto;
  min-height: auto;
  margin: 0 auto;
}

.dashboard-brandmark {
  width: min(760px, 100%);
  gap: clamp(14px, 2.2vw, 24px);
  margin: 0 auto clamp(6px, 1.4vh, 14px);
  color: #f8fbff;
}

.dashboard-brandmark img {
  width: clamp(118px, 12vw, 172px);
  height: clamp(84px, 8.6vw, 122px);
  flex: 0 0 auto;
}

.dashboard-brandmark h1 {
  font-size: clamp(38px, 5.6vw, 74px);
  line-height: 0.94;
}

.dashboard-brandmark p {
  color: rgba(226, 242, 255, 0.82);
  font-size: clamp(11px, 1vw, 14px);
  letter-spacing: 0.08em;
}

.app-shell.is-dashboard-home .module-launcher-panel {
  width: min(100%, calc((var(--dashboard-card-width) * 3) + (var(--dashboard-gap) * 2)));
  margin: 0 auto;
}

.app-shell.is-dashboard-home .module-launcher {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--dashboard-gap);
  max-width: none;
  width: 100%;
  margin: 0 auto;
}

.app-shell.is-dashboard-home .module-tile {
  grid-column: span 2;
  width: 100%;
  max-width: none;
  min-height: clamp(148px, 18vh, 190px);
  aspect-ratio: auto;
}

.app-shell.is-dashboard-home .module-tile:nth-child(4):nth-last-child(2) {
  grid-column: 2 / span 2;
}

.app-shell.is-dashboard-home .module-tile:nth-child(5):last-child {
  grid-column: 4 / span 2;
}

.app-shell.is-dashboard-home .kpi-grid {
  width: min(100%, calc((var(--dashboard-card-width) * 3) + (var(--dashboard-gap) * 2)));
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 auto;
}

.app-shell.is-dashboard-home .kpi-card {
  min-height: 116px;
  padding: 14px;
}

.app-shell.is-dashboard-home .kpi-card strong {
  font-size: clamp(24px, 3vw, 40px);
}

.app-shell.is-dashboard-home .dashboard-created-by {
  margin-top: 2px;
  color: rgba(226, 242, 255, 0.48);
}

.topbar {
  grid-template-columns: minmax(92px, 1fr) minmax(180px, auto) minmax(360px, 1fr);
  padding-right: 54px;
}

.topbar-actions {
  padding-right: 4px;
}

.browser-layout {
  transition: grid-template-columns 180ms ease;
}

.detail-panel {
  transform-origin: top right;
}

.line-row {
  animation: lineIn 180ms ease-out both;
}

@keyframes lineIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

:root[data-theme="light"] .settings-cog-button {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(15, 23, 42, 0.18);
}

@media (max-width: 980px) {
  .app-shell.is-dashboard-home .module-launcher {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell.is-dashboard-home .module-tile,
  .app-shell.is-dashboard-home .module-tile:nth-child(4):nth-last-child(2),
  .app-shell.is-dashboard-home .module-tile:nth-child(5):last-child {
    grid-column: auto;
  }

  .app-shell.is-dashboard-home .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    grid-template-columns: 1fr;
    padding-right: 54px;
  }
}

@media (max-width: 640px) {
  .app-shell.is-dashboard-home .main-content {
    padding-top: 64px;
  }

  .dashboard-brandmark {
    flex-direction: column;
    text-align: center;
  }

  .app-shell.is-dashboard-home .module-launcher,
  .app-shell.is-dashboard-home .kpi-grid {
    grid-template-columns: 1fr;
  }

  .floating-settings {
    top: 10px;
    right: 10px;
  }
}

/* Inline settings action and stronger screen motion */
.topbar {
  padding-right: 0;
}

.topbar-actions {
  align-items: end;
  padding-right: 0;
}

.topbar-actions .floating-settings {
  position: relative;
  inset: auto;
  z-index: 12;
  display: grid;
  align-self: end;
  justify-items: end;
  gap: 8px;
}

.topbar-actions .settings-cog-button {
  width: 42px;
  height: 38px;
  border-radius: var(--radius);
}

.topbar-actions .floating-settings-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
}

.login-view > .floating-settings,
#dashboardView > .floating-settings {
  position: fixed;
  top: 16px;
  right: 18px;
  bottom: auto;
  z-index: 60;
}

#dashboardView {
  position: relative;
}

.login-view::before,
.app-shell.is-dashboard-home .main-content::before {
  content: "";
  position: fixed;
  inset: -12%;
  pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='260' viewBox='0 0 420 260'%3E%3Cg transform='rotate(-14 210 130)'%3E%3Ctext x='210' y='142' text-anchor='middle' font-family='Aptos Display, Segoe UI, Arial, sans-serif' font-size='92' font-weight='700' letter-spacing='10' fill='none' stroke='%2393c5fd' stroke-opacity='.18' stroke-width='1.2'%3EK12%3C/text%3E%3Ctext x='210' y='142' text-anchor='middle' font-family='Aptos Display, Segoe UI, Arial, sans-serif' font-size='92' font-weight='700' letter-spacing='10' fill='%23dbeafe' fill-opacity='.045'%3EK12%3C/text%3E%3C/g%3E%3C/svg%3E");
  background-size: 420px 260px;
  opacity: 0.72;
  animation: k12BackdropDrift 42s linear infinite;
}

.login-view::after,
.app-shell.is-dashboard-home .main-content::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 22%, rgba(56, 189, 248, 0.2), transparent 32%),
    radial-gradient(circle at 78% 12%, rgba(0, 70, 199, 0.22), transparent 34%);
  opacity: 0.8;
  animation: commandGlowShift 18s ease-in-out infinite alternate;
}

.login-shell,
#dashboardView > * {
  position: relative;
  z-index: 1;
}

@keyframes k12BackdropDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(120px, 74px, 0); }
}

@keyframes commandGlowShift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); opacity: 0.58; }
  to { transform: translate3d(1.5%, 1%, 0) scale(1.04); opacity: 0.86; }
}

.dashboard-brandmark {
  animation: dashboardHeaderIn 360ms cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes dashboardHeaderIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.app-shell.is-dashboard-home .module-tile {
  animation: dashboardTileIn 420ms cubic-bezier(.2, .8, .2, 1) both;
}

.app-shell.is-dashboard-home .module-tile:nth-child(1) { animation-delay: 40ms; }
.app-shell.is-dashboard-home .module-tile:nth-child(2) { animation-delay: 100ms; }
.app-shell.is-dashboard-home .module-tile:nth-child(3) { animation-delay: 160ms; }
.app-shell.is-dashboard-home .module-tile:nth-child(4) { animation-delay: 220ms; }
.app-shell.is-dashboard-home .module-tile:nth-child(5) { animation-delay: 280ms; }

@keyframes dashboardTileIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.app-shell.is-dashboard-home .kpi-card {
  animation: dashboardMetricIn 420ms cubic-bezier(.2, .8, .2, 1) both;
}

.app-shell.is-dashboard-home .kpi-card:nth-child(1) { animation-delay: 320ms; }
.app-shell.is-dashboard-home .kpi-card:nth-child(2) { animation-delay: 370ms; }
.app-shell.is-dashboard-home .kpi-card:nth-child(3) { animation-delay: 420ms; }
.app-shell.is-dashboard-home .kpi-card:nth-child(4) { animation-delay: 470ms; }
.app-shell.is-dashboard-home .kpi-card:nth-child(5) { animation-delay: 520ms; }

@keyframes dashboardMetricIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-showcase {
  animation: loginPanelIn 320ms ease-out 80ms both;
}

.login-panel {
  animation: loginPanelIn 320ms ease-out 160ms both;
}

.login-signal-grid span {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.login-signal-grid span:hover {
  transform: translateY(-3px);
  border-color: rgba(125, 211, 252, 0.58);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18), 0 0 20px rgba(56, 189, 248, 0.16);
}

@keyframes loginPanelIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.detail-panel.is-updating {
  animation: detailRefresh 220ms ease-out both;
}

@keyframes detailRefresh {
  from { opacity: 0.65; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

button:active,
.module-tile:active,
.kpi-card:active {
  transform: translateY(0) scale(0.985);
}

@media (max-width: 980px) {
  .topbar-actions .floating-settings {
    width: auto;
  }
}

@media (max-width: 640px) {
  .topbar-actions .floating-settings,
  .topbar-actions .settings-cog-button {
    width: 100%;
  }

  .topbar-actions .floating-settings-menu {
    right: 0;
    width: min(220px, 100%);
  }
}

/* K12 Command Grid animated background */
.animated-command-bg {
  --k12-bg-opacity: 0.22;
  --k12-bg-stroke-opacity: 0.46;
  --k12-bg-speed: 28s;
  --k12-bg-distance-x: 210px;
  --k12-bg-distance-y: -136px;
  --command-grid-opacity: 0.18;
  --command-sweep-opacity: 0.26;
  --command-pulse-opacity: 0.36;
}

.command-bg-strong {
  --k12-bg-opacity: 0.36;
  --k12-bg-stroke-opacity: 0.72;
  --k12-bg-speed: 22s;
  --k12-bg-distance-x: 240px;
  --k12-bg-distance-y: -158px;
  --command-grid-opacity: 0.28;
  --command-sweep-opacity: 0.42;
  --command-pulse-opacity: 0.52;
}

.command-bg-medium {
  --k12-bg-opacity: 0.16;
  --k12-bg-stroke-opacity: 0.34;
  --k12-bg-speed: 34s;
  --k12-bg-distance-x: 160px;
  --k12-bg-distance-y: -98px;
  --command-grid-opacity: 0.12;
  --command-sweep-opacity: 0.18;
  --command-pulse-opacity: 0.24;
}

.command-bg-subtle {
  --k12-bg-opacity: 0.07;
  --k12-bg-stroke-opacity: 0.18;
  --k12-bg-speed: 48s;
  --k12-bg-distance-x: 96px;
  --k12-bg-distance-y: -56px;
  --command-grid-opacity: 0.07;
  --command-sweep-opacity: 0.08;
  --command-pulse-opacity: 0.12;
}

:root[data-theme="light"] .animated-command-bg {
  --k12-bg-opacity: 0.08;
  --k12-bg-stroke-opacity: 0.18;
  --command-grid-opacity: 0.08;
  --command-sweep-opacity: 0.12;
  --command-pulse-opacity: 0.16;
}

:root[data-theme="light"] .command-bg-strong {
  --k12-bg-opacity: 0.13;
  --k12-bg-stroke-opacity: 0.26;
  --command-grid-opacity: 0.12;
  --command-sweep-opacity: 0.16;
  --command-pulse-opacity: 0.18;
}

.login-view::before,
.app-shell.is-dashboard-home .main-content::before,
.app-shell.command-bg-medium:not(.is-dashboard-home):not(.is-locked)::before,
.app-shell.command-bg-subtle:not(.is-dashboard-home):not(.is-locked)::before {
  content: "";
  position: fixed;
  inset: -18%;
  z-index: 0;
  pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='260' viewBox='0 0 420 260'%3E%3Cg transform='rotate(-14 210 130)'%3E%3Ctext x='210' y='142' text-anchor='middle' font-family='Aptos Display, Segoe UI, Arial, sans-serif' font-size='92' font-weight='800' letter-spacing='10' fill='none' stroke='%23ffffff' stroke-opacity='0.62' stroke-width='1.4'%3EK12%3C/text%3E%3Ctext x='210' y='142' text-anchor='middle' font-family='Aptos Display, Segoe UI, Arial, sans-serif' font-size='92' font-weight='800' letter-spacing='10' fill='%2393c5fd' fill-opacity='0.16'%3EK12%3C/text%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(rgba(125, 211, 252, calc(var(--command-grid-opacity) * 0.34)) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, calc(var(--command-grid-opacity) * 0.28)) 1px, transparent 1px),
    repeating-linear-gradient(180deg, transparent 0 9px, rgba(255, 255, 255, calc(var(--command-grid-opacity) * 0.22)) 10px);
  background-size: 420px 260px, 56px 56px, 56px 56px, 100% 10px;
  opacity: var(--k12-bg-opacity);
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.22));
  animation:
    k12CommandDrift var(--k12-bg-speed) linear infinite,
    commandGridSlide 26s linear infinite;
}

.login-view::after,
.app-shell.is-dashboard-home .main-content::after,
.app-shell.command-bg-medium:not(.is-dashboard-home):not(.is-locked)::after,
.app-shell.command-bg-subtle:not(.is-dashboard-home):not(.is-locked)::after {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 34%, rgba(255, 255, 255, calc(var(--command-sweep-opacity) * 0.45)) 43%, rgba(56, 189, 248, var(--command-sweep-opacity)) 50%, rgba(0, 70, 199, calc(var(--command-sweep-opacity) * 0.52)) 58%, transparent 68%),
    radial-gradient(circle at 50% 42%, rgba(56, 189, 248, var(--command-pulse-opacity)), transparent 34%),
    radial-gradient(circle at 20% 78%, rgba(0, 70, 199, calc(var(--command-pulse-opacity) * 0.64)), transparent 28%);
  opacity: 0.95;
  mix-blend-mode: screen;
  animation:
    commandLightSweep 11s ease-in-out infinite,
    commandCenterPulse 6s ease-in-out infinite alternate;
}

.app-shell.command-bg-medium:not(.is-dashboard-home):not(.is-locked)::before,
.app-shell.command-bg-medium:not(.is-dashboard-home):not(.is-locked)::after,
.app-shell.command-bg-subtle:not(.is-dashboard-home):not(.is-locked)::before,
.app-shell.command-bg-subtle:not(.is-dashboard-home):not(.is-locked)::after {
  z-index: 0;
}

.app-shell > .floating-settings,
.app-shell > .sidebar,
.app-shell > .main-content,
.login-view > .login-shell,
.login-view > .floating-settings {
  position: relative;
  z-index: 1;
}

@keyframes k12CommandDrift {
  0% { transform: translate3d(calc(var(--k12-bg-distance-x) * -0.24), calc(var(--k12-bg-distance-y) * -0.24), 0); }
  100% { transform: translate3d(var(--k12-bg-distance-x), var(--k12-bg-distance-y), 0); }
}

@keyframes commandGridSlide {
  from { background-position: 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 240px -158px, 56px 56px, 56px 56px, 0 80px; }
}

@keyframes commandLightSweep {
  0% { transform: translate3d(-38%, 28%, 0) rotate(0.001deg); opacity: 0.18; }
  24% { opacity: 0.9; }
  52% { transform: translate3d(38%, -22%, 0) rotate(0.001deg); opacity: 0.7; }
  100% { transform: translate3d(68%, -42%, 0) rotate(0.001deg); opacity: 0.12; }
}

@keyframes commandCenterPulse {
  from { transform: scale(0.98); opacity: 0.58; }
  to { transform: scale(1.06); opacity: 0.98; }
}

.app-shell.is-dashboard-home .module-tile:hover,
.app-shell.is-dashboard-home .module-tile:focus-visible {
  border-color: rgba(186, 230, 253, 0.88);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.36),
    0 0 44px rgba(56, 189, 248, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.app-shell.is-dashboard-home .module-tile:hover .module-tile-icon,
.app-shell.is-dashboard-home .module-tile:focus-visible .module-tile-icon {
  border-color: rgba(186, 230, 253, 0.68);
  box-shadow:
    0 0 34px rgba(56, 189, 248, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

@media (prefers-reduced-motion: reduce) {
  .login-view::before,
  .login-view::after,
  .app-shell.is-dashboard-home .main-content::before,
  .app-shell.is-dashboard-home .main-content::after,
  .app-shell.command-bg-medium:not(.is-dashboard-home):not(.is-locked)::before,
  .app-shell.command-bg-medium:not(.is-dashboard-home):not(.is-locked)::after,
  .app-shell.command-bg-subtle:not(.is-dashboard-home):not(.is-locked)::before,
  .app-shell.command-bg-subtle:not(.is-dashboard-home):not(.is-locked)::after {
    animation: none !important;
    transform: none !important;
  }
}
