/* Urus CRM v1 — shared workspace components */

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

.field textarea,
.stack-form textarea,
.compact-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
}

.field textarea,
.stack-form textarea {
  min-height: 112px;
  padding: 13px 14px;
  line-height: 1.55;
  resize: vertical;
}

.field textarea:focus,
.stack-form textarea:focus,
.compact-field input:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(185, 101, 63, 0.1);
  outline: none;
}

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

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

.modal-note {
  margin: 0 0 22px;
  border-left: 3px solid var(--copper);
  padding: 12px 15px;
  background: #faf3ed;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.sidebar {
  overflow: hidden;
}

.side-nav {
  min-height: 0;
  margin-top: 32px;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
  scrollbar-width: thin;
}

.side-nav-section {
  display: block;
  margin: 16px 12px 5px;
  color: rgba(255, 255, 255, 0.28);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.side-nav-section:first-of-type {
  margin-top: 20px;
}

.side-nav-link {
  min-height: 40px;
  font-size: 12px;
}

.sidebar-foot {
  flex: 0 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 17px;
}

.link-button {
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 0;
  background: none;
  color: var(--copper-dark);
  cursor: pointer;
  font-size: 11px;
}

.link-button:hover {
  border-bottom-color: currentColor;
}

.muted {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.danger-text {
  color: var(--danger) !important;
}

.module-toolbar,
.detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.module-toolbar h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.module-toolbar .eyebrow {
  margin-bottom: 8px;
}

.toolbar-actions,
.detail-toolbar > div,
.view-switch,
.task-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.detail-toolbar > a,
.detail-toolbar a {
  color: var(--copper-dark);
  font-size: 12px;
  text-decoration: none;
}

.compact-field {
  display: grid;
  gap: 4px;
}

.compact-field span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compact-field input {
  min-height: 42px;
  padding: 0 11px;
}

.view-switch {
  border: 1px solid var(--line);
  padding: 3px;
  background: var(--paper-strong);
}

.view-switch button {
  min-height: 34px;
  border: 0;
  padding: 0 12px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
}

.view-switch button.is-active,
.view-switch button.active,
.view-switch button:hover {
  background: var(--ink);
  color: #fff;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 24px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.metrics-grid.compact {
  margin-bottom: 18px;
}

.crm-metric {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px;
  background: rgba(255, 253, 248, 0.68);
}

.metrics-grid.compact .crm-metric {
  min-height: 108px;
}

.crm-metric::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--line);
  content: "";
}

.crm-metric.tone-copper::after {
  background: var(--copper);
}
.crm-metric.tone-ink::after {
  background: var(--ink);
}
.crm-metric.tone-sage::after {
  background: var(--sage);
}
.crm-metric.tone-success::after {
  background: var(--success);
}

.crm-metric > span,
.crm-metric > strong,
.crm-metric > small {
  display: block;
}

.crm-metric > span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.crm-metric > strong {
  margin-top: 13px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 3vw, 38px);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.crm-metric > small {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10px;
}

.crm-panel {
  min-width: 0;
  border: 1px solid var(--line);
  padding: 22px;
  background: var(--paper-strong);
  box-shadow: 0 12px 32px rgba(35, 30, 24, 0.045);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: -3px 0 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 15px;
}

.panel-head span,
.panel-head h2 {
  display: block;
}

.panel-head span {
  color: var(--copper-dark);
  font-size: 8px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-head h2 {
  margin: 5px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 400;
}

.panel-head > a {
  color: var(--copper-dark);
  font-size: 10px;
  text-decoration: none;
}

.panel-head > b {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
}

.dashboard-hero {
  position: relative;
  display: flex;
  min-height: 245px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  overflow: hidden;
  margin-bottom: 25px;
  padding: clamp(28px, 5vw, 58px);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--sidebar);
  background-size: 38px 38px;
  color: #f8f4ec;
}

.dashboard-hero::after {
  position: absolute;
  right: 24%;
  bottom: -90px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  content: "";
  transform: rotate(27deg);
}

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

.dashboard-hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 5vw, 68px);
  font-weight: 400;
  letter-spacing: -0.045em;
}

.dashboard-hero p:last-child {
  max-width: 680px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  line-height: 1.6;
}

.dashboard-date {
  min-width: 180px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  padding-left: 22px;
}

