:root {
  --bg: #070a0f;
  --bg-2: #0b1118;
  --surface: #101720;
  --surface-2: #141d28;
  --surface-3: #192332;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f7fafc;
  --muted: #a7b4c4;
  --muted-2: #7d8a9c;
  --accent: #2dd4bf;
  --accent-2: #38bdf8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #fb7185;
  --info: #38bdf8;
  --chart-grid: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 56px rgba(0, 0, 0, 0.28);
  --radius: 8px;
}

/* Qive reference override for secondary pages. The app no longer mixes a dark
   operations theme with the white/cinza Qive direction used on the dashboard. */
:root {
  --bg: #ffffff;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f7f8;
  --surface-3: #eaebee;
  --border: #e3e4e8;
  --border-strong: #d7d8dc;
  --text: #0b0d10;
  --muted: #59606d;
  --muted-2: #8c919b;
  --accent: #f04423;
  --accent-2: #d92905;
  --success: #f04423;
  --warning: #59606d;
  --danger: #d92905;
  --info: #59606d;
  --chart-grid: #e3e4e8;
  --shadow: none;
  --radius: 12px;
}

html,
body {
  background: #ffffff;
}

body {
  background: #ffffff;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  border-top: 6px solid var(--accent);
}

.app-shell {
  grid-template-columns: minmax(330px, 430px) minmax(0, 1fr);
}

.sidebar {
  margin: 44px 24px 24px 60px;
  height: calc(100vh - 74px);
  padding: 42px 36px;
  border: 1px solid #dedfe2;
  border-radius: 18px;
  background: #f7f7f8;
  backdrop-filter: none;
}

.brand {
  padding: 0;
  margin-bottom: 26px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border: 2px solid var(--accent);
  border-radius: 7px;
  background: #ffffff;
  color: var(--accent);
  box-shadow: none;
}

.brand strong {
  color: #050505;
  font-size: 1.45rem;
  font-weight: 800;
}

.brand span {
  color: var(--muted-2);
  font-size: 0.92rem;
}

.nav {
  gap: 8px;
}

.nav a,
.nav button {
  min-height: 58px;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  padding: 0 18px;
  font-size: 1.25rem;
  font-weight: 430;
}

.nav a:hover,
.nav a.active,
.nav button:hover {
  background: #eaebee;
  color: #182131;
  border-color: transparent;
}

.nav a.active {
  box-shadow: none;
  font-weight: 780;
}

.side-status,
.panel,
.metric,
.ops-card,
.table-card,
.quick,
.status-hero,
.form-card {
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: none;
}

.side-status {
  background: #ffffff;
}

.side-status p,
.topbar-title span,
.hero p,
.panel-sub,
.muted,
.metric-label,
.metric-hint {
  color: var(--muted-2);
}

.workspace {
  padding: 44px 54px 34px 24px;
}

.topbar {
  position: static;
  margin: 0 0 28px;
  border-bottom: 1px solid #e9e9ea;
  background: #ffffff;
  padding: 0 0 24px;
  backdrop-filter: none;
}

.topbar-title strong {
  color: #0b0d10;
  font-size: 2.15rem;
  font-weight: 460;
}

.hero {
  border-left: 0;
  padding: 0;
}

.eyebrow {
  color: var(--muted-2);
  font-size: 0.95rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: none;
}

h1 {
  color: #0b0d10;
  font-size: clamp(32px, 3vw, 44px);
  font-weight: 460;
}

h2,
.panel-head h2 {
  color: #0b0d10;
  font-size: 1.15rem;
  font-weight: 760;
}

.btn {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #ffffff;
  color: var(--muted);
  box-shadow: none;
}

.btn-primary,
.btn-danger,
.btn-success {
  border-color: transparent;
  background: var(--accent-2);
  color: #ffffff;
}

.btn:hover {
  border-color: var(--border-strong);
}

.btn-primary:hover,
.btn-danger:hover,
.btn-success:hover {
  background: #c92605;
}

.alert,
.command-feedback {
  border-color: #ffd9cf;
  background: #fff4f0;
  color: var(--accent-2);
}

.badge,
.badge.success,
.badge.warning,
.badge.danger,
.badge.info,
.badge.neutral,
.green,
.yellow,
.red,
.blue,
.gray {
  border: 0;
  border-radius: 5px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 650;
}

