:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #eef1f5;
  --surface-strong: #e4e9ef;
  --border: #d8dee7;
  --border-strong: #bbc5d1;
  --text: #171b22;
  --muted: #5f6876;
  --quiet: #8993a1;
  --blue: #155eef;
  --blue-soft: #e7efff;
  --green: #167044;
  --green-soft: #dcfce7;
  --amber: #9a5b00;
  --amber-soft: #fff2cc;
  --red: #b42318;
  --red-soft: #fee4e2;
  --teal: #0e6f6a;
  --teal-soft: #d9fbf7;
  --purple: #6941c6;
  --purple-soft: #eee8ff;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --radius: 8px;
  --line: #dce2eb;
  --ink: #172033;
  --brand: #153c6b;
  --brand-2: #0b6bcb;
  --brand-3: #eaf4ff;
  --ok: #127c55;
  --ok-bg: #eaf8f1;
  --warn: #aa6b00;
  --warn-bg: #fff4db;
  --danger: #b42318;
  --danger-bg: #ffebe8;
  --violet: #5c3fb2;
  --violet-bg: #f0ecff;
  --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.07);
  --radius-sm: 12px;
  --sidebar: 292px;
  --sidebar-collapsed: 88px;
  --topbar: 72px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

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

button {
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(21, 60, 107, 0.08) 0 26%, transparent 26%),
    linear-gradient(45deg, rgba(18, 124, 85, 0.1) 0 18%, transparent 18%),
    #eef3f8;
}

.command-login {
  position: relative;
  overflow: hidden;
}

.command-login::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.48;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 39, 69, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 39, 69, 0.08) 1px, transparent 1px);
  background-size: 38px 38px;
}

.login-panel {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  background: var(--surface);
  border: 1px solid rgba(15, 39, 69, 0.12);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(15, 39, 69, 0.18);
}

.command-login-panel {
  isolation: isolate;
}

.login-copy {
  position: relative;
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 34px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 18%, transparent 18%),
    linear-gradient(155deg, #0f2745 0%, #153c6b 58%, #0c6f69 100%);
  color: #fff;
}

.login-copy::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transform: rotate(18deg);
}

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

.login-logo-plate {
  width: 100px;
  height: 86px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(4, 12, 24, 0.22);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.command-brand {
  display: grid;
  align-items: start;
  gap: 2px;
  color: #fff;
}

.command-brand small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-logo {
  width: 74px;
  height: 54px;
  object-fit: contain;
  flex: 0 0 auto;
}

.login-logo-plate .brand-logo {
  width: 88px;
  height: 70px;
}

.command-copy {
  position: relative;
  z-index: 1;
  max-width: 610px;
}

.command-kicker,
.secure-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.command-kicker {
  background: rgba(25, 195, 125, 0.18);
  color: #bff7d8;
}

.login-copy h1 {
  max-width: 600px;
  margin: 20px 0 16px;
  color: #fff;
  font-size: 46px;
  line-height: 1.03;
  letter-spacing: 0;
}

.login-copy p {
  max-width: 520px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 16px;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 36px;
}

.login-stat {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 14px;
}

.login-stat strong {
  display: block;
  font-size: 22px;
}

.command-board {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.command-metric {
  min-height: 132px;
  display: grid;
  align-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
}

.command-metric span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.command-metric strong {
  color: #fff;
  font-size: 32px;
  line-height: 1;
}

.command-metric small {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
}

.metric-blue {
  box-shadow: inset 0 3px 0 #72b7ff;
}

.metric-green {
  box-shadow: inset 0 3px 0 #36d48c;
}

.metric-amber {
  box-shadow: inset 0 3px 0 #ffcc66;
}

.workflow-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.workflow-strip span {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.login-form {
  padding: 48px;
  border-left: 1px solid rgba(15, 39, 69, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.command-login-form {
  min-width: 0;
}

.login-form-head {
  display: grid;
  gap: 8px;
  margin-bottom: 2px;
}

.login-form-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.08;
}

.secure-pill {
  border: 1px solid #bfe9d4;
  background: #eaf8f1;
  color: #127c55;
}

.login-field .input {
  min-height: 46px;
  border-radius: 8px;
  border-color: #cfd9e6;
  background: #fff;
}

.field {
  display: grid;
  gap: 6px;
}

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

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

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

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.13);
}

.login-users {
  display: grid;
  gap: 8px;
}

.role-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

.login-user {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #d7e0eb;
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  text-align: left;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

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

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

.role-avatar {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #edf5ff;
  color: var(--brand);
  font-weight: 900;
}

.login-user:hover,
.login-user.active {
  transform: translateY(-1px);
  border-color: #0b6bcb;
  background: #f1f7ff;
  box-shadow: 0 12px 28px rgba(11, 107, 203, 0.1);
}

.login-user.active .role-avatar {
  background: var(--brand);
  color: #fff;
}

/* Reference HTML visual pass for the DM Workspace login. */
.html-login-shell {
  place-items: stretch;
  padding: 0;
  background: var(--bg);
}

.html-login-shell::before {
  opacity: 0;
}

.html-login-layout {
  width: 100%;
  min-height: 100vh;
  grid-template-columns: 1.1fr 0.9fr;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 255, 0.98)),
    #f7f9fc;
  box-shadow: none;
}

.html-login-hero {
  padding: 56px;
  background:
    linear-gradient(135deg, rgba(21, 60, 107, 0.96), rgba(11, 107, 203, 0.86)),
    #153c6b;
}

.html-login-hero::after {
  right: -122px;
  bottom: -168px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 56px;
  background: rgba(255, 255, 255, 0.06);
  transform: rotate(18deg);
}

.html-login-hero .login-logo-plate {
  width: 92px;
  height: 74px;
  box-shadow: 0 18px 42px rgba(4, 12, 24, 0.22);
}

.html-login-hero .brand-logo {
  width: 80px;
  height: 62px;
}

.html-login-hero .command-brand > span {
  font-size: 21px;
  font-weight: 900;
}

.html-login-hero .command-brand small {
  max-width: 270px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.25;
}

.html-login-hero .command-copy {
  max-width: 720px;
}

.html-login-hero h1 {
  max-width: 720px;
  margin: 20px 0;
  font-size: 54px;
  line-height: 1.02;
}

.html-login-hero p {
  max-width: 650px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 18px;
  line-height: 1.58;
}

.html-login-hero .command-board {
  max-width: 760px;
  gap: 14px;
  margin-top: 6px;
}

.html-login-hero .command-metric {
  min-height: 118px;
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.html-login-hero .command-metric strong {
  font-size: 28px;
}

.html-login-card {
  width: min(460px, calc(100% - 84px));
  align-self: center;
  justify-self: center;
  border: 1px solid rgba(220, 226, 235, 0.82);
  border-radius: 28px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 70px rgba(15, 39, 69, 0.16);
}

.html-login-card .login-form-head h2 {
  font-size: 28px;
}

.html-login-card .login-user {
  border-radius: 16px;
  padding: 14px;
}

.html-login-card .login-user.active {
  background: var(--brand-3);
  box-shadow: 0 0 0 4px rgba(11, 107, 203, 0.09);
}

.html-login-card .login-field .input,
.html-login-card .btn.full {
  border-radius: 14px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
}

.topbar .brand-mark {
  min-width: 210px;
}

.topbar .brand-logo {
  width: 58px;
  height: 42px;
}

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

.view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 3px;
}

.view-tab {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 5px 10px;
  font-weight: 800;
}

.view-tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.role-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 340px;
  min-height: 0;
}

.sidebar,
.right-rail {
  background: var(--surface);
  border-right: 1px solid var(--border);
  min-height: calc(100vh - 58px);
  overflow: auto;
}

.right-rail {
  border-right: 0;
  border-left: 1px solid var(--border);
}