.dashboard-date span,
.dashboard-date strong {
  display: block;
}

.dashboard-date span {
  color: rgba(255, 255, 255, 0.46);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.dashboard-date strong {
  margin-top: 7px;
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 400;
}

.dashboard-grid,
.analytics-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.panel-wide,
.settings-wide {
  grid-column: 1 / -1;
}

.pipeline-strip {
  display: grid;
  gap: 14px;
}

.pipeline-strip a {
  display: grid;
  gap: 7px;
  color: var(--ink);
  text-decoration: none;
}

.pipeline-strip a > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.pipeline-strip span {
  font-size: 11px;
}

.pipeline-strip strong {
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 400;
}

.pipeline-strip a > i {
  height: 4px;
  overflow: hidden;
  background: #ebe7df;
}

.pipeline-strip a > i > b {
  display: block;
  height: 100%;
  background: var(--status);
}

.attention-list,
.activity-feed,
.record-list,
.settings-list,
.compact-list,
.address-list,
.notes-list,
.people-list,
.timeline-list,
.money-list {
  display: grid;
}

.attention-list a,
.record-list a,
.settings-list article,
.compact-list article,
.people-list article,
.timeline-list article,
.money-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #e8e3da;
  padding: 12px 0;
  color: var(--ink);
  text-decoration: none;
}

.attention-list a:last-child,
.record-list a:last-child,
.settings-list article:last-child,
.compact-list article:last-child,
.people-list article:last-child,
.timeline-list article:last-child,
.money-list > div:last-child {
  border-bottom: 0;
}

.attention-list a > i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--danger);
}

.attention-list a > span,
.record-list a > div {
  min-width: 0;
  flex: 1;
}

.attention-list strong,
.attention-list small,
.record-list strong,
.record-list small,
.compact-list strong,
.compact-list small,
.settings-list strong,
.settings-list small {
  display: block;
}

.attention-list strong,
.record-list strong,
.compact-list strong,
.settings-list strong {
  font-size: 11px;
}

.attention-list small,
.record-list small,
.compact-list small,
.settings-list small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.attention-list em {
  color: var(--copper);
  font-style: normal;
}

.activity-feed article {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 11px;
  border-bottom: 1px solid #e8e3da;
  padding: 10px 0;
}

.activity-feed article:last-child {
  border-bottom: 0;
}
.activity-feed i {
  width: 6px;
  height: 6px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--sage);
}
.activity-feed strong,
.activity-feed span {
  display: block;
}
.activity-feed strong {
  font-size: 10px;
}
.activity-feed span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.empty-state {
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  padding: 25px;
  color: var(--ink-soft);
  text-align: center;
}

.empty-state > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--copper);
  font-family: Georgia, serif;
}

.empty-state h3 {
  margin: 13px 0 5px;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 400;
}

.empty-state p {
  max-width: 440px;
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
}

.page-loading,
.page-error {
  display: grid;
  min-height: 300px;
  place-items: center;
  align-content: center;
  color: var(--ink-soft);
  text-align: center;
}

.page-loading > span {
  width: 28px;
  height: 28px;
  border: 2px solid var(--line);
  border-top-color: var(--copper);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.page-loading p,
.page-error p {
  margin: 13px 0;
}

.page-error strong {
  color: var(--danger);
}

.crm-table,
.tasks-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.crm-table th,
.crm-table td,
.tasks-table th,
.tasks-table td {
  border-bottom: 1px solid #e7e3db;
  padding: 14px;
  text-align: left;
  vertical-align: middle;
}

.crm-table th,
.tasks-table th {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.crm-table td,
.tasks-table td {
  font-size: 11px;
}

.crm-table td > strong,
.crm-table td > small,
.tasks-table td > strong,
.tasks-table td > small {
  display: block;
}

.crm-table td > small,
.tasks-table td > small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.crm-table tbody tr:hover,
.tasks-table tbody tr:hover {
  background: #fbf8f2;
}

.entity-cell {
  display: flex;
  min-width: 205px;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.entity-cell > span {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 13px;
}

.entity-cell strong,
.entity-cell small,
.entity-title strong,
.entity-title small {
  display: block;
}

.entity-cell strong {
  font-size: 11px;
}
.entity-cell small,
.entity-title small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.crm-status {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--status) 35%, var(--line));
  padding: 0 9px;
  background: color-mix(in srgb, var(--status) 8%, white);
  color: var(--ink);
  font-size: 9px;
  white-space: nowrap;
}

.crm-status > i,
.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--status);
}

