:root {
  --paper: #f3f5f7;
  --surface: #ffffff;
  --surface-subtle: #fbfcfd;
  --ink: #1a232c;
  --muted: #5d6671;
  --line: #d9e0e7;
  --line-soft: #edf1f5;
  --primary: #23303b;
  --secondary: #164f8f;
  --secondary-dark: #123d70;
  --accent: #aa622e;
  --blue-soft: #e9f1fa;
  --amber-soft: #f4e7dc;
  --green: #2f6d51;
  --red: #9f2d20;
  --shadow: 0 1px 2px rgba(24, 38, 55, 0.04), 0 14px 32px rgba(24, 38, 55, 0.045);
  --shadow-tight: 0 1px 2px rgba(24, 38, 55, 0.04), 0 8px 18px rgba(24, 38, 55, 0.04);
  --radius: 8px;
  --topbar-offset: 60px;
  color: var(--ink);
  font-family: Aptos, "Segoe UI", Inter, Arial, sans-serif;
  font-feature-settings: "tnum" on, "lnum" on;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0) 260px),
    var(--paper);
  color: var(--ink);
  margin: 0;
  min-width: 320px;
}

a {
  color: inherit;
}

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

button {
  cursor: pointer;
}

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

.topbar {
  align-items: center;
  background: rgba(247, 249, 251, 0.92);
  border-bottom: 1px solid rgba(217, 224, 231, 0.82);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(220px, 1fr) auto minmax(180px, auto);
  padding: 12px clamp(16px, 4vw, 46px);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 14px;
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  max-height: 34px;
  max-width: 190px;
  object-fit: contain;
}

.nav {
  align-items: center;
  display: flex;
  gap: 4px;
}

.nav a {
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  min-height: 36px;
  padding: 8px 13px;
  text-decoration: none;
}

.nav a.active,
.nav a:hover {
  background: var(--blue-soft);
  color: var(--secondary);
}

.button.ghost.active {
  background: var(--blue-soft);
  border-color: #c7d9ec;
  color: var(--secondary);
}

.user-pill {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  justify-self: end;
  max-width: 280px;
  overflow: hidden;
  padding: 8px 12px;
  box-shadow: 0 1px 2px rgba(24, 38, 55, 0.04);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page {
  display: grid;
  gap: 14px;
  margin: 0 auto;
  max-width: 1480px;
  padding: 20px clamp(16px, 4vw, 46px) 52px;
}

.page > *,
.toolbar > *,
.calendar-title > *,
.calendar-controls > *,
.kpi-grid > *,
.admin-grid > *,
.detail-grid > * {
  min-width: 0;
}

.page-head {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: var(--primary);
  font-size: 28px;
  letter-spacing: 0;
  line-height: 1.1;
}

h2 {
  color: var(--primary);
  font-size: 18px;
  letter-spacing: 0;
}

h3 {
  color: var(--primary);
  font-size: 16px;
}

.page-head p,
.muted,
.fineprint {
  color: var(--muted);
  line-height: 1.45;
}

.button,
.icon-button {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  text-align: center;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.button.primary {
  background: var(--secondary);
  border-color: var(--secondary);
  box-shadow: 0 8px 16px rgba(22, 79, 143, 0.14);
  color: #fff;
}

.button.primary:hover {
  background: var(--secondary-dark);
  box-shadow: 0 10px 24px rgba(18, 61, 112, 0.22);
}

.button:active,
.icon-button:active {
  transform: translateY(1px);
}

.button.ghost,
.icon-button {
  background: rgba(255, 255, 255, 0.88);
  color: var(--primary);
}

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

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

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

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

.section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--secondary);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(24, 38, 55, 0.04);
  padding: 13px 15px;
}

.kpi strong {
  color: var(--primary);
  display: block;
  font-size: 26px;
  line-height: 1;
  margin-bottom: 5px;
}

.kpi span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.toolbar {
  align-items: end;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-tight);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1.2fr) minmax(145px, 0.8fr) repeat(3, minmax(135px, 180px));
  padding: 10px;
}

.filter-toggle {
  display: none;
}

label {
  color: var(--primary);
  display: grid;
  font-size: 11px;
  font-weight: 800;
  gap: 6px;
  letter-spacing: 0.01em;
  min-width: 0;
}

input,
select,
textarea {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 36px;
  min-width: 0;
  padding: 7px 10px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
  width: 100%;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(22, 79, 143, 0.18);
  outline-offset: 2px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

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

th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  font-size: 14px;
  line-height: 1.35;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: #f8fbff;
}

.cell-primary {
  min-width: 190px;
}

.cell-alerts {
  min-width: 150px;
}

.project-link {
  color: var(--secondary);
  font-weight: 850;
  text-decoration: none;
}

.project-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chip,
.badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  gap: 6px;
  min-height: 22px;
  padding: 4px 9px;
  white-space: nowrap;
}

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

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

.chip.green,
.badge.green {
  background: #e4f0eb;
  color: var(--green);
}

.badge {
  background: #eef1f4;
  color: var(--muted);
  margin: 2px 4px 2px 0;
}

.progress {
  background: #e3e8ee;
  border-radius: 999px;
  height: 8px;
  min-width: 92px;
  overflow: hidden;
}

.progress span {
  background: var(--secondary);
  display: block;
  height: 100%;
}

.progress.payment span {
  background: var(--accent);
}

.meter {
  appearance: none;
  background: #e3e8ee;
  border: 0;
  border-radius: 999px;
  display: block;
  height: 8px;
  min-width: 92px;
  overflow: hidden;
  width: 100%;
}

.meter::-webkit-progress-bar {
  background: #e3e8ee;
  border-radius: 999px;
}

.meter::-webkit-progress-value {
  background: var(--secondary);
  border-radius: 999px;
}

.meter::-moz-progress-bar {
  background: var(--secondary);
  border-radius: 999px;
}

.meter.payment::-webkit-progress-value {
  background: var(--accent);
}

.meter.payment::-moz-progress-bar {
  background: var(--accent);
}

.metric-inline {
  align-items: center;
  display: grid;
  gap: 5px;
  max-width: 120px;
}

.phase-progress {
  margin-top: 7px;
}

.stack-offset {
  margin-top: 14px;
}

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

.timeline-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 260px) repeat(5, minmax(90px, 1fr));
}

.timeline-row.header {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.phase-cell {
  background: #eef1f4;
  border: 1px solid #d9dee4;
  border-radius: 999px;
  min-height: 12px;
  position: relative;
}

.phase-cell.done {
  background: #dcebe4;
  border-color: #bdd8c9;
}

.phase-cell.current {
  background: var(--blue-soft);
  border-color: var(--secondary);
  box-shadow: inset 0 0 0 2px rgba(22, 79, 143, 0.15);
}

.project-cover {
  display: grid;
  gap: 16px;
}

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

.cover-title {
  display: grid;
  gap: 8px;
}

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

.field {
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 10px;
}

.field span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 850;
  margin-bottom: 4px;
}

.field strong {
  color: var(--primary);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

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

.gantt-phase {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-top: 4px solid #d9dee4;
  border-radius: var(--radius);
  min-height: 110px;
  padding: 12px;
}

.gantt-phase.done {
  border-top-color: var(--green);
}

.gantt-phase.current {
  border-top-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(22, 79, 143, 0.08);
}

.gantt-phase strong {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}

.gantt-phase span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.35;
}

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

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

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

.doc-frame {
  background: #f8fafb;
  height: 280px;
}

.doc-frame iframe,
.doc-frame img {
  border: 0;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.pdf-preview,
.doc-fallback {
  align-items: center;
  color: var(--primary);
  display: flex;
  gap: 14px;
  height: 100%;
  justify-content: center;
  padding: 22px;
  text-align: left;
}

.pdf-preview {
  background:
    linear-gradient(90deg, rgba(200, 207, 214, 0.25) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(rgba(200, 207, 214, 0.25) 1px, transparent 1px) 0 0 / 34px 34px,
    #f8fafb;
}

.pdf-preview strong,
.doc-fallback strong {
  display: block;
  font-size: 17px;
  margin-bottom: 4px;
}

.pdf-preview span,
.doc-fallback span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.pdf-mark {
  align-items: center;
  background: #fff;
  border: 1px solid #e1bbb5;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--red);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 900;
  height: 70px;
  justify-content: center;
  width: 58px;
}

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

.tabs button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  min-height: 38px;
  padding: 0 9px;
  white-space: nowrap;
}

.tabs button.active {
  border-bottom-color: var(--secondary);
  color: var(--secondary);
}

.tab-panel {
  display: none;
  padding-top: 16px;
}

.tab-panel.active {
  display: block;
}

.split {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
}

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

.list-item {
  align-items: center;
  background: #f8fafb;
  border: 1px solid #e1e5ea;
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 11px 12px;
}

.list-item .meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.checkbox-hit {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
}

.inline-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 180px) auto;
  margin-top: 12px;
}

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

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

.modal {
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(24, 38, 55, 0.22);
  max-height: min(90dvh, 760px);
  max-width: 780px;
  overflow: auto;
  width: min(96vw, 780px);
}

.modal::backdrop {
  background: rgba(26, 35, 44, 0.32);
}

.project-form {
  display: grid;
  gap: 16px;
}

.project-form header,
.project-form footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.form-status {
  color: var(--red);
  font-weight: 750;
  min-height: 18px;
}

.admin-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.auth-page {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 24px;
}

.auth-page[data-environment="local"] {
  border-top: 3px solid var(--accent);
}

.auth-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--secondary);
  border-radius: var(--radius);
  box-shadow: 0 22px 60px rgba(24, 38, 55, 0.13);
  display: grid;
  gap: 16px;
  margin: 0 auto;
  max-width: 540px;
  padding: 34px;
}

.brand-lockup img {
  max-height: 38px;
  max-width: 220px;
}

.auth-panel h1 {
  font-size: 32px;
}

