:root {
  --green-950: #0d3c21;
  --green-800: #176b34;
  --green-700: #1c823c;
  --green-600: #249b45;
  --green-500: #2fb356;
  --green-100: #dff5e6;
  --green-50: #f2fbf5;
  --ink-950: #15201a;
  --ink-800: #344039;
  --ink-700: #4d5a51;
  --ink-600: #657168;
  --ink-500: #7d8880;
  --line: #dfe6e1;
  --line-soft: #edf1ee;
  --surface: #ffffff;
  --surface-2: #f7f9f7;
  --surface-3: #eef3ef;
  --danger: #d84d5d;
  --danger-soft: #fff0f2;
  --warning: #d98d15;
  --warning-soft: #fff7e6;
  --info: #267ca8;
  --info-soft: #eaf7fd;
  --purple: #6957b6;
  --purple-soft: #f0edff;
  --shadow-sm: 0 1px 2px rgb(20 38 27 / 6%), 0 5px 18px rgb(20 38 27 / 5%);
  --shadow-md: 0 14px 38px rgb(17 40 25 / 13%);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --sidebar: 238px;
  --topbar: 72px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink-950);
  background: var(--surface-2);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--surface-2);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgb(36 155 69 / 2.5%) 25%, transparent 25%) 0 0 / 42px
      42px,
    var(--surface-2);
}

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

button,
a,
select,
input[type="checkbox"] {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  outline-offset: 3px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgb(36 155 69 / 22%);
  border-color: var(--green-600);
}

a {
  color: inherit;
  text-decoration: none;
}

.noscript {
  padding: 1rem;
  color: white;
  text-align: center;
  background: var(--danger);
}

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

.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  color: #dce9df;
  background:
    radial-gradient(circle at 20% 8%, rgb(73 193 102 / 18%), transparent 30%),
    var(--green-950);
  border-right: 1px solid rgb(255 255 255 / 5%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 6px 16px;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  color: var(--green-950);
  font-weight: 900;
  font-size: 20px;
  background: linear-gradient(145deg, #89e09e, #42bf66);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 35%);
}

.brand-copy strong {
  display: block;
  color: white;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.brand-copy span {
  display: block;
  margin-top: 2px;
  color: #9db4a4;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.side-nav-label {
  margin: 10px 12px 5px;
  color: #809789;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  color: #b9cbbf;
  font-size: 14px;
  font-weight: 650;
  border-radius: 10px;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.nav-link:hover {
  color: white;
  background: rgb(255 255 255 / 7%);
  transform: translateX(2px);
}

.nav-link.active {
  color: white;
  background: linear-gradient(100deg, var(--green-600), #37af59);
  box-shadow: 0 8px 22px rgb(0 0 0 / 17%);
}

.nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  font-size: 15px;
}

.nav-badge {
  min-width: 22px;
  margin-left: auto;
  padding: 2px 6px;
  color: var(--green-950);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  background: #87dda0;
  border-radius: 999px;
}

.sidebar-card {
  padding: 13px;
  color: #a9bbae;
  font-size: 11px;
  line-height: 1.45;
  background: rgb(255 255 255 / 6%);
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 12px;
}

.sidebar-card strong {
  display: block;
  margin-bottom: 3px;
  color: white;
  font-size: 12px;
}

.app-column {
  min-width: 0;
  grid-column: 2;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  height: var(--topbar);
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  background: rgb(255 255 255 / 94%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.mobile-menu {
  display: none;
}

.global-search {
  position: relative;
  width: min(420px, 42vw);
}

.global-search::before {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--ink-500);
  content: "⌕";
  font-size: 22px;
  transform: translateY(-54%);
}

.global-search input {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 43px;
  color: var(--ink-950);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.global-search input::placeholder {
  color: #98a29b;
}

.demo-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 7px 11px;
  color: var(--green-800);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--green-50);
  border: 1px solid #caead3;
  border-radius: 999px;
  text-transform: uppercase;
}

.demo-chip::before {
  width: 7px;
  height: 7px;
  content: "";
  background: var(--green-500);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgb(47 179 86 / 12%);
}

.topbar-action {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  color: var(--ink-600);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
}

.topbar-action:hover {
  color: var(--green-800);
  background: var(--green-50);
  border-color: #d8eedf;
}

.user-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: white;
  font-size: 12px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--green-700), #4bb96a);
  border: 3px solid #e4f5e9;
  border-radius: 50%;
}

.main-content {
  min-height: calc(100vh - var(--topbar));
  padding: 28px;
}

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

.eyebrow {
  margin: 0 0 5px;
  color: var(--green-700);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  color: var(--ink-950);
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.page-description {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--ink-600);
  font-size: 14px;
  line-height: 1.55;
}

.page-actions,
.toolbar,
.segmented,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--ink-800);
  font-size: 13px;
  font-weight: 750;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 1px 1px rgb(20 38 27 / 3%);
  cursor: pointer;
  transition:
    border 140ms ease,
    background 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.btn:hover {
  color: var(--green-800);
  background: var(--green-50);
  border-color: #b9dec4;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  border-color: var(--green-600);
  box-shadow: 0 8px 18px rgb(36 155 69 / 20%);
}