.crm-status small {
  color: var(--ink-soft);
}

.priority-tag {
  display: inline-block;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  font-size: 9px;
}

.priority-low {
  color: #64748b;
}
.priority-normal {
  color: var(--sage);
}
.priority-high {
  color: var(--copper-dark);
}
.priority-urgent {
  color: var(--danger);
  font-weight: 750;
}

.money-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  border-top: 1px solid var(--line);
  padding: 13px;
  color: var(--ink-soft);
  font-size: 10px;
}

.entity-hero,
.order-hero,
.production-hero,
.task-hero,
.payment-hero {
  position: relative;
  display: flex;
  min-height: 185px;
  align-items: center;
  gap: 24px;
  overflow: hidden;
  margin-bottom: 22px;
  padding: clamp(24px, 4vw, 44px);
  background: var(--sidebar);
  color: #fff;
}

.entity-hero::after,
.order-hero::after,
.production-hero::after,
.task-hero::after,
.payment-hero::after {
  position: absolute;
  right: -55px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  content: "";
  transform: rotate(26deg);
}

.entity-hero > *,
.order-hero > *,
.production-hero > *,
.task-hero > *,
.payment-hero > * {
  position: relative;
  z-index: 1;
}

.entity-monogram,
.production-index {
  display: grid;
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-family: Georgia, serif;
  font-size: 28px;
}

.production-index {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.production-index strong {
  font-size: 27px;
  font-weight: 400;
}

.entity-hero > div:nth-child(2),
.order-hero > div:first-child,
.production-hero > div:nth-child(2),
.task-hero > div:first-child,
.payment-hero > div:first-child {
  min-width: 0;
  flex: 1;
}

.entity-hero span,
.order-hero span,
.production-hero span,
.task-hero span,
.payment-hero span {
  color: rgba(255, 255, 255, 0.48);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.entity-hero h1,
.order-hero h1,
.production-hero h1,
.task-hero h1,
.payment-hero h1 {
  margin: 7px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.entity-hero p,
.order-hero p,
.production-hero p,
.task-hero p,
.payment-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
}

.order-hero a,
.production-hero a,
.payment-hero a {
  color: inherit;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 3px;
}

.entity-hero .crm-status,
.order-hero .crm-status,
.production-hero .crm-status,
.task-hero .crm-status,
.payment-hero .crm-status {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.detail-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 20px;
}

.detail-columns > main,
.detail-columns > aside {
  display: grid;
  align-content: start;
  gap: 20px;
}

.fact-list,
.fact-grid {
  margin: 0;
}

.fact-list > div,
.fact-grid > div {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) 1.3fr;
  gap: 15px;
  border-bottom: 1px solid #e8e3da;
  padding: 10px 0;
}

.fact-list > div:last-child,
.fact-grid > div:last-child {
  border-bottom: 0;
}
.fact-list dt,
.fact-grid dt {
  color: var(--ink-soft);
  font-size: 9px;
}
.fact-list dd,
.fact-grid dd {
  margin: 0;
  font-size: 11px;
  text-align: right;
  overflow-wrap: anywhere;
}

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

.notes-list article,
.address-list article {
  border-bottom: 1px solid #e8e3da;
  padding: 13px 0;
}

.address-list article {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.address-list article > div {
  min-width: 0;
}

.address-list small {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.5;
}

.notes-list article:last-child,
.address-list article:last-child {
  border-bottom: 0;
}
.notes-list article.is-pinned {
  border-left: 3px solid var(--copper);
  padding-left: 13px;
}
.notes-list header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.notes-list strong,
.address-list strong {
  font-size: 10px;
}
.notes-list time {
  color: var(--ink-soft);
  font-size: 9px;
}
.notes-list p,
.address-list p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.person-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 8px;
  letter-spacing: 0.06em;
}

.person-copy {
  min-width: 0;
  flex: 1;
}

.person-copy strong,
.person-copy small {
  display: block;
}

.person-copy strong {
  font-size: 10px;
}

.person-copy small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.order-items {
  display: grid;
}

.order-items > article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(155px, auto) auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #e8e3da;
  padding: 14px 0;
}

