:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-strong: #f9fbff;
  --surface: #f8fafc;
  --ink: #172033;
  --muted: #66758c;
  --line: #d7e1ee;
  --line-strong: #b8c7da;
  --field: #ffffff;
  --soft: #e9f1f8;
  --soft-ink: #243247;
  --notice-bg: #e9fbf7;
  --notice-ink: #0f5f68;
  --notice-line: #94d8d0;
  --danger-notice-bg: #fff3f2;
  --danger-notice-line: #fecdca;
  --pill-bg: #eef2f7;
  --pill-ink: #344054;
  --pill-ok-bg: #dcfae6;
  --pill-warn-bg: #fff3dc;
  --pill-danger-bg: #fee4e2;
  --step-bg: #e3f5f2;
  --progress-bg: #e8eef3;
  --sidebar: #101826;
  --sidebar-ink: #eef2f7;
  --sidebar-muted: #aab4c2;
  --nav-hover: rgba(45, 212, 191, 0.12);
  --nav-active: rgba(20, 184, 166, 0.18);
  --brand: #0d9488;
  --brand-2: #2563eb;
  --brand-hover: #0f766e;
  --accent: #38bdf8;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --warn: #d97706;
  --ok: #059669;
  --focus-ring: rgba(56, 189, 248, 0.28);
  --shadow: 0 16px 34px rgba(15, 23, 42, 0.10);
}

body[data-theme="dark"] {
  --bg: #080d18;
  --panel: #141f31;
  --panel-strong: #192840;
  --surface: #10192a;
  --ink: #f2f7ff;
  --muted: #a2aec1;
  --line: #28405f;
  --line-strong: #3b5a7c;
  --field: #0d1728;
  --soft: #22334d;
  --soft-ink: #e9f2ff;
  --notice-bg: #0b3a3d;
  --notice-ink: #b7fff5;
  --notice-line: #1d7b7f;
  --danger-notice-bg: #3d181d;
  --danger-notice-line: #8d3639;
  --pill-bg: #22334d;
  --pill-ink: #e7eefc;
  --pill-ok-bg: #0d3d2c;
  --pill-warn-bg: #46300f;
  --pill-danger-bg: #4a1f25;
  --step-bg: #0c3b39;
  --progress-bg: #22334d;
  --sidebar: #0b1220;
  --sidebar-ink: #eef2f7;
  --sidebar-muted: #9caec4;
  --nav-hover: rgba(56, 189, 248, 0.13);
  --nav-active: rgba(20, 184, 166, 0.20);
  --brand: #14b8a6;
  --brand-2: #3b82f6;
  --brand-hover: #2dd4bf;
  --accent: #38bdf8;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --warn: #f59e0b;
  --ok: #22c55e;
  --focus-ring: rgba(56, 189, 248, 0.30);
  --shadow: 0 22px 48px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  border: 0;
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, var(--sidebar) 0%, #0a1020 100%);
  color: var(--sidebar-ink);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
}

.brand {
  display: grid;
  gap: 8px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 26px rgba(20, 184, 166, 0.26);
  font-weight: 800;
}

.brand h1 {
  font-size: 17px;
  margin: 0;
  line-height: 1.25;
}

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

.nav {
  display: grid;
  gap: 8px;
}

.nav-section {
  display: grid;
  gap: 6px;
}

.nav-group {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.36);
  overflow: hidden;
}