.metrics {
  gap: 14px;
}

.metric {
  min-height: 104px;
  border-radius: 12px;
}

.metric-value,
.load-summary strong,
.radial-label strong {
  color: #111827;
  font-weight: 760;
}

.table-card,
.panel,
.form-card {
  border-radius: 12px;
}

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

th {
  background: #ffffff;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 430;
  text-transform: none;
  letter-spacing: 0;
}

td {
  color: var(--muted);
  border-color: transparent;
}

tbody tr:nth-child(odd) {
  background: #f7f7f8;
}

.quick {
  border-radius: 10px;
  background: #ffffff;
}

.quick strong,
td strong {
  color: #1c2431;
}

input,
textarea,
select {
  background: #ffffff;
  border-color: var(--border);
  color: #1c2431;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #cfd1d6;
  box-shadow: 0 0 0 3px rgba(240, 68, 35, 0.08);
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: #ffffff;
}

.login-card {
  width: min(480px, calc(100vw - 32px));
  border: 1px solid #dedfe2;
  border-radius: 18px;
  background: #f7f7f8;
  color: var(--text);
  box-shadow: none;
  padding: 44px 42px;
}

.login-card h1 {
  font-size: 2.35rem;
  font-weight: 460;
}

.login-card p {
  color: var(--muted);
}

.login-card label {
  color: var(--muted);
  font-weight: 650;
}

img.brand-icon {
  display: block;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
}

/* Final compact pass for internal pages: match the dashboard proportions. */
.app-shell {
  grid-template-columns: minmax(250px, 292px) minmax(0, 1fr);
}

.sidebar {
  margin: 12px 14px 18px 30px;
  height: calc(100vh - 36px);
  padding: 22px 16px;
  border-radius: 18px;
}

.brand {
  gap: 10px;
  margin-bottom: 22px;
}

img.brand-icon,
.brand-icon {
  width: 28px;
  height: 28px;
}

.brand strong {
  font-size: 1.34rem;
}

.brand span {
  font-size: 0.82rem;
}

.nav {
  gap: 6px;
}

.nav a,
.nav button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 560;
}

.side-status {
  padding: 12px;
  border-radius: 10px;
}

.workspace {
  padding: 16px 38px 24px 26px;
}

.topbar {
  margin: 0 0 18px;
  padding: 0 0 14px;
}

.topbar-title strong {
  font-size: 1.35rem;
  font-weight: 650;
}

.topbar-title span,
.hero p,
.panel-sub,
.muted,
.metric-label,
.metric-hint {
  font-size: 0.82rem;
}

.eyebrow {
  font-size: 0.78rem;
}

h1 {
  font-size: 1.55rem;
  font-weight: 650;
}

h2,
.panel-head h2 {
  font-size: 1rem;
}

.metric {
  min-height: 78px;
  padding: 14px 16px;
}

.metric-value {
  font-size: 1.8rem;
}

th {
  font-size: 0.92rem;
}

td {
  font-size: 0.86rem;
}

.login-card {
  width: min(430px, calc(100vw - 32px));
  padding: 34px 38px;
}

.login-card h1 {
  font-size: 1.75rem;
  font-weight: 650;
}

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

  .sidebar {
    position: static;
    height: auto;
    margin: 16px;
    padding: 22px;
  }

  .workspace {
    padding: 16px;
  }
}