.order-items > article:last-child {
  border-bottom: 0;
}
.order-items h3,
.order-items p,
.order-items span {
  display: block;
}
.order-items h3 {
  margin: 4px 0 0;
  font-size: 12px;
}
.order-items p,
.order-items span,
.order-items dt {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}
.order-items dl,
.money-list {
  margin: 0;
}
.order-items dl > div {
  display: grid;
  gap: 4px;
  text-align: right;
}
.order-items dd {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.money-list > div {
  min-height: 42px;
}

.money-list dt,
.money-list dd {
  font-size: 10px;
}

.money-list dt {
  color: var(--ink-soft);
}

.money-list dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.money-list .total {
  font-weight: 750;
}

.order-status-box {
  display: grid;
  gap: 12px;
}

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

.long-copy {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.kanban-board {
  display: grid;
  grid-auto-columns: minmax(285px, 1fr);
  grid-auto-flow: column;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 16px;
  scroll-snap-type: x proximity;
}

.kanban-column {
  min-height: 470px;
  border-top: 3px solid var(--status);
  background: #ebe7de;
  scroll-snap-align: start;
}

.kanban-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #d8d3c9;
  padding: 15px;
}

.kanban-column > header h3 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 400;
}

.kanban-column > header span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  background: rgba(255, 255, 255, 0.7);
  font-family: ui-monospace, monospace;
  font-size: 9px;
}

.kanban-column > header > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.kanban-column > header > div > i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--status);
}

.kanban-column > header strong {
  overflow: hidden;
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-cards {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px;
}

.kanban-card,
.production-card {
  display: block;
  border: 1px solid #ddd7cc;
  padding: 15px;
  background: var(--paper-strong);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(35, 30, 24, 0.045);
  text-decoration: none;
}

.kanban-card:hover,
.production-card:hover {
  border-color: var(--copper);
  transform: translateY(-1px);
}

.kanban-card header,
.production-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.kanban-card header span,
.production-card header span {
  color: var(--ink-soft);
  font-family: ui-monospace, monospace;
  font-size: 9px;
}

.kanban-card h3,
.production-card h3 {
  margin: 0 0 8px;
  font-family: Georgia, serif;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.15;
}

.kanban-card p,
.production-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.kanban-card footer,
.production-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-top: 14px;
  border-top: 1px solid #e8e3da;
  padding-top: 10px;
  color: var(--ink-soft);
  font-size: 9px;
}

.kanban-empty {
  padding: 35px 12px;
  color: #92958f;
  font-size: 10px;
  text-align: center;
}

.production-board {
  grid-auto-columns: minmax(300px, 1fr);
}

.production-task {
  border-left: 3px solid var(--status, var(--sage));
  border-bottom: 1px solid #e8e3da;
  padding: 13px 0 13px 13px;
}

.production-task:last-child {
  border-bottom: 0;
}
.production-task header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.production-task h3 {
  margin: 0;
  font-size: 12px;
}
.production-task p {
  margin: 7px 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}
.production-task footer {
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 9px;
}

.task-progress {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  width: min(280px, 100%);
}

.task-progress > span {
  color: var(--ink-soft);
  font-size: 8px;
}

.task-progress > i {
  display: block;
  height: 5px;
  overflow: hidden;
  background: #e8e3da;
}

.task-progress > i > b {
  display: block;
  height: 100%;
  background: var(--copper);
}

.communication-feed {
  display: grid;
  gap: 12px;
}

.communication-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 17px;
  border: 1px solid var(--line);
  padding: 17px;
  background: var(--paper-strong);
}

.communication-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 18px;
}

.communication-card.channel-phone .communication-icon {
  background: var(--sage);
}
.communication-card.channel-wazzup .communication-icon,
.communication-card.channel-whatsapp .communication-icon {
  background: #397451;
}
.communication-card.channel-telegram .communication-icon {
  background: #477c99;
}

.communication-main header {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: space-between;
}

.communication-main header time {
  color: var(--ink-soft);
  font-size: 9px;
  white-space: nowrap;
}

.communication-main h3 {
  margin: 0;
  font-size: 12px;
}
.communication-main p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}
.communication-main small {
  display: block;
  margin-top: 7px;
  color: #92958f;
  font-size: 9px;
}
.communication-main footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 9px;
}

