:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #f1f4f7;
  --ink: #17202a;
  --muted: #657282;
  --line: #e1e6ec;
  --accent: #2563eb;
  --accent-soft: #e8f0ff;
  --accent-strong: #1d4ed8;
  --warn: #a15c07;
  --danger: #c2413a;
  --info: #2563eb;
  --shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

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

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

button {
  border: 0;
  cursor: pointer;
}

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

.login-brand {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(rgba(18, 48, 36, 0.72), rgba(18, 48, 36, 0.62)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='800' viewBox='0 0 1200 800'%3E%3Crect width='1200' height='800' fill='%23e5eee7'/%3E%3Cg fill='none' stroke='%2392ab9c' stroke-width='3'%3E%3Cpath d='M96 690h1000M170 690V260l220-128 220 128v430M610 690V330l188-105 190 105v360M250 690V420h132v270M705 690V448h115v242M900 690V448h116v242M242 302h94v92h-94zM421 302h94v92h-94zM707 350h92v78h-92zM888 350h92v78h-92z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  color: white;
}

.login-brand h1 {
  max-width: 720px;
  margin: 0;
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: 0;
}

.login-brand p {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.6;
}

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

.login-box {
  width: 100%;
  max-width: 360px;
}

.login-box h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

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

.form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.sale-form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

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

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

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

.check-field {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.check-field input {
  width: auto;
}

.compact-check {
  min-height: auto;
  font-size: 12px;
  font-weight: 600;
}

.field-config-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 110px 130px;
  gap: 8px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.field-config-head {
  color: #4c5c53;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

label {
  color: #324139;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
}

input:focus,
select:focus,
textarea:focus,
.searchable-select-input:focus {
  border-color: #93b4f8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

.native-select-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.searchable-select {
  position: relative;
}

.searchable-select-input {
  padding-right: 34px;
}

.searchable-select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 13px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #65746b;
  border-bottom: 2px solid #65746b;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.searchable-select.disabled {
  opacity: 0.65;
}

.searchable-select-list {
  position: absolute;
  z-index: 120;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: min(320px, 48vh);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(25, 42, 31, 0.16);
  display: none;
}

.searchable-select.open .searchable-select-list {
  display: grid;
  gap: 4px;
}

.searchable-select-list button {
  min-height: 34px;
  width: 100%;
  justify-content: flex-start;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  text-align: left;
}

.searchable-select-list button:hover,
.searchable-select-list button.active {
  background: #eaf4ee;
}

.searchable-select-empty {
  padding: 9px;
  color: var(--muted);
  font-size: 12px;
}

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

.btn {
  min-height: 36px;
  border-radius: 7px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
  font-size: 13px;
}

.btn.small {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.btn.compact {
  min-height: 32px;
}

.btn:hover {
  background: var(--accent-strong);
}

.btn.secondary {
  color: var(--ink);
  background: var(--panel-soft);
}

.btn.secondary:hover {
  background: #dfe9e2;
}

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

.btn.ghost {
  color: var(--ink);
  background: transparent;
}

.btn.ghost:hover {
  background: var(--panel-soft);
}

.quick-users {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quick-users button {
  min-height: 38px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel-soft);
  font-size: 13px;
  font-weight: 700;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  grid-template-rows: 58px 44px minmax(0, 1fr);
  background: var(--bg);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 80;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 250px minmax(280px, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 58px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

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

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

.brand-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 9px;
  object-fit: contain;
  background: #fff;
}

.brand-logo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.brand strong {
  font-size: 19px;
}

.header-brand strong {
  font-size: 17px;
}

.header-brand .muted {
  font-size: 12px;
}

.global-search {
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  color: var(--muted);
}

.global-search input {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

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

.header-shortcut,
.notification-pill {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.notification-pill {
  min-width: 34px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.profile {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.compact-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
  padding: 6px 9px;
}

.compact-profile div {
  min-width: 0;
}

.compact-profile strong,
.compact-profile span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile strong {
  display: block;
}

.avatar-sm,
.avatar-xs {
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-soft);
}

.avatar-sm {
  width: 32px;
  height: 32px;
}

.avatar-xs {
  width: 28px;
  height: 28px;
}

.image-upload-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.image-upload-row > div:last-child {
  display: grid;
  gap: 8px;
  min-width: min(320px, 100%);
}

.image-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent-strong);
  font-weight: 900;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-preview {
  width: 96px;
  height: 64px;
  border-radius: 10px;
}

.logo-preview img {
  object-fit: contain;
  padding: 6px;
}

.user-photo-preview {
  width: 76px;
  height: 76px;
  border-radius: 50%;
}

.user-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-name-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cropper-backdrop {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.48);
}

.cropper-modal {
  width: min(680px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

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

.cropper-canvas {
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: move;
  touch-action: none;
}

.cropper-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.module-nav {
  position: sticky;
  top: 58px;
  z-index: 70;
  grid-column: 1 / -1;
  display: flex;
  gap: 4px;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  overflow-x: auto;
}

.module-nav button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.module-nav button.active,
.module-nav button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.quick-sidebar {
  position: sticky;
  top: 102px;
  align-self: start;
  height: calc(100vh - 102px);
  grid-column: 1;
  grid-row: 3;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px 8px;
  border-right: 1px solid var(--line);
  background: #fbfcfe;
}

.quick-sidebar button {
  min-height: 48px;
  display: grid;
  place-items: center;
  gap: 2px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}

.quick-sidebar span {
  font-size: 12px;
  font-weight: 900;
}

.quick-sidebar small {
  max-width: 54px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
}

.quick-sidebar button.active,
.quick-sidebar button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.workspace {
  grid-column: 2;
  grid-row: 3;
  min-width: 0;
}

.subnav {
  position: sticky;
  top: 102px;
  z-index: 60;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 249, 0.96);
  backdrop-filter: blur(8px);
}

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

.subnav span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.subnav-links {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.subnav-links button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.subnav-links button.active,
.subnav-links button:hover {
  border-color: #b9cdf8;
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.content {
  min-width: 0;
  padding: 20px 22px 28px;
}

.module-eyebrow {
  margin-bottom: 3px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.topbar h1 {
  margin: 0 0 4px;
  font-size: 24px;
  letter-spacing: 0;
}

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

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

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

.metrics-six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dashboard-section {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.compact-heading {
  margin-bottom: 0;
}

.compact-heading h2 {
  margin: 0 0 2px;
  font-size: 15px;
}

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

.attention-card {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
}

.attention-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.attention-card strong {
  color: var(--ink);
  font-size: 24px;
}

.attention-card.attention {
  border-color: #f3d39b;
  background: #fffaf0;
}

.attention-card.ok strong {
  color: #166534;
}

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

.operational-list {
  padding: 12px;
}

.mini-table {
  font-size: 12px;
}

.mini-table td {
  padding: 7px 6px;
}

.mini-table td:last-child {
  text-align: right;
  font-weight: 800;
}

.dashboard-command-shell {
  grid-template-columns: 232px minmax(0, 1fr);
  grid-template-rows: 78px minmax(0, 1fr);
  background: #f7f9fd;
}

.dashboard-command-shell .app-header {
  grid-column: 2;
  grid-row: 1;
}

.dashboard-command-header {
  grid-template-columns: minmax(360px, 560px) minmax(0, auto);
  min-height: 78px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.92);
}

.dashboard-command-header .global-search {
  max-width: 560px;
  min-height: 42px;
  border-color: #d9e2f4;
  border-radius: 10px;
  background: #f9fbff;
}

.dashboard-command-header .global-search kbd {
  min-width: 36px;
  padding: 4px 6px;
  border-radius: 6px;
  color: #617099;
  background: #eef3ff;
  font-size: 11px;
  text-align: center;
}

.dashboard-command-header .header-actions {
  justify-content: flex-end;
}

.dashboard-command-header .header-shortcut {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid #dbe3f3;
  border-radius: 9px;
  background: #fff;
  color: #0e214c;
}

.dashboard-command-header .primary-shortcut {
  border-color: #0f49e7;
  background: #0f49e7;
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 73, 231, 0.22);
}

.dashboard-command-header .notification-pill {
  min-height: 38px;
  min-width: 42px;
  background: #fff;
  border: 1px solid #dbe3f3;
}

.dashboard-command-header #logoutButton {
  display: none;
}

.dashboard-sidebar {
  grid-column: 1;
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  height: 100vh;
  padding: 18px 17px;
  border-right: 1px solid #e1e7f3;
  background: #fff;
}

.dashboard-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.dashboard-sidebar-brand .brand-logo {
  width: 48px;
  height: 42px;
  flex-basis: 48px;
}

.dashboard-sidebar-brand strong {
  display: block;
  color: #10204a;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.dashboard-sidebar-brand span {
  color: #697696;
  font-size: 10px;
  font-weight: 700;
}

.dashboard-collapse {
  position: absolute;
  top: 24px;
  left: 196px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #647196;
  background: #fff;
}

.dashboard-nav-block {
  display: grid;
  gap: 7px;
}

.dashboard-nav-block small {
  margin: 8px 8px 4px;
  color: #5d6b92;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.dashboard-nav-block button {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-radius: 8px;
  color: #23355f;
  background: transparent;
  font-size: 13px;
  font-weight: 850;
}

.dashboard-nav-block button span {
  width: 18px;
  color: #33477a;
  font-weight: 900;
  text-align: center;
}

.dashboard-nav-block button.active,
.dashboard-nav-block button:hover {
  color: #fff;
  background: #0f49e7;
  box-shadow: 0 10px 22px rgba(15, 73, 231, 0.22);
}

.dashboard-nav-block button.active span,
.dashboard-nav-block button:hover span {
  color: #fff;
}

.dashboard-ai-card {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid #dde6fb;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff 0%, #f5f7ff 100%);
  color: #23355f;
}

.dashboard-ai-card strong {
  font-size: 13px;
  text-transform: uppercase;
}

.dashboard-ai-card span {
  color: #617099;
  font-size: 12px;
  line-height: 1.45;
}

.dashboard-ai-orb {
  width: 120px;
  height: 82px;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 35% 35%, #8da2ff 0 8%, transparent 9%),
    radial-gradient(circle, #4f46e5 0 38%, #1d4ed8 39% 62%, #dfe7ff 63% 100%);
  font-size: 24px;
  font-weight: 950;
}

.dashboard-ai-card button {
  min-height: 36px;
  border: 1px solid #dbe3f3;
  border-radius: 8px;
  background: #fff;
  color: #0f49e7;
  font-size: 12px;
  font-weight: 900;
}

.dashboard-command-workspace {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}

.dashboard-command-content {
  padding: 20px 24px 28px;
  overflow-x: hidden;
}

.workspace-command-bar {
  position: sticky;
  top: 78px;
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 62px;
  padding: 10px 24px;
  border-bottom: 1px solid #e1e7f3;
  background: rgba(247, 249, 253, 0.94);
  backdrop-filter: blur(8px);
}

.workspace-command-bar strong {
  display: block;
  color: #10204a;
  font-size: 14px;
  font-weight: 950;
}

.workspace-command-bar span {
  display: block;
  color: #617099;
  font-size: 11px;
  font-weight: 700;
}

.workspace-command-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
}

.workspace-command-tabs button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #dbe3f3;
  border-radius: 8px;
  color: #24365f;
  background: #fff;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.workspace-command-tabs button.active,
.workspace-command-tabs button:hover {
  border-color: #0f49e7;
  color: #0f49e7;
  background: #f2f6ff;
}

.workspace-command-summary {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.workspace-command-hero,
.workspace-mini-kpi,
.workspace-action-strip,
.workspace-chain-card {
  border: 1px solid #dbe3f3;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 26px rgba(23, 38, 84, 0.04);
}

.workspace-command-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  min-height: 112px;
  padding: 18px;
  background:
    radial-gradient(circle at 84px 50%, rgba(15, 73, 231, 0.08), transparent 180px),
    #fff;
}

.workspace-command-hero span {
  color: #0f49e7;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.workspace-command-hero h1 {
  margin: 5px 0 6px;
  color: #08122f;
  font-size: 24px;
  letter-spacing: 0;
}

.workspace-command-hero p {
  max-width: 820px;
  margin: 0;
  color: #617099;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.workspace-command-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workspace-command-actions button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #0f49e7;
  border-radius: 8px;
  color: #fff;
  background: #0f49e7;
  font-size: 12px;
  font-weight: 900;
}

.workspace-command-actions button + button {
  color: #0f49e7;
  background: #f2f6ff;
}

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

.workspace-mini-kpi {
  display: grid;
  gap: 7px;
  min-height: 94px;
  padding: 14px;
  border-left: 4px solid #0f49e7;
  text-align: left;
}

button.workspace-mini-kpi {
  width: 100%;
  border-top: 1px solid #dbe3f3;
  border-right: 1px solid #dbe3f3;
  border-bottom: 1px solid #dbe3f3;
  background: rgba(255, 255, 255, 0.96);
}

button.workspace-mini-kpi:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(23, 38, 84, 0.08);
}

.workspace-mini-kpi.green {
  border-left-color: #16a34a;
}

.workspace-mini-kpi.orange {
  border-left-color: #f97316;
}

.workspace-mini-kpi.red {
  border-left-color: #ef4444;
}

.workspace-mini-kpi.violet {
  border-left-color: #7c3aed;
}

.workspace-mini-kpi span {
  color: #617099;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.workspace-mini-kpi strong {
  color: #08122f;
  font-size: 23px;
  line-height: 1.1;
}

.workspace-mini-kpi small {
  color: #617099;
  font-size: 12px;
  font-weight: 750;
}

.workspace-command-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .5fr);
  gap: 12px;
}

.workspace-action-strip,
.workspace-chain-card {
  padding: 14px;
}

.workspace-action-strip h2,
.workspace-chain-card h2 {
  margin: 0 0 12px;
  color: #10204a;
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.workspace-action-strip > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.workspace-action-strip button {
  min-height: 92px;
  display: grid;
  gap: 5px;
  align-content: center;
  padding: 12px;
  border: 1px solid #dbe3f3;
  border-radius: 9px;
  background: #f7faff;
  text-align: left;
}

.workspace-action-strip button.red {
  border-color: #ffd7dc;
  background: #fff7f8;
}

.workspace-action-strip button.orange {
  border-color: #feddb8;
  background: #fff9f2;
}

.workspace-action-strip button.green {
  border-color: #ccefdc;
  background: #f4fff8;
}

.workspace-action-strip button.violet {
  border-color: #e7d8ff;
  background: #fbf8ff;
}

.workspace-action-strip strong {
  color: #10204a;
  font-size: 12px;
}

.workspace-action-strip span {
  color: #617099;
  font-size: 11px;
  line-height: 1.3;
}

.workspace-action-strip b {
  color: #0f49e7;
  font-size: 12px;
}

.workspace-action-strip button.red b {
  color: #ef4444;
}

.workspace-action-strip button.orange b {
  color: #f97316;
}

.workspace-action-strip button.green b {
  color: #16a34a;
}

.workspace-action-strip button.violet b {
  color: #7c3aed;
}

.workspace-chain-card > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.workspace-chain-card span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: #0f49e7;
  background: #edf3ff;
  font-size: 11px;
  font-weight: 950;
}

.workspace-chain-card i {
  color: #9aa8c7;
  font-style: normal;
  font-weight: 900;
}

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

.shortcut-card,
.report-card {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid #dbe3f3;
  border-radius: 10px;
  background: #fff;
  text-align: left;
}

.shortcut-card:hover,
.report-card:hover {
  border-color: #9db5f8;
  background: #f8fbff;
}

.shortcut-card strong,
.report-card strong {
  color: #10204a;
  font-size: 13px;
}

.shortcut-card span,
.report-card span {
  color: #617099;
  font-size: 12px;
  line-height: 1.35;
}

.shortcut-card b,
.report-card b {
  align-self: end;
  color: #0f49e7;
  font-size: 11px;
  text-transform: uppercase;
}

.shortcut-card.red b { color: #ef4444; }
.shortcut-card.orange b { color: #f97316; }
.shortcut-card.green b { color: #16a34a; }
.shortcut-card.violet b { color: #7c3aed; }

.reports-command-grid {
  display: grid;
  gap: 14px;
}

.reports-summary-card {
  padding: 16px;
}

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

.reports-summary-metrics div {
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 12px;
  border: 1px solid #e5ebf6;
  border-radius: 9px;
  background: #f8fbff;
}

.reports-summary-metrics span,
.reports-summary-metrics small {
  color: #617099;
  font-size: 11px;
  font-weight: 800;
}

.reports-summary-metrics strong {
  color: #08122f;
  font-size: 22px;
}

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

.report-card:disabled {
  opacity: .68;
  cursor: default;
}

.command-dashboard {
  display: grid;
  gap: 18px;
}

.command-hero,
.command-kpi,
.command-panel {
  border: 1px solid #dbe3f3;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 26px rgba(23, 38, 84, 0.04);
}

.command-hero {
  min-height: 96px;
  display: grid;
  grid-template-columns: 72px minmax(220px, 1fr) minmax(640px, 2.3fr);
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  background:
    radial-gradient(circle at 80px 50%, rgba(72, 87, 255, 0.10), transparent 170px),
    #fff;
}

.hero-orb {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, #eef4ff 0 28%, #304cff 29% 47%, #101d58 48% 60%, #e9efff 61% 100%);
  box-shadow: 0 0 26px rgba(44, 77, 255, 0.24);
}

.hero-orb span {
  color: #fff;
  font-size: 24px;
}

.hero-copy h1 {
  margin: 0 0 6px;
  color: #0d1839;
  font-size: 21px;
  letter-spacing: 0;
}

.hero-copy p {
  margin: 0;
  color: #617099;
  font-size: 13px;
  font-weight: 650;
}

.hero-alerts {
  display: grid;
  grid-template-columns: repeat(3, minmax(105px, 1fr)) minmax(150px, 1.3fr) 150px;
  gap: 12px;
  align-items: center;
}

.hero-alert,
.hero-performance {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 5px 9px;
  align-items: center;
}

button.hero-alert {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

button.hero-alert:hover small {
  color: #0f49e7;
}

.hero-alert span {
  grid-row: span 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 900;
}

.hero-alert strong {
  color: #ff3b30;
  font-size: 18px;
  line-height: 1;
}

.hero-alert small,
.hero-performance small,
.hero-performance span {
  color: #617099;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}

.hero-alert.danger span {
  color: #ef4444;
  background: #ffe9ea;
}

.hero-alert.orange span {
  color: #f97316;
  background: #fff1e6;
}

.hero-alert.amber span {
  color: #d97706;
  background: #fff7dc;
}

.hero-performance {
  border-left: 1px solid #e1e7f3;
  padding-left: 18px;
}

.hero-performance::before {
  content: "↗";
  grid-row: span 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #16a34a;
  background: #eafaf2;
  font-weight: 950;
}

.hero-performance strong {
  color: #16a34a;
  font-size: 18px;
}

.hero-performance.negative::before,
.hero-performance.negative strong {
  color: #dc2626;
}

.hero-performance.negative::before {
  background: #feecec;
}

.hero-link {
  min-height: 38px;
  border: 1px solid #cfdbff;
  border-radius: 8px;
  background: #f2f6ff;
  color: #0f49e7;
  font-size: 12px;
  font-weight: 900;
}

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

.command-kpi {
  min-height: 136px;
  height: 145px;
  position: relative;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow: hidden;
  padding: 15px;
}

.kpi-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #223766;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  background: #0f49e7;
}

.dot.green { background: #16a34a; }
.dot.orange { background: #f97316; }
.dot.violet { background: #7c3aed; }
.dot.blue { background: #0f49e7; }

.command-kpi > strong {
  color: #08122f;
  font-size: 23px;
  line-height: 1.1;
}

.trend {
  color: #617099;
  font-size: 12px;
  font-weight: 750;
}

.trend.positive {
  color: #16a34a;
}

.trend.negative {
  color: #dc2626;
}

.sparkline {
  position: absolute;
  right: 13px;
  bottom: 12px;
  width: 96px;
  height: 52px;
  color: #0f49e7;
}

.sparkline.green { color: #16a34a; }
.sparkline.orange { color: #f97316; }
.sparkline.violet { color: #7c3aed; }

.conversion-kpi {
  grid-template-columns: minmax(0, 1fr) 58px;
}

.conversion-kpi .kpi-title,
.conversion-kpi strong,
.conversion-kpi .trend {
  grid-column: 1;
}

.donut {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: conic-gradient(#0f49e7 calc(var(--value) * 1%), #eef2ff 0);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: #fff;
}

.conversion-kpi .donut {
  grid-column: 2;
  grid-row: 2 / span 2;
}

.pipeline-kpi strong {
  font-size: 16px;
  line-height: 1.05;
}

.pipeline-kpi span {
  color: #617099;
  font-size: 12px;
}

.pipeline-progress {
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: #eef2ff;
}

.pipeline-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f49e7, #8b5cf6);
}

.command-main-grid {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.15fr) 270px;
  gap: 14px;
}

.command-panel {
  padding: 13px;
}

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

.command-panel-head h2 {
  margin: 0;
  color: #10204a;
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.command-panel-head span {
  display: block;
  margin-top: 4px;
  color: #617099;
  font-size: 12px;
}

.command-panel-head button,
.command-panel-head select {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dbe3f3;
  border-radius: 7px;
  color: #0f49e7;
  background: #fff;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.command-panel-head select,
.period-select {
  appearance: none;
  padding-right: 26px;
  background:
    linear-gradient(45deg, transparent 50%, #617099 50%) calc(100% - 14px) 12px / 5px 5px no-repeat,
    linear-gradient(135deg, #617099 50%, transparent 50%) calc(100% - 9px) 12px / 5px 5px no-repeat,
    #fff;
}

.action-center {
  grid-column: 1 / 3;
}

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

.action-card {
  display: grid;
  gap: 7px;
  min-height: 162px;
  height: 162px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
}

.action-card.red {
  border-color: #ffd7dc;
  background: #fff7f8;
}

.action-card.orange {
  border-color: #feddb8;
  background: #fff9f2;
}

.action-card.amber {
  border-color: #fee6ad;
  background: #fffaf0;
}

.action-card.blue {
  border-color: #d9e5ff;
  background: #f7faff;
}

.action-card.violet {
  border-color: #e7d8ff;
  background: #fbf8ff;
}

.action-title {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.action-title > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  border-radius: 50%;
  background: rgba(15, 73, 231, 0.08);
  color: #0f49e7;
  font-weight: 950;
}

.action-title strong {
  display: block;
  color: #10204a;
  font-size: 11px;
}

.action-title small,
.action-card > span {
  color: #617099;
  font-size: 10px;
  line-height: 1.35;
}

.action-card b {
  color: #10204a;
  font-size: 13px;
}

.action-card button {
  min-height: 30px;
  align-self: end;
  border: 1px solid currentColor;
  border-radius: 7px;
  color: #0f49e7;
  background: rgba(255, 255, 255, 0.65);
  font-size: 11px;
  font-weight: 900;
}

.action-card.red button { color: #ef4444; }
.action-card.orange button { color: #f97316; }
.action-card.amber button { color: #d97706; }
.action-card.violet button { color: #7c3aed; }

.ranking-panel {
  grid-column: 3;
}

.timeline-panel {
  grid-column: 1;
}

.performance-panel {
  grid-column: 2;
}

.ranking-list {
  display: grid;
  gap: 12px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: #10204a;
  font-size: 12px;
}

.ranking-row:has(img) {
  grid-template-columns: 18px 28px minmax(0, 1fr) auto;
}

.ranking-row > span {
  color: #617099;
  font-weight: 850;
}

.ranking-row img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.ranking-row div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ranking-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.ranking-row i {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f49e7, #8b5cf6);
}

.ranking-row b {
  font-size: 11px;
  white-space: nowrap;
}

.command-timeline {
  display: grid;
  gap: 0;
}

.timeline-row {
  display: grid;
  grid-template-columns: 50px minmax(86px, .7fr) minmax(120px, 1fr) minmax(130px, 1.6fr);
  gap: 10px;
  align-items: center;
  min-height: 34px;
  min-width: 0;
  color: #24365f;
  font-size: 12px;
}

.timeline-row > * {
  min-width: 0;
}

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

.timeline-row time,
.timeline-row small {
  color: #617099;
  font-size: 11px;
}

.timeline-row b {
  text-align: right;
}

.activity-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 14px;
}

.activity-chart-panel {
  min-height: 285px;
}

.activity-bars {
  height: 210px;
  display: grid;
  grid-template-columns: repeat(12, minmax(16px, 1fr));
  gap: 8px;
  align-items: end;
  padding: 8px 0 0;
}

.activity-bar {
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 18px 16px;
  align-items: end;
  justify-items: center;
  color: #617099;
  font-size: 10px;
  font-weight: 800;
}

.activity-bar span {
  width: 100%;
  min-height: 8px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, #0f49e7, #8b5cf6);
}

.activity-bar b {
  color: #10204a;
  font-size: 10px;
}

.dense-table {
  table-layout: fixed;
}

.dense-table th,
.dense-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.alert-group {
  display: grid;
  gap: 12px;
}

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

.alert-card-list .action-card {
  height: auto;
  min-height: 148px;
}

.timeline-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 950;
}

.timeline-icon.blue { color: #0f49e7; background: #edf3ff; }
.timeline-icon.green,
.timeline-icon.teal { color: #16a34a; background: #eafaf2; }
.timeline-icon.orange { color: #f97316; background: #fff1e6; }

.performance-chart {
  min-height: 178px;
}

.chart-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 8px;
  color: #223766;
  font-size: 11px;
  font-weight: 800;
}

.performance-chart svg {
  width: 100%;
  height: 178px;
}

.performance-chart .grid-lines path {
  stroke: #edf1f8;
  stroke-width: 1;
}

.performance-chart .line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.performance-chart .line.blue { stroke: #0f49e7; }
.performance-chart .line.green { stroke: #16a34a; }
.performance-chart .line.orange { stroke: #f97316; }

.chain-panel {
  padding: 17px;
}

.chain-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(100px, 1fr) 22px) minmax(160px, .9fr);
  gap: 8px;
  align-items: center;
}

.chain-flow .chain-arrow:nth-last-child(2) {
  display: none;
}

.chain-step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 4px 9px;
  align-items: center;
  min-width: 0;
}

.chain-icon {
  grid-row: span 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #0f49e7;
  background: #edf3ff;
  font-weight: 950;
}

.chain-icon.green { color: #16a34a; background: #eafaf2; }
.chain-icon.orange { color: #f97316; background: #fff1e6; }
.chain-icon.violet { color: #7c3aed; background: #f3edff; }

.chain-step strong {
  color: #10204a;
  font-size: 21px;
}

.chain-step small {
  color: #617099;
  font-size: 11px;
}

.chain-step b {
  color: #10204a;
  font-size: 11px;
}

.chain-arrow {
  color: #9aa8c7;
  font-size: 22px;
}

.chain-efficiency {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 3px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dbe3f3;
  border-radius: 9px;
}

.chain-efficiency span,
.chain-efficiency small {
  color: #617099;
  font-size: 11px;
}

.chain-efficiency strong {
  color: #10204a;
  font-size: 26px;
}

.chain-efficiency .donut {
  grid-column: 2;
  grid-row: 1 / span 3;
}

@media (max-width: 1320px) {
  .dashboard-command-header {
    grid-template-columns: minmax(260px, 1fr) auto;
  }

  .dashboard-command-header .header-shortcut:not(.primary-shortcut),
  .dashboard-command-header .btn.secondary {
    display: none;
  }

  .command-hero {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .hero-alerts {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero-link {
    grid-column: 1 / -1;
  }

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

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

  .action-center {
    grid-column: 1 / -1;
  }

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

  .ranking-panel,
  .timeline-panel,
  .performance-panel {
    grid-column: auto;
  }

  .chain-flow {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 10px;
  }

  .chain-step {
    flex: 1 1 130px;
  }

  .chain-arrow {
    align-self: center;
  }

  .chain-efficiency {
    flex: 1 1 210px;
  }

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

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

.metric,
.panel,
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric {
  padding: 16px;
}

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

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
}

.panel {
  padding: 14px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.split {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

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

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

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  background: #f8fafc;
  white-space: normal;
}

td {
  overflow-wrap: anywhere;
}

tbody tr:hover {
  background: #fbfdff;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 700;
  background: var(--panel-soft);
  color: var(--ink);
  white-space: nowrap;
}

.status.ok {
  background: #dff3e7;
  color: #13583f;
}

.status.warn {
  background: #fff0d9;
  color: var(--warn);
}

.status.info {
  background: #e2edf8;
  color: var(--info);
}

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

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

.section-heading h2 {
  margin-bottom: 2px;
}

.list-panel {
  padding: 14px;
}

.filter-bar,
.filters {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.filter-main,
.filter-advanced {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.filter-advanced {
  display: none;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.filter-bar.show-advanced .filter-advanced {
  display: grid;
}

.filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
}

.filter-result-count {
  color: #475569;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.filter-chip-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.filter-chip {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid #dbe3f3;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 11px;
  font-weight: 750;
}

.pagination-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 2px 0;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.pagination-row > div {
  display: inline-flex;
  gap: 8px;
}

.filter-chip b {
  color: #10204a;
  font-weight: 950;
}

.product-search-filter {
  gap: 12px;
  padding: 12px;
}

.product-filter-top {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) repeat(3, minmax(160px, 1fr));
  gap: 8px;
  align-items: end;
}

.product-filter-section {
  display: grid;
  gap: 7px;
}

.product-filter-label {
  color: #324139;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.product-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f6;
}

.product-chip {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid #d7dee7;
  border-radius: 7px;
  background: #fff;
  color: #2c3948;
  font-weight: 800;
  white-space: nowrap;
}

.product-chip:hover {
  border-color: #9eb9f4;
  background: #f7fbff;
}

.product-chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.22);
}

.delivery-chip-group {
  background: #f5f7fa;
}

.product-range-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 10px;
}

.product-range {
  display: grid;
  gap: 10px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-range-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.product-range-head span {
  color: #324139;
  font-weight: 900;
}

.product-range-head strong {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.dual-range {
  position: relative;
  height: 34px;
  margin: 2px 8px 0;
  touch-action: none;
}

.dual-range-track,
.dual-range-fill {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 999px;
  transform: translateY(-50%);
}

.dual-range-track {
  background: #cbd5e1;
}

.dual-range-fill {
  right: auto;
  background: #22a34a;
}

.dual-range-thumb {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
}

.dual-range-thumb:active {
  cursor: grabbing;
}

.dual-range-thumb:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 3px;
}

.range-number-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.range-number-pair label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.range-number-pair input {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 12px;
}

.product-filter-extra-toggle {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.apportionment-grid,
.billing-grid {
  grid-template-columns: minmax(150px, 1fr) minmax(170px, 1fr) minmax(180px, 1fr);
}

.checkbox-list {
  display: grid;
  gap: 6px;
  max-height: 150px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.checkbox-list label {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 24px;
  font-size: 12px;
  color: var(--text);
}

.billing-allocation-list {
  grid-template-columns: 1fr;
  max-height: 220px;
}

.billing-allocation-list label {
  align-items: center;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
  line-height: 1.25;
}

.billing-allocation-list input {
  margin-top: 0;
}

.billing-allocation-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-invoice-table th:first-child,
.pending-invoice-table td:first-child {
  width: 54px;
  text-align: center;
}

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

.invoice-items-table th,
.invoice-items-table td {
  font-size: 12px;
}

.invoice-items-table .money-input {
  min-width: 0;
}

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

.attachment-actions .muted {
  margin-right: auto;
}

.sale-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 10px;
  background: #f8fafc;
}

.detail-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

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

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

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

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

.section-title-row label {
  margin: 0;
}

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

.allocation-editor,
.billing-editor {
  display: grid;
  gap: 10px;
}

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

.allocation-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(150px, 1fr) minmax(190px, 1.2fr) minmax(145px, 1fr) minmax(110px, .8fr) minmax(130px, .9fr) 34px;
  gap: 8px;
  align-items: end;
}

.billing-row-head {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(190px, 1.2fr) minmax(180px, 1fr) minmax(130px, .8fr) 34px;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}

.field.mini {
  margin: 0;
}

.field.mini label {
  font-size: 11px;
  margin-bottom: 4px;
}

.form-total-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.form-total-line strong {
  color: var(--text);
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.icon-btn.danger {
  color: #b42318;
}

@media (max-width: 980px) {
  .allocation-row,
  .billing-row-head {
    grid-template-columns: 1fr 1fr;
  }

  .invoice-group-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .allocation-row,
  .billing-row-head {
    grid-template-columns: 1fr;
  }

  .icon-btn {
    width: 100%;
  }
}

.filter-field,
.filters .field {
  display: grid;
  gap: 4px;
}

.filter-field span,
.filters label {
  color: #6b7787;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-field input,
.filter-field select,
.filters input,
.filters select {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 13px;
}

.filter-more {
  min-height: 32px;
  border-radius: 7px;
  padding: 0 10px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: 800;
  font-size: 12px;
}

.row-actions {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.row-actions-toggle {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #526071;
  background: transparent;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.row-actions-toggle:hover,
.row-actions.open .row-actions-toggle {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.row-actions-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  right: 0;
  min-width: 170px;
  display: none;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
}

.row-actions.open .row-actions-menu {
  display: grid;
  gap: 3px;
}

.row-actions-menu button {
  min-height: 32px;
  border-radius: 7px;
  padding: 0 9px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-weight: 650;
  font-size: 13px;
}

.row-actions-menu button:hover {
  background: var(--panel-soft);
}

.row-actions-menu button.danger {
  color: var(--danger);
}

.code-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.code-stack {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.code-stack span {
  display: flex;
  gap: 5px;
  align-items: center;
  white-space: normal;
  font-size: 12px;
  color: var(--muted);
}

.muted-input:disabled {
  color: var(--muted);
  background: var(--panel-soft);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  overflow: visible;
}

.modal-sm {
  width: min(520px, 100%);
}

.modal-md {
  width: min(760px, 100%);
}

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

.modal-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

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

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 24px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--ink);
  background: var(--panel-soft);
}

.modal-body {
  overflow-y: auto;
  overflow-x: visible;
  padding: 16px;
}

.modal-body.select-open,
.modal-body:has(.searchable-select.open) {
  padding-bottom: 280px;
}

.modal-body .form {
  margin-top: 0;
}

.sales-table {
  min-width: 980px;
  table-layout: fixed;
  font-size: 12px;
}

.sales-table th:nth-child(1),
.sales-table td:nth-child(1) { width: 10%; }
.sales-table th:nth-child(2),
.sales-table td:nth-child(2) { width: 10%; }
.sales-table th:nth-child(3),
.sales-table td:nth-child(3) { width: 16%; }
.sales-table th:nth-child(4),
.sales-table td:nth-child(4) { width: 20%; }
.sales-table th:nth-child(5),
.sales-table td:nth-child(5) { width: 12%; }
.sales-table th:nth-child(6),
.sales-table td:nth-child(6) { width: 16%; }
.sales-table th:nth-child(7),
.sales-table td:nth-child(7) { width: 9%; }
.sales-table th:nth-child(8),
.sales-table td:nth-child(8) { width: 7%; }

.sales-table td:first-child {
  min-width: 120px;
}

.sales-table td:first-child strong {
  display: block;
  margin-bottom: 4px;
}

.sale-date-under-status {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.sales-operational-table th:nth-child(1),
.sales-operational-table td:nth-child(1) { width: 12%; }
.sales-operational-table th:nth-child(2),
.sales-operational-table td:nth-child(2) { width: 20%; }
.sales-operational-table th:nth-child(3),
.sales-operational-table td:nth-child(3) { width: 24%; }
.sales-operational-table th:nth-child(4),
.sales-operational-table td:nth-child(4) { width: 14%; }
.sales-operational-table th:nth-child(5),
.sales-operational-table td:nth-child(5) { width: 12%; }
.sales-operational-table th:nth-child(6),
.sales-operational-table td:nth-child(6) { width: 12%; }
.sales-operational-table th:nth-child(7),
.sales-operational-table td:nth-child(7) { width: 6%; }

.commission-allocations-table th:nth-child(1),
.commission-allocations-table td:nth-child(1) { width: 11%; }
.commission-allocations-table th:nth-child(2),
.commission-allocations-table td:nth-child(2) { width: 10%; }
.commission-allocations-table th:nth-child(3),
.commission-allocations-table td:nth-child(3) { width: 15%; }
.commission-allocations-table th:nth-child(4),
.commission-allocations-table td:nth-child(4) { width: 15%; }
.commission-allocations-table th:nth-child(5),
.commission-allocations-table td:nth-child(5) { width: 12%; }
.commission-allocations-table th:nth-child(6),
.commission-allocations-table td:nth-child(6) { width: 13%; }
.commission-allocations-table th:nth-child(7),
.commission-allocations-table td:nth-child(7) { width: 7%; }
.commission-allocations-table th:nth-child(8),
.commission-allocations-table td:nth-child(8) { width: 10%; }
.commission-allocations-table th:nth-child(9),
.commission-allocations-table td:nth-child(9) { width: 10%; }

.apportionments-table th:nth-child(1),
.apportionments-table td:nth-child(1) { width: 12%; }
.apportionments-table th:nth-child(2),
.apportionments-table td:nth-child(2) { width: 10%; }
.apportionments-table th:nth-child(3),
.apportionments-table td:nth-child(3) { width: 18%; }
.apportionments-table th:nth-child(4),
.apportionments-table td:nth-child(4) { width: 23%; }
.apportionments-table th:nth-child(5),
.apportionments-table td:nth-child(5) { width: 12%; }
.apportionments-table th:nth-child(6),
.apportionments-table td:nth-child(6) { width: 11%; }
.apportionments-table th:nth-child(7),
.apportionments-table td:nth-child(7) { width: 9%; }
.apportionments-table th:nth-child(8),
.apportionments-table td:nth-child(8) { width: 5%; }

.pending-billing-table th:nth-child(1),
.pending-billing-table td:nth-child(1) { width: 6%; }
.pending-billing-table th:nth-child(2),
.pending-billing-table td:nth-child(2) { width: 11%; }
.pending-billing-table th:nth-child(3),
.pending-billing-table td:nth-child(3) { width: 11%; }
.pending-billing-table th:nth-child(4),
.pending-billing-table td:nth-child(4) { width: 27%; }
.pending-billing-table th:nth-child(5),
.pending-billing-table td:nth-child(5) { width: 18%; }
.pending-billing-table th:nth-child(6),
.pending-billing-table td:nth-child(6) { width: 17%; }
.pending-billing-table th:nth-child(7),
.pending-billing-table td:nth-child(7) { width: 10%; }

.pending-billing-table td:first-child,
.pending-invoice-table td:first-child {
  min-width: 56px;
}

.extra-invoices-table th:nth-child(1),
.extra-invoices-table td:nth-child(1) { width: 12%; }
.extra-invoices-table th:nth-child(2),
.extra-invoices-table td:nth-child(2) { width: 12%; }
.extra-invoices-table th:nth-child(3),
.extra-invoices-table td:nth-child(3) { width: 27%; }
.extra-invoices-table th:nth-child(4),
.extra-invoices-table td:nth-child(4) { width: 20%; }
.extra-invoices-table th:nth-child(5),
.extra-invoices-table td:nth-child(5) { width: 11%; }
.extra-invoices-table th:nth-child(6),
.extra-invoices-table td:nth-child(6) { width: 11%; }
.extra-invoices-table th:nth-child(7),
.extra-invoices-table td:nth-child(7) { width: 7%; }

.billing-apportionments-table th:nth-child(1),
.billing-apportionments-table td:nth-child(1) { width: 11%; }
.billing-apportionments-table th:nth-child(2),
.billing-apportionments-table td:nth-child(2) { width: 11%; }
.billing-apportionments-table th:nth-child(3),
.billing-apportionments-table td:nth-child(3) { width: 30%; }
.billing-apportionments-table th:nth-child(4),
.billing-apportionments-table td:nth-child(4) { width: 18%; }
.billing-apportionments-table th:nth-child(5),
.billing-apportionments-table td:nth-child(5) { width: 17%; }
.billing-apportionments-table th:nth-child(6),
.billing-apportionments-table td:nth-child(6) { width: 13%; }

.billing-apportionments-table .money-stack strong {
  color: var(--ink);
  font-size: 13px;
}

.billing-apportionments-table .money-stack small {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
}

.commission-payables-table th:nth-child(1),
.commission-payables-table td:nth-child(1) {
  width: 7%;
}

.commission-payables-table th:nth-child(2),
.commission-payables-table td:nth-child(2) {
  width: 11%;
}

.commission-payables-table th:nth-child(3),
.commission-payables-table td:nth-child(3) {
  width: 15%;
}

.commission-payables-table th:nth-child(4),
.commission-payables-table td:nth-child(4) {
  width: 18%;
}

.commission-payables-table th:nth-child(5),
.commission-payables-table td:nth-child(5) {
  width: 21%;
}

.commission-payables-table th:nth-child(6),
.commission-payables-table td:nth-child(6),
.commission-payables-table th:nth-child(7),
.commission-payables-table td:nth-child(7),
.commission-payables-table th:nth-child(8),
.commission-payables-table td:nth-child(8) {
  width: 9.33%;
}

.payments-table th:nth-child(1),
.payments-table td:nth-child(1) {
  width: 11%;
}

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

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

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

.payments-table th:nth-child(5),
.payments-table td:nth-child(5) {
  width: 11%;
}

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

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

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

.parties-stack span {
  align-items: flex-start;
}

.product-results-table {
  width: 100%;
  min-width: 980px;
}

.product-results-wrap {
  overflow-x: auto;
}

.product-results-table th,
.product-results-table td {
  vertical-align: middle;
}

.product-results-table .product-col {
  width: 19%;
}

.product-results-table .location-col {
  width: 14%;
}

.product-results-table .type-col {
  width: 16%;
}

.product-results-table .features-col {
  width: 12%;
}

.product-results-table .price-col {
  width: 12%;
}

.product-results-table .table-date-col {
  width: 12%;
}

.product-results-table .delivery-col {
  width: 6%;
}

.product-results-table .materials-col {
  width: 9%;
}

.product-results-table td:nth-child(1) .stack-cell strong,
.product-results-table td:nth-child(1) .stack-cell span,
.product-results-table td:nth-child(2) .stack-cell strong,
.product-results-table td:nth-child(2) .stack-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stack-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.stack-cell strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
}

.stack-cell span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.price-stack strong {
  color: #166534;
}

.drive-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 7px;
  opacity: 0.72;
}

.drive-link:hover {
  border-color: var(--line);
  background: #fff;
  opacity: 1;
}

.drive-link svg {
  width: 18px;
  height: 18px;
}

.drive-green {
  fill: #0f9d58;
}

.drive-yellow {
  fill: #f4b400;
}

.drive-blue {
  fill: #4285f4;
}

.unit-cell {
  min-width: 0;
  max-width: none;
}

.team-stack,
.money-stack,
.property-stack {
  display: grid;
  gap: 3px;
}

.team-stack span,
.money-stack span,
.property-stack span,
.property-stack small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.team-stack {
  min-width: 0;
  max-width: none;
}

.team-stack span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.property-stack {
  min-width: 0;
  max-width: none;
}

.property-stack strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.property-stack small {
  display: block;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.property-stack span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bulk-team-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.bulk-team-form select {
  min-height: 32px;
  max-width: 260px;
  font-size: 12px;
}

.coordination-bulk-form {
  align-items: stretch;
}

.coordination-bulk-form select {
  min-width: 180px;
}

.coordination-bulk-form input[type="date"] {
  min-height: 32px;
  max-width: 150px;
  font-size: 12px;
}

.assignments-group-table td {
  vertical-align: top;
}

.assignment-stack {
  display: grid;
  gap: 8px;
}

.assignment-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid #e5ebf6;
  border-radius: 8px;
  background: #f8fbff;
}

.assignment-line > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.assignment-line strong,
.assignment-line > div span,
.assignment-line small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.assignment-line strong {
  color: var(--ink);
  font-size: 12px;
}

.assignment-line > div span,
.assignment-line small {
  color: var(--muted);
  font-size: 11px;
}

.check-col {
  width: 34px;
  text-align: center;
}

.check-col input {
  width: 16px;
  height: 16px;
}

.money-stack strong {
  font-size: 13px;
}

.details-row td {
  padding: 0;
  background: #f8fafc;
}

.details-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 8px;
  padding: 12px;
}

.card {
  padding: 14px;
}

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

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

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

.fact {
  padding: 9px;
  border-radius: 8px;
  background: #f7f9fb;
}

.fact span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.fact strong {
  display: block;
  margin-top: 5px;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.message {
  min-height: 22px;
  color: var(--danger);
  font-weight: 700;
}

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

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

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  .app-header {
    position: static;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .dashboard-command-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .dashboard-sidebar {
    grid-column: 1;
    grid-row: 1;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #e1e7f3;
  }

  .dashboard-sidebar-brand {
    min-width: 210px;
  }

  .dashboard-collapse,
  .dashboard-ai-card {
    display: none;
  }

  .dashboard-nav-block {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    align-items: center;
  }

  .dashboard-nav-block small {
    display: none;
  }

  .dashboard-command-shell .app-header {
    grid-column: 1;
    grid-row: 2;
  }

  .dashboard-command-workspace {
    grid-column: 1;
    grid-row: 3;
  }

  .workspace-command-bar {
    position: static;
    grid-template-columns: 1fr;
  }

  .workspace-command-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-command-metrics,
  .reports-summary-metrics,
  .shortcut-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-command-lower,
  .reports-card-grid {
    grid-template-columns: 1fr;
  }

  .workspace-action-strip > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .module-nav {
    position: static;
    grid-row: 2;
  }

  .quick-sidebar {
    position: static;
    height: auto;
    grid-column: 1;
    grid-row: 3;
    grid-auto-flow: column;
    grid-auto-columns: minmax(56px, 1fr);
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    grid-column: 1;
    grid-row: 4;
  }

  .subnav {
    position: static;
    grid-template-columns: 1fr;
    padding: 10px 16px;
  }

  .login-brand {
    min-height: 330px;
    padding: 36px 24px;
  }

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

  .metrics,
  .metrics-six,
  .attention-grid,
  .operation-grid,
  .facts,
  .details-panel,
  .inline-form,
  .sale-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-main,
  .filter-advanced,
  .product-filter-top,
  .product-range-grid,
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-chip-list {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .content {
    padding: 16px;
  }

  .metrics,
  .metrics-six,
  .attention-grid,
  .operation-grid,
  .facts,
  .details-panel,
  .inline-form,
  .sale-form-grid,
  .workspace-command-metrics,
  .workspace-action-strip > div,
  .reports-summary-metrics,
  .reports-card-grid,
  .shortcut-grid,
  .quick-users,
  .filter-main,
  .filter-advanced,
  .product-filter-top,
  .product-range-grid,
  .filters {
    grid-template-columns: 1fr;
  }

  .product-filter-extra-toggle {
    justify-content: stretch;
  }

  .product-filter-extra-toggle button {
    flex: 1;
  }

  .topbar {
    flex-direction: column;
  }

  .modal-backdrop {
    align-items: stretch;
    padding: 10px;
  }

  .modal,
  .modal-sm,
  .modal-md,
  .modal-lg {
    width: 100%;
    max-height: calc(100vh - 20px);
    border-radius: 12px;
  }

  .modal-body {
    padding: 12px;
  }
}