/* QA final override: duplicated legacy blocks above must not re-expand secondary screens. */
@media (min-width: 901px) {
  .app-shell {
    grid-template-columns: minmax(238px, 278px) minmax(0, 1fr) !important;
  }

  .sidebar {
    margin: 12px 12px 18px 28px !important;
    height: calc(100vh - 36px) !important;
    padding: 20px 14px !important;
    border-radius: 18px !important;
  }

  .brand {
    gap: 10px !important;
    margin-bottom: 20px !important;
  }

  img.brand-icon,
  .brand-icon {
    width: 26px !important;
    height: 26px !important;
  }

  .brand strong {
    font-size: 1.18rem !important;
    line-height: 1 !important;
  }

  .brand span {
    font-size: 0.76rem !important;
    line-height: 1.1 !important;
  }

  .nav {
    gap: 5px !important;
  }

  .nav a,
  .nav button {
    min-height: 36px !important;
    padding: 0 11px !important;
    border-radius: 9px !important;
    font-size: 0.9rem !important;
    font-weight: 560 !important;
  }

  .side-status {
    padding: 11px !important;
    border-radius: 10px !important;
  }

  .workspace {
    padding: 14px 34px 24px 24px !important;
  }

  .topbar {
    margin: 0 0 14px !important;
    padding: 0 0 12px !important;
  }

  .topbar-title {
    gap: 2px !important;
  }

  .topbar-title strong {
    font-size: 1.22rem !important;
    line-height: 1.05 !important;
    font-weight: 650 !important;
  }

  .topbar-title span,
  .hero p,
  .panel-sub,
  .muted,
  .metric-label,
  .metric-hint {
    font-size: 0.8rem !important;
    line-height: 1.25 !important;
  }

  .eyebrow {
    font-size: 0.76rem !important;
  }

  h1,
  .hero h1 {
    font-size: 1.7rem !important;
    line-height: 1.08 !important;
  }

  h2,
  .panel-head h2 {
    font-size: 1.08rem !important;
  }

  .metric {
    min-height: 86px !important;
    padding: 13px 14px !important;
  }

  .metric-value,
  .load-summary strong,
  .radial-label strong {
    font-size: 1.45rem !important;
  }

  th {
    padding: 10px 12px !important;
    font-size: 0.9rem !important;
  }

  td {
    padding: 10px 12px !important;
    font-size: 0.86rem !important;
  }

  .btn {
    min-height: 36px !important;
    padding-inline: 12px !important;
    font-size: 0.86rem !important;
  }

  .login-card {
    width: min(420px, calc(100vw - 32px)) !important;
    padding: 34px 32px !important;
  }

  .login-card h1 {
    font-size: 1.62rem !important;
  }
}

/* QA final override: duplicated legacy blocks above must not re-expand secondary screens. */
@media (min-width: 901px) {
  .app-shell {
    grid-template-columns: minmax(238px, 278px) minmax(0, 1fr) !important;
  }

  .sidebar {
    margin: 12px 12px 18px 28px !important;
    height: calc(100vh - 36px) !important;
    padding: 20px 14px !important;
    border-radius: 18px !important;
  }

  .brand {
    gap: 10px !important;
    margin-bottom: 20px !important;
  }

  img.brand-icon,
  .brand-icon {
    width: 26px !important;
    height: 26px !important;
  }

  .brand strong {
    font-size: 1.18rem !important;
    line-height: 1 !important;
  }

  .brand span {
    font-size: 0.76rem !important;
    line-height: 1.1 !important;
  }

  .nav {
    gap: 5px !important;
  }

  .nav a,
  .nav button {
    min-height: 36px !important;
    padding: 0 11px !important;
    border-radius: 9px !important;
    font-size: 0.9rem !important;
    font-weight: 560 !important;
  }

  .side-status {
    padding: 11px !important;
    border-radius: 10px !important;
  }

  .workspace {
    padding: 14px 34px 24px 24px !important;
  }

  .topbar {
    margin: 0 0 14px !important;
    padding: 0 0 12px !important;
  }

  .topbar-title {
    gap: 2px !important;
  }

  .topbar-title strong {
    font-size: 1.22rem !important;
    line-height: 1.05 !important;
    font-weight: 650 !important;
  }

  .topbar-title span,
  .hero p,
  .panel-sub,
  .muted,
  .metric-label,
  .metric-hint {
    font-size: 0.8rem !important;
    line-height: 1.25 !important;
  }

  .eyebrow {
    font-size: 0.76rem !important;
  }

  h1,
  .hero h1 {
    font-size: 1.7rem !important;
    line-height: 1.08 !important;
  }

  h2,
  .panel-head h2 {
    font-size: 1.08rem !important;
  }

  .metric {
    min-height: 86px !important;
    padding: 13px 14px !important;
  }

  .metric-value,
  .load-summary strong,
  .radial-label strong {
    font-size: 1.45rem !important;
  }

  th {
    padding: 10px 12px !important;
    font-size: 0.9rem !important;
  }

  td {
    padding: 10px 12px !important;
    font-size: 0.86rem !important;
  }

  .btn {
    min-height: 36px !important;
    padding-inline: 12px !important;
    font-size: 0.86rem !important;
  }

  .login-card {
    width: min(420px, calc(100vw - 32px)) !important;
    padding: 34px 32px !important;
  }

  .login-card h1 {
    font-size: 1.62rem !important;
  }
}