.communication-card > .table-action {
  align-self: start;
}
.communication-card > aside {
  text-align: right;
}
.communication-card > aside strong,
.communication-card > aside small {
  display: block;
}
.communication-card > aside strong {
  font-size: 10px;
}
.communication-card > aside small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
}

.recording-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--copper-dark);
  font-size: 9px;
  text-decoration: none;
}

.linked-entity {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  border-left: 3px solid var(--copper);
  padding: 12px 14px;
  background: #f3eee6;
  color: var(--ink);
  text-decoration: none;
}

.linked-entity span {
  color: var(--ink-soft);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.linked-entity strong {
  font-size: 11px;
}

.document-grid,
.integration-grid,
.status-settings,
.roles-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.document-card,
.integration-card,
.role-card,
.status-settings > article {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  padding: 20px;
  background: var(--paper-strong);
}

.document-card::before,
.integration-card::before,
.role-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--copper);
  content: "";
}

.document-card header,
.integration-card header,
.role-card header,
.status-settings article header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.document-card h3,
.integration-card h3,
.role-card h3,
.status-settings h3 {
  margin: 6px 0 0;
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 400;
}

.document-card > p,
.integration-card > p,
.role-card > p,
.status-settings article > p {
  min-height: 34px;
  margin: 14px 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

.document-card dl {
  display: grid;
  gap: 8px;
  margin: 0 0 15px;
}

.document-card dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 9px;
}

.document-card dt {
  color: var(--ink-soft);
}

.document-card dd {
  margin: 0;
  text-align: right;
}

.document-card footer,
.integration-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #e8e3da;
  padding-top: 13px;
}

.document-card footer span,
.document-card header span,
.integration-card header span {
  color: var(--ink-soft);
  font-size: 9px;
}

.integration-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-family: Georgia, serif;
}

.integration-card header > div:nth-child(2) {
  flex: 1;
}
.integration-card header > b {
  color: var(--ink-soft);
  font-size: 8px;
  text-transform: uppercase;
}
.integration-card.status-ready::before {
  background: var(--success);
}
.integration-card.status-warning::before {
  background: #b88a38;
}
.integration-card.status-error::before {
  background: var(--danger);
}
.integration-card.status-disabled::before {
  background: #8f9691;
}
.integration-card dl {
  margin: 0 0 16px;
}
.integration-card dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e8e3da;
  padding: 8px 0;
}
.integration-card dt,
.integration-card dd {
  font-size: 9px;
}
.integration-card dt {
  color: var(--ink-soft);
}
.integration-card dd {
  margin: 0;
  text-align: right;
}
.integration-error {
  color: var(--danger) !important;
}

.settings-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.settings-tabs button {
  min-height: 46px;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0 17px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 10px;
  white-space: nowrap;
}

.settings-tabs button.is-active,
.settings-tabs button.active,
.settings-tabs button:hover {
  border-bottom-color: var(--copper);
  color: var(--ink);
}

.settings-card {
  min-height: 230px;
}

.permission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 14px 0;
}

.permission-tags span {
  border: 1px solid var(--line);
  padding: 5px 7px;
  color: var(--ink-soft);
  font-size: 8px;
}

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

.permission-checkboxes label {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  padding: 11px;
  cursor: pointer;
}

.permission-checkboxes label:has(input:checked) {
  border-color: var(--copper);
  background: #fff8f3;
}

.permission-checkboxes strong,
.permission-checkboxes small {
  display: block;
}

.permission-checkboxes strong {
  font-size: 10px;
}
.permission-checkboxes small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 8px;
}
.permission-legend {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 10px;
}

.permission-legend span {
  border: 1px solid var(--line);
  padding: 5px 8px;
  background: var(--paper-strong);
}

.success-text {
  color: var(--success) !important;
}

.timeline-list article {
  align-items: flex-start;
  justify-content: flex-start;
}

.timeline-list article > i {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--status, var(--sage));
  box-shadow: 0 0 0 4px
    color-mix(in srgb, var(--status, var(--sage)) 16%, transparent);
}

.timeline-list article > div {
  display: grid;
  gap: 4px;
}

.timeline-list strong,
.timeline-list small {
  display: block;
}