.nav-group summary {
  cursor: pointer;
  list-style: none;
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.nav-group summary::after {
  content: "v";
  color: var(--sidebar-muted);
  transition: transform 160ms ease;
}

.nav-group[open] summary::after {
  transform: rotate(180deg);
}

.nav-group .nav-section {
  padding: 0 8px 8px;
}

.nav button {
  width: 100%;
  color: var(--sidebar-ink);
  background: transparent;
  text-align: left;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.nav button.active,
.nav button:hover {
  background: var(--nav-active);
  border-color: rgba(56, 189, 248, 0.24);
  color: #ffffff;
}

.nav button:hover {
  transform: translateX(2px);
}

.main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  height: 72px;
  background: color-mix(in srgb, var(--panel) 88%, var(--bg));
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.topbar h2 {
  font-size: 18px;
  margin: 0;
}

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

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

.notification-area {
  position: relative;
  justify-content: flex-end;
}

.notification-button {
  gap: 8px;
}

.notification-badge {
  min-width: 22px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 12px;
  padding: 2px 6px;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 9;
  width: min(420px, calc(100vw - 48px));
  max-height: 480px;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px;
}

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

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

.notification-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px;
  text-align: left;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.notification-item.unread {
  border-color: var(--notice-line);
  background: var(--notice-bg);
}

.notification-item span,
.notification-item small {
  color: var(--muted);
}

.access-lock-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.access-lock-banner div {
  display: grid;
  gap: 4px;
}

.access-lock-banner span {
  color: var(--muted);
}

.content {
  padding: 28px;
  display: grid;
  gap: 22px;
  align-content: start;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 480px) 1fr;
}

.login-panel {
  background: linear-gradient(180deg, var(--sidebar) 0%, #0b1f33 100%);
  color: white;
  padding: 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-panel h1 {
  font-size: 34px;
  margin: 18px 0 8px;
}

.login-panel p {
  color: #b9c4d2;
}

.login-form {
  align-self: center;
  width: min(440px, calc(100% - 36px));
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-form h2 {
  margin: 0 0 18px;
}

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

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

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

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

.card {
  position: relative;
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, var(--brand), var(--accent), transparent 70%);
  opacity: 0.55;
  pointer-events: none;
}

.settings-card {
  align-content: start;
  display: grid;
  gap: 16px;
}

.settings-card h3 {
  margin: 0;
}

.settings-card .muted {
  font-weight: 400;
}

.desktop-app-card {
  overflow: hidden;
}

.desktop-app-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.desktop-app-meta div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.desktop-app-meta span {
  color: var(--muted);
  font-size: 12px;
}

.desktop-app-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-app-download {
  justify-content: center;
  width: 100%;
}

.collapsible-card {
  display: block;
}

.collapsible-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.collapsible-card summary::-webkit-details-marker {
  display: none;
}

.collapsible-card summary span:first-child {
  display: grid;
  gap: 4px;
}

.collapsible-card summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.collapsible-card[open] summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  padding-bottom: 14px;
}

.password-settings-card summary .muted {
  font-size: 12px;
  font-weight: 700;
}

.password-settings-form {
  margin-top: 2px;
}

.installer-options {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 14px;
  padding: 12px;
}

.agent-data-info {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.agent-data-info p {
  margin: 0;
}

.agent-data-info dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.agent-data-info dl > div {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  gap: 10px;
  align-items: baseline;
}

.agent-data-info dt {
  color: var(--muted);
  font-size: 12px;
}

.agent-data-info dd {
  margin: 0;
}

.agent-data-info code {
  display: inline-block;
  max-width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  white-space: normal;
  word-break: break-all;
}

.compact-settings-form {
  margin-top: 12px;
}

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

.dashboard-tile {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  color: var(--ink);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.dashboard-tile:hover {
  border-color: var(--line-strong);
  box-shadow: 0 18px 38px rgba(20, 184, 166, 0.12);
  transform: translateY(-1px);
}

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

.dashboard-tile span {
  color: var(--muted);
  font-size: 13px;
}

.tile-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white !important;
  font-size: 20px !important;
  font-weight: 800;
}

.tile-icon.purple {
  background: #7c3aed;
}

.tile-icon.green {
  background: #059669;
}

.tile-icon.blue {
  background: #2563eb;
}

.tile-icon.orange {
  background: #f59e0b;
}

.tile-icon.red {
  background: #ef4444;
}

.tile-icon.gray {
  background: #64748b;
}

.tile-icon.cyan {
  background: #0891b2;
}

.metric {
  display: grid;
  gap: 8px;
}

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

.metric strong {
  font-size: 30px;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.page-heading h3 {
  margin: 0 0 4px;
  font-size: 22px;
}

.page-heading p {
  margin: 0;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-line input {
  width: auto;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.04);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--field);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.password-field .button {
  white-space: nowrap;
}

.action-select {
  min-width: 180px;
  background: var(--soft);
  color: var(--soft-ink);
  font-weight: 700;
}

.compact-control {
  min-width: 130px;
  padding: 7px 9px;
}

textarea {
  min-height: 74px;
  resize: vertical;
}

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

.filter-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(160px, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

.block {
  display: block;
}

.inventory-actions {
  min-width: 360px;
}

.network-device-details {
  margin-top: 10px;
}

.network-device-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 6px 6px 0 0;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
}

.confidence-bar {
  width: 120px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.confidence-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.asset-profile {
  display: grid;
  gap: 16px;
}

.asset-profile-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.asset-profile-tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 12px 14px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.asset-profile-tabs button.active {
  border-color: var(--brand);
  color: var(--ink);
}

.asset-profile-content {
  display: grid;
  gap: 16px;
}

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

.asset-profile-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-strong) 82%, transparent);
  padding: 16px;
}

.asset-profile-section h4 {
  margin: 0 0 14px;
}

.asset-detail-row {
  display: grid;
  grid-template-columns: minmax(140px, 210px) minmax(0, 1fr);
  gap: 14px;
  padding: 7px 0;
  align-items: start;
}

.asset-detail-row span {
  color: var(--muted);
}

.asset-detail-row strong {
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.asset-inline-card {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 10px;
}

.disk-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.disk-summary strong {
  font-size: 28px;
}

.disk-card {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 18px;
}

.usage-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-top: 8px;
}

.usage-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--warn), var(--danger));
}