.auth-status {
  background: #f8fafb;
  border: 1px solid #e1e5ea;
  border-radius: var(--radius);
  display: grid;
  gap: 4px;
  padding: 12px;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.local-auth-options .button {
  min-width: 112px;
}

.toast {
  bottom: 20px;
  position: fixed;
  right: 20px;
  z-index: 60;
}

.empty {
  background: #f8fafb;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 18px;
}

pre.empty {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

aside.list > .button {
  width: 100%;
  white-space: normal;
}

@media (max-width: 980px) {
  .topbar,
  .toolbar,
  .cover-meta,
  .document-preview-grid,
  .admin-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: start;
  }

  .user-pill {
    justify-self: start;
  }

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

  .gantt-track {
    grid-template-columns: 1fr;
  }

  .timeline-row {
    grid-template-columns: 1fr repeat(5, minmax(42px, 1fr));
  }
}

@media (max-width: 720px) {
  .page {
    gap: 14px;
    padding: 14px 12px 48px;
  }

  .topbar {
    align-items: center;
    gap: 6px 8px;
    grid-template-areas:
      "brand user"
      "nav nav";
    grid-template-columns: minmax(0, 1fr) minmax(72px, auto);
    min-height: 0;
    padding: 7px 12px;
  }

  .brand {
    grid-area: brand;
    gap: 8px;
    min-height: 34px;
    min-width: 0;
  }

  .brand img {
    max-height: 24px;
    max-width: 112px;
  }

  .brand span {
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-pill {
    font-size: 12px;
    grid-area: user;
    justify-self: end;
    max-width: 96px;
    min-height: 30px;
    padding: 5px 9px;
    text-transform: capitalize;
  }

  .nav {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(24, 38, 55, 0.04);
    display: grid;
    gap: 4px;
    grid-area: nav;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 3px;
    position: static;
  }

  .nav a {
    border-radius: var(--radius);
    justify-content: center;
    min-height: 34px;
    padding: 5px 8px;
    text-align: center;
  }

  .button,
  .icon-button,
  input,
  select,
  textarea {
    min-height: 44px;
  }

  .icon-button {
    min-width: 44px;
  }

  .page-head {
    gap: 12px;
  }

  .page-head h1 {
    font-size: 28px;
  }

  .page-head p {
    font-size: 14px;
  }

  .page-head h1,
  .cover-top h1,
  .project-link {
    overflow-wrap: anywhere;
  }

  .project-link,
  .project-cover a.muted {
    align-items: center;
    display: inline-flex;
    min-height: 44px;
  }

  .page-head .button {
    width: 100%;
  }

  .filter-toggle {
    display: inline-flex;
    min-height: 44px;
    width: 100%;
  }

  .toolbar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 26px rgba(24, 38, 55, 0.07);
    padding: 12px;
  }

  .toolbar.toolbar-mobile-collapsed {
    display: none;
  }

  .kpi-grid {
    display: flex;
    gap: 10px;
    margin-inline: -12px;
    overflow-x: auto;
    padding-inline: 12px;
    scroll-snap-type: x mandatory;
  }

  .kpi {
    flex: 0 0 154px;
    min-height: 84px;
    padding: 11px 12px;
    scroll-snap-align: start;
  }

  .kpi strong {
    font-size: 22px;
  }

  .kpi span {
    font-size: 12px;
    line-height: 1.25;
  }

  .panel {
    padding: 16px;
  }

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

  .section-title .action-row {
    width: 100%;
  }

  .section-title .action-row .button {
    flex: 1 1 150px;
  }

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

  .attention-card {
    min-height: 0;
  }

  .calendar-summary {
    align-items: start;
  }

  .calendar-summary-action {
    white-space: nowrap;
  }

  .table-wrap {
    overflow: visible;
  }

  .project-table,
  .project-table tbody,
  .project-table tr,
  .project-table td {
    display: block;
    width: 100%;
  }

  .project-table thead {
    display: none;
  }

  .project-table tbody {
    display: grid;
    gap: 12px;
  }

  .project-table tbody tr {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(24, 38, 55, 0.04);
    padding: 13px;
  }

  .project-table tbody tr:hover {
    background: #fff;
  }

  .project-table td {
    align-items: start;
    border: 0;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(82px, 0.34fr) minmax(0, 1fr);
    min-height: 32px;
    padding: 7px 0;
  }

  .project-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.35;
    text-transform: uppercase;
  }

  .cell-primary {
    border-bottom: 1px solid var(--line-soft);
    display: block;
    min-width: 0;
    padding-bottom: 12px;
  }

  .cell-primary::before {
    display: none;
  }

  .cell-primary .project-link {
    display: block;
    font-size: 16px;
    line-height: 1.25;
  }

  .cell-alerts {
    min-width: 0;
  }

  .metric-inline {
    max-width: none;
  }

  .progress,
  .meter {
    min-width: 0;
    width: 100%;
  }

  .chip,
  .badge {
    white-space: normal;
  }

  .portfolio-timeline {
    gap: 12px;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .timeline-row {
    background: #f8fafb;
    border: 1px solid #e1e5ea;
    border-radius: var(--radius);
    gap: 7px;
    grid-template-columns: 1fr;
    min-width: 0;
    padding: 12px;
  }

  .timeline-row.header {
    display: none;
  }

  .phase-cell {
    align-items: center;
    display: flex;
    min-height: 32px;
    padding: 0 10px;
  }

  .phase-cell::after {
    color: var(--muted);
    content: attr(data-phase-label);
    font-size: 12px;
    font-weight: 800;
  }

  .phase-cell.current::after {
    color: var(--secondary);
  }

  .tabs {
    background: var(--surface);
    margin-inline: -16px;
    padding-inline: 16px;
    position: sticky;
    top: var(--topbar-offset);
    z-index: 12;
  }

  .tabs button {
    min-height: 46px;
    padding-inline: 12px;
  }

  .doc-frame {
    height: 190px;
  }

  .list-item {
    align-items: start;
    grid-template-columns: minmax(0, 1fr);
  }

  .list-item .action-row,
  .list-item > .button,
  .list-item > select {
    width: 100%;
  }

  input[type="checkbox"] {
    height: 20px;
    width: 20px;
  }
}

@media (max-width: 640px) {
  .page-head,
  .cover-top {
    align-items: start;
    flex-direction: column;
  }

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

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

  .cover-meta .field:nth-child(1),
  .cover-meta .field:nth-child(2) {
    grid-column: 1 / -1;
  }

  .action-row .button,
  .project-form footer .button {
    flex: 1 1 100%;
    min-height: 44px;
  }

  .gantt-phase {
    min-height: auto;
    padding: 10px;
  }

  .modal {
    border-radius: 0;
    height: 100dvh;
    max-height: 100dvh;
    max-width: none;
    overflow: auto;
    width: 100vw;
  }

  .modal .project-form {
    min-height: calc(100dvh - 2em);
  }

  .project-form footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
    bottom: 0;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
    margin: 0 -2px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-top: 12px;
    position: sticky;
  }

  h1 {
    font-size: 28px;
  }

  .auth-page {
    min-height: 100dvh;
    padding: 16px;
  }

  .auth-panel {
    padding: 26px 22px;
  }
}

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

.offers-kpis {
  gap: 7px;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
}

.kpi.button-like {
  appearance: none;
  color: inherit;
  text-align: left;
  width: 100%;
}

.offers-kpis .kpi {
  background: rgba(255, 255, 255, 0.86);
  border-left-width: 2px;
  border-radius: 6px;
  box-shadow: none;
  min-height: 52px;
  padding: 7px 10px;
}

.offers-kpis .kpi strong {
  font-size: 19px;
  line-height: 1;
  margin-bottom: 3px;
}

.offers-kpis .kpi:nth-child(5) strong {
  font-size: 18px;
}

.offers-kpis .kpi span {
  display: block;
  font-size: 11px;
  line-height: 1.12;
}

.kpi.button-like:hover {
  border-color: var(--secondary);
  background: #fbfdff;
  box-shadow: 0 0 0 2px rgba(22, 79, 143, 0.06);
}

.attention-panel {
  border-top: 4px solid var(--secondary);
}

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

.attention-card {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 10px;
  min-height: 176px;
  padding: 12px;
}

.attention-card header {
  align-items: start;
  display: grid;
  gap: 8px;
}

.attention-card strong {
  color: var(--primary);
  display: block;
  font-size: 28px;
  line-height: 1;
}

.attention-card header span {
  color: var(--primary);
  display: block;
  font-size: 13px;
  font-weight: 900;
  margin-top: 4px;
}

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

.attention-card ul {
  display: grid;
  gap: 7px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.attention-card li {
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 2px;
  padding-top: 7px;
}

.attention-card li a {
  color: var(--secondary);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.attention-card li span {
  color: var(--muted);
  display: -webkit-box;
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
}

.attention-card.red {
  border-top: 3px solid var(--red);
}

.attention-card.amber {
  border-top: 3px solid var(--accent);
}

.attention-card.blue {
  border-top: 3px solid var(--secondary);
}

.attention-card.slate {
  border-top: 3px solid var(--muted);
}

.secondary-panel {
  box-shadow: 0 1px 2px rgba(24, 38, 55, 0.04);
}

.empty.compact {
  padding: 12px;
}

.skeleton-card {
  animation: skeleton-pulse 1200ms ease-in-out infinite;
  background: linear-gradient(90deg, #eef1f4 0%, #f8fafb 48%, #eef1f4 100%);
  background-size: 220% 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 176px;
}

@keyframes skeleton-pulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.calendar-panel {
  overflow: hidden;
}

.calendar-summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  list-style: none;
}

.calendar-summary::-webkit-details-marker {
  display: none;
}

.calendar-summary-action {
  background: var(--blue-soft);
  border-radius: 999px;
  color: var(--secondary);
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 850;
  padding: 7px 11px;
}

.calendar-summary-action::before {
  content: "Abrir ";
}

.calendar-panel[open] .calendar-summary {
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 14px;
  padding-bottom: 14px;
}

.calendar-panel[open] .calendar-summary-action {
  background: #eef1f4;
  color: var(--muted);
}

.calendar-panel[open] .calendar-summary-action::before {
  content: "Cerrar ";
}

.calendar-body-shell {
  display: grid;
  gap: 12px;
}

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

.calendar-controls {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: 110px 160px 130px;
}

.calendar-shell {
  display: grid;
  gap: 10px;
}

.calendar-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.calendar-inner {
  display: grid;
  gap: 6px;
  min-width: 830px;
}

.calendar-months {
  color: var(--muted);
  display: grid;
  font-size: 11px;
  font-weight: 850;
  grid-template-columns: 36px repeat(53, 1fr);
  line-height: 1;
  min-height: 14px;
  text-transform: lowercase;
}

.calendar-months span {
  min-width: 0;
}

.calendar-body {
  display: grid;
  gap: 7px;
  grid-template-columns: 28px 1fr;
}

.calendar-weekdays {
  color: var(--muted);
  display: grid;
  font-size: 10px;
  font-weight: 850;
  gap: 4px;
  grid-template-rows: repeat(7, 12px);
  line-height: 12px;
  text-transform: uppercase;
}

.calendar-cells {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(53, 12px);
  grid-template-rows: repeat(7, 12px);
  width: max-content;
}

.calendar-day {
  background: var(--line-soft);
  border: 1px solid transparent;
  border-radius: 3px;
  height: 12px;
  min-height: 12px;
  padding: 0;
  width: 12px;
}

.calendar-day[data-level="1"] { background: var(--blue-soft); }
.calendar-day[data-level="2"] { background: #b9d3ef; }
.calendar-day[data-level="3"] { background: var(--secondary); }
.calendar-day[data-level="4"] { background: var(--secondary-dark); }

.calendar-day.today {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(170, 98, 46, 0.18);
}

.calendar-day.selected {
  outline: 3px solid rgba(170, 98, 46, 0.32);
  outline-offset: 1px;
}

.calendar-day:focus-visible {
  outline: 3px solid rgba(22, 79, 143, 0.35);
  outline-offset: 2px;
}

.calendar-legend {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  justify-content: flex-end;
}

.legend-swatch {
  border-radius: 3px;
  display: inline-block;
  height: 12px;
  width: 12px;
}

.calendar-tooltip {
  background: var(--primary);
  border-radius: var(--radius);
  box-shadow: 0 18px 42px rgba(24, 38, 55, 0.18);
  color: #fff;
  display: none;
  font-size: 12px;
  line-height: 1.35;
  max-width: 320px;
  padding: 10px 12px;
  pointer-events: none;
  position: fixed;
  z-index: 80;
}

.calendar-tooltip strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.page-actions {
  align-items: center;
  justify-content: flex-end;
}

.alert-trigger {
  gap: 8px;
}

.alert-badge {
  align-items: center;
  background: var(--secondary);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  justify-content: center;
  min-width: 24px;
  padding: 2px 7px;
}

.alerts-modal {
  max-width: 1240px;
  padding: 0;
  width: min(96vw, 1240px);
}

.alerts-shell {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.alerts-head {
  align-items: start;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding-bottom: 14px;
}

.alerts-head span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}

.sent-heatmap-panel {
  border-top: 2px solid var(--secondary);
  display: grid;
  gap: 12px;
}

.sent-heatmap-panel .section-title {
  margin-bottom: 0;
}

.crm-panel {
  border-top: 1px solid var(--line-soft);
  display: block;
  overflow: hidden;
  padding: 0;
}

.crm-disclosure[open] {
  border-top-color: color-mix(in srgb, var(--accent) 55%, var(--line-soft));
}

.crm-summary-bar {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  list-style: none;
  min-height: 46px;
  padding: 9px 13px;
}

.crm-summary-bar::-webkit-details-marker {
  display: none;
}

.crm-summary-bar:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--secondary) 35%, transparent);
  outline-offset: -3px;
}

.crm-summary-title {
  align-items: baseline;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.crm-summary-title strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0;
}

.crm-summary-title em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-summary-metrics {
  align-items: center;
  display: flex;
  gap: 6px;
}

.crm-summary-metrics span {
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  padding: 5px 8px;
  white-space: nowrap;
}

.crm-summary-toggle {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 7px 10px;
  white-space: nowrap;
}

.crm-expanded {
  background: linear-gradient(180deg, rgba(248, 251, 253, 0.86), #fff 62%);
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 10px;
  padding: 12px 13px 13px;
}

.crm-expanded-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.crm-expanded-head h2 {
  font-size: 18px;
  margin: 0;
}

.crm-expanded-head span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 750;
  margin-top: 3px;
}

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

.crm-metrics {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
}

.crm-metrics div {
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  display: grid;
  gap: 3px;
  min-height: 48px;
  padding: 9px 10px;
}

.crm-metrics div:nth-child(2n) {
  border-right: 0;
}

.crm-metrics div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.crm-metrics strong {
  color: var(--ink);
  font-size: 17px;
  line-height: 1;
}

.crm-metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

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

.crm-item {
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 42px;
  padding: 7px 10px;
  text-decoration: none;
}

.crm-item:hover {
  background: #f9fbfd;
}

.crm-item span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.crm-item strong {
  color: var(--secondary);
  font-weight: 900;
}

.crm-item em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-item b {
  border-radius: 999px;
  font-size: 11px;
  min-width: 72px;
  padding: 5px 8px;
  text-align: center;
  white-space: nowrap;
}

.crm-item b.critical {
  background: #f4dedb;
  color: var(--red);
}

.crm-item b.warning {
  background: var(--amber-soft);
  color: var(--accent);
}

.crm-item b.fresh {
  background: var(--blue-soft);
  color: var(--secondary);
}

.sent-heatmap-summary {
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  padding: 7px 9px;
}

.heatmap-controls {
  grid-template-columns: minmax(120px, 160px) auto;
}

.sent-calendar-shell {
  gap: 10px;
}

.sent-calendar-workspace {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, max-content) minmax(260px, 1fr);
}

.sent-calendar-workspace > [data-calendar] {
  min-width: 0;
}

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