.rail-section,
.sidebar-section {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

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

.section-title h2,
.section-title h3 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.summary-card {
  min-height: 72px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.summary-card strong {
  display: block;
  font-size: 24px;
  line-height: 1;
  margin-bottom: 6px;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

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

.case-item {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}

.case-item:hover,
.case-item.active {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.case-item-head,
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.case-code {
  color: var(--quiet);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.case-name {
  font-weight: 800;
}

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

.case-layout {
  min-width: 0;
  min-height: calc(100vh - 58px);
  overflow: auto;
  padding: 18px;
}

.main-view {
  min-height: calc(100vh - 58px);
  overflow: auto;
  padding: 18px;
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.view-header h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.hero-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 18px;
}

.hero-panel h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

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

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

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

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

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

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

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.panel h3 {
  margin: 0 0 12px;
  font-size: 14px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0;
}

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

.panel-head h3 {
  margin: 0;
}

.fact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.fact-grid.tight {
  gap: 8px;
}

.fact {
  min-width: 0;
}

.fact span {
  display: block;
  color: var(--quiet);
  font-size: 12px;
  margin-bottom: 2px;
}

.fact strong {
  display: block;
  overflow-wrap: anywhere;
}

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

.record-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.record-row.soft {
  background: var(--surface-soft);
}

.record-row p {
  margin: 5px 0 0;
  color: var(--muted);
}

.document-stack,
.request-block {
  display: grid;
  gap: 12px;
}

.document-upload-form {
  display: grid;
  grid-template-columns: minmax(140px, 190px) minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.request-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

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

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  padding: 8px 12px;
}

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

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

.btn.success {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.btn.secondary {
  background: var(--surface-soft);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn.danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.btn.ghost {
  background: transparent;
}

.btn.full {
  width: 100%;
}

.btn.compact {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
}

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

.operator-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 12px;
  align-items: start;
}

.operator-column {
  min-height: 240px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

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

.operator-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.operator-card h3 {
  margin: 8px 0 4px;
  font-size: 15px;
  letter-spacing: 0;
}

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

.bi-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.bi-card:first-child {
  grid-row: span 2;
}

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

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

.metric-row small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.compact-row {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.bar {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.modern-shell {
  grid-template-columns: 292px minmax(0, 1fr);
  grid-template-rows: 1fr;
}

.sidebar-shell {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px;
  background: #102943;
  color: #fff;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 62px;
  height: 46px;
  object-fit: contain;
  flex: 0 0 auto;
}

.sidebar-brand strong,
.workspace-pill strong {
  display: block;
  font-size: 14px;
}

.sidebar-brand span,
.workspace-pill span,
.sidebar-note span {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.workspace-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: #102943;
  font-weight: 900;
}

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

.nav-label {
  margin: 10px 8px 4px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-btn {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  padding: 10px 12px;
  text-align: left;
  font-weight: 800;
}

.nav-btn:hover,
.nav-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav-count {
  min-width: 24px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 11px;
}

.sidebar-note {
  margin-top: auto;
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

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

.modern-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 64px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

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

.searchbox {
  width: min(430px, 36vw);
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}

.searchbox span {
  padding-left: 14px;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 800;
}

.searchbox .input {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid rgba(22, 112, 68, 0.16);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.content-view {
  min-width: 0;
  padding: 22px 24px 42px;
  overflow: auto;
}

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

.page-head h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.page-head p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
}

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

.modern-summary {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  margin-bottom: 16px;
}

.modern-summary .summary-card {
  text-align: left;
  background: #fff;
}

.modern-summary .summary-card small {
  display: block;
  margin-top: 7px;
  color: var(--quiet);
  font-size: 11px;
}

.operation-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr) minmax(
      300px,
      390px
    );
  gap: 14px;
  align-items: start;
}

.operation-pane-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.operation-pane-tab {
  display: grid;
  gap: 3px;
  min-height: 58px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 12px 14px;
  text-align: left;
}

.operation-pane-tab:hover {
  border-color: #bdd2ff;
  background: #f8fbff;
}

.operation-pane-tab.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 0 -3px 0 var(--blue);
}

.operation-pane-tab strong {
  color: var(--ink);
  font-size: 14px;
}

.operation-pane-tab span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-panel {
  overflow: hidden;
}

.operation-panel-grid {
  display: grid;
  gap: 14px;
  align-items: start;
}

.operation-case-list {
  max-height: none;
}

.operation-context-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.operation-grid.two-column {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}

.case-list-panel {
  overflow: hidden;
}

.case-card {
  width: 100%;
  display: grid;
  gap: 9px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #fff;
  padding: 14px 15px;
  text-align: left;
}

.case-card:hover {
  background: #f8fbff;
}

.case-card.active {
  background: var(--blue-soft);
  box-shadow: inset 4px 0 0 var(--blue);
}

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

.case-top strong,
.case-top small {
  display: block;
}

.case-top small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.case-meta-grid,
.case-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.case-card-meta span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.case-card-meta b {
  color: var(--quiet);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.case-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-stage-chip {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid #cfe7ff;
  border-radius: 999px;
  background: #eaf4ff;
  color: #153c6b;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.case-stage-chip.neutral {
  border-color: var(--border);
  background: #f8fafc;
  color: #475569;
}

.case-workspace {
  overflow: hidden;
}

.detail-header {
  padding: 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #fff, var(--blue-soft));
}

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

.detail-header h2 {
  margin: 2px 0 5px;
  font-size: 23px;
  letter-spacing: 0;
}

.detail-header p {
  margin: 0;
  color: var(--muted);
}

.route-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.route-step {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 850;
}

.route-step.done {
  border-color: #bdebd1;
  background: var(--green-soft);
  color: var(--green);
}

.route-step.active {
  border-color: #bdd2ff;
  background: #fff;
  color: var(--blue);
}

.case-tabs {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 10px 12px 0;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.tab {
  border: 0;
  background: transparent;
  padding: 9px 7px 11px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.tab.active {
  border-bottom-color: var(--blue);
  color: var(--blue);
}

.workspace-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.info-section {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.info-section h4 {
  margin: 0;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.kv {
  display: grid;
  grid-template-columns: 42% 58%;
  border-bottom: 1px solid #edf1f6;
}

.kv:last-child {
  border-bottom: 0;
}

.kv span,
.kv strong {
  min-width: 0;
  padding: 9px 11px;
  overflow-wrap: anywhere;
}

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

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

.nested-panel {
  box-shadow: none;
}

.profile-tab-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.profile-tab-panel > .document-stack,
.profile-tab-panel > .table-list {
  padding: 16px;
}

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

.action-dock-panel {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border);
  background: #fbfcff;
}

.action-dock-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.action-dock-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.action-dock-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.action-card {
  min-height: 86px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 13px;
  text-align: left;
}

.action-card:hover {
  border-color: #bdd2ff;
  background: #f8fbff;
}

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

.action-card strong {
  font-size: 13px;
}

.action-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.action-card em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--brand);
  padding: 4px 8px;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.action-card.success em {
  background: var(--green-soft);
  color: var(--green);
}

.action-card.danger em {
  background: var(--red-soft);
  color: var(--red);
}

.action-card.pending {
  cursor: not-allowed;
  opacity: 0.72;
}

.action-card.pending em {
  background: #f8fafc;
  color: var(--muted);
}

.chat-panel {
  overflow: hidden;
}

.chat-shell {
  display: grid;
  grid-template-rows: auto auto auto minmax(220px, 1fr) auto;
  min-height: 640px;
  max-height: calc(100vh - 150px);
  background: #fff;
}

.chat-phase-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 13px;
  border-bottom: 1px solid var(--border);
  background: #fbfcff;
}

.phase-chip {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
}

.phase-chip.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.wa-note {
  margin: 12px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}

.chat-context-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 14px 0;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(135deg, #fff, #f6fbff);
}

.chat-context-card strong,
.chat-context-card span {
  display: block;
}

.chat-context-card strong {
  color: var(--ink);
  font-size: 13px;
}

.chat-context-card span {
  color: var(--muted);
  font-size: 12px;
}

.chat-route-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: right;
}

.chat-body {
  overflow: auto;
  padding: 16px;
  background: linear-gradient(#f8fafc, #fff);
}

.composer {
  display: grid;
  gap: 9px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.template-select {
  width: min(360px, 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
}

.template-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(21, 94, 239, 0.1);
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

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

.panel-scroll {
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.doc-viewer {
  min-height: 360px;
  display: grid;
  place-items: center;
  gap: 6px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

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

.event {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.event:last-child {
  border-bottom: 0;
}

.event time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.event p {
  margin: 4px 0 0;
  color: var(--muted);
}

.conversation-list,
.message-list {
  display: grid;
  align-content: start;
  align-items: start;
  gap: 10px;
}

.conversation-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 16px;
}

.conversation-item.active,
.conversation-item:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.conversation-avatar {
  display: none;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.conversation-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}

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

.conversation-preview {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-status {
  display: flex;
  justify-content: flex-end;
}

.message {
  width: fit-content;
  max-width: min(72%, 560px);
  align-self: start;
  justify-self: start;
  border: 1px solid transparent;
  border-radius: 18px 18px 18px 6px;
  padding: 7px 10px 6px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.message strong {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.message.outgoing {
  justify-self: end;
  margin-left: 0;
  border-radius: 18px 18px 6px 18px;
  background: linear-gradient(135deg, #d8fdd2, #baf3c4);
  border-color: #9fe4ad;
}

.message.incoming {
  margin-right: auto;
  background: linear-gradient(135deg, #ffffff, #e8f2ff);
  border-color: #c9def8;
}

.message.internal {
  max-width: min(84%, 640px);
  justify-self: center;
  margin-inline: auto;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff7d6, #ffe8a3);
  border-color: #ffd772;
}

.message-body {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.message small {
  display: block;
  margin-top: 4px;
  color: var(--quiet);
  font-size: 10px;
  text-align: right;
}

.empty-chat-state {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

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

.empty-state {
  display: grid;
  place-items: center;
  min-height: 420px;
  color: var(--muted);
  text-align: center;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: grid;
  gap: 8px;
}

.toast {
  width: min(380px, calc(100vw - 36px));
  background: #111827;
  color: #fff;
  border-radius: 8px;
  padding: 11px 13px;
  box-shadow: var(--shadow);
}

.toast.error {
  background: var(--red);
}

.toast.success {
  background: var(--green);
}

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

.modal {
  width: min(940px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.modal-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #fff, var(--brand-3));
}

.modal-body {
  padding: 20px 22px;
}

.modal h2 {
  margin: 0;
  font-size: 22px;
}

.modal p {
  margin: 6px 0 0;
  color: var(--muted);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  background: #fbfcff;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.check-card {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.check-list {
  display: grid;
  gap: 9px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.check-item input {
  margin-top: 3px;
}

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

.check-item strong {
  font-size: 13px;
}

.check-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.action-observation {
  margin-top: 14px;
}

.template-preview {
  min-height: 280px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f8fafc;
  color: #263244;
  padding: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

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

@media (max-width: 1180px) {
  .modern-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .sidebar-shell {
    padding: 18px 14px;
  }

  .searchbox {
    display: none;
  }

  .operation-grid,
  .operation-grid.two-column,
  .operation-panel-grid,
  .modern-detail,
  .modal-grid,
  .action-dock,
  .info-grid {
    grid-template-columns: 1fr;
  }

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

  .chat-shell {
    max-height: none;
  }

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

  .operator-board {
    grid-template-columns: repeat(2, minmax(230px, 1fr));
  }

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

  .bi-card:first-child {
    grid-row: auto;
  }

  .right-rail {
    grid-column: 1 / -1;
    min-height: auto;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 820px) {
  .login-shell {
    align-items: start;
    padding: 14px;
  }

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

  .sidebar-shell {
    position: relative;
    height: auto;
  }

  .modern-topbar,
  .page-head,
  .top-left,
  .topbar-actions {
    flex-wrap: wrap;
  }

  .content-view {
    padding: 16px;
  }

  .modern-summary {
    grid-template-columns: 1fr;
  }

  .login-panel,
  .workspace,
  .detail-grid,
  .hero-grid,
  .document-upload-form {
    grid-template-columns: 1fr;
  }

  .login-panel {
    min-height: auto;
  }

  .html-login-layout {
    min-height: 100vh;
    padding: 0;
    background: #f7f9fc;
  }

  .html-login-hero {
    display: flex;
    padding: 28px;
  }

  .html-login-card {
    width: min(460px, calc(100% - 44px));
    margin: 22px 0;
  }

  .login-copy,
  .login-form {
    padding: 22px;
  }

  .login-copy {
    gap: 18px;
  }

  .login-logo-plate {
    width: 76px;
    height: 66px;
  }

  .login-logo-plate .brand-logo {
    width: 66px;
    height: 54px;
  }

  .login-copy h1 {
    margin-top: 14px;
    font-size: 30px;
  }

  .login-copy p {
    font-size: 14px;
  }

  .command-board,
  .workflow-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .command-metric {
    min-height: 92px;
    padding: 12px;
  }

  .command-metric strong {
    font-size: 24px;
  }

  .command-metric small {
    display: none;
  }

  .workflow-strip span {
    min-height: 34px;
    padding: 6px;
    font-size: 10px;
  }

  .login-form {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 12px;
  }

  .topbar .brand-mark {
    min-width: auto;
  }

  .sidebar,
  .case-layout,
  .right-rail {
    min-height: auto;
  }

  .operator-board,
  .fact-grid,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .view-tabs,
  .topbar-actions {
    width: 100%;
  }

  .view-tab,
  .topbar-actions .btn {
    flex: 1;
  }

  .message {
    max-width: 84%;
  }

  .message.internal {
    max-width: 94%;
  }
}

/* GPT Web Pro visual system, adapted to the connected app. */
body {
  background:
    radial-gradient(circle at top left, #eaf4ff 0, transparent 30%), var(--bg);
  color: var(--ink);
}

.modern-shell {
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  grid-template-rows: 1fr;
  transition: grid-template-columns 0.2s ease;
}

.modern-shell.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
}

.sidebar {
  background: #0f2745;
  color: #fff;
}

.sidebar.sidebar-shell {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 18px;
  background: #0f2745;
  color: #fff;
  border-right: 0;
  transition:
    padding 0.2s ease,
    width 0.2s ease;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-plate {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(3, 13, 25, 0.24);
}

.sidebar-logo {
  width: 56px;
  height: 48px;
  object-fit: contain;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.05;
}

.brand-title small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 600;
}

.sidebar-collapse-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.sidebar-collapse-btn:hover,
.sidebar-collapse-btn:focus-visible {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.modern-shell.sidebar-collapsed .sidebar.sidebar-shell {
  gap: 18px;
  padding-inline: 12px;
  overflow-x: hidden;
}

.modern-shell.sidebar-collapsed .sidebar-brand {
  position: relative;
  justify-content: center;
  gap: 0;
}

.modern-shell.sidebar-collapsed .logo-plate {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.modern-shell.sidebar-collapsed .sidebar-logo {
  width: 50px;
  height: 42px;
}

.modern-shell.sidebar-collapsed .brand-title,
.modern-shell.sidebar-collapsed .workspace-pill > div,
.modern-shell.sidebar-collapsed .nav-label,
.modern-shell.sidebar-collapsed .sidebar-note {
  display: none;
}

.modern-shell.sidebar-collapsed .sidebar-collapse-btn {
  position: absolute;
  top: 50%;
  right: -8px;
  width: 26px;
  height: 26px;
  margin-left: 0;
  border-color: rgba(15, 39, 69, 0.12);
  border-radius: 999px;
  background: #fff;
  color: #0f2745;
  font-size: 18px;
  box-shadow: 0 10px 20px rgba(3, 13, 25, 0.24);
  transform: translate(50%, -50%);
}

.modern-shell.sidebar-collapsed .sidebar-collapse-btn:hover,
.modern-shell.sidebar-collapsed .sidebar-collapse-btn:focus-visible {
  background: #eaf4ff;
  border-color: rgba(21, 94, 239, 0.24);
}

.modern-shell.sidebar-collapsed .workspace-pill {
  justify-content: center;
  padding: 8px 0;
  border-color: transparent;
  background: transparent;
}

.modern-shell.sidebar-collapsed .side-nav {
  align-items: center;
  gap: 8px;
}

.modern-shell.sidebar-collapsed .nav-btn {
  width: 52px;
  min-height: 48px;
  justify-content: center;
  gap: 0;
  padding: 11px 0;
}

.modern-shell.sidebar-collapsed .nav-btn > span:not(.nav-icon) {
  display: none;
}

.modern-shell.sidebar-collapsed .nav-icon {
  width: 22px;
  flex-basis: 22px;
}

.workspace-pill {
  border-radius: 16px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
}

.workspace-pill .avatar,
.avatar {
  width: 34px;
  height: 34px;
  background: #fff;
  color: #0f2745;
}

.nav-group,
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-label {
  margin: 6px 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-btn {
  justify-content: flex-start;
  min-height: 44px;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.78);
  padding: 11px 12px;
  font-weight: 750;
}

.nav-btn:hover,
.nav-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav-icon {
  width: 22px;
  flex: 0 0 22px;
  text-align: center;
}

.nav-count {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.12);
  font-size: 11px;
  padding: 3px 7px;
}

.sidebar-footer,
.sidebar-note {
  margin-top: auto;
  border-radius: 18px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  line-height: 1.4;
}

.main-shell {
  grid-template-rows: var(--topbar) 1fr;
}

.topbar.modern-topbar {
  height: var(--topbar);
  min-height: var(--topbar);
  justify-content: space-between;
  gap: 14px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  z-index: 50;
}

.top-left,
.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mobile-menu {
  display: none;
}

.searchbox {
  position: relative;
  display: block;
  width: 38vw;
  min-width: 340px;
  max-width: 540px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.searchbox input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 11px 14px 11px 40px;
  outline: none;
}

.searchbox span {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0;
  color: var(--muted);
}

.sync-pill {
  border-color: rgba(18, 124, 85, 0.14);
  background: var(--ok-bg);
  color: var(--ok);
  font-weight: 850;
}

.content-view,
.main-view {
  padding: 22px 24px 42px;
}

.page-head,
.view-header {
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-head h1,
.view-header h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.page-head p,
.view-header p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 4px;
}

.segment {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}

.segment.active {
  background: var(--brand);
  color: #fff;
}

.modern-summary {
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-card {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.summary-card::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--tint, var(--brand-3));
  opacity: 0.9;
}

.summary-card strong {
  position: relative;
  z-index: 1;
  font-size: 27px;
  letter-spacing: 0;
}

.summary-card span {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.summary-card small {
  position: relative;
  z-index: 1;
}

.summary-card.active {
  border-color: var(--brand-2);
  background: #f4f9ff;
  box-shadow:
    0 0 0 4px rgba(11, 107, 203, 0.1),
    var(--shadow-soft);
}

.summary-card.active span {
  color: var(--brand);
}

.chat-filter-tabs {
  flex: 0 0 auto;
}

.operation-grid {
  grid-template-columns:
    minmax(310px, 390px) minmax(480px, 1fr)
    minmax(330px, 420px);
  gap: 16px;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 0;
}

.panel-head {
  margin: 0;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fbfcff);
}

.panel-title,
.panel-head h3,
.panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
}

.panel-subtitle,
.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.case-list {
  display: flex;
  flex-direction: column;
  max-height: 830px;
  overflow: auto;
  gap: 0;
}

.case-card {
  border-bottom: 1px solid var(--line);
  padding: 18px 16px;
}

.case-card:hover {
  background: #fbfdff;
}

.case-card.active {
  background: var(--brand-3);
  box-shadow: inset 4px 0 0 var(--brand-2);
}

.case-card .badge {
  justify-self: end;
  white-space: normal;
}

.case-card-meta {
  column-gap: 16px;
  row-gap: 10px;
  font-size: 13px;
}

.case-card-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.case-card-tags {
  margin-top: 2px;
}

.operation-pane-tabs {
  gap: 12px;
}

.operation-pane-tab {
  border-color: var(--line);
  border-radius: 14px;
}

.operation-pane-tab.active {
  border-color: #cfe7ff;
  background: #f4f9ff;
  box-shadow: inset 0 -3px 0 var(--brand-2);
}

.detail-header {
  border-bottom-color: var(--line);
  background: linear-gradient(135deg, #fff, var(--brand-3));
}

.info-section {
  border-color: var(--line);
  border-radius: 16px;
}

.profile-tab-panel {
  border-color: var(--line);
  border-radius: 16px;
}

.nested-panel > .table-list,
.nested-panel > .document-stack {
  padding: 16px 18px;
}

.action-dock {
  position: sticky;
  bottom: 0;
  z-index: 20;
  border-top-color: var(--line);
  background: #fbfcff;
}

.chat-shell {
  grid-template-rows: auto auto auto 1fr auto;
  min-height: 760px;
  max-height: calc(100vh - 138px);
}

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

.wa-note,
.doc-viewer,
.record-row,
.conversation-item,
.check-card {
  border-color: var(--line);
  border-radius: 14px;
}

.chat-context-card {
  border-color: var(--line);
}

.chat-composer {
  border-top-color: var(--line);
}

.message {
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.message.outgoing {
  background: linear-gradient(135deg, #d8fdd2, #baf3c4);
  border-color: #9fe4ad;
}

.message.incoming {
  background: linear-gradient(135deg, #ffffff, #e8f2ff);
  border-color: #c9def8;
}

.message.internal {
  background: linear-gradient(135deg, #fff7d6, #ffe8a3);
  border-color: #ffd772;
}

.btn {
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  transition: 0.18s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: transparent;
  background: var(--brand);
  box-shadow: 0 10px 22px rgba(21, 60, 107, 0.18);
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
}

.btn.success {
  background: var(--ok);
  border-color: var(--ok);
}

.btn.secondary,
.btn.ghost {
  background: #fff;
  color: var(--brand);
  border-color: var(--line);
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
}

.btn.compact {
  border-radius: 10px;
}

.badge {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 900;
}

.badge.blue {
  background: #eef2ff;
  color: #3345a8;
  border-color: #dbe2ff;
}

.badge.amber {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: #ffe3a3;
}

.badge.green {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: #c9efdc;
}

.badge.red {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #ffd2cc;
}

.badge.purple {
  background: var(--violet-bg);
  color: var(--violet);
  border-color: #ded5ff;
}

.badge.teal,
.badge.neutral {
  background: #edf2f7;
  color: #475569;
  border-color: #d9e1ea;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

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

.kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  letter-spacing: 0;
}

.kpi small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

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

.chart {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.chart h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.chart p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 150px 1fr 44px;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
  font-size: 13px;
}

.bar-label {
  color: #334155;
  font-weight: 750;
}

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

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.bar-value {
  color: var(--muted);
  text-align: right;
  font-weight: 900;
}

/* Premium operations layer: visual-only hooks for analyst, operator and admin. */
.premium-shell {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(21, 60, 107, 0.08) 0 24%, transparent 24%),
    linear-gradient(45deg, rgba(18, 124, 85, 0.08) 0 16%, transparent 16%),
    #f3f6fa;
}

.premium-shell .sidebar.sidebar-shell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 34%),
    #0b223d;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}

.premium-shell .main-shell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(243, 246, 250, 0.96)),
    #f3f6fa;
}

.premium-shell .topbar.modern-topbar {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 32px rgba(15, 39, 69, 0.06);
}

.premium-shell .searchbox input {
  border-color: #d9e3ef;
  box-shadow: 0 10px 24px rgba(15, 39, 69, 0.04);
}

.premium-shell .content-view,
.premium-shell .main-view {
  position: relative;
}

.premium-panel .page-head,
.premium-panel .view-header {
  min-height: 108px;
  align-items: center;
  margin-bottom: 20px;
  border: 1px solid rgba(15, 39, 69, 0.1);
  border-radius: 8px;
  padding: 20px 22px;
  background:
    linear-gradient(135deg, #ffffff 0%, #f7fbff 54%, #edf8f3 100%);
  box-shadow: 0 18px 44px rgba(15, 39, 69, 0.08);
}

.premium-panel .page-head h1,
.premium-panel .view-header h1 {
  color: #10243f;
  font-size: 30px;
}

.premium-panel .page-head p,
.premium-panel .view-header p {
  max-width: 820px;
  color: #5b6676;
}

.premium-panel .actions-row {
  justify-content: flex-end;
}

.premium-analyst-panel .modern-summary {
  gap: 14px;
}

.premium-analyst-panel .summary-card {
  min-height: 104px;
  border-color: rgba(15, 39, 69, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 252, 255, 0.98)),
    var(--surface);
  box-shadow: 0 16px 34px rgba(15, 39, 69, 0.08);
}

.premium-analyst-panel .summary-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand-2), #20b486);
}

.premium-analyst-panel .summary-card.active {
  border-color: var(--brand-2);
  background: #ffffff;
  box-shadow:
    0 0 0 4px rgba(11, 107, 203, 0.12),
    0 16px 34px rgba(15, 39, 69, 0.08);
  transform: none;
}

.html-summary-selection .summary-card.active {
  border-color: var(--brand-2);
  background: var(--surface);
  box-shadow:
    0 0 0 4px rgba(11, 107, 203, 0.1),
    var(--shadow-soft);
}

.premium-analyst-panel .summary-card.active::before {
  width: 4px;
  background: linear-gradient(180deg, var(--brand-2), #20b486);
}

.premium-analyst-panel .summary-card.active strong,
.premium-analyst-panel .summary-card.active span,
.premium-analyst-panel .summary-card.active small {
  color: inherit;
}

.premium-analyst-panel .summary-card.active span {
  color: var(--brand);
}

.premium-analyst-panel .operation-pane-tab {
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: 0 12px 28px rgba(15, 39, 69, 0.06);
}

.premium-analyst-panel .operation-pane-tab.active {
  border-color: rgba(11, 107, 203, 0.32);
  background: linear-gradient(135deg, #f3f8ff, #ecfbf4);
  box-shadow:
    inset 0 -3px 0 #0b6bcb,
    0 16px 32px rgba(11, 107, 203, 0.12);
}

.premium-analyst-panel .panel,
.premium-analyst-panel .case-workspace,
.premium-operator-panel .operator-column,
.premium-admin-panel .chart {
  border-color: rgba(15, 39, 69, 0.1);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(15, 39, 69, 0.08);
}

.premium-analyst-panel .case-card {
  position: relative;
  border-bottom-color: #e4ebf4;
  background: #fff;
}

.premium-analyst-panel .case-card:hover,
.premium-analyst-panel .case-card.active {
  background: linear-gradient(90deg, #f3f8ff, #ffffff);
}

.premium-analyst-panel .case-card.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #0b6bcb, #18a66a);
}

.premium-analyst-panel .detail-header {
  background:
    linear-gradient(135deg, rgba(11, 107, 203, 0.1), rgba(18, 124, 85, 0.08)),
    #fff;
}

.premium-analyst-panel .info-section,
.premium-analyst-panel .profile-tab-panel,
.premium-analyst-panel .action-dock-panel {
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 39, 69, 0.05);
}

.premium-analyst-panel .action-card {
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fff, #fbfdff);
}

.premium-analyst-panel .action-card:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(15, 39, 69, 0.1);
}

.premium-operator-panel .view-header {
  background:
    linear-gradient(135deg, #10243f 0%, #153c6b 58%, #0c6f69 100%);
  color: #fff;
}

.premium-operator-panel .view-header h1,
.premium-operator-panel .view-header .case-code {
  color: #fff;
}

.premium-operator-panel .view-header .badge {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.24);
}

.premium-operator-panel .operator-board {
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 14px;
}

.operator-column {
  position: relative;
  overflow: hidden;
}

.operator-column::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #72b7ff, #36d48c, #ffcc66);
}

.premium-operator-panel .operator-column {
  padding: 14px;
  background:
    linear-gradient(180deg, #ffffff, #fbfdff);
}

.premium-operator-panel .operator-column .section-title {
  margin-bottom: 12px;
  padding-top: 4px;
}

.premium-operator-panel .operator-card {
  border-color: #dfe7f1;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: 0 10px 24px rgba(15, 39, 69, 0.06);
}

.premium-operator-panel .operator-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(15, 39, 69, 0.1);
}

.premium-operator-panel .operator-card .inline-actions {
  border-top: 1px solid #edf1f6;
  padding-top: 10px;
}

.premium-admin-panel .page-head {
  background:
    linear-gradient(135deg, #0f2745 0%, #153c6b 54%, #0c6f69 100%);
  color: #fff;
}

.premium-admin-panel .page-head h1,
.premium-admin-panel .page-head p {
  color: #fff;
}

.premium-admin-panel .page-head p {
  opacity: 0.78;
}

.premium-admin-panel .kpi-grid {
  gap: 16px;
}

.premium-admin-panel .kpi {
  position: relative;
  overflow: hidden;
  border-color: rgba(15, 39, 69, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: 0 18px 42px rgba(15, 39, 69, 0.08);
}

.kpi::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 4px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, #0b6bcb, #18a66a, #ffcc66);
}

.premium-admin-panel .chart {
  background:
    linear-gradient(180deg, #ffffff, #fbfdff);
}

.premium-admin-panel .chart h3 {
  color: #10243f;
}

.premium-admin-panel .bar-fill {
  background: linear-gradient(90deg, #153c6b, #0b6bcb, #18a66a);
}

@media (max-width: 1280px) {
  .modern-summary {
    grid-template-columns: repeat(3, 1fr);
  }

  .operation-grid {
    grid-template-columns: 360px 1fr;
  }

  .operation-grid .chat-panel {
    grid-column: 1 / -1;
  }

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

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

@media (max-width: 920px) {
  .modern-shell.sidebar-collapsed,
  .modern-shell {
    grid-template-columns: 1fr;
  }

  .sidebar.sidebar-shell {
    position: fixed;
    z-index: 120;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar);
    transform: translateX(-105%);
    transition: 0.2s ease;
  }

  .modern-shell.sidebar-collapsed .sidebar.sidebar-shell {
    width: var(--sidebar);
    padding: 24px 18px;
    overflow-y: auto;
  }

  .modern-shell.sidebar-collapsed .sidebar-brand {
    justify-content: flex-start;
    gap: 14px;
  }

  .modern-shell.sidebar-collapsed .logo-plate {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }

  .modern-shell.sidebar-collapsed .sidebar-logo {
    width: 56px;
    height: 48px;
  }

  .modern-shell.sidebar-collapsed .brand-title,
  .modern-shell.sidebar-collapsed .workspace-pill > div,
  .modern-shell.sidebar-collapsed .nav-label {
    display: block;
  }

  .modern-shell.sidebar-collapsed .sidebar-note {
    display: grid;
  }

  .modern-shell.sidebar-collapsed .sidebar-collapse-btn {
    position: static;
    width: 34px;
    height: 34px;
    margin-left: auto;
    border-color: rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 22px;
    box-shadow: none;
    transform: none;
  }

  .modern-shell.sidebar-collapsed .workspace-pill {
    justify-content: flex-start;
    padding: 12px;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
  }

  .modern-shell.sidebar-collapsed .side-nav {
    align-items: stretch;
    gap: 6px;
  }

  .modern-shell.sidebar-collapsed .nav-btn {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
    padding: 11px 12px;
  }

  .modern-shell.sidebar-collapsed .nav-btn > span:not(.nav-icon) {
    display: inline;
  }

  .modern-shell.sidebar-collapsed .nav-count {
    display: inline-grid;
  }

  .sidebar.sidebar-shell.open {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-flex;
  }

  .searchbox {
    display: none;
  }

  .topbar.modern-topbar {
    height: auto;
    min-height: var(--topbar);
    padding: 12px 16px;
  }

  .content-view,
  .main-view {
    padding: 16px;
  }

  .operation-grid,
  .operation-grid.two-column,
  .info-grid,
  .modern-detail {
    grid-template-columns: 1fr;
  }

  .modern-summary {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .bar-row {
    grid-template-columns: 120px 1fr 40px;
  }
}

/* NEXO-inspired dark operations layer. Visual only: contracts and actions stay intact. */
:root {
  --nexo-bg: #07090f;
  --nexo-bg-1: #0d1117;
  --nexo-bg-2: #111827;
  --nexo-bg-3: #1a2235;
  --nexo-line: rgba(255, 255, 255, 0.07);
  --nexo-line-strong: rgba(255, 255, 255, 0.15);
  --nexo-text: #eef2f7;
  --nexo-muted: #8b949e;
  --nexo-faint: #3d4450;
  --nexo-teal: #00d4aa;
  --nexo-teal-soft: rgba(0, 212, 170, 0.1);
  --nexo-amber: #f59e0b;
  --nexo-red: #f43f5e;
  --nexo-green: #22c55e;
  --nexo-blue: #3b82f6;
  --nexo-purple: #a78bfa;
  --nexo-slate: #64748b;
}

.nexo-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(6, 10, 17, 0.96), rgba(6, 14, 24, 0.9) 54%, rgba(5, 12, 22, 0.98)),
    linear-gradient(132deg, transparent 0 37%, rgba(0, 186, 216, 0.13) 37.1% 37.4%, transparent 37.5%),
    linear-gradient(var(--nexo-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--nexo-line) 1px, transparent 1px),
    #060a11;
  background-size:
    auto,
    auto,
    40px 40px,
    40px 40px,
    auto;
}

.nexo-login::before,
.nexo-login::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.nexo-login::before {
  background:
    linear-gradient(108deg, transparent 0 14%, rgba(0, 212, 255, 0.16) 14.2% 14.32%, transparent 14.5%),
    linear-gradient(136deg, transparent 0 69%, rgba(85, 180, 255, 0.13) 69.1% 69.24%, transparent 69.4%),
    linear-gradient(180deg, rgba(10, 18, 30, 0), rgba(10, 18, 30, 0.42));
  opacity: 0.88;
}

.nexo-login::after {
  background:
    linear-gradient(90deg, rgba(0, 217, 255, 0.09), transparent 22% 76%, rgba(57, 137, 255, 0.12)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 44%, rgba(0, 0, 0, 0.34));
}

.nexo-login .html-login-layout {
  position: relative;
  z-index: 1;
  width: min(500px, calc(100vw - 36px));
  min-height: auto;
  display: block;
  border: 1px solid rgba(148, 184, 214, 0.45);
  border-radius: 20px;
  background:
    linear-gradient(155deg, rgba(16, 32, 48, 0.88), rgba(6, 10, 18, 0.94) 55%, rgba(5, 8, 14, 0.98)),
    var(--nexo-bg-1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 42px 110px rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(18px);
}

.nexo-login .html-login-hero {
  display: none;
}

.nexo-login .html-login-card {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 20px;
  padding: 26px 34px 24px;
  background:
    linear-gradient(90deg, rgba(0, 212, 170, 0.04), transparent 32%),
    transparent;
  box-shadow: none;
}

.nexo-login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.nexo-logo-plate {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(225, 241, 255, 0.84);
  border-radius: 11px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(8, 15, 26, 0.7)),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 20px rgba(255, 255, 255, 0.08),
    0 18px 34px rgba(0, 0, 0, 0.34);
}

.nexo-logo-plate .brand-logo {
  width: 43px;
  height: 34px;
  object-fit: contain;
}

.nexo-login-logo strong {
  display: block;
  color: var(--nexo-text);
  font-size: 25px;
  line-height: 1.05;
  letter-spacing: 0;
}

.nexo-login-logo span,
.nexo-login .case-meta,
.nexo-login .field span,
.nexo-login-system-note {
  color: var(--nexo-muted);
}

.nexo-login-logo span {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.nexo-login .secure-pill {
  gap: 8px;
  min-height: 30px;
  margin: 2px 0 6px;
  border-color: rgba(0, 212, 170, 0.35);
  background: rgba(0, 212, 170, 0.08);
  color: var(--nexo-teal);
  font-size: 12px;
  letter-spacing: 0;
}

.secure-icon {
  position: relative;
  width: 14px;
  height: 16px;
  display: inline-block;
  border: 2px solid currentColor;
  border-radius: 9px 9px 7px 7px;
  transform: translateY(1px);
}

.secure-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 5px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(40deg);
}

.nexo-login .login-form-head h2 {
  color: var(--nexo-text);
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: 0;
}

.nexo-login .case-meta {
  margin: 0 0 12px;
  color: #aeb7c5;
  font-size: 14px;
}

.nexo-login .login-user,
.nexo-login .login-field .input {
  border-color: rgba(125, 154, 190, 0.34);
  background:
    linear-gradient(90deg, rgba(49, 92, 132, 0.16), rgba(15, 24, 39, 0.4)),
    rgba(12, 18, 30, 0.74);
  color: var(--nexo-text);
}

.nexo-login .login-users {
  gap: 8px;
  margin-bottom: 12px;
}

.nexo-login .login-user {
  position: relative;
  min-height: 58px;
  padding: 8px 16px 8px 10px;
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nexo-login .login-user strong {
  color: #f5f7fb;
  font-size: 15px;
  line-height: 1.1;
}

.nexo-login .login-user small {
  margin-top: 4px;
  color: #99a4b3;
  font-size: 12px;
  line-height: 1.1;
}

.nexo-login .login-user:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 212, 170, 0.58);
  background:
    linear-gradient(90deg, rgba(0, 212, 170, 0.12), rgba(31, 61, 92, 0.22)),
    rgba(12, 18, 30, 0.78);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
}

.nexo-login .login-user.active {
  border-color: var(--nexo-teal);
  background:
    linear-gradient(90deg, rgba(0, 212, 170, 0.2), rgba(23, 63, 84, 0.26)),
    rgba(12, 24, 35, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(0, 212, 170, 0.16),
    0 18px 44px rgba(0, 212, 170, 0.1);
}

.nexo-login .role-avatar {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background:
    linear-gradient(145deg, rgba(48, 67, 103, 0.72), rgba(17, 31, 58, 0.88));
  color: #4f86ff;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nexo-login .login-user[data-role="admin"] .role-avatar {
  color: #6f99ff;
}

.nexo-login .login-user.active .role-avatar {
  background:
    linear-gradient(145deg, #19f0da, #00c8b6);
  color: #021017;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 16px 28px rgba(0, 212, 170, 0.2);
}

.nexo-login .login-user-status {
  position: relative;
  width: 18px;
  height: 18px;
  margin-left: auto;
  flex: 0 0 auto;
}

.nexo-login .login-user-status::before {
  content: "";
  position: absolute;
  inset: 5px 6px 5px 4px;
  border-top: 2px solid #8d98a8;
  border-right: 2px solid #8d98a8;
  transform: rotate(45deg);
}

.nexo-login .login-user.active .login-user-status {
  border: 2px solid var(--nexo-teal);
  border-radius: 999px;
}

.nexo-login .login-user.active .login-user-status::before {
  inset: 3px 5px 5px 5px;
  border-top: 0;
  border-left: 0;
  border-color: var(--nexo-teal);
  border-width: 2px;
  transform: rotate(40deg);
}

.nexo-login .login-field {
  position: relative;
  gap: 5px;
}

.nexo-login .login-field span {
  font-size: 12px;
  letter-spacing: 0.6px;
}

.nexo-login .login-field .input {
  min-height: 40px;
  padding-left: 44px;
  padding-right: 38px;
  border-radius: 8px;
  font-size: 15px;
}

.nexo-login .login-field::before {
  content: "";
  position: absolute;
  left: 15px;
  bottom: 12px;
  z-index: 1;
  width: 14px;
  height: 14px;
  border: 2px solid #a0abba;
  pointer-events: none;
}

.nexo-login .login-field-email::before {
  border-radius: 999px;
  box-shadow: 0 10px 0 -5px #a0abba;
}

.nexo-login .login-field-password::before {
  bottom: 13px;
  width: 13px;
  height: 10px;
  border-radius: 3px;
}

.nexo-login .login-field-password::after {
  content: "";
  position: absolute;
  right: 15px;
  bottom: 15px;
  z-index: 1;
  width: 14px;
  height: 9px;
  border: 2px solid #a0abba;
  border-radius: 50%;
  pointer-events: none;
}

.nexo-login .login-field-password span::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: 23px;
  z-index: 1;
  width: 7px;
  height: 6px;
  border: 2px solid #a0abba;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  pointer-events: none;
}

.nexo-login .login-field-password .input {
  letter-spacing: 0.18em;
}

.nexo-login .login-field .input:focus {
  border-color: rgba(0, 212, 170, 0.78);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.nexo-login .btn.primary {
  min-height: 42px;
  margin-top: 3px;
  border-color: #00cfb9;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #16efe0, #00cdb8);
  color: #031118;
  font-size: 15px;
  font-weight: 900;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 18px 34px rgba(0, 212, 170, 0.18);
}

.nexo-login .btn.primary {
  color: #031118;
}

.nexo-login .btn.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 22px 42px rgba(0, 212, 170, 0.24);
}

.nexo-shell {
  background: var(--nexo-bg);
  color: var(--nexo-text);
}

.nexo-shell .main-shell {
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--nexo-bg);
}

.nexo-shell .sidebar.sidebar-shell {
  border-right: 1px solid var(--nexo-line);
  background: var(--nexo-bg-1);
  box-shadow: none;
}

.nexo-shell .logo-plate {
  width: 54px;
  height: 54px;
  border-color: transparent;
  border-radius: 8px;
  box-shadow: none;
}

.nexo-shell .sidebar-logo {
  width: 48px;
  height: 40px;
}

.nexo-shell .brand-title {
  color: var(--nexo-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 16px;
}

.nexo-shell .brand-title small,
.nexo-shell .workspace-pill span,
.nexo-shell .nav-label,
.nexo-shell .sidebar-note span {
  color: var(--nexo-muted);
}

.nexo-shell .workspace-pill,
.nexo-shell .sidebar-note {
  border-color: var(--nexo-line);
  background: rgba(255, 255, 255, 0.03);
}

.nexo-shell .workspace-pill strong,
.nexo-shell .sidebar-note strong {
  color: var(--nexo-text);
}

.nexo-shell .workspace-pill .avatar,
.nexo-shell .nav-count {
  border-color: rgba(0, 212, 170, 0.36);
  background: var(--nexo-teal-soft);
  color: var(--nexo-teal);
}

.nexo-shell .nav-btn {
  border-radius: 6px;
  color: var(--nexo-muted);
}

.nexo-shell .nav-btn:hover {
  background: var(--nexo-bg-2);
  color: var(--nexo-text);
}

.nexo-shell .nav-btn.active {
  background: var(--nexo-teal-soft);
  color: var(--nexo-teal);
}

.nexo-shell .sidebar-collapse-btn,
.nexo-shell .mobile-menu,
.nexo-shell .topbar-actions .btn {
  border-color: var(--nexo-line);
  background: var(--nexo-bg-2);
  color: var(--nexo-muted);
  box-shadow: none;
}

.nexo-shell .topbar.modern-topbar {
  min-height: 52px;
  height: 52px;
  border-bottom: 1px solid var(--nexo-line);
  background: var(--nexo-bg-1);
  box-shadow: none;
}

.nexo-shell .searchbox {
  border: 1px solid var(--nexo-line);
  border-radius: 6px;
  background: var(--nexo-bg-2);
}

.nexo-shell .searchbox input {
  border: 0;
  background: transparent;
  color: var(--nexo-text);
  box-shadow: none;
}

.nexo-shell .sync-pill,
.nexo-shell .role-pill,
.nexo-shell .badge {
  border: 1px solid var(--nexo-line);
  background: var(--nexo-bg-2);
  color: var(--nexo-muted);
}

.nexo-shell .sync-pill .dot {
  background: var(--nexo-teal);
}

.nexo-shell .content-view,
.nexo-shell .main-view {
  padding: 22px;
  background: var(--nexo-bg);
}

.nexo-shell .page-head,
.nexo-shell .view-header {
  min-height: auto;
  border-color: transparent;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.nexo-shell .page-head h1,
.nexo-shell .view-header h1 {
  color: var(--nexo-text);
  font-size: 18px;
}

.nexo-shell .page-head p,
.nexo-shell .view-header p {
  color: var(--nexo-muted);
  font-size: 12px;
}

.nexo-shell .segmented {
  border-color: var(--nexo-line);
  border-radius: 6px;
  background: var(--nexo-bg-2);
}

.nexo-shell .segment {
  border-radius: 4px;
  color: var(--nexo-muted);
}

.nexo-shell .segment.active {
  background: var(--nexo-bg-3);
  color: var(--nexo-text);
}

.nexo-shell .modern-summary {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
}

.nexo-stat-card {
  --stat: var(--nexo-teal);
  --stat-dim: var(--nexo-teal-soft);
  min-height: 132px;
  align-content: start;
  border: 1px solid var(--nexo-line);
  border-radius: 10px;
  padding: 16px 14px;
  background: var(--nexo-bg-1);
  box-shadow: none;
}

.nexo-stat-card::before {
  width: 3px;
  background: var(--stat);
}

.nexo-stat-card::after {
  display: none;
}

.nexo-stat-card:hover {
  border-color: var(--nexo-line-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.nexo-stat-card.active {
  border-color: var(--stat);
  background: var(--stat-dim);
  box-shadow: 0 0 0 1px var(--stat);
}

.nexo-stat-card.blue {
  --stat: var(--nexo-blue);
  --stat-dim: rgba(59, 130, 246, 0.12);
}

.nexo-stat-card.amber {
  --stat: var(--nexo-amber);
  --stat-dim: rgba(245, 158, 11, 0.12);
}

.nexo-stat-card.purple {
  --stat: var(--nexo-purple);
  --stat-dim: rgba(167, 139, 250, 0.12);
}

.nexo-stat-card.teal {
  --stat: var(--nexo-slate);
  --stat-dim: rgba(100, 116, 139, 0.12);
}

.nexo-stat-card.red {
  --stat: var(--nexo-red);
  --stat-dim: rgba(244, 63, 94, 0.12);
}

.nexo-stat-card.green {
  --stat: var(--nexo-green);
  --stat-dim: rgba(34, 197, 94, 0.12);
}

.nexo-stat-card .stat-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 7px;
  background: var(--stat-dim);
  color: var(--stat);
  font-size: 10px;
  font-weight: 900;
}

.nexo-stat-card .stat-count {
  display: block;
  color: var(--stat);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 28px;
  line-height: 1;
}

.nexo-stat-card .stat-label {
  display: block;
  margin-top: 6px;
  color: var(--nexo-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

.nexo-stat-card .stat-link {
  display: block;
  margin-top: 8px;
  color: var(--stat);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  opacity: 0.72;
}

.nexo-shell .premium-analyst-panel .nexo-stat-card {
  border-color: var(--nexo-line);
  background: var(--nexo-bg-1);
  color: var(--nexo-text) !important;
  box-shadow: none;
}

.nexo-shell .premium-analyst-panel .nexo-stat-card::before {
  width: 3px;
  background: var(--stat);
}

.nexo-shell .premium-analyst-panel .nexo-stat-card:hover {
  border-color: var(--nexo-line-strong);
  background: var(--nexo-bg-1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.nexo-shell .premium-analyst-panel .nexo-stat-card.active {
  border-color: var(--stat);
  background: var(--stat-dim);
  box-shadow: 0 0 0 1px var(--stat);
}

.nexo-shell .premium-analyst-panel .nexo-stat-card.active span,
.nexo-shell .premium-analyst-panel .nexo-stat-card.active strong,
.nexo-shell .premium-analyst-panel .nexo-stat-card.active small {
  color: inherit;
}

.nexo-shell .premium-analyst-panel .nexo-stat-card .stat-count,
.nexo-shell .premium-analyst-panel .nexo-stat-card.active .stat-count,
.nexo-shell .premium-analyst-panel .nexo-stat-card .stat-link,
.nexo-shell .premium-analyst-panel .nexo-stat-card.active .stat-link {
  color: var(--stat) !important;
}

.nexo-shell .premium-analyst-panel .nexo-stat-card .stat-label,
.nexo-shell .premium-analyst-panel .nexo-stat-card.active .stat-label {
  color: var(--nexo-muted) !important;
}

.nexo-shell .panel,
.nexo-shell .case-workspace,
.nexo-shell .profile-tab-panel,
.nexo-shell .action-dock-panel,
.nexo-shell .operator-column,
.nexo-shell .chart,
.nexo-shell .kpi {
  border: 1px solid var(--nexo-line);
  border-radius: 10px;
  background: var(--nexo-bg-1);
  color: var(--nexo-text);
  box-shadow: none;
}

.nexo-shell .panel-head {
  border-color: var(--nexo-line);
  background: transparent;
}

.nexo-shell .panel-head h3,
.nexo-shell .panel h3,
.nexo-shell .action-dock-head h3,
.nexo-shell .info-section h4,
.nexo-shell .chart h3 {
  color: var(--nexo-text);
}

.nexo-shell .panel-head p,
.nexo-shell .action-dock-head p,
.nexo-shell .chart p,
.nexo-shell .case-meta,
.nexo-shell .case-top small,
.nexo-shell .record-row p,
.nexo-shell .kv span,
.nexo-shell .info-section .kv span {
  color: var(--nexo-muted);
}

.nexo-case-card {
  margin-bottom: 5px;
  border: 1px solid var(--nexo-line);
  border-radius: 6px;
  background: var(--nexo-bg-1);
  color: var(--nexo-text);
}

.nexo-case-card:hover {
  border-color: var(--nexo-line-strong);
  background: var(--nexo-bg-2);
}

.nexo-case-card.active {
  border-color: var(--nexo-teal);
  background: var(--nexo-teal-soft);
  box-shadow: none;
}

.nexo-case-card .case-card-meta {
  color: var(--nexo-muted);
}

.nexo-case-card .case-card-meta b {
  color: var(--nexo-faint);
}

.nexo-shell .case-stage-chip,
.nexo-shell .phase-chip,
.nexo-shell .route-step {
  border-color: var(--nexo-line);
  background: var(--nexo-bg-2);
  color: var(--nexo-muted);
}

.nexo-shell .case-stage-chip:not(.neutral),
.nexo-shell .phase-chip.active,
.nexo-shell .route-step.active {
  border-color: var(--nexo-teal);
  background: var(--nexo-teal-soft);
  color: var(--nexo-teal);
}

.nexo-shell .tab,
.nexo-shell .operation-pane-tab {
  border-color: var(--nexo-line);
  background: var(--nexo-bg-1);
  color: var(--nexo-muted);
}

.nexo-shell .tab.active,
.nexo-shell .operation-pane-tab.active {
  border-color: var(--nexo-teal);
  background: var(--nexo-teal-soft);
  color: var(--nexo-teal);
  box-shadow: none;
}

.nexo-shell .info-section,
.nexo-shell .record-row,
.nexo-shell .doc-viewer,
.nexo-shell .action-card {
  border-color: var(--nexo-line);
  background: var(--nexo-bg-2);
  color: var(--nexo-text);
}

.nexo-shell .kv,
.nexo-shell .fact {
  color: var(--nexo-text);
}

.nexo-shell .btn {
  border-color: var(--nexo-line-strong);
  background: var(--nexo-bg-2);
  color: var(--nexo-text);
}

.nexo-shell .btn.primary,
.nexo-shell .btn.success {
  border-color: var(--nexo-teal);
  background: var(--nexo-teal);
  color: var(--nexo-bg);
}

.nexo-shell .btn.danger {
  border-color: var(--nexo-red);
  background: rgba(244, 63, 94, 0.14);
  color: var(--nexo-red);
}

.nexo-shell .btn.secondary,
.nexo-shell .btn.ghost {
  background: var(--nexo-bg-2);
  color: var(--nexo-muted);
}

.nexo-shell .badge.blue {
  background: rgba(59, 130, 246, 0.12);
  color: var(--nexo-blue);
}

.nexo-shell .badge.green {
  background: rgba(34, 197, 94, 0.12);
  color: var(--nexo-green);
}

.nexo-shell .badge.amber {
  background: rgba(245, 158, 11, 0.12);
  color: var(--nexo-amber);
}

.nexo-shell .badge.red {
  background: rgba(244, 63, 94, 0.12);
  color: var(--nexo-red);
}

.nexo-shell .badge.purple {
  background: rgba(167, 139, 250, 0.12);
  color: var(--nexo-purple);
}

.nexo-shell .badge.teal,
.nexo-shell .badge.neutral {
  background: rgba(100, 116, 139, 0.12);
  color: var(--nexo-muted);
}

.nexo-chat-shell {
  background: var(--nexo-bg-1);
  color: var(--nexo-text);
}

.nexo-shell .chat-context-card,
.nexo-shell .wa-note,
.nexo-shell .composer,
.nexo-shell .template-select,
.nexo-shell .textarea {
  border-color: var(--nexo-line);
  background: var(--nexo-bg-2);
  color: var(--nexo-text);
}

.nexo-shell .message {
  border-color: var(--nexo-line);
  background: var(--nexo-bg-3);
  box-shadow: none;
}

.nexo-shell .message.incoming {
  background: var(--nexo-bg-3);
  color: var(--nexo-text);
}

.nexo-shell .message.outgoing {
  border-color: var(--nexo-teal);
  background: var(--nexo-teal-soft);
}

.nexo-shell .message.internal {
  border-color: rgba(245, 158, 11, 0.36);
  background: rgba(245, 158, 11, 0.12);
}

.nexo-shell .message-body {
  color: var(--nexo-text);
}

.nexo-shell .message strong,
.nexo-shell .message small,
.nexo-shell .composer-actions small {
  color: var(--nexo-muted);
}

.nexo-shell .conversation-item {
  border-color: var(--nexo-line);
  border-radius: 6px;
  background: var(--nexo-bg-1);
}

.nexo-shell .conversation-item.active,
.nexo-shell .conversation-item:hover {
  border-color: var(--nexo-teal);
  background: var(--nexo-teal-soft);
}

.nexo-shell .conversation-avatar {
  display: grid;
  border-color: var(--nexo-teal);
  background: var(--nexo-teal-soft);
  color: var(--nexo-teal);
}

.nexo-shell .conversation-preview {
  color: var(--nexo-muted);
}

.nexo-bi-panel .page-head {
  background: transparent;
}

.nexo-bi-panel .kpi::before {
  left: 0;
  right: auto;
  top: 0;
  bottom: 0;
  width: 3px;
  height: auto;
  border-radius: 0;
  background: var(--nexo-teal);
}

.nexo-bi-panel .kpi span,
.nexo-bi-panel .kpi small {
  color: var(--nexo-muted);
}

.nexo-bi-panel .kpi strong {
  color: var(--nexo-teal);
}

.nexo-bi-panel .bar-track,
.nexo-shell .bar-track {
  background: var(--nexo-bg-2);
}

.nexo-bi-panel .bar-fill,
.nexo-shell .bar-fill {
  background: linear-gradient(90deg, var(--nexo-teal), var(--nexo-blue));
}

.nexo-shell .nexo-operation-view {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}

.nexo-shell .nexo-operation-head {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.nexo-workbench {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 370px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--nexo-line);
  border-radius: 10px;
  background: var(--nexo-bg);
}

.nexo-cases-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--nexo-line);
  background: var(--nexo-bg);
}

.nexo-filter-tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding: 10px 10px 0;
  border-bottom: 1px solid var(--nexo-line);
  background: var(--nexo-bg-1);
}

.nexo-filter-tabs::-webkit-scrollbar {
  height: 0;
}

.nexo-filter-tabs .ftab {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--nexo-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.nexo-filter-tabs .ftab:hover {
  color: var(--nexo-text);
}

.nexo-filter-tabs .ftab.active {
  border-bottom-color: var(--nexo-teal);
  color: var(--nexo-teal);
}

.nexo-cases-search {
  flex: 0 0 auto;
  padding: 10px;
  border-bottom: 1px solid var(--nexo-line);
  background: var(--nexo-bg);
}

.nexo-cases-search .casos-search {
  width: 100%;
  border: 1px solid var(--nexo-line);
  border-radius: 6px;
  background: var(--nexo-bg-2);
  color: var(--nexo-text);
  padding: 7px 12px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.16s ease;
}

.nexo-cases-search .casos-search:focus {
  border-color: var(--nexo-line-strong);
}

.nexo-cases-search .casos-search::placeholder {
  color: var(--nexo-faint);
}

.nexo-cases-count {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-bottom: 1px solid var(--nexo-line);
  color: var(--nexo-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 10px;
}

.nexo-cases-list {
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  overflow-y: auto;
  padding: 8px;
}

.nexo-cases-list .nexo-case-card {
  margin-bottom: 5px;
  padding: 12px;
  border: 1px solid var(--nexo-line);
  border-radius: 6px;
  background: var(--nexo-bg-1);
  box-shadow: none;
}

.nexo-cases-list .nexo-case-card:hover {
  border-color: var(--nexo-line-strong);
  background: var(--nexo-bg-2);
}

.nexo-cases-list .nexo-case-card.active {
  border-color: var(--nexo-teal);
  background: var(--nexo-teal-soft);
  box-shadow: none;
}

.nexo-cases-list .nexo-case-card.active::before {
  display: none;
}

.nexo-cases-list .case-top {
  margin-bottom: 5px;
}

.nexo-cases-list .case-top strong {
  color: var(--nexo-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.nexo-cases-list .case-top small {
  color: var(--nexo-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
}

.nexo-cases-list .case-card-meta {
  gap: 7px 10px;
  color: var(--nexo-muted);
  font-size: 11px;
}

.nexo-cases-list .case-card-meta b {
  color: var(--nexo-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.4px;
}

.nexo-cases-list .case-card-tags {
  gap: 6px;
}

.nexo-cases-list .case-stage-chip {
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
}

.nexo-detail-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--nexo-bg);
}

.nexo-detail-empty {
  height: 100%;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--nexo-faint);
  text-align: center;
}

.nexo-detail-empty strong {
  color: var(--nexo-muted);
  font-size: 15px;
}

.nexo-detail-empty span {
  color: var(--nexo-faint);
  font-size: 12px;
}

.nexo-detail-shell {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nexo-shell .nexo-detail-header {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--nexo-line);
  background: var(--nexo-bg-1);
}

.nexo-detail-header .dh-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.nexo-detail-header .dh-spacer {
  display: none;
}

.nexo-detail-header h2 {
  margin: 2px 0 2px;
  color: var(--nexo-text);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
}

.nexo-detail-header p {
  overflow: hidden;
  margin: 0;
  color: var(--nexo-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nexo-detail-header .case-code {
  display: block;
  overflow: hidden;
  color: var(--nexo-teal);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nexo-detail-header .badge-row {
  margin: 0;
}

.nexo-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nexo-actions-panel {
  display: block;
  padding: 2px 0 0;
  border: 0;
  background: transparent;
}

.nexo-actions-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nexo-actions-head strong {
  color: var(--nexo-text);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.nexo-actions-head span {
  color: var(--nexo-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 10px;
}

.nexo-action-bar .abtn,
.nexo-tab-content .abtn {
  display: inline-flex;
  flex-direction: row;
  gap: 5px;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--nexo-line-strong);
  border-radius: 6px;
  background: var(--nexo-bg-2);
  color: var(--nexo-muted);
  padding: 7px 13px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.nexo-action-bar .action-label,
.nexo-tab-content .action-label {
  color: inherit;
}

.nexo-action-bar .action-icon {
  display: inline-grid;
  place-items: center;
  width: 12px;
  height: 12px;
  color: currentColor;
  font-size: 12px;
  line-height: 1;
}

.nexo-action-bar .abtn.primary,
.nexo-tab-content .abtn.primary {
  border-color: var(--nexo-teal);
  background: var(--nexo-teal-soft);
  color: var(--nexo-teal);
}

.nexo-action-bar .abtn.secondary {
  border-color: var(--nexo-blue);
  background: rgba(59, 130, 246, 0.12);
  color: var(--nexo-blue);
}

.nexo-action-bar .abtn.success {
  border-color: var(--nexo-green);
  background: rgba(34, 197, 94, 0.12);
  color: var(--nexo-green);
}

.nexo-action-bar .abtn.danger {
  border-color: var(--nexo-red);
  background: rgba(244, 63, 94, 0.12);
  color: var(--nexo-red);
}

.nexo-action-bar .abtn.amber,
.nexo-action-bar .abtn.warning {
  border-color: var(--nexo-amber);
  background: rgba(245, 158, 11, 0.12);
  color: var(--nexo-amber);
}

.nexo-action-bar .abtn.purple {
  border-color: var(--nexo-purple);
  background: rgba(167, 139, 250, 0.12);
  color: var(--nexo-purple);
}

.nexo-action-bar .abtn.pending,
.nexo-action-bar .abtn:disabled,
.nexo-tab-content .abtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nexo-tab-content .abtn {
  min-height: 32px;
  border-radius: 6px;
  padding: 7px 13px;
  font-size: 11px;
}

.nexo-detail-tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 0 20px;
  border-bottom: 1px solid var(--nexo-line);
  background: var(--nexo-bg-1);
}

.nexo-detail-tabs .ctab {
  flex: 0 0 auto;
  padding: 10px 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--nexo-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.nexo-detail-tabs .ctab:hover {
  color: var(--nexo-text);
}

.nexo-detail-tabs .ctab.active {
  border-bottom-color: var(--nexo-teal);
  color: var(--nexo-teal);
}

.nexo-tab-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  background: var(--nexo-bg);
}

.nexo-tab-content .info-section {
  margin-bottom: 22px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.nexo-tab-content .info-section-title {
  margin-bottom: 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--nexo-line);
  color: var(--nexo-teal);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nexo-tab-content .info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.nexo-tab-content .info-grid.cols3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nexo-tab-content .kv,
.nexo-tab-content .fact {
  border: 1px solid var(--nexo-line);
  border-radius: 6px;
  background: var(--nexo-bg-1);
  padding: 10px 12px;
}

.nexo-tab-content .kv span,
.nexo-tab-content .fact span {
  display: block;
  margin-bottom: 2px;
  color: var(--nexo-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.nexo-tab-content .kv strong,
.nexo-tab-content .fact strong {
  color: var(--nexo-text);
  font-size: 12px;
  font-weight: 650;
}

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

.nexo-tab-content .docs-title {
  color: var(--nexo-text);
  font-size: 12px;
  font-weight: 800;
}

.nexo-tab-content .doc-card,
.nexo-tab-content .record-row {
  border-color: var(--nexo-line);
  background: var(--nexo-bg-1);
  color: var(--nexo-text);
}

.nexo-tab-content .hist-list {
  display: flex;
  flex-direction: column;
}

.nexo-tab-content .nexo-chat-shell {
  height: 100%;
  min-height: 420px;
  max-height: none;
  border: 0;
  background: transparent;
}

.nexo-tab-content .nexo-chat-shell .chat-phase-filter,
.nexo-tab-content .nexo-chat-shell .wa-note {
  display: none;
}

.nexo-tab-content .nexo-chat-shell .chat-context-card {
  margin: 0 0 12px;
  border-radius: 6px;
  background: var(--nexo-bg-1);
}

.nexo-tab-content .nexo-chat-shell .chat-body {
  min-height: 0;
  padding: 0 0 8px;
  background: transparent;
}

.nexo-shell .chat-body {
  display: grid;
  align-content: start;
  align-items: start;
  gap: 8px;
}

.nexo-shell .message {
  width: fit-content;
  max-width: min(72%, 560px);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
}

.nexo-shell .message.incoming {
  border-color: transparent;
  border-bottom-left-radius: 2px;
  background: var(--nexo-bg-3);
}

.nexo-shell .message.outgoing {
  border-color: var(--nexo-teal);
  border-bottom-right-radius: 2px;
  background: var(--nexo-teal-soft);
}

.nexo-shell .message.internal {
  max-width: min(72%, 560px);
  border-color: rgba(245, 158, 11, 0.28);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.1);
}

.nexo-shell .message strong {
  margin-bottom: 2px;
  font-size: 9px;
  letter-spacing: 0.4px;
}

.nexo-shell .message-body {
  font-size: 12px;
  line-height: 1.45;
}

.nexo-shell .message-meta {
  margin-top: 3px;
  color: var(--nexo-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 9px;
}

.nexo-shell .composer {
  padding: 10px 0 0;
  border-top: 1px solid var(--nexo-line);
  background: transparent;
}

.nexo-shell .textarea {
  min-height: 38px;
  max-height: 100px;
  border-radius: 6px;
  font-size: 12px;
}

@media (max-width: 1280px) {
  .nexo-shell .modern-summary {
    grid-template-columns: repeat(3, 1fr);
  }

  .nexo-workbench {
    grid-template-columns: 330px minmax(0, 1fr);
  }

  .nexo-tab-content .info-grid.cols3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .nexo-login .html-login-layout {
    width: min(420px, 100%);
  }

  .nexo-shell .modern-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .nexo-shell .topbar.modern-topbar {
    height: auto;
  }

  .nexo-shell .nexo-operation-view {
    height: auto;
    overflow: auto;
  }

  .nexo-workbench {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .nexo-cases-panel {
    max-height: 430px;
    border-right: 0;
    border-bottom: 1px solid var(--nexo-line);
  }

  .nexo-detail-panel {
    min-height: 640px;
  }

  .nexo-shell .nexo-detail-header {
    gap: 10px;
    padding: 14px 20px;
  }

  .nexo-detail-header h2 {
    font-size: 16px;
  }

  .nexo-detail-header p {
    font-size: 12px;
  }

  .nexo-action-bar .abtn {
    min-height: 34px;
    padding: 7px 13px;
    font-size: 11px;
  }

  .nexo-detail-header .nexo-action-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nexo-detail-header .nexo-action-bar::-webkit-scrollbar {
    height: 0;
  }

  .nexo-tab-content .info-grid,
  .nexo-tab-content .info-grid.cols3 {
    grid-template-columns: 1fr;
  }
}