/* QA compact override: final layer for secondary pages. */
@media (min-width: 901px) {
  .app-shell {
    grid-template-columns: minmax(250px, 292px) minmax(0, 1fr) !important;
  }

  .sidebar {
    margin: 12px 14px 18px 30px !important;
    height: calc(100vh - 36px) !important;
    padding: 22px 16px !important;
    border-radius: 18px !important;
  }

  .brand {
    gap: 10px !important;
    margin-bottom: 22px !important;
  }

  img.brand-icon,
  .brand-icon {
    width: 28px !important;
    height: 28px !important;
  }

  .brand strong {
    font-size: 1.25rem !important;
  }

  .brand span {
    font-size: 0.8rem !important;
  }

  .nav {
    gap: 6px !important;
  }

  .nav a,
  .nav button {
    min-height: 38px !important;
    padding: 0 12px !important;
    border-radius: 10px !important;
    font-size: 0.95rem !important;
    font-weight: 560 !important;
  }

  .side-status {
    padding: 12px !important;
    border-radius: 10px !important;
  }

  .workspace {
    padding: 16px 38px 24px 26px !important;
  }

  .topbar {
    margin: 0 0 18px !important;
    padding: 0 0 14px !important;
  }

  .topbar-title strong {
    font-size: 1.35rem !important;
    font-weight: 650 !important;
  }

  .topbar-title span,
  .hero p,
  .panel-sub,
  .muted,
  .metric-label,
  .metric-hint {
    font-size: 0.82rem !important;
  }

  .eyebrow {
    font-size: 0.78rem !important;
  }

  h1 {
    font-size: 1.55rem !important;
    font-weight: 650 !important;
  }

  h2,
  .panel-head h2 {
    font-size: 1rem !important;
  }

  .metric {
    min-height: 78px !important;
    padding: 14px 16px !important;
  }

  .metric-value {
    font-size: 1.8rem !important;
  }

  th {
    font-size: 0.92rem !important;
  }

  td {
    font-size: 0.86rem !important;
  }
}

.login-card {
  width: min(430px, calc(100vw - 32px)) !important;
  padding: 34px 38px !important;
}

.login-card h1 {
  font-size: 1.75rem !important;
  font-weight: 650 !important;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid var(--border);
  background: rgba(10, 15, 22, 0.94);
  padding: 18px 14px;
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 14px;
}

.brand-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(45, 212, 191, 0.45);
  border-radius: var(--radius);
  background: rgba(45, 212, 191, 0.12);
  color: #99f6e4;
  font-size: 16px;
  font-weight: 950;
  box-shadow: none;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 14px;
  letter-spacing: 0;
}

.brand span {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 12px;
}

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

.nav a,
.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  transition: 160ms ease;
}

.nav a:hover,
.nav a.active,
.nav button:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
}

.nav a.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.side-status {
  margin-top: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  box-shadow: var(--shadow);
}

.side-status p {
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 13px;
  line-height: 1.45;
}

.workspace {
  min-width: 0;
  padding: 16px clamp(14px, 2.4vw, 26px) 30px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -16px calc(clamp(14px, 2.4vw, 26px) * -1) 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 10, 15, 0.82);
  padding: 11px clamp(14px, 2.4vw, 26px);
  backdrop-filter: blur(20px);
}

.topbar-title strong {
  display: block;
  font-size: 15px;
}

.topbar-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 12px;
}

.topbar-actions,
.actions,
.button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.page-stack {
  display: grid;
  gap: 12px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 14px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin-top: 5px;
  max-width: 840px;
  font-size: clamp(21px, 1.8vw, 28px);
  line-height: 1.14;
  letter-spacing: 0;
}

h2 {
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0;
}

.hero p,
.panel-sub,
.muted {
  color: var(--muted-2);
}

.hero p {
  max-width: 760px;
  margin-top: 13px;
  line-height: 1.55;
}