.calendar-year-grid[data-month-count="1"] {
  grid-template-columns: minmax(320px, 430px);
  justify-content: start;
}

.calendar-year-grid[data-month-count="2"] {
  grid-template-columns: repeat(2, minmax(320px, 430px));
  justify-content: start;
}

.calendar-month {
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
  padding: 9px;
}

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

.calendar-month-weekdays,
.calendar-month-cells {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-month-weekdays span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.calendar-month-cells {
  grid-auto-rows: 34px;
}

.calendar-day {
  align-items: center;
  aspect-ratio: auto;
  background: #f2f5f8;
  border: 1px solid #e3e8ed;
  border-radius: 3px;
  color: var(--muted);
  display: grid;
  font-size: 10px;
  font-weight: 850;
  gap: 0;
  height: 34px;
  justify-items: center;
  line-height: 1;
  min-height: 34px;
  padding: 3px;
  position: relative;
  width: 100%;
}

.calendar-day:disabled {
  cursor: default;
}

.calendar-day:not(:disabled):hover {
  border-color: rgba(22, 79, 143, 0.44);
  box-shadow: 0 0 0 2px rgba(22, 79, 143, 0.1);
}

.calendar-day-blank {
  background: transparent;
  border: 0;
}

.day-number {
  justify-self: start;
  opacity: 0.78;
}

.day-count {
  color: inherit;
  font-size: 15px;
  font-weight: 950;
}

.day-moba-count {
  align-items: center;
  background: #a62f25;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 10px;
  font-weight: 950;
  height: 15px;
  justify-content: center;
  min-width: 15px;
  padding: 0 4px;
  position: absolute;
  right: 3px;
  top: 3px;
}

.calendar-day[data-level="1"] { background: #e9f1fa; color: var(--secondary-dark); }
.calendar-day[data-level="2"] { background: #cfe0f2; color: var(--secondary-dark); }
.calendar-day[data-level="3"] { background: #8fb8df; color: #0f2f54; }
.calendar-day[data-level="4"] { background: var(--secondary); color: #fff; }
.calendar-day[data-level="5"] { background: var(--secondary-dark); color: #fff; }

.calendar-day.has-moba[data-moba-level="1"] { background: #fae6e3; color: #7f1f18; }
.calendar-day.has-moba[data-moba-level="2"] { background: #f2bcb5; color: #741c16; }
.calendar-day.has-moba[data-moba-level="3"] { background: #de776b; color: #3f110d; }
.calendar-day.has-moba[data-moba-level="4"] { background: #bb3f33; color: #fff; }
.calendar-day.has-moba[data-moba-level="5"] { background: #832219; color: #fff; }

.calendar-day.mixed-source {
  border-color: rgba(166, 47, 37, 0.42);
}

.calendar-day.mixed-source[data-level="1"] { background: linear-gradient(135deg, #e9f1fa 0 58%, #d2574c 58% 100%); }
.calendar-day.mixed-source[data-level="2"] { background: linear-gradient(135deg, #cfe0f2 0 58%, #d2574c 58% 100%); }
.calendar-day.mixed-source[data-level="3"] { background: linear-gradient(135deg, #8fb8df 0 58%, #bb3f33 58% 100%); }
.calendar-day.mixed-source[data-level="4"] { background: linear-gradient(135deg, var(--secondary) 0 58%, #bb3f33 58% 100%); }
.calendar-day.mixed-source[data-level="5"] { background: linear-gradient(135deg, var(--secondary-dark) 0 58%, #832219 58% 100%); }

.calendar-day.today {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px rgba(35, 48, 59, 0.28);
}

.calendar-day.today::after {
  background: var(--accent);
  border: 1px solid #fff;
  border-radius: 999px;
  bottom: 3px;
  content: "";
  height: 6px;
  position: absolute;
  right: 3px;
  width: 6px;
}

.calendar-day.selected {
  outline: 3px solid rgba(22, 79, 143, 0.48);
  outline-offset: 1px;
}

.legend-swatch.calendar-day {
  aspect-ratio: auto;
  display: inline-block;
  height: 12px;
  min-height: 12px;
  padding: 0;
  width: 18px;
}

.legend-separator {
  background: var(--line);
  display: inline-block;
  height: 16px;
  margin: 0 2px;
  width: 1px;
}

.tooltip-moba {
  color: #8c261e;
  font-weight: 900;
  margin-top: 3px;
}

.calendar-tooltip ul {
  display: grid;
  gap: 3px;
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.day-detail {
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
  padding: 10px;
}

.day-detail-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.day-detail-head p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin-top: 2px;
}

.moba-inline {
  color: #8c261e;
  font-weight: 950;
}

.day-offer-list {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.day-offer {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  display: grid;
  gap: 2px;
  min-height: 54px;
  padding: 8px 10px;
  text-decoration: none;
}

.day-offer strong {
  color: var(--secondary);
  font-size: 13px;
  font-weight: 950;
}

.day-offer span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-offer em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.day-offer.moba-offer {
  border-color: rgba(166, 47, 37, 0.35);
  box-shadow: inset 4px 0 0 #a62f25;
}

.day-offer.moba-offer strong,
.day-offer.moba-offer span b {
  color: #8c261e;
}

.serial-number {
  color: var(--primary);
  display: block;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-skeleton {
  animation: skeleton-pulse 1200ms ease-in-out infinite;
  background: linear-gradient(90deg, #eef1f4 0%, #f8fafb 48%, #eef1f4 100%);
  background-size: 220% 100%;
  border-radius: var(--radius);
  min-height: 360px;
}

.active-filter {
  align-items: center;
  background: var(--amber-soft);
  border: 1px solid #dfc2aa;
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  gap: 8px;
  margin-bottom: 12px;
  padding: 7px 10px;
  width: fit-content;
}

.active-filter button {
  background: transparent;
  border: 0;
  color: inherit;
  font-weight: 900;
  min-height: 24px;
  padding: 0 4px;
}

.offers-toolbar {
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(130px, 180px));
}

.offers-toolbar label:first-child input {
  background: #ffffff;
  font-weight: 750;
}

.offer-table th button {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  padding: 0;
  text-transform: inherit;
}

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

.offer-table th {
  background: #f7f9fb;
  box-shadow: 0 1px 0 var(--line-soft);
}

.offer-table th:first-child,
.offer-table td:first-child {
  background: var(--surface);
  left: 0;
  position: sticky;
  z-index: 3;
}

.offer-table th:first-child {
  z-index: 5;
}

.offer-table tbody tr {
  background: #fff;
}

.offer-table tbody tr:hover td,
.offer-table tbody tr:hover td:first-child {
  background: #f8fbff;
}

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

.amount {
  display: block;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  text-align: right;
  white-space: nowrap;
}

.offer-table th:nth-child(6),
.offer-table td:nth-child(6) {
  text-align: right;
}

.row-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.mini-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  padding: 4px 6px;
}

.mini-badge.red {
  background: #f4dedb;
  color: var(--red);
}

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

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

.mini-badge.slate {
  background: #eef1f4;
  color: var(--muted);
}

.next-action {
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: inline-grid;
  gap: 3px;
  max-width: 100%;
  padding: 6px 8px;
}

.next-action strong {
  font-size: 11px;
  font-weight: 950;
  line-height: 1.1;
}

.next-action em {
  color: var(--muted);
  display: -webkit-box;
  font-size: 10px;
  font-style: normal;
  line-height: 1.25;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.next-action.red {
  background: #fff5f3;
  border-color: #e8c2bc;
  color: var(--red);
}

.next-action.amber {
  background: #fff8f1;
  border-color: #ead3bd;
  color: var(--accent);
}

.next-action.blue {
  background: #f3f8fe;
  border-color: #cddded;
  color: var(--secondary);
}

.next-action.green {
  background: #f1f8f4;
  border-color: #c9dfd2;
  color: var(--green);
}

.next-action.slate {
  background: #f7f9fb;
  border-color: #dce4ee;
  color: var(--muted);
}

.command-modal {
  padding: 0;
}

.command-shell {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.command-results {
  display: grid;
  gap: 8px;
  max-height: min(58vh, 520px);
  overflow: auto;
}

.command-result {
  align-items: center;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr) auto;
  min-height: 50px;
  padding: 10px 12px;
  text-decoration: none;
}

.command-result:hover,
.command-result:focus-visible {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(22, 79, 143, 0.09);
}

.command-result strong {
  color: var(--secondary);
}

.command-result span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-shell footer {
  align-items: center;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
}

.offer-machine {
  color: var(--muted);
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-grid {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(360px, 0.9fr) minmax(560px, 1.1fr);
}

.offer-cover {
  display: grid;
  gap: 16px;
}

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

.offer-cover .cover-meta .field:nth-child(3) {
  grid-column: 1 / -1;
}

.offer-title-row {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.next-action-banner {
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.next-action-banner span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.next-action-banner strong {
  font-size: 17px;
  font-weight: 950;
}

.next-action-banner em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.4;
}

.next-action-banner.red {
  background: #fff5f3;
  border-color: #e8c2bc;
}

.next-action-banner.amber {
  background: #fff8f1;
  border-color: #ead3bd;
}

.next-action-banner.blue {
  background: #f3f8fe;
  border-color: #cddded;
}

.next-action-banner.green {
  background: #f1f8f4;
  border-color: #c9dfd2;
}

.next-action-banner.slate {
  background: #f7f9fb;
  border-color: #dce4ee;
}

.status-editor {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-editor label {
  min-width: min(100%, 180px);
}

.pdf-viewer-header {
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line-soft);
  gap: 12px;
  min-height: 46px;
}

.pdf-viewer-title {
  display: grid;
  gap: 2px;
}

.pdf-viewer-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.pdf-viewer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.pdf-tool,
.pdf-icon-button,
.pdf-zoom-readout {
  align-items: center;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  color: var(--primary);
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  height: 28px;
  justify-content: center;
  line-height: 1;
}

.pdf-tool {
  border-radius: 6px;
  padding: 0 9px;
}

.pdf-tool.active {
  background: #eef4fb;
  border-color: #bfd0e4;
  color: var(--secondary);
}

.pdf-icon-button {
  border-radius: 999px;
  font-size: 17px;
  padding: 0;
  width: 28px;
}

.pdf-zoom-readout {
  background: #f8fafb;
  border-radius: 6px;
  min-width: 58px;
  padding: 0 8px;
}

.pdf-tool:focus-visible,
.pdf-icon-button:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

.pdf-frame-large {
  background:
    linear-gradient(90deg, rgba(217, 224, 231, 0.28) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(rgba(217, 224, 231, 0.28) 1px, transparent 1px) 0 0 / 28px 28px,
    #eef2f6;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  height: min(78vh, 900px);
  min-height: 640px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

.pdf-canvas-stack {
  align-items: center;
  display: grid;
  gap: 18px;
  min-height: 100%;
}

.pdf-page-shell {
  background: #ffffff;
  border: 1px solid #d8dee6;
  box-shadow: 0 1px 2px rgba(24, 38, 55, 0.08), 0 18px 42px rgba(24, 38, 55, 0.12);
  display: grid;
  justify-items: center;
  position: relative;
}

.pdf-page-shell canvas {
  display: block;
  height: auto;
}

.pdf-page-marker {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  min-width: 24px;
  padding: 3px 7px;
  position: absolute;
  right: 8px;
}

.pdf-loading {
  align-items: center;
  align-self: center;
  color: var(--muted);
  display: grid;
  gap: 7px;
  justify-items: center;
  min-height: 320px;
  text-align: center;
}

.pdf-loading strong {
  color: var(--primary);
  font-size: 14px;
}

.pdf-loading span:not(.pdf-spinner) {
  font-size: 12px;
}

.pdf-spinner {
  animation: pdf-spin 0.8s linear infinite;
  border: 2px solid #d7dee7;
  border-top-color: var(--secondary);
  border-radius: 50%;
  display: block;
  height: 18px;
  width: 18px;
}

.pdf-error {
  align-self: center;
  justify-self: center;
}

@keyframes pdf-spin {
  to {
    transform: rotate(360deg);
  }
}

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

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

.timeline-item {
  align-items: start;
  background: #f8fafb;
  border: 1px solid var(--line-soft);
  border-left: 3px solid #b9c4cf;
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  grid-template-columns: 110px minmax(0, 1fr);
  padding: 10px 12px;
}

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

.timeline-item strong {
  color: var(--primary);
  display: block;
  font-size: 14px;
}

.timeline-item span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.timeline-item.red { border-left-color: var(--red); }
.timeline-item.amber { border-left-color: var(--accent); }
.timeline-item.blue { border-left-color: var(--secondary); }
.timeline-item.green { border-left-color: var(--green); }

.governance-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

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

.document-row {
  align-items: center;
  background: #f8fafb;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 12px;
}

.document-row strong {
  color: var(--primary);
  display: block;
  font-size: 14px;
}

.document-row span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.document-row.manufacturer_offer,
.document-row.manufacturer_document,
.document-row.manufacturer_plan {
  border-left: 3px solid var(--red);
}

.document-badges {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.document-badges span,
.document-badges a {
  background: #eef1f4;
  border: 1px solid #dce4ee;
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  padding: 5px 7px;
  text-decoration: none;
}

.kv {
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 10px;
}

.kv span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 850;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.kv strong,
.kv p {
  overflow-wrap: anywhere;
}

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

.data-health-card {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.data-health-card h3 {
  margin-bottom: 10px;
}

.data-health-card ul {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.data-health-card li {
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}

.toast-message {
  background: var(--primary);
  border-radius: var(--radius);
  box-shadow: 0 16px 42px rgba(24, 38, 55, 0.18);
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  max-width: 340px;
  padding: 12px 14px;
}

@media (max-width: 1120px) {
  .calendar-title,
  .crm-grid,
  .detail-grid,
  .data-health-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .sent-calendar-workspace {
    grid-template-columns: 1fr;
  }

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

  .calendar-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .offers-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .crm-summary-bar {
    grid-template-columns: minmax(180px, 1fr) auto;
  }

  .crm-summary-metrics {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .page-head {
    align-items: start;
    flex-direction: column;
  }

  .page-actions {
    justify-content: stretch;
    width: 100%;
  }

  .offers-kpis {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-inline: 0;
    overflow: visible;
    padding-inline: 0;
    scroll-snap-type: none;
  }

  .offers-kpis .kpi {
    flex: initial;
    min-height: 48px;
    padding: 7px 9px;
  }

  .offers-kpis .kpi strong {
    font-size: 18px;
  }

  .offers-kpis .kpi:nth-child(5) strong {
    font-size: 16px;
  }

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

  .attention-card {
    min-height: 0;
  }

  .calendar-controls,
  .crm-metrics,
  .offers-toolbar,
  .readonly-grid {
    grid-template-columns: 1fr;
  }

  .crm-summary-bar {
    gap: 8px;
    grid-template-columns: 1fr auto;
    min-height: 0;
    padding: 10px;
  }

  .crm-summary-title {
    align-items: start;
    display: grid;
    gap: 2px;
  }

  .crm-summary-metrics {
    grid-column: 1 / -1;
    overflow-x: auto;
    padding-bottom: 1px;
  }

  .crm-expanded {
    padding: 10px;
  }

  .crm-expanded-head {
    align-items: stretch;
    display: grid;
  }

  .crm-metrics div {
    border-right: 0;
  }

  .crm-metrics div:nth-last-child(2) {
    border-bottom: 1px solid var(--line-soft);
  }

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

  .offer-cover .cover-meta .field:nth-child(3) {
    grid-column: auto;
  }

  .calendar-year-grid {
    grid-template-columns: 1fr;
  }

  .calendar-year-grid[data-month-count] {
    grid-template-columns: 1fr;
  }

  .calendar-month-cells {
    grid-auto-rows: 30px;
  }

  .calendar-day {
    height: 30px;
    min-height: 30px;
  }

  .alerts-head,
  .day-detail-head {
    display: grid;
  }

  .offer-table th,
  .offer-table th:first-child,
  .offer-table td,
  .offer-table td:first-child {
    left: auto;
    position: static;
    width: 100%;
  }

  .offer-table th:nth-child(n),
  .offer-table td:nth-child(n) {
    width: 100%;
  }

  .project-table td > * {
    justify-self: start;
    max-width: 100%;
    min-width: 0;
  }

  .serial-number {
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

  .offer-table td:nth-child(6),
  .amount {
    text-align: left;
  }

  .command-result {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .pdf-frame-large {
    height: 420px;
    min-height: 420px;
    padding: 10px;
  }

  .pdf-viewer-header {
    align-items: stretch;
    display: grid;
  }

  .pdf-viewer-actions {
    gap: 5px;
    justify-content: start;
  }

  .pdf-tool,
  .pdf-icon-button,
  .pdf-zoom-readout {
    height: 28px;
  }

  .offer-machine {
    display: -webkit-box;
    line-clamp: 3;
    max-width: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    white-space: normal;
  }
}

body[data-page="dashboard"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 247, 250, 0.96) 260px),
    radial-gradient(circle at 82% 0%, rgba(31, 78, 140, 0.1), transparent 28%),
    #f5f7fa;
}

body[data-page="dashboard"] .dashboard-topbar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: #dce4ee;
  box-shadow: 0 10px 32px rgba(23, 38, 59, 0.04);
  gap: 16px;
  grid-template-columns: minmax(240px, auto) minmax(280px, 1fr) auto auto;
  min-height: 58px;
  padding: 0 clamp(18px, 3vw, 34px);
}

body[data-page="dashboard"] .brand {
  gap: 12px;
}

body[data-page="dashboard"] .brand img {
  max-height: 32px;
  max-width: 176px;
}

body[data-page="dashboard"] .brand span {
  color: #102033;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.global-search {
  align-items: center;
  background: #f9fbfd;
  border: 1px solid #dce4ee;
  border-radius: 9px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  justify-self: stretch;
  max-width: 720px;
  min-height: 38px;
  padding: 6px 10px;
}

.global-search span {
  color: #8b99ad;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  margin-right: 9px;
  text-transform: uppercase;
}

.global-search input {
  background: transparent;
  border: 0;
  border-radius: 0;
  min-height: 24px;
  padding: 0;
}

.global-search input:focus {
  box-shadow: none;
  outline: 0;
}

body[data-page="dashboard"] .nav a {
  border-radius: 999px;
  font-size: 13px;
  min-height: 34px;
  padding: 7px 13px;
}

body[data-page="dashboard"] .user-pill {
  background: #ffffff;
  border-color: #dce4ee;
  color: #657287;
  font-size: 12px;
  min-height: 34px;
  padding: 7px 12px;
}

body[data-page="dashboard"] .dashboard-console {
  max-width: none;
  padding: 18px clamp(18px, 3vw, 34px) 92px;
}

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

.console-workspace {
  display: grid;
  gap: 14px;
  min-width: 0;
}

body[data-page="dashboard"] .filter-rail {
  align-self: start;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #dce4ee;
  border-radius: 12px;
  box-shadow: 0 18px 54px rgba(23, 38, 59, 0.08);
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  padding: 15px;
  position: sticky;
  top: 74px;
}

.rail-head {
  border-bottom: 1px solid #edf2f7;
  display: grid;
  gap: 2px;
  padding-bottom: 10px;
}

.rail-head strong {
  color: #102033;
  font-size: 13px;
  font-weight: 950;
}

.rail-head span {
  color: #657287;
  font-size: 11px;
  font-weight: 800;
}

body[data-page="dashboard"] .filter-rail label {
  color: #657287;
  font-size: 11px;
  font-weight: 900;
  gap: 7px;
  text-transform: uppercase;
}

body[data-page="dashboard"] .filter-rail select {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #dce4ee;
  border-radius: 0;
  color: #102033;
  min-height: 32px;
  padding: 5px 0;
}

.workspace-commandbar {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  min-height: 38px;
}

.workspace-commandbar strong {
  color: #102033;
  display: block;
  font-size: 15px;
  font-weight: 950;
}

.workspace-commandbar span {
  color: #657287;
  display: block;
  font-size: 12px;
  font-weight: 750;
  margin-top: 2px;
}

body[data-page="dashboard"] .button {
  border-color: #dce4ee;
  border-radius: 9px;
  min-height: 36px;
}

body[data-page="dashboard"] .button.primary {
  background: #0f5aa8;
  border-color: #0f5aa8;
  box-shadow: 0 8px 20px rgba(15, 90, 168, 0.16);
}

body[data-page="dashboard"] .button.ghost {
  background: rgba(255, 255, 255, 0.86);
}

body[data-page="dashboard"] .alert-badge {
  background: #0f5aa8;
  min-width: 22px;
}

body[data-page="dashboard"] .offers-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(8, minmax(96px, 1fr));
}

body[data-page="dashboard"] .offers-kpis .kpi {
  appearance: none;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #dce4ee;
  border-radius: 12px;
  border-left: 0;
  box-shadow: 0 14px 36px rgba(23, 38, 59, 0.055);
  min-height: 74px;
  padding: 12px 13px;
  text-align: left;
}

body[data-page="dashboard"] .offers-kpis .kpi:hover,
body[data-page="dashboard"] .offers-kpis .kpi:focus-visible {
  border-color: #b9cee5;
  box-shadow: 0 16px 42px rgba(23, 38, 59, 0.085);
}

body[data-page="dashboard"] .offers-kpis .kpi strong {
  color: #102033;
  font-size: 22px;
  letter-spacing: 0;
  margin-bottom: 7px;
}

body[data-page="dashboard"] .offers-kpis .kpi:nth-child(5) strong {
  font-size: 20px;
}

body[data-page="dashboard"] .offers-kpis .kpi span {
  color: #657287;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.22;
  text-transform: uppercase;
}

body[data-page="dashboard"] .panel {
  background: rgba(255, 255, 255, 0.94);
  border-color: #dce4ee;
  border-radius: 14px;
  box-shadow: 0 18px 54px rgba(23, 38, 59, 0.075);
}

body[data-page="dashboard"] .sent-heatmap-panel {
  border-top: 0;
  padding: 15px;
}

body[data-page="dashboard"] .calendar-title {
  align-items: end;
}

body[data-page="dashboard"] .calendar-title h2,
body[data-page="dashboard"] .registry-panel h2 {
  color: #102033;
  font-size: 18px;
  font-weight: 950;
}

body[data-page="dashboard"] .calendar-title span,
body[data-page="dashboard"] .section-title span {
  color: #657287;
  font-size: 12px;
  font-weight: 800;
}

body[data-page="dashboard"] .sent-heatmap-summary {
  background: #f9fbfd;
  border-color: #edf2f7;
  color: #102033;
  font-size: 12px;
}

body[data-page="dashboard"] .sent-calendar-workspace {
  gap: 14px;
  grid-template-columns: minmax(520px, 1.1fr) minmax(320px, 0.9fr);
}

body[data-page="dashboard"] .calendar-year-grid {
  gap: 10px;
}

body[data-page="dashboard"] .calendar-year-grid[data-month-count="2"] {
  grid-template-columns: repeat(2, minmax(245px, 1fr));
}

body[data-page="dashboard"] .calendar-year-grid[data-month-count="1"] {
  grid-template-columns: minmax(280px, 420px);
}

body[data-page="dashboard"] .calendar-month {
  background: #f9fbfd;
  border-color: #dce4ee;
  border-radius: 10px;
  gap: 6px;
  padding: 8px;
}

body[data-page="dashboard"] .calendar-month h3 {
  color: #657287;
  font-size: 12px;
}

body[data-page="dashboard"] .calendar-month-cells {
  gap: 3px;
  grid-auto-rows: 25px;
}

body[data-page="dashboard"] .calendar-day {
  border-color: #dce4ee;
  border-radius: 6px;
  height: 25px;
  min-height: 25px;
  padding: 2px;
}

body[data-page="dashboard"] .day-count {
  font-size: 13px;
}

body[data-page="dashboard"] .day-moba-count {
  font-size: 9px;
  height: 13px;
  min-width: 13px;
}

body[data-page="dashboard"] .calendar-day.today {
  border-color: #aa622e;
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px rgba(170, 98, 46, 0.28);
}

body[data-page="dashboard"] .day-detail {
  align-self: start;
  background: #f9fbfd;
  border-color: #dce4ee;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  max-height: 230px;
  overflow: auto;
  padding: 13px;
}

body[data-page="dashboard"] .day-offer {
  border-color: #dce4ee;
  border-radius: 10px;
}

body[data-page="dashboard"] .registry-panel {
  padding: 15px;
}

body[data-page="dashboard"] .offer-table {
  font-size: 12px;
}

body[data-page="dashboard"] .offer-table th {
  background: #f9fbfd;
  color: #8b99ad;
  font-size: 10px;
}

body[data-page="dashboard"] .offer-table th,
body[data-page="dashboard"] .offer-table td {
  padding: 9px 10px;
}

body[data-page="dashboard"] .offer-table td {
  color: #26364a;
  font-size: 13px;
}

body[data-page="dashboard"] .offer-table .project-link {
  color: #0f5aa8;
}

body[data-page="dashboard"] .amount {
  font-variant-numeric: tabular-nums lining-nums;
  text-align: right;
}

body[data-page="dashboard"] .chip,
body[data-page="dashboard"] .badge {
  font-size: 10px;
  min-height: 21px;
}

body[data-page="dashboard"] .crm-panel {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  border: 0;
  border-radius: 0;
  border-top: 1px solid #dce4ee;
  bottom: 0;
  box-shadow: 0 -14px 40px rgba(23, 38, 59, 0.09);
  left: 0;
  position: fixed;
  right: 0;
  z-index: 35;
}

body[data-page="dashboard"] .crm-disclosure[open] {
  border-top-color: #c9d5e3;
}

body[data-page="dashboard"] .crm-summary-bar {
  grid-template-columns: minmax(280px, 1fr) auto auto;
  min-height: 46px;
  padding: 7px clamp(18px, 3vw, 34px);
}

body[data-page="dashboard"] .crm-summary-title strong {
  color: #102033;
  font-size: 13px;
}

body[data-page="dashboard"] .crm-summary-title em {
  color: #657287;
  font-size: 11px;
}

body[data-page="dashboard"] .crm-summary-metrics span {
  background: #f9fbfd;
  border-color: #dce4ee;
  color: #657287;
}

body[data-page="dashboard"] .crm-summary-toggle {
  border-color: #dce4ee;
  color: #0f5aa8;
}

body[data-page="dashboard"] .crm-expanded {
  background: #ffffff;
  max-height: min(44vh, 420px);
  overflow: auto;
  padding: 12px clamp(18px, 3vw, 34px) 16px;
}

body[data-page="dashboard"] .crm-expanded-head h2 {
  color: #102033;
}

body[data-page="dashboard"] .crm-item {
  background: #f9fbfd;
  border-color: #dce4ee;
  border-radius: 10px;
}

@media (max-width: 1100px) {
  body[data-page="dashboard"] .offers-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body[data-page="dashboard"] .sent-calendar-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  body[data-page="dashboard"] .dashboard-topbar {
    grid-template-columns: 1fr;
    padding-block: 10px;
  }

  .global-search {
    max-width: none;
    width: 100%;
  }

  .console-layout {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .filter-rail {
    position: static;
  }

  body[data-page="dashboard"] .offers-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rail-head {
    grid-column: 1 / -1;
  }

  .workspace-commandbar {
    align-items: stretch;
    display: grid;
  }

  body[data-page="dashboard"] .page-actions {
    justify-content: start;
  }
}

@media (max-width: 720px) {
  body[data-page="dashboard"] .dashboard-console {
    padding: 12px 12px 98px;
  }

  body[data-page="dashboard"] .dashboard-topbar {
    grid-template-areas:
      "brand user"
      "search search"
      "nav nav";
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body[data-page="dashboard"] .brand {
    grid-area: brand;
  }

  body[data-page="dashboard"] .global-search {
    grid-area: search;
  }

  body[data-page="dashboard"] .nav {
    grid-area: nav;
  }

  body[data-page="dashboard"] .user-pill {
    grid-area: user;
  }

  body[data-page="dashboard"] .offers-toolbar {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .filter-toggle[aria-expanded="false"] + .console-layout .filter-rail {
    display: none;
  }

  body[data-page="dashboard"] .page-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  body[data-page="dashboard"] .page-actions .button {
    min-height: 36px;
    width: auto;
  }

  body[data-page="dashboard"] .page-actions .button.primary {
    grid-column: span 2;
  }

  body[data-page="dashboard"] .offers-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="dashboard"] .offers-kpis .kpi {
    min-height: 62px;
  }

  body[data-page="dashboard"] .sent-calendar-workspace,
  body[data-page="dashboard"] .calendar-year-grid[data-month-count],
  body[data-page="dashboard"] .calendar-year-grid[data-month-count="2"] {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .calendar-month-cells {
    grid-auto-rows: 30px;
  }

  body[data-page="dashboard"] .calendar-day {
    height: 30px;
    min-height: 30px;
  }

  body[data-page="dashboard"] .crm-summary-bar {
    gap: 8px;
    grid-template-columns: 1fr auto;
    padding-inline: 12px;
  }

  body[data-page="dashboard"] .crm-expanded {
    max-height: 52vh;
    padding-inline: 12px;
  }
}

/* Premium 2026 visual refresh: light industrial cockpit */
.auth-page,
body[data-page="dashboard"] {
  --dash-bg: #f4f6f8;
  --dash-surface: #ffffff;
  --dash-surface-soft: #f8fafc;
  --dash-ink: #111827;
  --dash-muted: #536173;
  --dash-faint: #64748b;
  --dash-line: #dbe3ec;
  --dash-line-soft: #edf1f5;
  --dash-blue: #164f8f;
  --dash-blue-dark: #123a68;
  --dash-copper: #aa622e;
  --dash-copper-soft: #f6eadf;
  --dash-red: #ae3529;
  --dash-green: #27745a;
  --dash-shadow: 0 18px 56px rgba(20, 32, 46, 0.08);
  --dash-shadow-soft: 0 1px 2px rgba(20, 32, 46, 0.04), 0 12px 32px rgba(20, 32, 46, 0.045);
}

.auth-page {
  background:
    linear-gradient(90deg, rgba(219, 227, 236, 0.38) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(180deg, #fbfcfd 0%, var(--dash-bg) 100%);
  min-height: 100dvh;
  padding: 32px;
}

.auth-shell {
  align-items: center;
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(360px, 520px) minmax(420px, 640px);
  margin: 0 auto;
  max-width: 1240px;
  min-height: calc(100dvh - 64px);
}

.secure-auth-shell {
  grid-template-columns: minmax(300px, 520px);
  justify-content: center;
}

.auth-page .auth-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(219, 227, 236, 0.92);
  border-radius: 22px;
  box-shadow: var(--dash-shadow);
  gap: 18px;
  margin: 0;
  max-width: none;
  padding: 38px;
}

.auth-page .auth-panel::before {
  background: linear-gradient(90deg, var(--dash-copper), var(--dash-blue));
  border-radius: 22px 22px 0 0;
  content: "";
  height: 4px;
  left: -1px;
  position: absolute;
  right: -1px;
  top: -1px;
}

.auth-panel {
  position: relative;
}

.auth-eyebrow {
  color: var(--dash-copper);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-page .auth-panel h1 {
  color: var(--dash-ink);
  font-size: 42px;
  line-height: 1.04;
}

.auth-page .auth-panel p {
  color: var(--dash-muted);
  font-size: 16px;
  line-height: 1.55;
  max-width: 42ch;
}

.auth-page .auth-status {
  background: var(--dash-surface-soft);
  border-color: var(--dash-line);
  border-radius: 12px;
  min-height: 52px;
}

.auth-visual {
  display: grid;
  gap: 16px;
}

.auth-visual-topline {
  align-items: center;
  color: var(--dash-faint);
  display: flex;
  font-size: 12px;
  font-weight: 900;
  justify-content: space-between;
  text-transform: uppercase;
}

.auth-visual-topline strong {
  color: var(--dash-ink);
}

.auth-calendar-preview {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(219, 227, 236, 0.95);
  border-radius: 24px;
  box-shadow: var(--dash-shadow);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 220px;
  padding: 22px;
}

.preview-month {
  display: grid;
  gap: 12px;
}

.preview-month > span {
  color: var(--dash-ink);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.preview-weekdays,
.preview-days {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.preview-weekdays i,
.preview-days i {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-style: normal;
  justify-content: center;
}

.preview-weekdays i {
  color: var(--dash-faint);
  font-size: 10px;
  font-weight: 900;
}

.preview-days i {
  aspect-ratio: 1;
  background: #eef3f8;
  border: 1px solid #e0e7ef;
  color: var(--dash-muted);
  font-size: 11px;
  font-weight: 850;
}

.preview-days i[data-level="1"] { background: #dce9f6; color: var(--dash-blue-dark); }
.preview-days i[data-level="2"] { background: #b9d3ee; color: var(--dash-blue-dark); }
.preview-days i[data-level="3"] { background: #7fb0df; color: #082947; }
.preview-days i[data-level="5"] { background: var(--dash-blue-dark); color: #fff; }
.preview-days i.moba { background: #d85a4d; color: #fff; }
.preview-days i.today {
  background: #fff;
  border-color: var(--dash-copper);
  box-shadow: 0 0 0 3px rgba(170, 98, 46, 0.14);
  color: var(--dash-ink);
}
.preview-days i.selected {
  background: var(--dash-copper);
  color: #fff;
}

.preview-detail {
  align-content: center;
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-line);
  border-radius: 18px;
  display: grid;
  gap: 7px;
  padding: 18px;
}

.preview-detail span,
.preview-detail em {
  color: var(--dash-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.preview-detail strong {
  color: var(--dash-ink);
  font-size: 28px;
  line-height: 1;
}

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

.auth-preview-rows span {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(219, 227, 236, 0.95);
  border-radius: 16px;
  display: grid;
  gap: 2px;
  padding: 14px;
}

.auth-preview-rows b {
  background: var(--dash-copper);
  border-radius: 999px;
  height: 7px;
  margin-bottom: 8px;
  width: 32px;
}

.auth-preview-rows strong {
  color: var(--dash-ink);
  font-size: 14px;
}

.auth-preview-rows em {
  color: var(--dash-muted);
  font-size: 12px;
  font-style: normal;
}

.personal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.personal-badges span {
  background: #f4f7fb;
  border: 1px solid #dce5ef;
  border-radius: 999px;
  color: #405168;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 7px;
}

.personal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.personal-actions button {
  background: #f8fafc;
  border: 1px solid #dbe4ee;
  border-radius: 999px;
  color: #405168;
  font-size: 12px;
  font-weight: 900;
  min-height: 30px;
  padding: 5px 9px;
}

.personal-actions button.active {
  background: #fff7e8;
  border-color: #e8c58d;
  color: #7a4a15;
}

.personal-actions button.danger.active {
  background: #f8e9e6;
  border-color: #e4bbb5;
  color: #9f2d25;
}

.personal-editor,
.personal-detail-card {
  display: grid;
  gap: 14px;
}

.personal-editor {
  background: #fff;
  border-radius: 18px;
  min-width: min(620px, calc(100vw - 24px));
  padding: 18px;
}

.personal-editor header,
.personal-detail-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

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

.personal-editor header span,
.personal-detail-head span {
  color: var(--dash-muted, #536173);
  font-size: 12px;
  font-weight: 750;
}

.personal-editor-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.personal-editor-flags label {
  align-items: center;
  background: #f7fafc;
  border: 1px solid #dfe8f2;
  border-radius: 999px;
  color: #26364a;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  gap: 7px;
  min-height: 36px;
  padding: 7px 10px;
}

.personal-editor textarea,
.personal-detail-card textarea {
  min-height: 112px;
  resize: vertical;
}

.personal-editor-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 180px minmax(0, 1fr);
}

.personal-editor footer,
.personal-detail-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.personal-detail-card {
  background: #f8fafc;
  border: 1px solid #dbe5ef;
  border-radius: 16px;
  padding: 13px;
}

.personal-detail-head strong {
  color: var(--dash-ink, #111827);
  font-size: 15px;
  font-weight: 950;
}

body[data-page="dashboard"] {
  background:
    linear-gradient(90deg, rgba(219, 227, 236, 0.26) 1px, transparent 1px) 0 0 / 38px 38px,
    linear-gradient(180deg, #fbfcfd 0%, var(--dash-bg) 230px, var(--dash-bg) 100%);
  color: var(--dash-ink);
}

body[data-page="dashboard"] .dashboard-topbar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(219, 227, 236, 0.95);
  box-shadow: none;
  gap: 18px;
  grid-template-columns: minmax(250px, auto) minmax(320px, 1fr) auto auto;
  min-height: 64px;
  padding: 0 clamp(22px, 3vw, 42px);
}

body[data-page="dashboard"] .brand span {
  color: var(--dash-ink);
  font-size: 17px;
  font-weight: 900;
}

body[data-page="dashboard"] .brand img {
  max-height: 34px;
  max-width: 184px;
}

body[data-page="dashboard"] .global-search {
  background: rgba(248, 250, 252, 0.82);
  border: 1px solid transparent;
  border-bottom-color: var(--dash-line);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  max-width: 760px;
  min-height: 42px;
}

body[data-page="dashboard"] .global-search:focus-within {
  background: #fff;
  border-color: #bfd0e2;
  box-shadow: 0 0 0 4px rgba(22, 79, 143, 0.08);
}

body[data-page="dashboard"] .nav {
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-line);
  border-radius: 999px;
  gap: 2px;
  padding: 3px;
}

body[data-page="dashboard"] .nav a {
  border-radius: 999px;
  color: var(--dash-muted);
  min-height: 34px;
  padding: 7px 14px;
}

body[data-page="dashboard"] .nav a.active {
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 32, 46, 0.07);
  color: var(--dash-blue);
}

body[data-page="dashboard"] .user-pill {
  border-color: var(--dash-line);
  box-shadow: none;
  color: var(--dash-muted);
}

body[data-page="dashboard"] .personal-viewbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--dash-line);
  border-radius: 16px;
  box-shadow: var(--dash-shadow-soft);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 10px 12px;
}

.personal-viewbar-title {
  display: grid;
  gap: 2px;
}

.personal-viewbar-title strong {
  color: var(--dash-ink);
  font-size: 13px;
  font-weight: 950;
}

.personal-viewbar-title span {
  color: var(--dash-muted);
  font-size: 12px;
  font-weight: 750;
}

.personal-view-tabs {
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-line);
  border-radius: 999px;
  display: flex;
  gap: 2px;
  padding: 3px;
}

.personal-view-tabs button,
.personal-actions button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.personal-view-tabs button {
  background: transparent;
  border-radius: 999px;
  color: var(--dash-muted);
  font-size: 12px;
  font-weight: 900;
  min-height: 30px;
  padding: 6px 10px;
}

.personal-view-tabs button.active {
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 32, 46, 0.08);
  color: var(--dash-blue);
}

body[data-page="dashboard"] .dashboard-console {
  max-width: 1560px;
  padding: 20px clamp(22px, 3vw, 42px) 94px;
}

body[data-page="dashboard"] .console-layout {
  gap: 22px;
  grid-template-columns: 188px minmax(0, 1fr);
}

body[data-page="dashboard"] .filter-rail {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(219, 227, 236, 0.82);
  border-radius: 18px;
  box-shadow: none;
  gap: 12px;
  padding: 14px;
  top: 84px;
}

body[data-page="dashboard"] .rail-head {
  border-bottom-color: var(--dash-line);
  padding-bottom: 12px;
}

body[data-page="dashboard"] .rail-head strong {
  color: var(--dash-ink);
  font-size: 12px;
  text-transform: uppercase;
}

body[data-page="dashboard"] .rail-head span,
body[data-page="dashboard"] .filter-rail label,
body[data-page="dashboard"] .global-search span {
  color: var(--dash-faint);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body[data-page="dashboard"] .filter-rail select {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--dash-line);
  border-radius: 10px;
  color: var(--dash-ink);
  min-height: 36px;
  padding: 7px 9px;
}

body[data-page="dashboard"] .console-workspace {
  gap: 16px;
}

body[data-page="dashboard"] .workspace-commandbar {
  background: transparent;
  border: 0;
  min-height: 46px;
}

body[data-page="dashboard"] .workspace-commandbar strong {
  color: var(--dash-ink);
  font-size: 18px;
  font-weight: 950;
}

body[data-page="dashboard"] .workspace-commandbar span {
  color: var(--dash-muted);
  font-size: 13px;
}

body[data-page="dashboard"] .button {
  border-color: var(--dash-line);
  border-radius: 12px;
  box-shadow: none;
  font-size: 13px;
  min-height: 38px;
  padding-inline: 14px;
}

body[data-page="dashboard"] .button.primary {
  background: var(--dash-blue);
  border-color: var(--dash-blue);
  box-shadow: 0 12px 24px rgba(22, 79, 143, 0.16);
}

body[data-page="dashboard"] .button.primary:hover {
  background: var(--dash-blue-dark);
}

body[data-page="dashboard"] .button.ghost {
  background: rgba(255, 255, 255, 0.72);
  color: var(--dash-ink);
}

body[data-page="dashboard"] .offers-kpis {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(219, 227, 236, 0.95);
  border-radius: 18px;
  box-shadow: var(--dash-shadow-soft);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  overflow: hidden;
}

body[data-page="dashboard"] .offers-kpis .kpi {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--dash-line-soft);
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 8px;
  min-height: 82px;
  padding: 15px 16px;
  position: relative;
}

body[data-page="dashboard"] .offers-kpis .kpi:last-child {
  border-right: 0;
}

body[data-page="dashboard"] .offers-kpis .kpi::before {
  background: var(--dash-blue);
  border-radius: 999px;
  content: "";
  height: 3px;
  left: 16px;
  position: absolute;
  right: 16px;
  top: 0;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 160ms ease;
}

body[data-page="dashboard"] .offers-kpis .kpi:hover,
body[data-page="dashboard"] .offers-kpis .kpi:focus-visible {
  background: #fff;
  border-color: var(--dash-line-soft);
  box-shadow: none;
}

body[data-page="dashboard"] .offers-kpis .kpi:hover::before,
body[data-page="dashboard"] .offers-kpis .kpi:focus-visible::before {
  transform: scaleX(1);
}

body[data-page="dashboard"] .offers-kpis .kpi[data-tone="amber"]::before { background: var(--dash-copper); }
body[data-page="dashboard"] .offers-kpis .kpi[data-tone="red"]::before { background: var(--dash-red); }
body[data-page="dashboard"] .offers-kpis .kpi[data-tone="moba"]::before { background: #c24135; }
body[data-page="dashboard"] .offers-kpis .kpi[data-tone="primary"]::before { background: var(--dash-green); }

body[data-page="dashboard"] .offers-kpis .kpi span {
  color: var(--dash-faint);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
  order: 1;
  text-transform: uppercase;
}

body[data-page="dashboard"] .offers-kpis .kpi strong {
  color: var(--dash-ink);
  font-size: 25px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
  margin: 0;
  order: 2;
}

body[data-page="dashboard"] .offers-kpis .kpi:nth-child(7) strong {
  font-size: 22px;
}

body[data-page="dashboard"] .panel {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(219, 227, 236, 0.95);
  border-radius: 18px;
  box-shadow: var(--dash-shadow-soft);
}

body[data-page="dashboard"] .sent-heatmap-panel {
  padding: 22px;
}

body[data-page="dashboard"] .calendar-title {
  align-items: center;
  margin-bottom: 16px;
}

body[data-page="dashboard"] .calendar-title h2,
body[data-page="dashboard"] .registry-panel h2 {
  color: var(--dash-ink);
  font-size: 19px;
  font-weight: 950;
}

body[data-page="dashboard"] .calendar-title span,
body[data-page="dashboard"] .section-title span {
  color: var(--dash-muted);
  font-size: 12px;
}

body[data-page="dashboard"] .calendar-controls {
  align-items: end;
}

body[data-page="dashboard"] .calendar-controls label {
  gap: 5px;
}

body[data-page="dashboard"] .calendar-controls select {
  min-height: 36px;
}

body[data-page="dashboard"] .sent-heatmap-summary {
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-line);
  border-radius: 12px;
  color: var(--dash-ink);
  font-size: 12px;
  margin-bottom: 12px;
  padding: 9px 11px;
}

body[data-page="dashboard"] .sent-calendar-workspace {
  align-items: stretch;
  gap: 18px;
  grid-template-columns: minmax(640px, 1fr) minmax(340px, 430px);
}

body[data-page="dashboard"] .calendar-year-grid {
  gap: 14px;
}

body[data-page="dashboard"] .calendar-year-grid[data-month-count="2"] {
  grid-template-columns: repeat(2, minmax(300px, 1fr));
}

body[data-page="dashboard"] .calendar-month {
  background: #fff;
  border: 1px solid var(--dash-line);
  border-radius: 16px;
  gap: 9px;
  padding: 13px;
}

body[data-page="dashboard"] .calendar-month h3 {
  color: var(--dash-ink);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

body[data-page="dashboard"] .calendar-month-weekdays {
  margin-top: 2px;
}

body[data-page="dashboard"] .calendar-month-weekdays span {
  color: var(--dash-faint);
  font-size: 10px;
  font-weight: 900;
}

body[data-page="dashboard"] .calendar-month-cells {
  gap: 5px;
  grid-auto-rows: 34px;
}

body[data-page="dashboard"] .calendar-day {
  border: 1px solid #dde6ef;
  border-radius: 9px;
  height: 34px;
  min-height: 34px;
  padding: 3px;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

body[data-page="dashboard"] .calendar-day:not(:disabled):hover {
  border-color: var(--dash-copper);
  box-shadow: 0 0 0 3px rgba(170, 98, 46, 0.13);
  transform: translateY(-1px);
}

body[data-page="dashboard"] .calendar-day[data-level="1"] { background: #e8f1fa; color: var(--dash-blue-dark); }
body[data-page="dashboard"] .calendar-day[data-level="2"] { background: #cfe0f2; color: var(--dash-blue-dark); }
body[data-page="dashboard"] .calendar-day[data-level="3"] { background: #8fb9df; color: #082947; }
body[data-page="dashboard"] .calendar-day[data-level="4"] { background: var(--dash-blue); color: #fff; }
body[data-page="dashboard"] .calendar-day[data-level="5"] { background: var(--dash-blue-dark); color: #fff; }
body[data-page="dashboard"] .calendar-day.has-moba[data-moba-level] { background: #c24135; color: #fff; }
body[data-page="dashboard"] .calendar-day.mixed-source[data-level] {
  background: linear-gradient(135deg, var(--dash-blue) 0 58%, #c24135 58% 100%);
}

body[data-page="dashboard"] .calendar-day.today {
  border-color: var(--dash-copper);
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px rgba(170, 98, 46, 0.3);
}

body[data-page="dashboard"] .calendar-day.selected {
  outline: 3px solid rgba(17, 24, 39, 0.18);
  outline-offset: 2px;
}

body[data-page="dashboard"] .day-number {
  font-size: 10px;
  font-weight: 850;
}

body[data-page="dashboard"] .day-count {
  font-size: 14px;
  font-weight: 950;
}

body[data-page="dashboard"] .calendar-legend {
  margin-top: 12px;
}

body[data-page="dashboard"] .day-detail {
  background: #fff;
  border: 1px solid var(--dash-line);
  border-radius: 16px;
  box-shadow: none;
  max-height: 344px;
  padding: 16px;
}

body[data-page="dashboard"] .day-detail-head {
  align-items: start;
  border-bottom: 1px solid var(--dash-line-soft);
  margin-bottom: 12px;
  padding-bottom: 12px;
}

body[data-page="dashboard"] .day-detail-head h3 {
  color: var(--dash-ink);
  font-size: 17px;
}

body[data-page="dashboard"] .day-offer {
  background: var(--dash-surface-soft);
  border-color: var(--dash-line);
  border-radius: 12px;
  padding: 11px 12px;
}

body[data-page="dashboard"] .day-offer:hover {
  background: #fff;
  border-color: #c7d5e5;
}

body[data-page="dashboard"] .registry-panel {
  padding: 18px 18px 12px;
}

body[data-page="dashboard"] .table-wrap {
  border: 1px solid var(--dash-line-soft);
  border-radius: 14px;
  max-height: none;
  overflow: auto;
}

body[data-page="dashboard"] .offer-table th {
  background: var(--dash-surface-soft);
  border-bottom: 1px solid var(--dash-line);
  color: var(--dash-faint);
  font-size: 10px;
  font-weight: 900;
  position: sticky;
  top: 0;
  z-index: 2;
}

body[data-page="dashboard"] .offer-table th,
body[data-page="dashboard"] .offer-table td {
  padding: 11px 12px;
}

body[data-page="dashboard"] .offer-table td {
  border-bottom-color: var(--dash-line-soft);
  color: #263445;
  font-size: 13px;
}

body[data-page="dashboard"] .offer-table tbody tr:nth-child(even) {
  background: #fbfcfd;
}

body[data-page="dashboard"] .offer-table tbody tr:hover {
  background: #fff;
  box-shadow: inset 3px 0 0 var(--dash-blue);
}

body[data-page="dashboard"] .offer-table .project-link {
  color: var(--dash-blue);
  font-weight: 900;
}

body[data-page="dashboard"] .offer-machine {
  color: var(--dash-muted);
}

body[data-page="dashboard"] .amount,
body[data-page="dashboard"] .serial-number,
body[data-page="dashboard"] .offer-table td:nth-child(9) {
  font-variant-numeric: tabular-nums lining-nums;
}

body[data-page="dashboard"] .chip,
body[data-page="dashboard"] .badge,
body[data-page="dashboard"] .next-action {
  border-radius: 999px;
  box-shadow: none;
  font-size: 10px;
  min-height: 22px;
}

body[data-page="dashboard"] .crm-panel {
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--dash-line);
  box-shadow: 0 -12px 34px rgba(20, 32, 46, 0.08);
}

body[data-page="dashboard"] .crm-summary-bar {
  min-height: 48px;
  padding: 8px clamp(22px, 3vw, 42px);
}

body[data-page="dashboard"] .crm-summary-title strong {
  color: var(--dash-ink);
  font-size: 13px;
  text-transform: uppercase;
}

body[data-page="dashboard"] .crm-summary-title em {
  color: var(--dash-muted);
  font-size: 12px;
}

body[data-page="dashboard"] .crm-summary-metrics span {
  background: var(--dash-surface-soft);
  border-color: var(--dash-line);
  color: var(--dash-muted);
}

body[data-page="dashboard"] .crm-summary-metrics span:first-child {
  background: var(--dash-copper-soft);
  color: #7c3d12;
}

body[data-page="dashboard"] .crm-summary-toggle {
  background: #fff;
  border-color: var(--dash-line);
  color: var(--dash-blue);
}

body[data-page="dashboard"] .crm-expanded {
  border-top: 1px solid var(--dash-line-soft);
  max-height: min(50vh, 460px);
}

body[data-page="dashboard"] .crm-item {
  background: var(--dash-surface-soft);
  border-color: var(--dash-line);
}

body[data-page="dashboard"] .crm-item:hover {
  background: #fff;
}

@media (max-width: 1280px) {
  body[data-page="dashboard"] .offers-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body[data-page="dashboard"] .offers-kpis .kpi:nth-child(4n) {
    border-right: 0;
  }

  body[data-page="dashboard"] .sent-calendar-workspace {
    grid-template-columns: 1fr;
  }
}

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

  .auth-visual {
    order: -1;
  }

  body[data-page="dashboard"] .dashboard-topbar {
    grid-template-columns: 1fr;
    padding-block: 10px;
  }

  body[data-page="dashboard"] .console-layout {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .filter-rail {
    position: static;
  }

  body[data-page="dashboard"] .calendar-year-grid[data-month-count="2"] {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}

@media (max-width: 720px) {
  .auth-page {
    padding: 16px;
  }

  .auth-shell {
    gap: 18px;
    min-height: calc(100dvh - 32px);
  }

  .auth-page .auth-panel {
    padding: 26px;
  }

  .auth-page .auth-panel h1 {
    font-size: 34px;
  }

  .auth-calendar-preview,
  .auth-preview-rows {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .dashboard-console {
    padding: 12px 12px 98px;
  }

  body[data-page="dashboard"] .workspace-commandbar {
    gap: 12px;
  }

  body[data-page="dashboard"] .page-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="dashboard"] .offers-kpis {
    display: flex;
    gap: 8px;
    margin-inline: -12px;
    overflow-x: auto;
    padding: 0 12px 4px;
    scroll-snap-type: x mandatory;
  }

  body[data-page="dashboard"] .offers-kpis .kpi {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--dash-line);
    border-radius: 14px;
    flex: 0 0 138px;
    min-height: 66px;
    padding: 12px;
    scroll-snap-align: start;
  }

  body[data-page="dashboard"] .offers-kpis .kpi:nth-child(2n) {
    border-right: 1px solid var(--dash-line);
  }

  body[data-page="dashboard"] .offers-kpis .kpi strong {
    font-size: 21px;
  }

  body[data-page="dashboard"] .offers-kpis .kpi:nth-child(7) strong {
    font-size: 18px;
  }

  body[data-page="dashboard"] .sent-heatmap-panel,
  body[data-page="dashboard"] .registry-panel {
    padding: 14px;
  }

  body[data-page="dashboard"] .calendar-year-grid[data-month-count],
  body[data-page="dashboard"] .calendar-year-grid[data-month-count="2"] {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .calendar-month-cells {
    grid-auto-rows: 32px;
  }

  body[data-page="dashboard"] .calendar-day {
    height: 32px;
    min-height: 32px;
  }

  body[data-page="dashboard"] .table-wrap {
    border: 0;
    border-radius: 0;
  }
}

/* Premium dashboard layer: clear, light, operational */
body[data-page="dashboard"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0, rgba(246, 248, 251, 0.98) 260px),
    linear-gradient(90deg, rgba(210, 219, 230, 0.34) 1px, transparent 1px) 0 0 / 42px 42px,
    #f6f8fb;
}

body[data-page="dashboard"] .dashboard-topbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(210, 219, 230, 0.9);
  box-shadow: 0 10px 36px rgba(17, 31, 49, 0.045);
  gap: 14px;
  grid-template-columns: minmax(238px, auto) minmax(280px, 1fr) auto auto;
  min-height: 56px;
  padding: 0 clamp(18px, 3vw, 36px);
}

body[data-page="dashboard"] .brand img {
  max-height: 30px;
  max-width: 168px;
}

body[data-page="dashboard"] .brand span {
  color: #102033;
  font-size: 15px;
  font-weight: 950;
}

body[data-page="dashboard"] .global-search {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #d8e1ec;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  min-height: 40px;
}

body[data-page="dashboard"] .global-search:focus-within {
  border-color: #adc6e0;
  box-shadow: 0 0 0 4px rgba(15, 90, 168, 0.08);
}

body[data-page="dashboard"] .dashboard-console {
  padding: 18px clamp(18px, 3vw, 36px) 104px;
}

body[data-page="dashboard"] .console-layout {
  gap: 18px;
  grid-template-columns: 190px minmax(0, 1fr);
}

body[data-page="dashboard"] .filter-rail {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(216, 225, 236, 0.95);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(18, 35, 55, 0.07);
  padding: 14px;
}

body[data-page="dashboard"] .workspace-commandbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 253, 0.88));
  border: 1px solid rgba(216, 225, 236, 0.95);
  border-radius: 16px;
  box-shadow: 0 12px 34px rgba(18, 35, 55, 0.055);
  min-height: 56px;
  padding: 10px 12px 10px 16px;
}

body[data-page="dashboard"] .workspace-commandbar strong {
  color: #102033;
  font-size: 19px;
  letter-spacing: 0;
}

body[data-page="dashboard"] .workspace-commandbar span {
  color: #657287;
  font-size: 12px;
  font-weight: 800;
}

body[data-page="dashboard"] .button {
  border-radius: 10px;
  font-weight: 900;
}

body[data-page="dashboard"] .offers-kpis {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #d8e1ec;
  border-radius: 16px;
  box-shadow: 0 16px 42px rgba(18, 35, 55, 0.055);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  overflow: hidden;
}

body[data-page="dashboard"] .offers-kpis .kpi {
  background: transparent;
  border: 0;
  border-radius: 0;
  border-right: 1px solid #edf2f7;
  box-shadow: none;
  min-height: 58px;
  padding: 10px 12px;
}

body[data-page="dashboard"] .offers-kpis .kpi:last-child {
  border-right: 0;
}

body[data-page="dashboard"] .offers-kpis .kpi:hover,
body[data-page="dashboard"] .offers-kpis .kpi:focus-visible {
  background: #fff;
  box-shadow: inset 0 3px 0 #0f5aa8;
}

body[data-page="dashboard"] .offers-kpis .kpi[data-tone="amber"]:hover,
body[data-page="dashboard"] .offers-kpis .kpi[data-tone="amber"]:focus-visible {
  box-shadow: inset 0 3px 0 #aa622e;
}

body[data-page="dashboard"] .offers-kpis .kpi[data-tone="red"]:hover,
body[data-page="dashboard"] .offers-kpis .kpi[data-tone="red"]:focus-visible,
body[data-page="dashboard"] .offers-kpis .kpi[data-tone="moba"]:hover,
body[data-page="dashboard"] .offers-kpis .kpi[data-tone="moba"]:focus-visible {
  box-shadow: inset 0 3px 0 #bb3f33;
}

body[data-page="dashboard"] .offers-kpis .kpi strong {
  color: #102033;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  margin: 0 0 5px;
}

body[data-page="dashboard"] .offers-kpis .kpi:nth-child(7) strong {
  font-size: 18px;
}

body[data-page="dashboard"] .offers-kpis .kpi span {
  color: #657287;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.01em;
  line-height: 1.18;
  text-transform: uppercase;
}

body[data-page="dashboard"] .panel {
  background: rgba(255, 255, 255, 0.94);
  border-color: #d8e1ec;
  border-radius: 18px;
  box-shadow: 0 20px 56px rgba(18, 35, 55, 0.07);
}

body[data-page="dashboard"] .sent-heatmap-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 251, 253, 0.94));
  padding: 20px;
}

body[data-page="dashboard"] .calendar-title {
  align-items: end;
  margin-bottom: 14px;
}

body[data-page="dashboard"] .calendar-title h2,
body[data-page="dashboard"] .registry-panel h2 {
  color: #102033;
  font-size: 20px;
  font-weight: 950;
}

body[data-page="dashboard"] .calendar-title span,
body[data-page="dashboard"] .section-title span {
  color: #657287;
  font-size: 12px;
  font-weight: 800;
}

body[data-page="dashboard"] .sent-heatmap-summary {
  background: #f8fafc;
  border: 1px solid #e2e9f1;
  border-radius: 12px;
  color: #102033;
  font-size: 12px;
  font-weight: 850;
  margin-bottom: 14px;
}

body[data-page="dashboard"] .sent-calendar-workspace {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(700px, 1.35fr) minmax(340px, 0.65fr);
}

body[data-page="dashboard"] .calendar-year-grid {
  gap: 16px;
}

body[data-page="dashboard"] .calendar-year-grid[data-month-count="2"] {
  grid-template-columns: repeat(2, minmax(330px, 1fr));
}

body[data-page="dashboard"] .calendar-month {
  background: #fff;
  border: 1px solid #d8e1ec;
  border-radius: 16px;
  gap: 10px;
  padding: 15px;
}

body[data-page="dashboard"] .calendar-month h3 {
  color: #334155;
  font-size: 13px;
  font-weight: 950;
}

body[data-page="dashboard"] .calendar-month-cells {
  gap: 5px;
  grid-auto-rows: 38px;
}

body[data-page="dashboard"] .calendar-day {
  border-color: #dbe4ee;
  border-radius: 10px;
  height: 38px;
  min-height: 38px;
  padding: 4px;
  position: relative;
}

body[data-page="dashboard"] .calendar-day:not(:disabled):hover {
  border-color: #aa622e;
  box-shadow: 0 0 0 3px rgba(170, 98, 46, 0.13);
  transform: translateY(-1px);
}

body[data-page="dashboard"] .calendar-day.today {
  border-color: #aa622e;
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px rgba(170, 98, 46, 0.25);
}

body[data-page="dashboard"] .calendar-day.today::after {
  background: #aa622e;
  border-radius: 999px;
  bottom: 4px;
  box-shadow: 0 0 0 2px #fff;
  content: "";
  height: 6px;
  position: absolute;
  right: 4px;
  width: 6px;
}

body[data-page="dashboard"] .calendar-day.selected {
  outline: 3px solid rgba(15, 90, 168, 0.36);
  outline-offset: 2px;
}

body[data-page="dashboard"] .day-number {
  font-size: 10px;
  font-weight: 900;
}

body[data-page="dashboard"] .day-count {
  font-size: 15px;
  font-weight: 950;
}

body[data-page="dashboard"] .day-moba-count {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  color: #832219;
  font-size: 9px;
  height: 15px;
  min-width: 15px;
}

body[data-page="dashboard"] .calendar-day.has-moba[data-moba-level] {
  background: #c24135;
  color: #fff;
}

body[data-page="dashboard"] .calendar-day.mixed-source[data-level] {
  background: linear-gradient(135deg, #0f5aa8 0 58%, #c24135 58% 100%);
}

body[data-page="dashboard"] .calendar-legend {
  color: #657287;
  font-size: 11px;
  justify-content: center;
  margin-top: 14px;
}

body[data-page="dashboard"] .day-detail {
  background: #fff;
  border: 1px solid #d8e1ec;
  border-radius: 16px;
  max-height: 410px;
  overflow: auto;
  padding: 16px;
}

body[data-page="dashboard"] .day-detail-head {
  align-items: start;
  border-bottom: 1px solid #edf2f7;
  margin-bottom: 12px;
  padding-bottom: 12px;
}

body[data-page="dashboard"] .day-detail-head h3 {
  color: #102033;
  font-size: 17px;
  line-height: 1.2;
}

body[data-page="dashboard"] .day-detail-head p {
  color: #536173;
  font-size: 12px;
  font-weight: 850;
  margin-top: 4px;
}

body[data-page="dashboard"] .moba-inline {
  color: #9f2d20;
  font-weight: 950;
}

body[data-page="dashboard"] .day-offer {
  background: #f8fafc;
  border: 1px solid #d8e1ec;
  border-radius: 12px;
  padding: 12px;
}

body[data-page="dashboard"] .day-offer.moba-offer {
  border-color: #efc5c0;
  box-shadow: inset 3px 0 0 #c24135;
}

body[data-page="dashboard"] .registry-panel {
  padding: 18px;
}

body[data-page="dashboard"] .table-wrap {
  border: 1px solid #edf2f7;
  border-radius: 14px;
}

body[data-page="dashboard"] .offer-table th {
  background: #f8fafc;
  color: #728199;
  font-size: 10px;
}

body[data-page="dashboard"] .offer-table th,
body[data-page="dashboard"] .offer-table td {
  padding: 10px 11px;
}

body[data-page="dashboard"] .offer-table td {
  color: #27364a;
}

body[data-page="dashboard"] .offer-table tbody tr:hover {
  background: #fff;
  box-shadow: inset 3px 0 0 #0f5aa8;
}

body[data-page="dashboard"] .crm-panel {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  border: 0;
  border-top: 1px solid #d8e1ec;
  bottom: 0;
  box-shadow: 0 -12px 34px rgba(18, 35, 55, 0.08);
  left: 0;
  position: fixed;
  right: 0;
  z-index: 35;
}

body[data-page="dashboard"] .crm-summary-bar {
  gap: 10px;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  min-height: 42px;
  padding: 6px clamp(18px, 3vw, 36px);
}

body[data-page="dashboard"] .crm-summary-title strong {
  color: #102033;
  font-size: 12px;
  letter-spacing: 0.02em;
}

body[data-page="dashboard"] .crm-summary-title em {
  color: #657287;
  font-size: 11px;
}

body[data-page="dashboard"] .crm-summary-metrics span,
body[data-page="dashboard"] .crm-summary-toggle {
  border-color: #d8e1ec;
  font-size: 11px;
}

body[data-page="dashboard"] .crm-expanded {
  background: #fff;
  max-height: min(46vh, 430px);
  overflow: auto;
  padding: 12px clamp(18px, 3vw, 36px) 16px;
}

@media (max-width: 1320px) {
  body[data-page="dashboard"] .sent-calendar-workspace {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .offers-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body[data-page="dashboard"] .offers-kpis .kpi:nth-child(4n) {
    border-right: 0;
  }
}

@media (max-width: 980px) {
  body[data-page="dashboard"] .dashboard-topbar,
  body[data-page="dashboard"] .console-layout {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .filter-rail {
    position: static;
  }

  body[data-page="dashboard"] .sent-calendar-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body[data-page="dashboard"] .dashboard-console {
    padding: 12px 12px 106px;
  }

  body[data-page="dashboard"] .workspace-commandbar {
    align-items: stretch;
    display: grid;
  }

  body[data-page="dashboard"] .offers-kpis {
    display: flex;
    gap: 8px;
    margin-inline: -12px;
    overflow-x: auto;
    padding: 0 12px 4px;
    scroll-snap-type: x mandatory;
  }

  body[data-page="dashboard"] .offers-kpis .kpi {
    border: 1px solid #d8e1ec;
    border-radius: 14px;
    flex: 0 0 132px;
    min-height: 62px;
    scroll-snap-align: start;
  }

  body[data-page="dashboard"] .calendar-year-grid[data-month-count],
  body[data-page="dashboard"] .calendar-year-grid[data-month-count="2"] {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .calendar-month-cells {
    grid-auto-rows: 34px;
  }

  body[data-page="dashboard"] .calendar-day {
    height: 34px;
    min-height: 34px;
  }

  body[data-page="dashboard"] .crm-summary-bar {
    grid-template-columns: 1fr auto;
    padding-inline: 12px;
  }

body[data-page="dashboard"] .crm-summary-metrics {
    display: none;
  }
}

/* Smartphone operations layer: fast metadata first */
.mobile-offer-summary,
.mobile-detail-summary {
  display: none;
}

@media (max-width: 720px) {
  body[data-page="dashboard"] .dashboard-topbar,
  body[data-page="detail"] .topbar {
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 10px 30px rgba(18, 35, 55, 0.08);
    gap: 9px;
    padding: 8px 12px 10px;
    position: sticky;
    top: 0;
    z-index: 30;
  }

  body[data-page="detail"] .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  body[data-page="detail"] .topbar .nav {
    grid-column: 1 / -1;
  }

  body[data-page="dashboard"] .brand,
  body[data-page="detail"] .brand {
    min-height: 34px;
  }

  body[data-page="dashboard"] .brand img,
  body[data-page="detail"] .brand img {
    max-height: 25px;
    max-width: 118px;
  }

  body[data-page="dashboard"] .brand span,
  body[data-page="detail"] .brand span {
    font-size: 13px;
  }

  body[data-page="dashboard"] .global-search {
    min-height: 42px;
  }

  body[data-page="dashboard"] .global-search span {
    display: none;
  }

  body[data-page="dashboard"] .global-search input {
    font-size: 16px;
  }

  body[data-page="dashboard"] .dashboard-console,
  body[data-page="detail"] .page {
    padding-inline: 10px;
  }

  body[data-page="dashboard"] .personal-viewbar {
    align-items: stretch;
    display: grid;
    gap: 9px;
    margin-bottom: 10px;
    padding: 10px;
  }

  .personal-view-tabs {
    border-radius: 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .personal-view-tabs::-webkit-scrollbar {
    display: none;
  }

  .personal-view-tabs button {
    flex: 0 0 auto;
    min-height: 36px;
    white-space: nowrap;
  }

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

  .personal-actions button {
    border-radius: 10px;
    min-height: 38px;
    padding-inline: 6px;
  }

  .personal-editor {
    border-radius: 16px;
    padding: 14px;
  }

  .personal-editor header,
  .personal-editor footer,
  .personal-detail-actions {
    align-items: stretch;
    display: grid;
  }

  .personal-editor-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .workspace-commandbar {
    border-radius: 18px;
    padding: 12px;
  }

  body[data-page="dashboard"] .console-workspace {
    display: flex;
    flex-direction: column;
  }

  body[data-page="dashboard"] .workspace-commandbar,
  body[data-page="dashboard"] .offers-kpis {
    display: none;
  }

  body[data-page="dashboard"] .registry-panel {
    order: 2;
  }

  body[data-page="dashboard"] .sent-heatmap-panel {
    order: 1;
    border-radius: 16px;
    margin-top: 0;
    padding: 10px;
  }

  body[data-page="dashboard"] .sent-heatmap-panel .section-title,
  body[data-page="dashboard"] .calendar-title {
    align-items: start;
    gap: 8px;
    margin-bottom: 8px;
  }

  body[data-page="dashboard"] .calendar-title h2 {
    font-size: 17px;
  }

  body[data-page="dashboard"] .calendar-title span,
  body[data-page="dashboard"] .sent-heatmap-summary,
  body[data-page="dashboard"] .calendar-legend,
  body[data-page="dashboard"] .day-detail {
    display: none;
  }

  body[data-page="dashboard"] .calendar-controls {
    gap: 6px;
  }

  body[data-page="dashboard"] .calendar-controls label {
    display: none;
  }

  body[data-page="dashboard"] .calendar-controls .button {
    min-height: 34px;
    padding-inline: 10px;
  }

  body[data-page="dashboard"] .sent-calendar-workspace {
    display: block;
  }

  body[data-page="dashboard"] .calendar-year-grid,
  body[data-page="dashboard"] .calendar-year-grid[data-month-count],
  body[data-page="dashboard"] .calendar-year-grid[data-month-count="2"] {
    gap: 8px;
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .calendar-month {
    border-radius: 14px;
    padding: 9px;
  }

  body[data-page="dashboard"] .calendar-month h3 {
    font-size: 12px;
    margin-bottom: 6px;
  }

  body[data-page="dashboard"] .calendar-month-weekdays,
  body[data-page="dashboard"] .calendar-month-cells {
    gap: 3px;
  }

  body[data-page="dashboard"] .calendar-day {
    border-radius: 6px;
    min-height: 27px;
  }

  body[data-page="dashboard"] .calendar-day .day-number {
    font-size: 9px;
  }

  body[data-page="dashboard"] .calendar-day .day-count,
  body[data-page="dashboard"] .calendar-day .day-moba-count {
    font-size: 10px;
    line-height: 1;
  }

  body[data-page="dashboard"] .filter-toggle {
    margin-bottom: 0;
  }

  body[data-page="dashboard"] .workspace-commandbar strong {
    font-size: 18px;
  }

  body[data-page="dashboard"] .registry-panel {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  body[data-page="dashboard"] .registry-panel .section-title {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #d8e1ec;
    border-radius: 16px;
    margin-bottom: 10px;
    padding: 12px;
  }

  body[data-page="dashboard"] .table-wrap {
    overflow: visible;
  }

  body[data-page="dashboard"] .offer-table tbody {
    gap: 10px;
  }

  body[data-page="dashboard"] .offer-table tbody tr {
    background: #fff;
    border: 1px solid #d7e1ec;
    border-radius: 18px;
    box-shadow: 0 14px 32px rgba(18, 35, 55, 0.075);
    overflow: hidden;
    padding: 0;
  }

  body[data-page="dashboard"] .offer-table tbody tr:hover {
    box-shadow: 0 14px 32px rgba(18, 35, 55, 0.075);
  }

  body[data-page="dashboard"] .offer-table td:not(.cell-primary) {
    display: none;
  }

  body[data-page="dashboard"] .offer-table .cell-primary {
    border: 0;
    display: block;
    padding: 14px;
  }

  body[data-page="dashboard"] .offer-table .cell-primary::before {
    display: none;
  }

  body[data-page="dashboard"] .offer-table .project-link {
    color: #0f4f91;
    display: inline-flex;
    font-size: 18px;
    line-height: 1.1;
    min-height: 26px;
  }

  body[data-page="dashboard"] .offer-table .cell-primary > .meta {
    color: #6b7789;
    font-size: 12px;
    font-weight: 800;
    margin-top: 3px;
  }

  .mobile-offer-summary {
    display: grid;
    gap: 11px;
    margin-top: 13px;
  }

  .mobile-offer-line {
    align-items: start;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .mobile-offer-line > span {
    color: #142033;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.25;
  }

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

  .mobile-fact {
    background: #f7fafc;
    border: 1px solid #e2eaf3;
    border-radius: 12px;
    display: grid;
    gap: 3px;
    min-height: 54px;
    padding: 9px 10px;
  }

  .mobile-fact.wide {
    grid-column: 1 / -1;
  }

  .mobile-fact em {
    color: #758397;
    font-size: 10px;
    font-style: normal;
    font-weight: 950;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .mobile-fact b,
  .mobile-offer-machine strong {
    color: #142033;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .mobile-offer-machine {
    background: linear-gradient(180deg, #f9fbfd, #f3f7fb);
    border: 1px solid #dce7f2;
    border-radius: 14px;
    display: grid;
    gap: 4px;
    padding: 10px 11px;
  }

  .mobile-offer-machine span {
    color: #758397;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .mobile-offer-machine strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }

  .mobile-card-action {
    align-items: center;
    background: #0f5aa8;
    border-radius: 12px;
    color: #fff;
    display: inline-flex;
    font-size: 14px;
    font-weight: 950;
    justify-content: center;
    min-height: 42px;
    text-decoration: none;
    width: 100%;
  }

  .mobile-card-action:active {
    transform: translateY(1px);
  }

  body[data-page="detail"] .page {
    gap: 10px;
    padding-bottom: 34px;
  }

  body[data-page="detail"] .page-head {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #d8e1ec;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(18, 35, 55, 0.06);
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 13px;
  }

  body[data-page="detail"] .page-head .button {
    align-self: start;
    min-height: 36px;
    padding-inline: 12px;
    width: auto;
  }

  body[data-page="detail"] .page-head h1 {
    font-size: 24px;
  }

  body[data-page="detail"] .page-head p {
    display: -webkit-box;
    font-size: 13px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  body[data-page="detail"] .detail-grid {
    gap: 10px;
    grid-template-columns: 1fr;
  }

  body[data-page="detail"] .offer-cover {
    border-radius: 18px;
    gap: 12px;
    padding: 14px;
  }

  body[data-page="detail"] .offer-title-row {
    gap: 10px;
  }

  body[data-page="detail"] .offer-title-row h2 {
    font-size: 17px;
  }

  body[data-page="detail"] .offer-title-row .muted {
    font-size: 12px;
  }

  body[data-page="detail"] .offer-cover .cover-meta {
    display: none;
  }

  .mobile-detail-summary {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 253, 0.98));
    border: 1px solid #d8e1ec;
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: grid;
    gap: 11px;
    padding: 12px;
  }

  .mobile-detail-primary {
    align-items: start;
    display: grid;
    gap: 4px;
  }

  .mobile-detail-primary span {
    color: #142033;
    font-size: 15px;
    font-weight: 950;
    line-height: 1.25;
  }

  .mobile-detail-primary strong {
    color: #0f4f91;
    font-size: 28px;
    font-weight: 950;
    line-height: 1;
  }

  .mobile-detail-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr 0.72fr;
  }

  .mobile-detail-actions .button {
    min-height: 44px;
    width: 100%;
  }

  .mobile-pdf-missing {
    align-items: center;
    background: #f7fafc;
    border: 1px dashed #cfd9e6;
    border-radius: 10px;
    color: #6b7789;
    display: inline-flex;
    font-size: 13px;
    font-weight: 900;
    justify-content: center;
    min-height: 44px;
  }

  body[data-page="detail"] .next-action-banner {
    padding: 10px 11px;
  }

  body[data-page="detail"] .next-action-banner strong {
    font-size: 15px;
  }

  body[data-page="detail"] .tabs {
    gap: 6px;
    margin-inline: -10px;
    overflow-x: auto;
    padding-inline: 10px;
    scrollbar-width: none;
  }

  body[data-page="detail"] .tabs::-webkit-scrollbar {
    display: none;
  }

  body[data-page="detail"] .tabs button {
    flex: 0 0 auto;
    min-height: 38px;
    white-space: nowrap;
  }

  body[data-page="detail"] .pdf-viewer {
    border-radius: 18px;
    overflow: hidden;
  }

  body[data-page="detail"] .pdf-frame-large {
    height: min(58vh, 560px);
    min-height: 360px;
    padding: 8px;
  }

  body[data-page="detail"] .pdf-viewer-actions {
    justify-content: stretch;
  }

  body[data-page="detail"] .pdf-tool {
    flex: 1 1 auto;
  }

  body[data-page="detail"] .pdf-zoom-readout {
    min-width: 54px;
  }
}
