@import url("https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css");

:root {
  --primary: #4b0073;
  --primary-hover: #660099;
  --primary-dark: #2b0644;
  --primary-soft: #f4e8fb;
  --accent: #764ba2;
  --bg-app: #f6f7fb;
  --bg-primary: #f6f7fb;
  --bg-secondary: #ffffff;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #e5e7eb;
  --border-color: #e5e7eb;
  --text-main: #111827;
  --text-muted: #6b7280;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --sidebar-width: 190px;
  --header-height: 56px;
  --radius: 12px;
  --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.06);
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-app);
  color: var(--text-main);
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

* {
  box-sizing: border-box;
}

button,
input,
select,
textarea {
  min-width: 0;
  font: inherit;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  vertical-align: middle;
}

.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(244, 232, 251, 0.9), transparent 36rem),
    var(--bg-app);
  color: var(--text-main);
}

.app-main {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.page {
  padding: 18px;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar-width);
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.sidebar-inner {
  display: flex;
  height: 100%;
  flex-direction: column;
  padding: 14px 12px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 16px;
}

.sidebar-logo {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.sidebar-brand p {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-brand h1 {
  margin: 1px 0 0;
  color: var(--text-main);
  font-size: 15px;
  font-weight: 800;
}

.sidebar-nav ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  color: #374151;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.sidebar-link:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.sidebar-link.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(75, 0, 115, 0.18);
}

.sidebar-link span:first-child {
  display: inline-flex;
  width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(75, 0, 115, 0.08);
  font-size: 10px;
  font-weight: 800;
}

.sidebar-link.active span:first-child {
  background: rgba(255, 255, 255, 0.18);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  padding: 0 18px;
  backdrop-filter: blur(12px);
}

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

.topbar-title h2 {
  margin: 0;
  overflow: hidden;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-title p {
  margin: 1px 0 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.topbar-user div {
  text-align: right;
}

.topbar-user strong,
.topbar-user span {
  display: block;
}

.topbar-user strong {
  color: var(--text-main);
  font-size: 12px;
}

.topbar-user span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.kpi-card {
  position: relative;
  min-height: 86px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.kpi-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #d1d5db;
  content: "";
}

.kpi-card p,
.kpi-card span {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
}

.kpi-card p {
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kpi-card strong {
  display: block;
  margin-top: 4px;
  color: var(--text-main);
  font-size: 25px;
  line-height: 1;
}

.kpi-ok::before {
  background: var(--success);
}

.kpi-warning::before {
  background: var(--warning);
}

.kpi-danger::before {
  background: var(--danger);
}

.button {
  display: inline-flex;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transition: background 0.15s ease, border 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

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

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

.button-primary:hover {
  background: var(--primary-hover);
}

.button-secondary {
  border-color: var(--border);
  background: #fff;
  color: #374151;
}

.button-secondary:hover,
.button-ghost:hover {
  background: var(--surface-muted);
}

.button-ghost {
  background: transparent;
  color: var(--text-muted);
}

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

.input,
.select {
  width: 100%;
  height: 34px;
  border: 1px solid #d1d5db;
  border-radius: 9px;
  background: #fff;
  color: var(--text-main);
  padding: 0 10px;
  font-size: 13px;
  line-height: 1.3;
  outline: none;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.13);
}

.textarea {
  min-height: 96px;
  padding: 10px;
  resize: vertical;
}

.input-search {
  min-width: 190px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}

.badge-soft {
  background: var(--primary-soft);
  color: var(--primary);
}

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

.badge-warning,
.badge-notice {
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.13);
  color: #b91c1c;
}

.badge-info {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.workqueue {
  display: grid;
  gap: 12px;
}

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

.workqueue-kpi {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.workqueue-kpi span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workqueue-kpi strong {
  display: block;
  margin-top: 3px;
  color: var(--text-main);
  font-size: 22px;
  line-height: 1;
}

.workqueue-kpi-warning {
  border-color: rgba(245, 158, 11, 0.35);
  background: #fffbeb;
}

.workqueue-kpi-notice {
  border-color: rgba(118, 75, 162, 0.25);
  background: var(--primary-soft);
}

.workqueue-kpi-danger {
  border-color: rgba(239, 68, 68, 0.35);
  background: #fef2f2;
}

.workqueue-kpi-success {
  border-color: rgba(16, 185, 129, 0.28);
  background: #ecfdf5;
}

.toolbar-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.audit-toolbar {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.audit-note {
  border: 1px solid rgba(118, 75, 162, 0.2);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(118, 75, 162, 0.1), rgba(255, 255, 255, 0.96));
  color: var(--text-main);
  padding: 12px 14px;
  font-size: 12px;
}

.audit-note strong {
  font-weight: 850;
}

.audit-note a {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.audit-note a:hover {
  text-decoration: underline;
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-filter {
  display: inline-flex;
  height: 30px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #374151;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.quick-filter.active,
.quick-filter:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.table-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.data-table-wrap {
  max-height: calc(100vh - 330px);
  min-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
}

.data-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  color: var(--text-main);
  font-size: 12.5px;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f9fafb;
  box-shadow: inset 0 -1px 0 var(--border), 0 1px 2px rgba(15, 23, 42, 0.04);
}

.data-table th {
  height: 38px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  padding: 0 10px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  height: 42px;
  border-top: 1px solid #f1f5f9;
  padding: 6px 10px;
  overflow: hidden;
}

.data-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.data-table tbody tr:hover {
  background: #faf5ff;
}

.data-table .row-pending {
  background: #fffbeb;
}

.data-table .row-critical {
  background: #fef2f2;
}

.data-table th:nth-child(1),
.data-table td:nth-child(1) {
  width: 86px;
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
  width: 86px;
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
  width: 13%;
}

.data-table th:nth-child(4),
.data-table td:nth-child(4) {
  width: 78px;
}

.data-table th:nth-child(5),
.data-table td:nth-child(5) {
  width: 88px;
}

.data-table th:nth-child(6),
.data-table td:nth-child(6) {
  width: 58px;
}

.data-table th:nth-child(7),
.data-table td:nth-child(7) {
  width: 84px;
}

.data-table th:nth-child(8),
.data-table td:nth-child(8) {
  width: 9%;
}

.data-table th:nth-child(9),
.data-table td:nth-child(9) {
  width: 10%;
}

.data-table th:nth-child(10),
.data-table td:nth-child(10) {
  width: auto;
}

.data-table th:nth-child(11),
.data-table td:nth-child(11) {
  width: 98px;
}

.data-table th:nth-child(12),
.data-table td:nth-child(12) {
  width: 90px;
}

.table-link {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.table-link:hover {
  text-decoration: underline;
}

.cell-subtle {
  color: var(--text-muted);
  font-size: 11px;
}

.truncate-cell {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-row {
  height: 90px;
  color: var(--text-muted);
  text-align: center;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.table-pagination div {
  display: flex;
  gap: 8px;
}

.page > .space-y-2 > .rounded.border,
.page > .space-y-2 > article.rounded,
.page > .space-y-2 > form.rounded,
.page > .space-y-2 > div.rounded {
  border-color: var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.page .space-y-2 input.h-6,
.page .space-y-2 select.h-6,
.page .space-y-2 input.h-5,
.page .space-y-2 select.h-5 {
  height: 34px;
  border-color: #d1d5db;
  border-radius: 9px;
  padding: 0 10px;
  font-size: 13px;
  line-height: 1.3;
}

.page .space-y-2 button.h-5,
.page .space-y-2 button.h-6,
.page .space-y-2 label.h-7,
.page .space-y-2 button.h-7 {
  display: inline-flex;
  min-width: max-content;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}

.page .space-y-2 table.min-w-full {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  line-height: 1.35;
}

.page .space-y-2 table.min-w-full th {
  height: 36px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  padding: 0 10px;
  text-align: left;
  white-space: nowrap;
}

.page .space-y-2 table.min-w-full td {
  height: 40px;
  border-top: 1px solid #f1f5f9;
  padding: 6px 10px;
  overflow: hidden;
  color: #374151;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page .space-y-2 table.min-w-full td:last-child {
  white-space: normal;
}

.page .space-y-2 .overflow-x-auto {
  overflow-x: hidden;
}

.page .space-y-2 h3 {
  font-size: 13px;
  line-height: 1.3;
}

.page .space-y-2 p {
  line-height: 1.4;
}

.audit-table th:nth-child(1),
.audit-table td:nth-child(1) {
  width: 88px;
}

.audit-table th:nth-child(2),
.audit-table td:nth-child(2) {
  width: 92px;
}

.audit-table th:nth-child(3),
.audit-table td:nth-child(3) {
  width: 62px;
}

.audit-table th:nth-child(4),
.audit-table td:nth-child(4) {
  width: 15%;
}

.audit-table th:nth-child(5),
.audit-table td:nth-child(5) {
  width: 92px;
}

.audit-table th:nth-child(6),
.audit-table td:nth-child(6) {
  width: 96px;
}

.audit-table th:nth-child(7),
.audit-table td:nth-child(7) {
  width: 10%;
}

.audit-table th:nth-child(8),
.audit-table td:nth-child(8) {
  width: 78px;
}

.audit-table th:nth-child(9),
.audit-table td:nth-child(9) {
  width: 88px;
}

.audit-table th:nth-child(10),
.audit-table td:nth-child(10) {
  width: 112px;
}

.audit-table th:nth-child(11),
.audit-table td:nth-child(11) {
  width: auto;
}

.audit-table th:nth-child(12),
.audit-table td:nth-child(12) {
  width: 124px;
}

.dashboard-charts {
  display: grid;
  gap: 12px;
}

.metrics-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chart-card {
  padding: 16px;
}

.chart-card h3 {
  margin: 0 0 10px;
  color: var(--text-main);
  font-size: 15px;
  font-weight: 850;
}

.chart-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.chart-card-header h3 {
  margin-bottom: 2px;
}

.chart-card-header p,
.chart-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.daily-chart {
  width: 100%;
}

.daily-chart-svg {
  display: block;
  width: 100%;
  height: 230px;
}

.chart-footer {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.chart-footer span {
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--text-muted);
  padding: 7px 10px;
  font-size: 12px;
}

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

.ranking-list,
.completude-list {
  display: grid;
  gap: 10px;
}

.ranking-row {
  display: grid;
  gap: 4px;
}

.ranking-label,
.completude-row > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-main);
  font-size: 12px;
}

.ranking-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-label strong,
.completude-row strong {
  color: var(--text-muted);
  font-size: 12px;
}

.ranking-bar,
.stacked-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.ranking-bar div,
.stacked-bar div {
  height: 100%;
  border-radius: inherit;
}

.ranking-row p,
.completude-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
}

.bar-warning {
  background: var(--warning);
}

.bar-primary {
  background: var(--primary);
}

.bar-success {
  background: var(--success);
}

.bar-muted {
  background: #9ca3af;
}

.bar-info {
  background: var(--info);
}

.completude-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.heatmap-cell {
  min-height: 40px;
  border-radius: 8px;
  padding: 6px;
  font-size: 11px;
}

.heatmap-cell strong {
  display: block;
  font-size: 11px;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  background:
    radial-gradient(circle at 20% 20%, rgba(240, 147, 251, 0.28), transparent 22rem),
    linear-gradient(135deg, #fbf7ff 0%, #f6f7fb 45%, #fff 100%);
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7vw;
}

.login-logo {
  display: inline-flex;
  width: 58px;
  height: 58px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.login-eyebrow {
  margin: 22px 0 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-brand h1 {
  margin: 8px 0 0;
  color: var(--text-main);
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.95;
}

.login-copy {
  max-width: 560px;
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 18px;
}

.login-bullets {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.login-bullets li {
  position: relative;
  color: #374151;
  font-size: 15px;
  font-weight: 700;
  padding-left: 24px;
}

.login-bullets li::before {
  position: absolute;
  top: 8px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--primary);
  content: "";
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.login-card {
  width: min(100%, 420px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  padding: 28px;
  box-shadow: 0 24px 70px rgba(75, 0, 115, 0.12);
}

.login-card h2 {
  margin: 4px 0 4px;
  color: var(--text-main);
  font-size: 24px;
}

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

.login-card label {
  display: block;
  margin: 18px 0 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.login-submit {
  width: 100%;
  margin-top: 18px;
}

.login-message {
  min-height: 18px;
  margin-top: 12px;
  color: #b91c1c;
  font-size: 12px;
}

/* Compatibility for existing utility-heavy islands/pages. */
.bg-\[var\(--primary\)\] {
  background-color: var(--primary);
}

.bg-\[var\(--primary-dark\)\] {
  background-color: var(--primary-hover);
}

.bg-\[var\(--bg-primary\)\] {
  background-color: var(--bg-app);
}

.border-\[var\(--border-color\)\] {
  border-color: var(--border);
}

.text-\[var\(--accent\)\],
.text-\[var\(--primary\)\] {
  color: var(--primary);
}

.h-5 {
  height: 1.25rem;
}

.h-6 {
  height: 1.5rem;
}

.h-7 {
  height: 1.75rem;
}

.h-8 {
  height: 2rem;
}

.leading-\[1\] {
  line-height: 1;
}

.leading-\[1\.1\],
.leading-tight {
  line-height: 1.25;
}

.tracking-\[0\.08em\] {
  letter-spacing: 0.08em;
}

.tracking-\[0\.12em\] {
  letter-spacing: 0.12em;
}

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

  .toolbar-form {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

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

@media (max-width: 760px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    display: none;
  }

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

  .page {
    padding: 12px;
  }

  .topbar {
    padding: 0 12px;
  }

  .topbar-title p,
  .topbar-user div {
    display: none;
  }

  .toolbar-form,
  .workqueue-kpis,
  .dashboard-grid-two,
  .chart-footer,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    padding: 34px 24px 0;
  }

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

/* Operational queue control tower */
.queue-tower {
  display: grid;
  gap: 12px;
}

.queue-hero {
  display: grid;
  gap: 10px;
  border: 1px solid #d6dce5;
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(145deg, #f8fbff 0%, #eef5ff 100%);
}

.queue-eyebrow {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0369a1;
  font-weight: 700;
}

.queue-hero h2 {
  margin: 2px 0;
  font-size: 18px;
  color: #0f172a;
}

.queue-hero p {
  margin: 0;
  font-size: 12px;
  color: #334155;
}

.queue-hero-kpis {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.queue-hero-kpis article {
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
}

.queue-hero-kpis span {
  display: block;
  color: #64748b;
  font-size: 10px;
  text-transform: uppercase;
}

.queue-hero-kpis strong {
  display: block;
  margin-top: 3px;
  color: #0f172a;
  font-size: 15px;
}

.queue-controls,
.queue-mode-switch,
.queue-group-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.queue-mode-switch button,
.queue-group-switch button {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #1e293b;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
}

.queue-mode-switch button.active,
.queue-group-switch button.active {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.queue-top-priority,
.queue-group,
.queue-bulk-bar {
  border: 1px solid #d6dce5;
  background: #fff;
  border-radius: 10px;
  padding: 10px;
}

.queue-top-priority h3,
.queue-group h3 {
  margin: 0;
  font-size: 13px;
  color: #0f172a;
}

.queue-priority-grid {
  margin-top: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.queue-priority-item {
  display: grid;
  gap: 2px;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  padding: 8px;
  text-decoration: none;
  background: #f8fafc;
}

.queue-priority-item strong {
  color: #0f172a;
  font-size: 12px;
}
.queue-priority-item span {
  color: #334155;
  font-size: 11px;
}
.queue-priority-item em {
  color: #0369a1;
  font-style: normal;
  font-size: 10px;
}

.queue-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.queue-bulk-bar p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #475569;
}
.queue-bulk-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.queue-bulk-actions button,
.queue-bulk-actions a {
  border: 1px solid #0f766e;
  background: #0f766e;
  color: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  text-decoration: none;
  font-weight: 600;
}
.queue-bulk-actions a {
  background: #fff;
  color: #0f766e;
}
.queue-bulk-actions button:disabled {
  opacity: 0.5;
}

.queue-group header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.queue-group header p {
  margin: 0;
  font-size: 11px;
  color: #64748b;
}

.queue-cards {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.queue-card {
  border: 1px solid #d7dee8;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.queue-card.tone-critico {
  border-color: #f59e0b;
  background: #fffbeb;
}
.queue-card.tone-atrasado {
  border-color: #ef4444;
  background: #fef2f2;
}
.queue-card.tone-pendente {
  border-color: #0ea5e9;
  background: #f0f9ff;
}
.queue-card.queue-card-critical {
  box-shadow: inset 0 0 0 1px #f97316, 0 10px 22px rgba(249, 115, 22, 0.18);
}

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

.queue-card-head label {
  display: flex;
  gap: 6px;
  align-items: center;
}

.queue-card-sub {
  margin: 5px 0;
  font-size: 11px;
  color: #334155;
}

.queue-badge {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  color: #0f172a;
}

.queue-status-row {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.queue-status-row .queue-badge,
.queue-card-head .queue-badge {
  border-radius: 999px;
  padding: 2px 7px;
  background: #f1f5f9;
}

.criticality-critico {
  background: #fee2e2 !important;
  color: #991b1b;
}
.criticality-alto {
  background: #ffedd5 !important;
  color: #9a3412;
}
.criticality-medio {
  background: #fef3c7 !important;
  color: #92400e;
}
.criticality-baixo {
  background: #dcfce7 !important;
  color: #166534;
}
.treatment-pendente_classificacao {
  background: #fef3c7 !important;
  color: #92400e;
}
.treatment-plano_pendente {
  background: #ede9fe !important;
  color: #5b21b6;
}
.treatment-em_tratamento {
  background: #dbeafe !important;
  color: #1d4ed8;
}
.treatment-concluido {
  background: #dcfce7 !important;
  color: #166534;
}
.treatment-reincidente {
  background: #fee2e2 !important;
  color: #991b1b;
}
.treatment-classificado {
  background: #e0f2fe !important;
  color: #075985;
}
.queue-badge.recurrence {
  background: #f8fafc;
  color: #475569;
}

.queue-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.queue-card-metrics span {
  display: block;
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
}

.queue-card-metrics strong {
  display: block;
  font-size: 12px;
  color: #0f172a;
}

.queue-timeline {
  margin-top: 8px;
  display: flex;
  gap: 4px;
}

.queue-timeline .dot {
  width: 100%;
  max-width: 18px;
  height: 8px;
  border-radius: 999px;
  background: #cbd5e1;
}

.queue-timeline .dot-pending {
  background: #f59e0b;
}
.queue-timeline .dot-sla {
  background: #ef4444;
}
.queue-timeline .dot-critical {
  background: #f97316;
}
.queue-timeline .dot-ok {
  background: #10b981;
}
.queue-timeline .dot-neutral {
  background: #cbd5e1;
}

.queue-card-footer {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.queue-card-footer a {
  font-size: 11px;
  color: #0c4a6e;
  text-decoration: none;
  font-weight: 600;
}

.queue-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  color: #475569;
  background: #f8fafc;
}

.queue-admin-diagnostics {
  display: flex;
  justify-content: flex-end;
}

.queue-admin-diagnostics a {
  font-size: 11px;
  color: #0c4a6e;
  text-decoration: none;
  font-weight: 700;
}

/* Site treatment UX */
.site-chart-wrap {
  height: 100%;
  display: grid;
  gap: 10px;
}

.site-chart-grid {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
  gap: 4px;
  align-items: end;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: linear-gradient(180deg, #faf8ff 0%, #ffffff 100%);
}

.site-chart-col {
  height: 100%;
  min-height: 130px;
  display: grid;
  gap: 4px;
  align-items: end;
  justify-items: center;
}

.site-chart-col span {
  font-size: 9px;
  color: #64748b;
}

.site-chart-bar {
  width: 100%;
  border-radius: 6px 6px 2px 2px;
  border: 1px solid #d8dce8;
  background: #cbd5e1;
}

.site-chart-bar-pending {
  background: #fb923c;
  border-color: #f97316;
}
.site-chart-bar-classified {
  background: #34d399;
  border-color: #10b981;
}
.site-chart-bar-neutral {
  background: #cbd5e1;
  border-color: #94a3b8;
}
.site-chart-bar-worst {
  box-shadow: 0 0 0 2px rgba(107, 33, 168, 0.28);
}

.site-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  color: #475569;
}

.site-chart-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 4px;
}

.site-chart-dot.pending {
  background: #f97316;
}
.site-chart-dot.classified {
  background: #10b981;
}
.site-chart-dot.neutral {
  background: #94a3b8;
}
.site-chart-worst {
  margin-left: auto;
  color: #5b21b6;
  font-weight: 700;
}

.site-treatment-board {
  box-shadow: 0 12px 24px rgba(30, 41, 59, 0.06);
}

.site-header-hero {
  border: 1px solid #d7c7ee;
  border-radius: 12px;
  background: linear-gradient(140deg, #f8f2ff 0%, #ffffff 100%);
  padding: 12px;
  box-shadow: 0 10px 20px rgba(91, 33, 182, 0.08);
}

.site-header-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.site-header-eyebrow {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b21a8;
  font-weight: 700;
}

.site-header-hero h3 {
  margin: 3px 0;
  color: #312e81;
  font-size: 18px;
}

.site-header-sub {
  margin: 0;
  font-size: 12px;
  color: #475569;
}

.site-header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.site-header-grid {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.site-header-grid p {
  margin: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.site-header-grid span {
  display: block;
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
}

.site-header-grid strong {
  display: block;
  margin-top: 3px;
  color: #0f172a;
  font-size: 12px;
}

.site-treatment-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.site-treatment-toolbar h3 {
  margin: 0;
  font-size: 14px;
  color: #312e81;
}

.site-treatment-toolbar p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #64748b;
}

.site-treatment-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.site-treatment-feedback {
  margin: 8px 0 0;
  font-size: 11px;
  color: #334155;
}

.site-hydration-status {
  margin-bottom: 8px;
  border: 1px solid #ddd6fe;
  border-radius: 8px;
  background: #f5f3ff;
  padding: 6px 8px;
  color: #5b21b6;
  font-size: 11px;
  font-weight: 700;
}

.site-date-cards {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}

.site-date-card {
  border: 1px solid #d8deeb;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.site-date-card.high-cdt {
  box-shadow: inset 0 0 0 1px #a855f7;
}
.site-date-card.is-selected {
  box-shadow: inset 0 0 0 2px #7e22ce, 0 0 0 2px rgba(126, 34, 206, 0.12);
}

.site-date-card.tone-pending {
  background: #fff7ed;
  border-color: #fdba74;
}
.site-date-card.tone-warn {
  background: #fef3c7;
  border-color: #f59e0b;
}
.site-date-card.tone-info {
  background: #eff6ff;
  border-color: #93c5fd;
}
.site-date-card.tone-ok {
  background: #ecfdf5;
  border-color: #6ee7b7;
}

.site-date-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.site-date-head label {
  display: flex;
  gap: 6px;
  align-items: center;
}

.site-date-sub {
  margin: 5px 0;
  font-size: 11px;
  color: #334155;
}

.site-chip {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.site-chip.pending {
  background: #ffedd5;
  color: #9a3412;
}
.site-chip.warn {
  background: #fef3c7;
  color: #92400e;
}
.site-chip.info {
  background: #dbeafe;
  color: #1d4ed8;
}
.site-chip.ok {
  background: #dcfce7;
  color: #166534;
}

.site-date-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: #475569;
}

.site-chart-server {
  height: 100%;
  display: grid;
  gap: 8px;
}

.site-chart-svg {
  width: 100%;
  height: 170px;
  display: block;
}

.site-native-bulk-form {
  margin-bottom: 12px;
  border: 1px solid #ddd6fe;
  border-radius: 10px;
  background: #f8f5ff;
  padding: 10px;
}

.site-native-form-grid {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.site-native-form-grid label {
  display: grid;
  gap: 4px;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

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

.site-overwrite-check {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.site-classify-details {
  margin-top: 8px;
}

.site-classify-details summary {
  width: max-content;
  cursor: pointer;
  list-style: none;
}

.site-classify-details summary::-webkit-details-marker {
  display: none;
}

.site-native-single-form {
  margin-top: 8px;
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
}

.site-native-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .queue-cards {
    grid-template-columns: 1fr;
  }
}
