:root {
  --bg: #0c0d0f;
  --surface: #131518;
  --surface-2: #181b1f;
  --surface-3: #1e2227;
  --line: #292d33;
  --line-strong: #353a42;
  --text: #f2f3f5;
  --text-soft: #c9cdd3;
  --muted: #8d949e;
  --accent: #8d9bff;
  --accent-strong: #7181f4;
  --accent-soft: rgba(141, 155, 255, .12);
  --success: #55c99a;
  --success-soft: rgba(85, 201, 154, .12);
  --warning: #e7b65f;
  --warning-soft: rgba(231, 182, 95, .12);
  --danger: #ef7f8d;
  --danger-soft: rgba(239, 127, 141, .12);
  --shadow: 0 18px 50px rgba(0, 0, 0, .18);
  --radius: 12px;
  --radius-small: 8px;
}

html[data-theme="light"] {
  --bg: #f4f4f1;
  --surface: #ffffff;
  --surface-2: #f7f7f4;
  --surface-3: #efefeb;
  --line: #dfdfda;
  --line-strong: #cecec7;
  --text: #17181a;
  --text-soft: #42464d;
  --muted: #747981;
  --accent: #5362d9;
  --accent-strong: #4351c2;
  --accent-soft: rgba(83, 98, 217, .10);
  --success: #278560;
  --success-soft: rgba(39, 133, 96, .10);
  --warning: #9b6a16;
  --warning-soft: rgba(155, 106, 22, .10);
  --danger: #bd4454;
  --danger-soft: rgba(189, 68, 84, .10);
  --shadow: 0 16px 45px rgba(26, 27, 29, .08);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
}

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