.split-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
}

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

  .asset-profile-grid,
  .disk-card {
    grid-template-columns: 1fr;
  }
}

.financial-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.financial-shortcut {
  position: relative;
  min-height: 72px;
  display: grid;
  gap: 4px;
  align-content: center;
  text-align: left;
  padding: 14px 16px 14px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--soft), var(--panel));
  color: var(--ink);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.financial-shortcut::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, var(--brand), var(--accent));
  opacity: 0.85;
}

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

.financial-shortcut strong {
  font-size: 15px;
  line-height: 1.25;
}

.financial-shortcut:hover,
.financial-shortcut.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 16%, var(--panel)), var(--panel));
  box-shadow: 0 18px 34px rgba(20, 184, 166, 0.18);
  transform: translateY(-1px);
}

.financial-shortcut.active {
  box-shadow: 0 0 0 3px var(--focus-ring), 0 18px 34px rgba(20, 184, 166, 0.18);
}

.button {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  padding: 10px 13px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(20, 184, 166, 0.16);
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease, background 150ms ease;
}

.button:hover {
  filter: brightness(1.05);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
  transform: translateY(-1px);
}

.button.secondary {
  background: var(--soft);
  color: var(--soft-ink);
  box-shadow: none;
}

.button.primary {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
}

.button.danger {
  background: linear-gradient(135deg, var(--danger), var(--danger-hover));
}

.button.small {
  min-height: 30px;
  padding: 7px 10px;
  font-size: 12px;
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.row-between.gap {
  gap: 10px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover {
  background: var(--soft);
  color: var(--ink);
}

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

.center {
  text-align: center;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

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

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

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--soft) 42%, transparent);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
  background: var(--pill-bg);
  color: var(--pill-ink);
}

.pill.ok {
  background: var(--pill-ok-bg);
  color: var(--ok);
}

.pill.warn {
  background: var(--pill-warn-bg);
  color: var(--warn);
}

.pill.danger {
  background: var(--pill-danger-bg);
  color: var(--danger);
}

.notice {
  border: 1px solid var(--notice-line);
  background: var(--notice-bg);
  color: var(--notice-ink);
  border-radius: 8px;
  padding: 12px 14px;
  word-break: break-word;
}

.danger-notice {
  border-color: var(--danger-notice-line);
  background: var(--danger-notice-bg);
  color: var(--danger);
}

.compact-notice {
  padding: 7px 9px;
  font-size: 12px;
}

.fiscal-status.needs-attention {
  border-left: 3px solid var(--warn);
  padding-left: 8px;
}

.attention-text {
  color: var(--warn);
  font-weight: 800;
  font-size: 12px;
}

.invite-link-box {
  display: grid;
  gap: 10px;
}

.invite-link-box a {
  color: var(--brand);
  font-weight: 700;
}

.invite-link-box .button {
  justify-self: start;
}

.invite-email-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.invite-email-header p {
  margin: 4px 0 0;
}

.invite-email-preview {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--notice-line);
  padding-top: 12px;
}

.invite-email-preview input,
.invite-email-preview pre {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
}

.invite-email-preview input {
  width: 100%;
  padding: 10px 12px;
}

.invite-email-preview pre {
  margin: 0;
  min-height: 140px;
  max-height: 300px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.invite-summary {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  font-size: 13px;
}

.setup-steps {
  display: grid;
  gap: 18px;
}

.setup-step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.setup-step:first-child {
  border-top: 0;
  padding-top: 0;
}

.setup-step h4 {
  margin: 0 0 6px;
}

.step-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--step-bg);
  color: var(--brand);
  font-weight: 800;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(150px, 200px) minmax(170px, 230px) auto;
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}

.audit-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}

.audit-quick-filters .button.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.hierarchy-tree {
  display: grid;
  gap: 10px;
}

.hierarchy-node {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--soft) 55%, transparent);
  padding: 10px;
}

.hierarchy-node summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 800;
  list-style-position: inside;
}