.btn {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  padding: 7px 10px;
  font-weight: 850;
  font-size: 0.82rem;
  text-decoration: none;
  transition: 160ms ease;
}

.btn:hover {
  border-color: var(--border-strong);
}

.btn-primary {
  border-color: rgba(45, 212, 191, 0.45);
  background: var(--accent);
  color: #031113;
  box-shadow: none;
}

.btn-danger {
  border-color: rgba(251, 113, 133, 0.42);
  background: rgba(251, 113, 133, 0.14);
  color: #fecdd3;
}

.btn-success {
  border-color: rgba(34, 197, 94, 0.42);
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
}

.alert {
  border: 1px solid rgba(45, 212, 191, 0.25);
  border-radius: var(--radius);
  background: rgba(45, 212, 191, 0.1);
  color: #ccfbf1;
  padding: 10px 12px;
  font-size: 0.84rem;
}

.command-feedback {
  margin-top: 10px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius);
  background: rgba(56, 189, 248, 0.12);
  color: #bae6fd;
  padding: 9px 11px;
  font-size: 0.84rem;
  font-weight: 850;
}

.panel,
.metric,
.ops-card,
.table-card,
.quick,
.status-hero,
.form-card {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.2);
}

.panel,
.table-card,
.form-card,
.status-hero {
  border-radius: var(--radius);
}

.panel,
.form-card {
  padding: 14px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.panel-sub {
  margin-top: 4px;
  font-size: 13px;
}

.status-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  padding: 14px;
}

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

.status-line h2 {
  font-size: 18px;
}

.status-copy {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.status-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.mini-kpi {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  padding: 9px;
}

.mini-kpi span {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
}

.mini-kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.load-summary {
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
}

.load-summary span,
.load-summary small {
  color: var(--muted-2);
  font-size: 12px;
}

.load-summary strong {
  font-size: 28px;
  line-height: 1;
}

.compact-actions {
  margin-top: 2px;
}

.radial {
  position: relative;
  display: grid;
  place-items: center;
}

.radial svg {
  width: 148px;
  height: 148px;
  rotate: -90deg;
}

.radial circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 11;
}

.radial circle:nth-child(2) {
  stroke: var(--accent);
  stroke-linecap: round;
}

.radial-label {
  position: absolute;
  text-align: center;
}

.radial-label strong {
  display: block;
  font-size: 28px;
}

.radial-label span {
  display: block;
  color: var(--muted-2);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid currentColor;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.badge.success,
.green {
  background: rgba(34, 197, 94, 0.13);
  color: #86efac;
}

.badge.warning,
.yellow {
  background: rgba(245, 158, 11, 0.13);
  color: #fcd34d;
}

.badge.danger,
.red {
  background: rgba(251, 113, 133, 0.13);
  color: #fda4af;
}

.badge.info,
.blue {
  background: rgba(56, 189, 248, 0.13);
  color: #7dd3fc;
}

.badge.neutral,
.gray {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

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

.metric {
  min-height: 98px;
  border-radius: var(--radius);
  padding: 12px;
}

.metric-label {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 7px;
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
}

.metric-hint {
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.35;
}

.metric.danger {
  border-color: rgba(251, 113, 133, 0.25);
}

.metric.warning {
  border-color: rgba(245, 158, 11, 0.24);
}

.grid-2,
.layout,
.split,
.users-grid,
.settings-grid {
  display: grid;
  gap: 14px;
}

.grid-2 {
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
}

.layout {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.dashboard-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
}

.split,
.users-grid,
.settings-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.chart-wrap {
  position: relative;
  height: 244px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(to top, rgba(34, 197, 94, 0.09) 0 50%, rgba(245, 158, 11, 0.1) 50% 80%, rgba(251, 113, 133, 0.1) 80% 100%),
    repeating-linear-gradient(to bottom, transparent 0, transparent 24%, var(--chart-grid) 25%, transparent 26%);
}

.compact-chart {
  height: 150px;
}

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

.chart-area {
  fill: rgba(56, 189, 248, 0.14);
}

.chart-line {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: var(--surface);
  stroke: var(--accent-2);
  stroke-width: 2;
}

.chart-dot.warn {
  stroke: var(--warning);
}

.chart-dot.danger {
  stroke: var(--danger);
}

.chart-axis {
  position: absolute;
  inset: 10px auto 10px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  pointer-events: none;
}

.periods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.period {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.period.active {
  border-color: rgba(45, 212, 191, 0.4);
  background: rgba(45, 212, 191, 0.14);
  color: #99f6e4;
}

.progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--success), var(--warning), var(--danger));
}