.btn-primary:hover {
  color: white;
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  border-color: var(--green-700);
}

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

.btn-quiet {
  color: var(--ink-600);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

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

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--ink-600);
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--green-800);
  background: var(--green-50);
  border-color: #c9e6d1;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.status-card {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.status-card:hover {
  border-color: #b9d9c1;
}

.status-card.active {
  background: var(--green-50);
  border-color: #acd9b9;
  box-shadow: inset 0 0 0 1px #cdebd5;
}

.status-card span {
  color: var(--ink-600);
  font-size: 11px;
  font-weight: 750;
}

.status-card strong {
  color: var(--ink-950);
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-title {
  margin: 0;
  color: var(--ink-950);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.panel-subtitle {
  margin: 3px 0 0;
  color: var(--ink-500);
  font-size: 11px;
}

.table-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.control,
.table-search,
.field {
  min-height: 38px;
  padding: 8px 11px;
  color: var(--ink-950);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-search {
  width: min(260px, 40vw);
  padding-left: 12px;
}

.control {
  cursor: pointer;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

.data-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 13px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-soft);
}

.data-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  color: var(--ink-600);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.055em;
  background: #fafcfb;
  text-transform: uppercase;
  cursor: pointer;
}

.data-table th.no-sort {
  cursor: default;
}

.data-table td {
  color: var(--ink-800);
  font-size: 12px;
}

.data-table tbody tr {
  transition: background 120ms ease;
}

.data-table tbody tr:hover {
  background: var(--green-50);
}

.data-table tbody tr.selected {
  background: #e9f7ed;
}

.lead-name {
  display: block;
  max-width: 220px;
  overflow: hidden;
  color: var(--ink-950);
  font-weight: 760;
  text-overflow: ellipsis;
}

.lead-meta {
  display: block;
  max-width: 220px;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 10px;
  text-overflow: ellipsis;
}

.open-lead {
  cursor: pointer;
}

.open-lead:hover .lead-name {
  color: var(--green-700);
}

.assignee {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mini-avatar {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  color: var(--green-800);
  font-size: 9px;
  font-weight: 850;
  background: var(--green-100);
  border-radius: 50%;
}

.status-select {
  max-width: 145px;
  min-height: 30px;
  padding: 4px 8px;
  color: var(--ink-800);
  font-size: 11px;
  font-weight: 750;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
}

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

.pill.new {
  color: var(--info);
  background: var(--info-soft);
}

.pill.in-progress {
  color: var(--purple);
  background: var(--purple-soft);
}

.pill.quoted {
  color: var(--warning);
  background: var(--warning-soft);
}

.pill.customer {
  color: var(--green-800);
  background: var(--green-100);
}

.pill.not-interested,
.pill.lost {
  color: var(--danger);
  background: var(--danger-soft);
}

.tag-list {
  display: flex;
  max-width: 180px;
  gap: 4px;
  overflow: hidden;
}

.tag {
  padding: 2px 6px;
  color: var(--green-800);
  font-size: 9px;
  font-weight: 750;
  background: var(--green-50);
  border: 1px solid #d5ebdb;
  border-radius: 999px;
}

.value {
  color: var(--ink-950);
  font-variant-numeric: tabular-nums;
  font-weight: 720;
}

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

.table-footer {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 16px;
  color: var(--ink-500);
  font-size: 11px;
}

.pagination {
  display: flex;
  gap: 5px;
}

.page-btn {
  display: grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  color: var(--ink-600);
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.page-btn.active {
  color: white;
  background: var(--green-600);
  border-color: var(--green-600);
}

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

.empty-state {
  padding: 55px 24px;
  color: var(--ink-500);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-800);
}

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  color: var(--green-950);
  font-size: 12px;
  font-weight: 700;
  background: var(--green-100);
  border-bottom: 1px solid #c5e6ce;
}

.bulk-bar .control {
  min-height: 32px;
  padding-block: 4px;
  font-size: 11px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(240px, 1fr));
  gap: 12px;
  padding: 16px;
  overflow: auto;
}