button,
a {
  color: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

::selection {
  color: white;
  background: var(--accent-strong);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 6px 26px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -.04em;
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 15px;
  letter-spacing: -.01em;
}

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

.sidebar nav {
  display: grid;
  gap: 3px;
}

.nav-label {
  margin: 18px 10px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.nav-item:hover {
  color: var(--text-soft);
  background: var(--surface-2);
}

.nav-item.is-active {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-2);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -1px;
  width: 3px;
  height: 17px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.nav-item span {
  min-width: 0;
  flex: 1;
}

.nav-item b {
  min-width: 22px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.side-plan {
  margin-top: auto;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.side-plan small,
.side-plan strong {
  display: block;
}

.side-plan small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.side-plan strong {
  margin: 7px 0 4px;
  font-size: 14px;
}

.side-plan p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.side-plan button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.side-user {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 9px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.side-user strong,
.side-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-user strong {
  font-size: 13px;
}

.side-user small {
  color: var(--muted);
  font-size: 11px;
}

.side-user button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}

.side-user button:hover {
  background: var(--surface-2);
  color: var(--danger);
}

.main-area {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.topbar > div:first-of-type {
  min-width: 0;
  margin-right: auto;
}

.topbar small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.topbar h1 {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-menu {
  display: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 20px;
}

.global-search {
  width: min(340px, 31vw);
  height: 39px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
}

.global-search:focus-within {
  border-color: var(--line-strong);
}

.global-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

kbd {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
}

.content {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 28px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: view-in .18s ease;
}

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

.hero {
  position: relative;
  min-height: 188px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.hero::before {
  content: "";
  position: absolute;
  top: 30px;
  bottom: 30px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.hero::after {
  content: "DD";
  position: absolute;
  right: 24px;
  top: -23px;
  color: var(--surface-2);
  font-size: 145px;
  font-weight: 900;
  letter-spacing: -.12em;
  line-height: 1;
  pointer-events: none;
}

.hero > div {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-head small,
.panel header small,
.modal header small,
.case-detail header small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero h2 {
  margin: 10px 0 9px;
  color: var(--text);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 720;
  letter-spacing: -.055em;
  line-height: 1.03;
}

.hero h2 em {
  color: var(--accent);
  font-style: normal;
}

.hero p {
  max-width: 610px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 8px;
}

.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

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

.btn.primary,
.btn.light {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: #101329;
}

html[data-theme="light"] .btn.primary,
html[data-theme="light"] .btn.light {
  color: white;
}

.btn.secondary,
.btn.outline-light {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

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

.btn.quiet:hover,
.btn.secondary:hover,
.btn.outline-light:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
}

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

.metrics article {
  min-height: 112px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metrics i {
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 15px;
  font-style: normal;
}

.metrics small,
.metrics strong,
.metrics p {
  display: block;
}

.metrics small {
  color: var(--muted);
  font-size: 12px;
}

.metrics strong {
  margin: 5px 0 2px;
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.04em;
}

.metrics p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

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

.grid.two {
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, .75fr);
}

.panel,
.news-card,
.case-card,
.table-wrap,
.pricing article,
.form-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel {
  padding: 19px;
}

.panel header,
.section-head,
.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel header {
  margin-bottom: 15px;
}

.panel h3,
.section-head h2 {
  margin: 4px 0 0;
  letter-spacing: -.03em;
}

.panel h3 {
  font-size: 16px;
}

.section-head {
  margin-bottom: 20px;
}

.section-head h2 {
  font-size: 27px;
}

.section-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.section-head.actions {
  align-items: flex-end;
}

.list,
.entity-list,
.quota-list {
  display: grid;
  gap: 8px;
}

.list-item,
.entity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.empty {
  padding: 38px 20px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.quota-item strong,
.quota-item span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.progress {
  height: 5px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.cards,
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}

.news-card,
.case-card {
  padding: 18px;
  transition: border-color .15s ease, transform .15s ease;
}

.news-card:hover,
.case-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.news-card time,
.case-card small {
  color: var(--muted);
  font-size: 11px;
}

.news-card p,
.case-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.case-card {
  cursor: pointer;
}

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

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.toolbar > input {
  min-width: 210px;
  flex: 1;
}

.toolbar input,
.toolbar select,
.form-grid input,
.form-grid select,
.form-stack input,
.form-stack select,
.form-stack textarea,
.modal input,
.modal select,
.modal textarea,
.case-detail input,
.case-detail select,
.case-detail textarea,
label > input,
label > select,
label > textarea {
  width: 100%;
  min-height: 40px;
  margin-top: 5px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  transition: border-color .15s ease, background .15s ease;
}

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

.toolbar input:focus,
.toolbar select:focus,
.modal input:focus,
.modal select:focus,
.modal textarea:focus,
.case-detail input:focus,
.case-detail select:focus,
.case-detail textarea:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-stack input:focus,
.form-stack select:focus,
.form-stack textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.tabs,
.detail-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.tabs button,
.detail-tabs button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tabs button.is-active,
.detail-tabs button.is-active {
  background: var(--surface-2);
  color: var(--text);
}

.tabs.compact {
  width: max-content;
}

.quota-banner {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
}

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

th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

td {
  color: var(--text-soft);
  font-size: 13px;
}

tbody tr:hover {
  background: var(--surface-2);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 11px;
  font-weight: 800;
}

.status.good {
  background: var(--success-soft);
  color: var(--success);
}

.status.bad {
  background: var(--danger-soft);
  color: var(--danger);
}

.row-actions {
  display: flex;
  gap: 5px;
}

.row-actions button {
  min-width: 29px;
  min-height: 29px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
}

.row-actions button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.form-panel {
  max-width: 900px;
  padding: 20px;
}

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

.form-grid label,
.form-stack label,
.modal label,
.case-detail label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.form-panel footer,
.modal footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.switch {
  width: 42px;
  height: 24px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}

.switch i {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .18s ease, background .18s ease;
}

.switch.on i {
  transform: translateX(17px);
  background: var(--accent);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.file-btn input {
  display: none;
}

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

.pricing article {
  padding: 22px;
}

.pricing article.accent {
  border-color: var(--accent);
}

.pricing > article > small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}

.pricing > article > strong {
  display: block;
  margin: 12px 0;
  font-size: 27px;
  letter-spacing: -.04em;
}

.pricing strong span {
  color: var(--muted);
  font-size: 12px;
}

.pricing ul {
  padding-left: 18px;
}

.pricing li {
  margin: 7px 0;
  color: var(--muted);
  font-size: 13px;
}

dialog {
  width: min(900px, 94vw);
  max-height: 92vh;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, .66);
}

/* Center the actual native dialogs, not only the inner form.
   In particular, the case dialog must share its width with .modal.small. */
dialog#shipment-dialog,
dialog#case-dialog {
  position: fixed;
  inset: 0;
  margin: auto !important;
  max-height: 92dvh;
}
dialog#shipment-dialog { width: min(900px, calc(100vw - 32px)); }
dialog#case-dialog { width: min(540px, calc(100vw - 32px)); }
dialog#case-dialog > .modal.small { width: 100%; }

.modal {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal.small {
  width: min(540px, 94vw);
}

.modal header,
.case-detail > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
}

.modal header h2,
.case-detail h2 {
  margin: 3px 0 0;
  font-size: 18px;
}

.modal header > button,
.close {
  width: 31px;
  height: 31px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 18px;
}

.modal-body {
  max-height: 68vh;
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 18px;
}

.modal fieldset {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.modal legend {
  padding: 0 6px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
}

.modal footer {
  margin: 0;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.input-action {
  display: flex;
}

.input-action input {
  border-radius: 8px 0 0 8px;
}

.input-action button {
  min-width: 40px;
  margin-top: 5px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: var(--surface-3);
  color: var(--text);
}

.drop {
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
}

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

.status-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.status-grid input {
  width: auto;
  min-height: auto;
  margin: 0;
}

.full-dialog {
  width: calc(100vw - 28px);
  height: calc(100vh - 28px);
  max-height: none;
}

.case-detail {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--bg);
}

.case-detail > header > div:last-child {
  display: flex;
  align-items: center;
  gap: 7px;
}

.detail-tabs {
  flex: 0 0 auto;
  overflow-x: auto;
  padding: 8px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
}

.case-detail > main {
  flex: 1;
  overflow: auto;
  padding: 18px;
}

.detail-panel {
  display: none;
}

.detail-panel.is-active {
  display: block;
}

.detail-head {
  margin-bottom: 12px;
}

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

.kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  gap: 10px;
  overflow-x: auto;
}

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

.kanban-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.kanban-column.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.kanban-list {
  display: grid;
  gap: 7px;
}

.kanban-card {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 13px;
}

.kanban-card:hover {
  border-color: var(--line-strong);
}

.calendar {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.calendar header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-day {
  min-height: 90px;
  padding: 7px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.is-today {
  background: var(--accent-soft);
  color: var(--text);
}

.calendar-event {
  display: block;
  margin-top: 4px;
  padding: 3px 5px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.document-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.document-card img,
.document-card iframe,
.document-card embed {
  width: 100%;
  height: 150px;
  border: 0;
  object-fit: cover;
  background: var(--surface-2);
}

.document-card > div {
  padding: 10px;
}

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: grid;
  gap: 8px;
}

.toast {
  width: min(340px, calc(100vw - 36px));
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-soft);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.toast.success {
  border-color: var(--success);
}

.toast.error {
  border-color: var(--danger);
}

.offline {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 90;
  transform: translateX(-50%);
  padding: 8px 12px;
  border: 1px solid var(--warning);
  border-radius: 8px;
  background: var(--surface);
  color: var(--warning);
  font-size: 12px;
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 204px minmax(0, 1fr);
  }

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

  .grid.two,
  .pricing {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .workspace {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-102%);
    width: 224px;
    box-shadow: var(--shadow);
    transition: transform .2s ease;
  }

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

  .mobile-menu {
    display: inline-grid;
    place-items: center;
  }

  .topbar {
    padding: 0 16px;
  }

  .global-search {
    width: 39px;
  }

  .global-search input,
  .global-search kbd {
    display: none;
  }

  .content {
    padding: 18px;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px;
  }

  .hero::after {
    display: none;
  }

  .section-head.actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .topbar h1 {
    max-width: 180px;
  }

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

  .hero-actions,
  .button-row {
    width: 100%;
  }

  .hero-actions .btn,
  .button-row .btn {
    flex: 1;
  }

  .section-head h2 {
    font-size: 23px;
  }

  .full-dialog {
    width: 100vw;
    height: 100vh;
  }

  .case-detail,
  .modal {
    border-radius: 0;
  }

  .case-detail > header {
    align-items: flex-start;
    flex-direction: column;
  }
}

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