.legend {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  color: var(--muted-2);
  font-size: 12px;
}

.table-card {
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 15px 16px;
}

.table-wrap {
  overflow: auto;
}

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

.dashboard-layout table {
  min-width: 640px;
}

th {
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  padding: 9px 10px;
  text-align: left;
  text-transform: uppercase;
}

td {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  padding: 9px 10px;
  vertical-align: middle;
}

td strong {
  color: var(--text);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.phone-edit {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 6px;
  margin-top: 6px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  padding: 8px 10px;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.12);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

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

.hint {
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.4;
  text-transform: none;
}

.quick,
.row-card,
.rank-row,
.bar-row,
.audit-row,
.toggle-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.quick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  text-decoration: none;
}

a.quick {
  min-height: 52px;
  border-color: var(--border-strong);
  background: linear-gradient(180deg, rgba(25, 35, 50, 0.96), rgba(16, 23, 32, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 1px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

a.quick:hover {
  border-color: rgba(56, 189, 248, 0.75);
  box-shadow: 0 8px 22px rgba(56, 189, 248, 0.09);
  transform: translateY(-1px);
}

a.quick:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
}

.quick strong,
.row-card strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}

.quick span,
.row-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 12px;
}

.quick .badge {
  display: inline-flex;
  margin-top: 0;
}

.stack {
  display: grid;
  gap: 10px;
}

.rank-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
}

.rank-title {
  font-weight: 950;
}

.rank-sub {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 12px;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.bar,
.fill {
  height: 100%;
  border-radius: inherit;
  background: var(--info);
}

.bar.danger,
.fill.danger {
  background: var(--danger);
}

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

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

.bar-row {
  display: grid;
  grid-template-columns: 70px 1fr 38px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  font-size: 12px;
}

.audit-row {
  padding: 11px;
}

.audit-row strong {
  display: block;
  font-size: 13px;
}

.audit-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.toggle-label {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.toggle {
  position: relative;
  width: 50px;
  height: 28px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.slider::before {
  content: "";
  position: absolute;
  left: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--muted-2);
  transition: 160ms ease;
}

.toggle input:checked + .slider {
  background: rgba(34, 197, 94, 0.18);
}

.toggle input:checked + .slider::before {
  transform: translateX(21px);
  background: var(--success);
}

.empty {
  color: var(--muted-2);
  padding: 18px;
  text-align: center;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 32px;
}

.login-card h1 {
  font-size: 32px;
}

.login-card p {
  margin: 10px 0 24px;
  color: var(--muted);
  line-height: 1.45;
}

.mobile-nav {
  display: none;
}

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

  .grid-2,
  .layout,
  .split,
  .users-grid,
  .settings-grid,
  .status-hero {
    grid-template-columns: 1fr;
  }

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

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .side-status {
    display: none;
  }

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

  .hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .metrics,
  .form-grid,
  .status-kpis {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    min-width: 0;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  tr {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
  }

  td {
    border: 0;
    padding: 6px 0;
  }

  td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--muted-2);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }
}

/* Final Qive override. Must stay last. */
:root {
  --bg: #ffffff;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f7f8;
  --surface-3: #eaebee;
  --border: #e3e4e8;
  --border-strong: #d7d8dc;
  --text: #0b0d10;
  --muted: #59606d;
  --muted-2: #8c919b;
  --accent: #f04423;
  --accent-2: #d92905;
  --success: #f04423;
  --warning: #59606d;
  --danger: #d92905;
  --info: #59606d;
  --chart-grid: #e3e4e8;
  --shadow: none;
  --radius: 12px;
}

html,
body {
  background: #ffffff;
}

body {
  background: #ffffff;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  border-top: 6px solid var(--accent);
}

.app-shell {
  grid-template-columns: minmax(330px, 430px) minmax(0, 1fr);
}