.hierarchy-node summary small {
  color: var(--muted);
  font-weight: 700;
}

.hierarchy-asset {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(120px, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.token-box {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  border: 1px solid var(--notice-line);
  background: var(--notice-bg);
  border-radius: 8px;
  padding: 12px;
}

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

.token-box strong {
  font-family: Consolas, "Courier New", monospace;
  overflow-wrap: anywhere;
}

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

.command-row {
  cursor: pointer;
}

.command-row:hover,
.command-row:focus,
.command-row.is-open {
  background: var(--notice-bg);
  outline: none;
}

.command-detail-row td {
  background: var(--surface);
  border-top: 0;
}

.command-details pre {
  max-height: 180px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.support-thread {
  display: grid;
  gap: 14px;
}

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

.support-company-card {
  display: grid;
  gap: 6px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
}

.support-company-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--notice-line);
}

.support-company-card span {
  color: var(--muted);
}

.support-message {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 12px;
}

.support-message.admin-message {
  border-color: var(--notice-line);
  background: var(--notice-bg);
}

.support-message p {
  margin: 8px 0 0;
  white-space: pre-wrap;
}

.support-reply-form {
  display: grid;
  gap: 12px;
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
}

.toggle-button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.toggle-button.active {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: white;
  box-shadow: 0 10px 22px rgba(20, 184, 166, 0.22);
}

.dashboard-mode-toggle {
  border-color: rgba(20, 184, 166, 0.48);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.dashboard-mode-toggle .toggle-button {
  min-width: 168px;
  padding: 12px 16px;
  color: var(--ink);
}

.dashboard-mode-toggle .toggle-button:not(.active) {
  background: var(--surface);
}

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

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

.support-dashboard-grid.custom {
  align-items: stretch;
}

.support-dashboard-grid.top {
  grid-template-columns: 2fr 1fr;
}

.support-widget {
  min-height: 190px;
}

.support-widget.wide {
  grid-column: span 2;
  min-height: 128px;
}

.support-widget.is-editing {
  position: relative;
  padding-top: 46px;
  outline: 1px dashed rgba(20, 184, 166, 0.48);
  cursor: grab;
}

.support-widget.is-dragging {
  opacity: 0.55;
}

.support-widget.is-drop-target {
  outline: 2px solid var(--brand);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14);
}

.dashboard-widget-tools {
  position: absolute;
  top: 10px;
  right: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.dashboard-widget-tools button,
.dashboard-widget-tools span {
  pointer-events: auto;
}

.dashboard-drag-handle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--muted);
  font-weight: 900;
  cursor: grab;
}

.dashboard-customizer,
.dashboard-add-widgets {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--panel-strong), var(--panel));
  padding: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}

.dashboard-customizer {
  position: sticky;
  top: 12px;
  z-index: 3;
}

.dashboard-customizer .button {
  min-width: 150px;
}

.dashboard-customizer > div:first-child {
  display: grid;
  gap: 4px;
}

.dashboard-add-widgets {
  justify-content: flex-start;
  flex-wrap: wrap;
  background: var(--surface);
}

.table-wrap.flush {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.support-widget h3 {
  margin: 0 0 16px;
  font-size: 16px;
}

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

.support-kpi-row.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.support-kpi-row div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.support-kpi-row strong {
  font-size: 28px;
}

.support-kpi-row span,
.support-sla-grid span {
  color: var(--muted);
  font-size: 13px;
}

.support-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  align-items: end;
  gap: 12px;
  height: 170px;
  padding-top: 10px;
  border-bottom: 1px solid var(--line);
}

.support-chart-day {
  display: grid;
  align-items: end;
  gap: 8px;
  min-width: 0;
  height: 100%;
  text-align: center;
}

.support-chart-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  height: 128px;
}

.support-chart-bars span {
  width: 12px;
  border-radius: 8px 8px 0 0;
  background: var(--brand);
}

.support-chart-bars .resolved {
  background: var(--ok);
}

.support-chart-day small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
}

.support-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.support-legend span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
}

.support-legend span.resolved {
  background: var(--ok);
}

.support-bars {
  display: grid;
  gap: 12px;
}

.tenant-complete-dashboard .support-widget {
  min-height: 220px;
}

.tenant-dashboard-overview {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 2fr);
  gap: 14px;
}

.tenant-dashboard-score,
.tenant-dashboard-mini-grid button,
.tenant-activity-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.tenant-dashboard-score {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
}

.tenant-dashboard-score strong {
  font-size: 42px;
}