.timeline-list strong {
  font-size: 10px;
}

.timeline-list small,
.timeline-list p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.45;
}

.webhook-pending {
  color: #8d6b28;
}
.webhook-processing {
  color: #477c99;
}
.webhook-processed {
  color: var(--success);
}
.webhook-failed {
  color: var(--danger);
}

.bar-chart {
  display: grid;
  gap: 14px;
}

.bar-chart > div {
  display: grid;
  grid-template-columns: minmax(100px, 0.7fr) minmax(100px, 2fr) 60px;
  align-items: center;
  gap: 12px;
}

.bar-chart span {
  color: var(--ink-soft);
  font-size: 10px;
}
.bar-chart i {
  height: 7px;
  overflow: hidden;
  background: #ebe7df;
}
.bar-chart b {
  display: block;
  height: 100%;
}
.bar-chart strong {
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 400;
  text-align: right;
}

.mini-columns {
  display: flex;
  height: 190px;
  align-items: end;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  padding-top: 10px;
}

.mini-columns > div {
  display: grid;
  min-width: 13px;
  height: 100%;
  grid-template-rows: 1fr 18px;
  align-items: end;
  gap: 5px;
}

.mini-columns i {
  display: block;
  min-height: 3px;
  background: var(--copper);
}
.mini-columns span {
  color: var(--ink-soft);
  font-size: 7px;
  text-align: center;
}

.analytics-table {
  display: grid;
}
.analytics-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(3, 0.7fr);
  gap: 12px;
  border-bottom: 1px solid #e8e3da;
  padding: 11px 0;
  font-size: 10px;
}
.analytics-row.head {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 1220px) {
  .document-grid,
  .integration-grid,
  .status-settings,
  .roles-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 980px) {
  .dashboard-grid,
  .analytics-grid,
  .settings-grid,
  .detail-columns {
    grid-template-columns: 1fr;
  }

  .panel-wide,
  .settings-wide {
    grid-column: auto;
  }
  .communication-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }
  .communication-card > aside {
    grid-column: 2;
    text-align: left;
  }
  .order-items > article {
    grid-template-columns: minmax(0, 1fr) minmax(145px, auto) auto;
  }
}

@media (max-width: 820px) {
  .side-nav {
    margin-top: 28px;
  }
  .module-toolbar,
  .detail-toolbar,
  .dashboard-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .dashboard-date {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 0;
    padding-top: 18px;
    padding-left: 0;
  }

  .entity-hero,
  .order-hero,
  .production-hero,
  .task-hero,
  .payment-hero {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .entity-hero > div:nth-child(2),
  .production-hero > div:nth-child(2) {
    min-width: calc(100% - 110px);
  }

  .fact-grid {
    grid-template-columns: 1fr;
  }
  .order-items > article {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .order-items .row-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .metrics-grid,
  .document-grid,
  .integration-grid,
  .status-settings,
  .roles-settings,
  .permission-checkboxes {
    grid-template-columns: 1fr;
  }

  .crm-metric {
    min-height: 100px;
  }
  .module-toolbar .button {
    width: 100%;
  }
  .toolbar-actions > * {
    flex: 1 1 150px;
  }
  .toolbar-actions .button {
    flex-basis: 100%;
  }
  .entity-hero,
  .order-hero,
  .production-hero,
  .task-hero,
  .payment-hero {
    padding: 24px;
  }
  .entity-monogram,
  .production-index {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    font-size: 22px;
  }
  .entity-hero > div:nth-child(2),
  .production-hero > div:nth-child(2) {
    min-width: calc(100% - 82px);
  }
  .communication-card {
    grid-template-columns: 1fr;
  }
  .communication-card > aside {
    grid-column: auto;
  }
  .communication-card > .table-action {
    justify-self: start;
  }
  .communication-icon {
    width: 42px;
    height: 42px;
  }
  .analytics-row {
    grid-template-columns: minmax(140px, 1.3fr) repeat(3, 0.6fr);
    min-width: 520px;
  }
  .analytics-table {
    overflow-x: auto;
  }
  .bar-chart > div {
    grid-template-columns: 90px 1fr 45px;
  }
  .detail-toolbar > div {
    width: 100%;
    flex-wrap: wrap;
  }
  .detail-toolbar .button {
    flex: 1;
  }
}