.kanban-column {
  min-height: 430px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.kanban-column.drag-over {
  background: var(--green-50);
  border-color: var(--green-500);
  box-shadow: inset 0 0 0 2px rgb(36 155 69 / 13%);
}

.kanban-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 3px 11px;
  color: var(--ink-800);
  font-size: 12px;
  font-weight: 850;
}

.kanban-count {
  display: grid;
  min-width: 23px;
  height: 23px;
  place-items: center;
  color: var(--ink-600);
  font-size: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.kanban-card {
  margin-bottom: 8px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 2px 7px rgb(20 38 27 / 4%);
  cursor: grab;
}

.kanban-card:hover {
  border-color: #b9dcc2;
  box-shadow: var(--shadow-sm);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card strong {
  display: block;
  color: var(--ink-950);
  font-size: 12px;
}

.kanban-card p {
  margin: 5px 0 10px;
  color: var(--ink-500);
  font-size: 10px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-500);
  font-size: 9px;
}

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

.kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 130px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.kpi-card::after {
  position: absolute;
  width: 100px;
  height: 100px;
  right: -35px;
  bottom: -42px;
  content: "";
  background: var(--green-100);
  border-radius: 50%;
}

.kpi-label {
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 750;
}

.kpi-value {
  display: block;
  margin: 13px 0 8px;
  color: var(--ink-950);
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.045em;
}

.kpi-trend {
  color: var(--green-700);
  font-size: 10px;
  font-weight: 700;
}

.dashboard-grid,
.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(310px, 0.7fr);
  gap: 16px;
}

.panel-body {
  padding: 16px;
}

.bar-list {
  display: grid;
  gap: 13px;
}

.bar-row {
  display: grid;
  grid-template-columns: 130px minmax(80px, 1fr) 54px;
  align-items: center;
  gap: 10px;
}

.bar-row-label {
  overflow: hidden;
  color: var(--ink-600);
  font-size: 11px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  background: var(--surface-3);
  border-radius: 999px;
}

.bar-fill {
  height: 100%;
  min-width: 3px;
  background: linear-gradient(90deg, var(--green-600), #61c67b);
  border-radius: 999px;
  transition: width 260ms ease;
}

.bar-fill.secondary {
  background: linear-gradient(90deg, #387da4, #72b4d4);
}

.bar-fill.warning {
  background: linear-gradient(90deg, #d78c17, #f1ba56);
}

.bar-value {
  color: var(--ink-800);
  text-align: right;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.follow-up-list,
.activity-list {
  display: grid;
  gap: 2px;
}

.follow-up-item,
.activity-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line-soft);
}

.follow-up-item:last-child,
.activity-item:last-child {
  border-bottom: 0;
}

.item-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--green-800);
  font-size: 12px;
  font-weight: 850;
  background: var(--green-100);
  border-radius: 9px;
}

.item-copy {
  min-width: 0;
}

.item-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink-800);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-copy span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.due {
  color: var(--danger);
  font-size: 9px;
  font-weight: 800;
}

.report-filters {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: #fafcfb;
  border-bottom: 1px solid var(--line-soft);
}

.mini-field {
  display: grid;
  gap: 5px;
}