.tenant-dashboard-score span,
.tenant-dashboard-mini-grid span,
.tenant-finance-card small,
.tenant-activity-item small {
  color: var(--muted);
  font-size: 12px;
}

.tenant-dashboard-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.tenant-dashboard-mini-grid button {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.tenant-dashboard-mini-grid strong {
  font-size: 24px;
}

.tenant-finance-card {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.16), rgba(59, 130, 246, 0.12));
}

.tenant-finance-card strong {
  font-size: 28px;
}

.tenant-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.tenant-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.tenant-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-activity-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tenant-activity-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 12px;
}

.tenant-activity-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-activity-item small {
  grid-column: 1 / -1;
}

.button.full {
  width: 100%;
  justify-content: center;
  margin-top: 12px;
}

.support-bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
}

.support-bar-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-bar-row strong {
  color: var(--ink);
  font-size: 13px;
}

.support-bar {
  grid-column: 1 / -1;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--field);
}

.support-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.support-bar i.warn {
  background: linear-gradient(90deg, #f59e0b, #f97316);
}

.support-bar i.danger {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.support-donut-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.support-donut {
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--percent) * 1%), var(--field) 0);
}

.support-donut span {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.support-sla-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.support-sla-grid div {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 120px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}

.support-sla-grid strong {
  font-size: 28px;
}

.support-rating {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 135px;
  text-align: center;
}

.support-rating.compact {
  min-height: auto;
}

.support-rating strong {
  font-size: 34px;
}

.support-stars {
  color: #f59e0b;
  font-size: 30px;
  letter-spacing: 0;
}

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

.saas-rating-input {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.saas-rating-input label {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.saas-rating-input input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.saas-rating-input span {
  color: inherit;
  font-size: 24px;
}

.saas-rating-input label:hover,
.saas-rating-input label.selected {
  border-color: #f59e0b;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.saas-feedback-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.saas-feedback-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.saas-feedback-item span {
  color: #f59e0b;
}

.saas-feedback-item p {
  margin: 0;
  color: var(--muted);
}

.attachment-list {
  display: grid;
  gap: 6px;
}

.attachment-list a {
  color: var(--brand);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.payment-attachments {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.attachment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.attachment-row a {
  min-width: 0;
}

.file-button {
  width: fit-content;
  cursor: pointer;
}

.icon-button.danger {
  color: var(--danger);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.38);
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
  padding: 18px;
}

.modal-wide {
  width: min(1040px, 100%);
}

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

.modal-header h3 {
  margin: 0;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.activity-device {
  display: grid;
  gap: 16px;
}

.activity-device-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.activity-device-header p {
  margin: 4px 0 0;
}

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

.activity-app {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.activity-app h4 {
  margin: 0;
  font-size: 20px;
}

.activity-app p {
  margin: 0;
}

.app-title {
  display: flex;
  gap: 9px;
  align-items: center;
}

.app-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font-weight: 800;
}

.progress {
  height: 6px;
  background: var(--progress-bg);
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--brand);
}

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

.payment-pix-box {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.payment-qr {
  width: 180px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: white;
}

.payment-pix-box textarea {
  width: 100%;
  resize: vertical;
  min-height: 88px;
}

.scanner-help {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.scanner-help ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.notice pre {
  overflow: auto;
  margin: 10px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.empty {
  color: var(--muted);
  padding: 16px 0;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    height: auto;
    padding: 14px;
    gap: 12px;
    max-height: 150px;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-section {
    display: flex;
    gap: 8px;
  }

  .nav-group {
    flex: 0 0 auto;
    min-width: 178px;
  }

  .nav-group .nav-section {
    display: flex;
    overflow-x: auto;
    padding: 0 8px 8px;
  }

  .nav button {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
    padding: 10px 12px;
  }

  .brand {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

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

  .brand p {
    font-size: 12px;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .dashboard-grid,
  .financial-shortcuts,
  .support-dashboard-grid,
  .support-dashboard-grid.top,
  .support-kpi-row,
  .support-kpi-row.compact,
  .support-sla-grid,
  .tenant-dashboard-overview,
  .tenant-dashboard-mini-grid,
  .tenant-activity-list,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .view-toggle {
    width: 100%;
  }

  .toggle-button {
    flex: 1;
  }

  .support-widget.wide {
    grid-column: auto;
  }

  .dashboard-customizer {
    align-items: stretch;
    flex-direction: column;
  }

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

  .command-details {
    grid-template-columns: 1fr;
  }

  .hierarchy-asset {
    grid-template-columns: 1fr;
  }

  .setup-step {
    grid-template-columns: 1fr;
  }

  .login-panel {
    padding: 30px;
  }
}