.sidebar {
  margin: 44px 24px 24px 60px;
  height: calc(100vh - 74px);
  padding: 42px 36px;
  border: 1px solid #dedfe2;
  border-radius: 18px;
  background: #f7f7f8;
  backdrop-filter: none;
}

.brand {
  padding: 0;
  margin-bottom: 26px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border: 2px solid var(--accent);
  border-radius: 7px;
  background: #ffffff;
  color: var(--accent);
  box-shadow: none;
}

.brand strong {
  color: #050505;
  font-size: 1.45rem;
  font-weight: 800;
}

.brand span {
  color: var(--muted-2);
  font-size: 0.92rem;
}

.nav {
  gap: 8px;
}

.nav a,
.nav button {
  min-height: 58px;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  padding: 0 18px;
  font-size: 1.25rem;
  font-weight: 430;
}

.nav a:hover,
.nav a.active,
.nav button:hover {
  background: #eaebee;
  color: #182131;
  border-color: transparent;
}

.nav a.active {
  box-shadow: none;
  font-weight: 780;
}

.side-status,
.panel,
.metric,
.ops-card,
.table-card,
.quick,
.status-hero,
.form-card {
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: none;
}

.workspace {
  padding: 44px 54px 34px 24px;
}

.topbar {
  position: static;
  margin: 0 0 28px;
  border-bottom: 1px solid #e9e9ea;
  background: #ffffff;
  padding: 0 0 24px;
  backdrop-filter: none;
}

.topbar-title strong {
  color: #0b0d10;
  font-size: 2.15rem;
  font-weight: 460;
}

.topbar-title span,
.side-status p,
.hero p,
.panel-sub,
.muted,
.metric-label,
.metric-hint {
  color: var(--muted-2);
}

.hero {
  border-left: 0;
  padding: 0;
}

.eyebrow {
  color: var(--muted-2);
  font-size: 0.95rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: none;
}

h1 {
  color: #0b0d10;
  font-size: clamp(32px, 3vw, 44px);
  font-weight: 460;
}

h2,
.panel-head h2 {
  color: #0b0d10;
  font-size: 1.15rem;
  font-weight: 760;
}

.btn {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #ffffff;
  color: var(--muted);
  box-shadow: none;
}

.btn-primary,
.btn-danger,
.btn-success {
  border-color: transparent;
  background: var(--accent-2);
  color: #ffffff;
}

.btn-primary:hover,
.btn-danger:hover,
.btn-success:hover {
  background: #c92605;
}

.alert,
.command-feedback {
  border-color: #ffd9cf;
  background: #fff4f0;
  color: var(--accent-2);
}

.badge,
.badge.success,
.badge.warning,
.badge.danger,
.badge.info,
.badge.neutral,
.green,
.yellow,
.red,
.blue,
.gray {
  border: 0;
  border-radius: 5px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 650;
}

.metric {
  min-height: 104px;
  border-radius: 12px;
}

.metric-value,
.load-summary strong,
.radial-label strong {
  color: #111827;
  font-weight: 760;
}

.table-card,
.panel,
.form-card {
  border-radius: 12px;
}

th {
  background: #ffffff;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 430;
  text-transform: none;
  letter-spacing: 0;
}

td {
  color: var(--muted);
  border-color: transparent;
}

tbody tr:nth-child(odd) {
  background: #f7f7f8;
}

.quick {
  border-radius: 10px;
  background: #ffffff;
}

.quick strong,
td strong {
  color: #1c2431;
}

input,
textarea,
select {
  background: #ffffff;
  border-color: var(--border);
  color: #1c2431;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #cfd1d6;
  box-shadow: 0 0 0 3px rgba(240, 68, 35, 0.08);
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: #ffffff;
}

.login-card {
  width: min(480px, calc(100vw - 32px));
  border: 1px solid #dedfe2;
  border-radius: 18px;
  background: #f7f7f8;
  color: var(--text);
  box-shadow: none;
  padding: 44px 42px;
}

.login-card h1 {
  font-size: 2.35rem;
  font-weight: 460;
}

.login-card p {
  color: var(--muted);
}

.login-card label {
  color: var(--muted);
  font-weight: 650;
}

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

  .sidebar {
    position: static;
    height: auto;
    margin: 16px;
    padding: 22px;
  }

  .workspace {
    padding: 16px;
  }
}