.mini-field label {
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mini-field input,
.mini-field select {
  min-height: 36px;
  padding: 6px 9px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.source-table {
  width: 100%;
  border-collapse: collapse;
}

.source-table th,
.source-table td {
  padding: 10px 7px;
  text-align: left;
  font-size: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.source-table th {
  color: var(--ink-500);
  font-size: 9px;
  text-transform: uppercase;
}

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

.integration-card {
  position: relative;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

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

.integration-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--green-800);
  font-size: 16px;
  font-weight: 900;
  background: var(--green-100);
  border-radius: 12px;
}

.integration-card h3 {
  margin: 14px 0 4px;
  font-size: 15px;
}

.integration-card p {
  min-height: 42px;
  margin: 0 0 14px;
  color: var(--ink-600);
  font-size: 11px;
  line-height: 1.5;
}

.connection-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  color: var(--green-800);
  font-size: 9px;
  font-weight: 850;
  background: var(--green-50);
  border-radius: 999px;
}

.connection-state::before {
  width: 6px;
  height: 6px;
  content: "";
  background: var(--green-500);
  border-radius: 50%;
}

.connection-state.planned {
  color: var(--warning);
  background: var(--warning-soft);
}

.connection-state.planned::before {
  background: var(--warning);
}

.integration-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.meta-box {
  padding: 9px;
  background: var(--surface-2);
  border-radius: 8px;
}

.meta-box span {
  display: block;
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.meta-box strong {
  display: block;
  margin-top: 4px;
  color: var(--ink-800);
  font-size: 11px;
}

.quality-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  color: #725016;
  background: var(--warning-soft);
  border: 1px solid #f3dfb2;
  border-radius: var(--radius);
}

.quality-score {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  color: #8d5d0f;
  font-size: 13px;
  font-weight: 900;
  background: #ffe9b8;
  border-radius: 50%;
}

.quality-banner strong {
  display: block;
  font-size: 12px;
}

.quality-banner p {
  margin: 3px 0 0;
  font-size: 10px;
  line-height: 1.45;
}

.overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  background: rgb(8 22 13 / 47%);
  backdrop-filter: blur(3px);
  animation: fade-in 140ms ease;
}

.modal {
  position: fixed;
  z-index: 101;
  top: 50%;
  left: 50%;
  width: min(720px, calc(100vw - 34px));
  max-height: calc(100vh - 42px);
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 30px 90px rgb(4 22 10 / 28%);
  transform: translate(-50%, -50%);
  animation: pop-in 180ms ease;
}

.modal.wide {
  width: min(960px, calc(100vw - 34px));
}

.modal-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  background: rgb(255 255 255 / 96%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.modal-body {
  padding: 18px;
}

.modal-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 18px;
  background: rgb(255 255 255 / 96%);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

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

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

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

.form-field label {
  color: var(--ink-600);
  font-size: 10px;
  font-weight: 800;
}

.form-field label .required {
  color: var(--danger);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink-950);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form-field textarea {
  min-height: 92px;
  resize: vertical;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-600);
  font-size: 11px;
}

.drawer {
  position: fixed;
  z-index: 102;
  inset: 0 0 0 auto;
  width: min(720px, 94vw);
  overflow: auto;
  background: white;
  box-shadow: -24px 0 70px rgb(7 28 13 / 20%);
  animation: slide-in 210ms ease;
}

.drawer-head {
  position: sticky;
  z-index: 4;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 22px;
  color: white;
  background:
    radial-gradient(circle at 80% 15%, rgb(255 255 255 / 12%), transparent 28%),
    var(--green-800);
}

.drawer-head h2 {
  margin: 3px 0 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.drawer-id {
  color: #bae0c4;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-actions .icon-button {
  color: white;
  background: rgb(255 255 255 / 9%);
  border-color: rgb(255 255 255 / 15%);
}

.drawer-tabs {
  position: sticky;
  z-index: 3;
  top: 84px;
  display: flex;
  gap: 2px;
  padding: 8px 14px 0;
  overflow: auto;
  background: white;
  border-bottom: 1px solid var(--line);
}

.drawer-tab {
  min-height: 40px;
  padding: 0 11px;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.drawer-tab.active {
  color: var(--green-800);
  border-color: var(--green-600);
}

.drawer-body {
  padding: 20px 22px 80px;
}

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

.detail-card {
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

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

.detail-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-card strong,
.detail-card p {
  margin: 0;
  color: var(--ink-800);
  font-size: 11px;
  line-height: 1.5;
}

.detail-section {
  margin-top: 22px;
}

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

.detail-section h3 {
  margin: 0;
  font-size: 13px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 12px;
  padding-left: 18px;
}

.timeline::before {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 5px;
  width: 1px;
  content: "";
  background: #cee3d4;
}

.timeline-item {
  position: relative;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 9px;
}

.timeline-item::before {
  position: absolute;
  top: 15px;
  left: -17px;
  width: 9px;
  height: 9px;
  content: "";
  background: var(--green-600);
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #aed7b9;
}

.timeline-item strong {
  display: block;
  color: var(--ink-800);
  font-size: 10px;
}

.timeline-item p {
  margin: 3px 0 0;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.4;
}

.list-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 9px;
}

.list-card + .list-card {
  margin-top: 8px;
}

.list-card strong {
  display: block;
  font-size: 11px;
}

.list-card p {
  margin: 4px 0 0;
  color: var(--ink-500);
  font-size: 9px;
}

.filter-drawer {
  position: fixed;
  z-index: 103;
  inset: 0 0 0 auto;
  width: min(390px, 94vw);
  padding: 20px;
  overflow: auto;
  background: white;
  box-shadow: -24px 0 70px rgb(7 28 13 / 20%);
  animation: slide-in 210ms ease;
}

.filter-drawer h2 {
  margin: 0 0 5px;
  font-size: 20px;
}

.filter-drawer > p {
  margin: 0 0 20px;
  color: var(--ink-500);
  font-size: 11px;
}

.filter-drawer .form-field {
  margin-bottom: 13px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  min-width: 190px;
  padding: 5px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow-md);
}

.dropdown-menu button {
  padding: 9px 10px;
  color: var(--ink-700);
  text-align: left;
  font-size: 11px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.dropdown-menu button:hover {
  color: var(--green-800);
  background: var(--green-50);
}

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

.toast-root {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  max-width: 390px;
  padding: 12px 14px;
  color: white;
  font-size: 11px;
  font-weight: 700;
  background: var(--green-950);
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  animation: toast-in 180ms ease;
}

.toast.error {
  background: #842d38;
}

.loading-state {
  display: grid;
  min-height: 60vh;
  place-items: center;
  align-content: center;
  color: var(--ink-500);
  font-size: 12px;
}

.loading-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: white;
  font-size: 22px;
  font-weight: 900;
  background: var(--green-600);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgb(36 155 69 / 22%);
}

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

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.98);
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 1260px) {
  .status-strip {
    grid-template-columns: repeat(3, 1fr);
  }

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

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

  .app-shell {
    display: block;
  }

  .sidebar {
    width: 238px;
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

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

  .app-column {
    grid-column: auto;
  }

  .mobile-menu {
    display: grid;
  }

  .dashboard-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

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

  .topbar {
    padding-inline: 18px;
  }

  .main-content {
    padding: 22px 18px;
  }
}

@media (max-width: 680px) {
  .topbar {
    gap: 9px;
  }

  .global-search {
    width: 100%;
  }

  .demo-chip,
  .topbar-action.optional,
  .user-avatar {
    display: none;
  }

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

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
  }

  .status-strip {
    display: flex;
    padding-bottom: 6px;
    overflow: auto;
  }

  .status-card {
    min-width: 135px;
  }

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

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .table-controls {
    width: 100%;
  }

  .table-search {
    width: 100%;
  }

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

  .form-field.full,
  .detail-card.full {
    grid-column: auto;
  }

  .modal-body {
    padding: 14px;
  }

  .drawer-body {
    padding-inline: 15px;
  }

  .drawer-tabs {
    top: 86px;
  }

  .bar-row {
    grid-template-columns: 90px minmax(70px, 1fr) 43px;
  }

  .integration-meta {
    grid-template-columns: 1fr;
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
