:root {
  --bg: #eef1f4;
  --panel: #ffffff;
  --panel-soft: #f7fafc;
  --line: #d9e2ec;
  --line-strong: #c2cdd9;
  --text: #12202f;
  --muted: #5f7186;
  --accent: #0f4f75;
  --accent-strong: #0a3854;
  --accent-soft: #dcecf7;
  --success-soft: #dff4ea;
  --danger: #a83b32;
  --danger-soft: #fbe6e4;
  --warning-soft: #fff5db;
  --warning-text: #724b00;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 6px 16px rgba(17, 30, 44, 0.06);
  --shadow-md: 0 18px 36px rgba(17, 30, 44, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "Source Sans Pro", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, #ffffff 0%, transparent 34%),
    radial-gradient(circle at 88% 12%, #dbe8f4 0%, transparent 32%),
    var(--bg);
  line-height: 1.4;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.45rem;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  letter-spacing: 0.01em;
}

p {
  margin: 0 0 0.5rem;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
.button-link {
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #176089, var(--accent));
  color: #fff;
  padding: 0.5rem 0.74rem;
  cursor: pointer;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: transform 120ms ease, box-shadow 140ms ease, filter 140ms ease;
  box-shadow: 0 6px 16px rgba(15, 79, 117, 0.25);
}

button:hover,
.button-link:hover {
  filter: brightness(1.03);
  text-decoration: none;
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button-muted {
  background: linear-gradient(180deg, #7a8796, #626f7d);
  box-shadow: 0 4px 12px rgba(43, 56, 70, 0.25);
}

input,
textarea,
select {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem 0.62rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: 0;
  border-color: #72a6c6;
  box-shadow: 0 0 0 3px rgba(71, 128, 163, 0.15);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  margin: 0;
}

label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

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

label {
  display: block;
  margin-bottom: 0.55rem;
  font-weight: 600;
  color: #23374b;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

body.sidebar-collapsed .layout {
  grid-template-columns: 78px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 1.5rem 1.1rem;
  color: #e8f0f6;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.08), transparent 38%),
    linear-gradient(180deg, #0f2f45, #12344b 45%, #0d283b);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-wrap {
  margin-bottom: 1.4rem;
  padding: 0.8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-toggle {
  width: 100%;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.sidebar-toggle svg {
  width: 18px;
  height: 18px;
  fill: #f2f8fc;
}

.nav-icon {
  display: inline-flex;
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.12);
  margin-right: 0.5rem;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  fill: #f2f8fc;
}

.nav-label {
  white-space: nowrap;
}

.brand {
  font-size: 1.18rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.brand-subtitle {
  font-size: 0.83rem;
  color: rgba(233, 241, 247, 0.85);
}

.sidebar nav {
  display: grid;
  gap: 0.4rem;
}

.nav-link {
  display: flex;
  align-items: center;
  position: relative;
  padding: 0.68rem 0.75rem;
  border-radius: 10px;
  color: #f2f8fc;
  border: 1px solid transparent;
}

.nav-link:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.nav-group {
  margin: 0;
}

.nav-group-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  list-style: none;
  cursor: pointer;
}

.nav-group-trigger .nav-icon {
  margin-right: 0.5rem;
}

.nav-group-trigger::after {
  content: ">";
  font-size: 0.78rem;
  opacity: 0.8;
  transform: rotate(90deg);
  transition: transform 120ms ease;
}

.nav-group[open] .nav-group-trigger::after {
  transform: rotate(270deg);
}

.nav-group-trigger::-webkit-details-marker {
  display: none;
}

.nav-submenu {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.2rem;
  padding-left: 0.7rem;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

body.sidebar-collapsed .brand-subtitle,
body.sidebar-collapsed .brand,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-group-trigger::after,
body.sidebar-collapsed .nav-submenu {
  display: none;
}

body.sidebar-collapsed .brand-wrap {
  padding: 0.45rem 0.35rem;
}

body.sidebar-collapsed .nav-link,
body.sidebar-collapsed .nav-group-trigger {
  justify-content: center;
  padding: 0.55rem 0.35rem;
}

body.sidebar-collapsed .nav-icon {
  margin-right: 0;
}

body.sidebar-collapsed .nav-link[data-tooltip]::after,
body.sidebar-collapsed .nav-group-trigger[data-tooltip]::after,
body.sidebar-collapsed .sidebar-toggle[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 0.25rem 0.45rem;
  border-radius: 8px;
  background: rgba(10, 29, 44, 0.95);
  color: #eaf2f8;
  font-size: 0.78rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 12;
}

body.sidebar-collapsed .nav-link[data-tooltip]:hover::after,
body.sidebar-collapsed .nav-group-trigger[data-tooltip]:hover::after,
body.sidebar-collapsed .sidebar-toggle[data-tooltip]:hover::after {
  opacity: 1;
}

.nav-sublink {
  padding-top: 0.56rem;
  padding-bottom: 0.56rem;
  font-size: 0.95rem;
  color: rgba(242, 248, 252, 0.92);
}

.content {
  padding: 1rem 1.3rem 1.6rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0.45rem 0.55rem;
  backdrop-filter: blur(6px);
  background: rgba(238, 241, 244, 0.8);
  border: 1px solid #d8e0e8;
  border-radius: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #174464;
  font-size: 0.88rem;
  font-weight: 650;
}

.mail-fetch-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  background: #eef5fd;
  color: #214867;
  font-size: 0.82rem;
  font-weight: 700;
}

.mail-fetch-chip.attention {
  background: #fff3e8;
  color: #8a4b12;
}

.page-header h1 {
  margin-bottom: 0.2rem;
}

.page-header p {
  margin: 0.1rem 0 0.75rem;
  color: var(--muted);
}

.card {
  margin-bottom: 0.75rem;
  background: linear-gradient(180deg, #fff, var(--panel-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0.82rem;
  box-shadow: var(--shadow-sm);
}

.grid {
  display: grid;
  gap: 0.6rem;
}

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

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

.case-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.summary-chip {
  padding: 0.58rem 0.65rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f4f8fb);
  box-shadow: var(--shadow-sm);
}

.summary-label {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0 0 0.55rem;
}

.dashboard-kpis .summary-chip {
  text-decoration: none;
  color: inherit;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.dashboard-kpis .summary-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(21, 66, 95, 0.12);
}

.dashboard-kpis .summary-chip strong {
  font-size: 1.35rem;
  color: #123751;
}

.dashboard-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-card {
  padding: 0.65rem 0.72rem;
}

.compact-card h2 {
  margin: 0 0 0.55rem;
  font-size: 0.98rem;
}

.dashboard-list {
  display: grid;
  gap: 0.12rem;
}

.dashboard-item {
  display: grid;
  gap: 0.08rem;
  padding: 0.28rem 0;
  border-bottom: 1px solid var(--line);
}

.dashboard-item:last-child {
  border-bottom: 0;
}

.planning-board-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 0.75rem;
}

.planning-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: flex-end;
}

.planning-inline-field {
  margin: 0;
  font-size: 0.84rem;
  min-width: 140px;
}

.planning-inline-field input,
.planning-inline-field select {
  margin-top: 0.15rem;
}

.planning-inline-check {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
}

.planning-inline-check input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.planning-calendar {
  display: grid;
  gap: 0.45rem;
}

.planning-calendar-head,
.planning-calendar-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.planning-calendar-head.business-days,
.planning-calendar-row.business-days {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.planning-calendar-row.one-col,
.planning-calendar-head.one-col {
  grid-template-columns: minmax(0, 1fr);
}

.planning-calendar-head div {
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  font-size: 0.82rem;
}

.planning-calendar-cell {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.35rem;
  min-height: 110px;
  background: #fff;
  display: grid;
  gap: 0.2rem;
  align-content: start;
}

.planning-calendar-cell.is-muted {
  opacity: 0.45;
  background: #f7f9fb;
}

.planning-calendar-day {
  font-weight: 700;
  font-size: 0.9rem;
}

.planning-calendar-chip {
  display: block;
  font-size: 0.78rem;
  line-height: 1.25;
  text-decoration: none;
  color: var(--accent);
  border-left: 3px solid #8cb2cf;
  padding-left: 0.3rem;
}

.planning-calendar-chip.team-colored {
  border-left-color: var(--team-color, #8aa1b5);
  background: linear-gradient(90deg, color-mix(in srgb, var(--team-color, #8aa1b5) 14%, #ffffff) 0%, #ffffff 56%);
}

.planning-calendar-bar {
  border-left-width: 6px;
  border-left-style: solid;
  border-left-color: var(--team-color, #8aa1b5);
  border-radius: 8px;
  padding: 0.22rem 0.35rem;
  color: #12202f;
  background: color-mix(in srgb, var(--team-color, #8aa1b5) 22%, #ffffff 78%);
  border: 1px solid color-mix(in srgb, var(--team-color, #8aa1b5) 55%, #ffffff 45%);
  font-weight: 600;
  text-shadow: none;
}

.planning-calendar-chip.status-confirmed {
  border-left-color: #3f9f66;
}

.planning-calendar-chip.status-in_progress {
  border-left-color: #0f4f75;
}

.planning-calendar-chip.status-planned {
  border-left-color: #8cb2cf;
}

.planning-calendar-chip.status-done {
  border-left-color: #6f7f91;
}

.planning-calendar-chip.status-cancelled {
  border-left-color: #a83b32;
}

.planning-list-item {
  border-left: 4px solid var(--team-color, #8aa1b5);
  padding-left: 0.55rem;
}

.planning-task-chip {
  border-left-width: 0;
  border-radius: 8px;
  padding: 0.2rem 0.35rem;
  background: #f4efe2;
  color: #5a4605;
  border: 1px solid #d9c98f;
  font-weight: 600;
}

.planning-task-list-item {
  border-left: 4px solid #d4b23a;
  padding-left: 0.55rem;
}

.dashboard-item small {
  color: var(--muted);
}

.dashboard-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.dashboard-inline-form {
  margin-top: 0.2rem;
}

.sticky-actions {
  position: sticky;
  top: 72px;
  z-index: 3;
}

.status-inline-note {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: #eef5fd;
  color: #214867;
}

.case-tabs {
  padding-top: 0.55rem;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.tab-link {
  background: #edf4fb;
  color: #214867;
  border: 1px solid #c7d7e7;
  box-shadow: none;
}

.tab-link.active {
  background: linear-gradient(180deg, #176089, var(--accent));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(15, 79, 117, 0.18);
}

.tab-panel {
  display: none;
}

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

.card-inset {
  margin-bottom: 0;
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
}

.quote-stack,
.task-stack {
  display: grid;
  gap: 0.4rem;
}

.quote-card {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.quote-card.is-active {
  border-color: #8cb2cf;
  box-shadow: 0 0 0 2px rgba(64, 118, 162, 0.12);
}

.quote-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
  margin-bottom: 0.5rem;
}

.quote-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.quote-actions {
  display: grid;
  gap: 0.55rem;
}

.quote-acceptance-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.55rem;
  padding: 0.7rem;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #f9fcff;
}

.quote-acceptance-form > button[type="submit"] {
  justify-self: start;
}

.quote-acceptance-form .muted-copy[data-acceptance-hint] {
  grid-column: 1 / -1;
}

.acceptance-field {
  min-width: 220px;
}

.quote-acceptance-form select[multiple] {
  min-height: 120px;
}

.compact-row {
  gap: 0.4rem;
}

.case-chatter-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0.55rem;
}

.chatter-side,
.chatter-main {
  min-height: 100%;
}

.compact-form textarea {
  min-height: 90px;
}

.customer-dialog {
  width: min(720px, calc(100vw - 2rem));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-md);
}

.customer-dialog::backdrop {
  background: rgba(14, 24, 35, 0.45);
}

.dialog-close-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.45rem;
}

.draft-preview-dialog {
  width: min(900px, calc(100vw - 2rem));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  box-shadow: var(--shadow-md);
}

.draft-preview-dialog::backdrop {
  background: rgba(14, 24, 35, 0.45);
}

.draft-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 0.5rem;
}

.draft-preview-header h3 {
  margin: 0;
}

.draft-preview-box {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: #fff;
}

.draft-preview-subject {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line-soft);
  font-weight: 600;
  background: #f7fafc;
}

.draft-preview-body {
  margin: 0;
  padding: 0.65rem;
  max-height: min(58vh, 520px);
  overflow: auto;
  white-space: pre-wrap;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 0.9rem;
  line-height: 1.4;
}

.draft-context-box {
  margin-top: 0.65rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: #fbfdff;
  padding: 0.55rem 0.65rem;
  display: grid;
  gap: 0.35rem;
}

.draft-context-body {
  max-height: min(34vh, 280px);
  padding: 0;
}

@media (max-width: 860px) {
  .draft-preview-header {
    flex-direction: column;
    align-items: stretch;
  }
}

.customer-rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.customer-rating-pill::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}

.customer-rating-pill.rating-cooperative {
  color: #1d6f3b;
  background: #e6f5ec;
  border: 1px solid #b8e2c8;
}

.customer-rating-pill.rating-neutral {
  color: #6d5a22;
  background: #fff6de;
  border: 1px solid #efdca2;
}

.customer-rating-pill.rating-problematic {
  color: #8a1f23;
  background: #fdebec;
  border: 1px solid #f4b8bc;
}

.customers-stats-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.customers-page .toolbar {
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(130px, 170px)) repeat(4, auto) auto;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.customers-page .toolbar input,
.customers-page .toolbar select {
  margin-top: 0;
  padding: 0.5rem 0.62rem;
}

.customers-page .toolbar .filter-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
}

.customers-page .toolbar .filter-inline input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.customers-tools-row {
  margin: 0.35rem 0 0.7rem;
}

.customers-page table {
  min-width: 680px;
}

.customers-page th,
.customers-page td {
  padding: 0.5rem 0.5rem;
  font-size: 0.92rem;
}

.customers-page .customer-rating-pill {
  font-size: 0.73rem;
  padding: 0.12rem 0.5rem;
}

.composer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.composer-tab {
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  border: 1px solid #c7d7e7;
  background: #eef4fb;
  color: #214867;
  box-shadow: none;
}

.composer-tab.active {
  background: linear-gradient(180deg, #176089, var(--accent));
  color: #fff;
  border-color: transparent;
}

.composer-panel {
  display: none;
}

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

.chatter-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.chip-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #c7d7e7;
  background: #f2f7fc;
  color: #214867;
  box-shadow: none;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}

.chip-filter::after {
  content: attr(data-count);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #e3edf8;
  color: #285173;
  font-size: 0.76rem;
  font-weight: 700;
}

.chip-filter.active {
  background: #d4e7f8;
  border-color: #78a4ca;
  box-shadow: 0 0 0 2px rgba(71, 128, 163, 0.2);
  transform: translateY(-1px);
}

.chip-filter.active::after {
  background: #2d638b;
  color: #fff;
}

.inquiry-rule-row {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.chatter-timeline {
  display: grid;
  gap: 0.9rem;
}

.chatter-entry {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 0.8rem;
}

.chatter-entry[hidden] {
  display: none;
}

.chatter-rail {
  display: flex;
  justify-content: center;
  position: relative;
}

.chatter-rail::after {
  content: "";
  position: absolute;
  top: 18px;
  bottom: -18px;
  width: 2px;
  background: #d3dfeb;
}

.chatter-entry:last-child .chatter-rail::after {
  display: none;
}

.chatter-dot {
  width: 12px;
  height: 12px;
  margin-top: 0.45rem;
  border-radius: 999px;
  background: #7ea6ca;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #d7e5f4;
  z-index: 1;
}

.chatter-card {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f9fbfd);
}

.chatter-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
  margin-bottom: 0.35rem;
}

.chatter-head strong {
  margin-left: 0.35rem;
}

.chatter-details {
  margin-top: 0.6rem;
}

.chatter-details summary {
  cursor: pointer;
  font-weight: 700;
  color: #214867;
}

.chatter-body {
  margin-top: 0.55rem;
  line-height: 1.45;
}

.chatter-body > :first-child {
  margin-top: 0;
}

.chatter-body > :last-child {
  margin-bottom: 0;
}

.chatter-body p,
.chatter-body ul,
.chatter-body ol,
.chatter-body pre,
.chatter-body blockquote,
.markdown-preview-body p,
.markdown-preview-body ul,
.markdown-preview-body ol,
.markdown-preview-body pre,
.markdown-preview-body blockquote {
  margin: 0.45rem 0;
}

.chatter-body code,
.quote-line-description code,
.markdown-preview-body code {
  padding: 0.08rem 0.34rem;
  border-radius: 6px;
  background: #eef3f8;
  color: #24435f;
  font-size: 0.92em;
}

.chatter-body pre,
.quote-line-description pre,
.markdown-preview-body pre {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #d7e3ef;
  background: #f7fafd;
}

.chatter-body blockquote,
.quote-line-description blockquote,
.markdown-preview-body blockquote {
  margin-left: 0;
  padding-left: 0.75rem;
  border-left: 3px solid #b4c8dc;
  color: #45637f;
}

.chatter-body a,
.quote-line-description a,
.markdown-preview-body a {
  word-break: break-word;
}

.note-body.is-collapsed {
  max-height: 180px;
  overflow: hidden;
  position: relative;
}

.note-body.is-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #ffffff);
}

.note-toggle {
  margin-top: 0.25rem;
}

.markdown-quick-help {
  margin: 0.2rem 0 0.1rem;
}

.compact-item {
  margin-top: 0.55rem;
}

.stack {
  display: grid;
  gap: 0.55rem;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 220px auto;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
  align-items: end;
}

.actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.button-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.inline-actions-menu {
  position: relative;
}

.inline-actions-menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.68rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f4f8fb;
  color: #214867;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.86rem;
}

.inline-actions-menu > summary::-webkit-details-marker {
  display: none;
}

.inline-actions-menu > summary::after {
  content: ">";
  font-size: 0.74rem;
  transform: rotate(90deg);
  transition: transform 120ms ease;
}

.inline-actions-menu[open] > summary::after {
  transform: rotate(270deg);
}

.inline-actions-menu > .button-row {
  margin-top: 0.4rem;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0;
  margin-right: 0.35rem;
}

.inline-form label {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.inline-form input[type="checkbox"] {
  width: auto;
  margin: 0 0.35rem 0 0;
}

.field-item {
  display: grid;
  gap: 0.25rem;
  padding: 0.44rem 0;
  border-bottom: 1px solid var(--line);
}

.field-item input[type="checkbox"] {
  width: auto;
  margin-right: 0.45rem;
}

.field-item:last-child {
  border-bottom: 0;
}

.mail-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.64rem;
  background: #fff;
}

.mail-meta {
  display: flex;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.attachments {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.4rem;
}

.attachments h4 {
  grid-column: 1 / -1;
  margin: 0;
}

.attachment-item {
  display: grid;
  gap: 0.35rem;
  padding: 0.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
}

.attachment-preview-link {
  display: inline-block;
  width: fit-content;
}

.attachment-preview-image {
  display: block;
  width: min(340px, 100%);
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  font-family: "Avenir Next", "Source Sans Pro", "Segoe UI", sans-serif;
}

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

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

th,
td {
  text-align: left;
  padding: 0.46rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef4f9;
  color: #1f3a53;
  font-size: 0.9rem;
}

tbody tr:nth-child(even) {
  background: #fafcff;
}

.alert {
  padding: 0.48rem 0.68rem;
  background: var(--danger-soft);
  border: 1px solid #efc0bb;
  color: var(--danger);
  border-radius: 10px;
  margin-bottom: 0.75rem;
}

.alert-warn {
  background: var(--warning-soft);
  border-color: #ead08b;
  color: var(--warning-text);
}

.note-warning {
  color: #8a5a00;
  font-weight: 600;
}

.muted-copy {
  color: var(--muted);
  font-size: 0.84rem;
}

.task-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.44rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 0.4rem;
}

.task-overdue {
  background: #f8d9d4;
  color: #8b2018;
}

.task-today {
  background: #ffe8c9;
  color: #8a4b00;
}

.task-upcoming {
  background: #dcecff;
  color: #174a8b;
}

.task-planned {
  background: var(--success-soft);
  color: #2a5b41;
}

.diff-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.diff-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.diff-added {
  background: #dbf3e4;
  color: #1f6a3d;
}

.diff-removed {
  background: #f9d7d3;
  color: #972b24;
}

.diff-changed {
  background: #d8eaff;
  color: #1b4f8d;
}

.diff-text {
  background: #eee5ff;
  color: #5d34a6;
}

.diff-none {
  background: #e6ecf3;
  color: #455468;
}

.alt-delta-card {
  display: grid;
  gap: 0.65rem;
}

.alt-delta-intro {
  margin: 0;
}

.alt-delta-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfdff;
  padding: 0.55rem;
}

.alt-delta-group + .alt-delta-group {
  margin-top: 0.5rem;
}

.alt-delta-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.alt-delta-base-label {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.44rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #2a4d73;
  background: #eaf2fb;
}

.alt-delta-table-wrap {
  border-radius: 10px;
}

.alt-delta-table {
  min-width: 560px;
}

.alt-delta-table td {
  vertical-align: middle;
}

.alt-delta-base {
  color: #2a4d73;
  font-weight: 600;
}

.alt-delta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.alt-delta-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.alt-delta-chip.is-added {
  background: #dff4e8;
  color: #1f6a3d;
}

.alt-delta-chip.is-removed {
  background: #f9dfdc;
  color: #972b24;
}

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.7), transparent 32%),
    linear-gradient(180deg, #d9e6f3, #edf3f8 48%, #e3edf6);
}

.login-card {
  width: min(460px, calc(100vw - 2rem));
  box-shadow: var(--shadow-md);
}

.article-workspace {
  display: grid;
  grid-template-columns: 260px minmax(360px, 1fr) minmax(360px, 1fr);
  gap: 1rem;
}

.quote-presets-overview {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.quote-presets-sidebar,
.quote-presets-meta,
.quote-presets-main {
  min-height: auto;
}

.quote-presets-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 0.5rem;
}

.compact-stack {
  gap: 0.6rem;
}

.compact-button-row {
  justify-content: flex-start;
  align-items: center;
}

.quote-presets-main .table-wrap table th,
.quote-presets-main .table-wrap table td {
  padding: 0.35rem 0.45rem;
}

.quote-presets-main .line-description-row td {
  padding-top: 0.2rem;
  padding-bottom: 0.4rem;
}

.quote-presets-main input,
.quote-presets-main select,
.quote-presets-main textarea {
  font-size: 0.9rem;
}

.article-tree-pane,
.article-list-pane,
.article-detail-pane {
  min-height: 640px;
}

.tree-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.36rem 0.55rem;
  border-radius: 8px;
  margin-bottom: 0.2rem;
  color: #274057;
}

.tree-link.active {
  background: #dbe9f7;
  color: #163c5a;
  font-weight: 700;
}

.category-node {
  cursor: grab;
}

.category-node.drag-valid {
  box-shadow: inset 0 0 0 1px rgba(47, 111, 152, 0.25);
}

.category-node.drag-invalid {
  opacity: 0.48;
  box-shadow: inset 0 0 0 1px rgba(164, 61, 64, 0.3);
}

.category-node.drag-over {
  outline: 2px dashed #2f6f98;
  background: #e4f1fb;
}

.category-node.drag-source,
.article-row.drag-source {
  opacity: 0.55;
}

.tree-count {
  font-size: 0.78rem;
  color: #5e7186;
}

.article-row.selected {
  background: #e8f2fb;
}

.preset-item-row.drag-over {
  outline: 2px dashed #2f6f98;
  background: #e4f1fb;
}

.quote-item-row.drag-over {
  outline: 2px dashed #2f6f98;
  background: #e4f1fb;
}

.line-row-section td {
  background: #e7effa;
  font-weight: 700;
  border-top: 2px solid #8ea7c5;
  border-bottom: 2px solid #8ea7c5;
}

.section-main-cell {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.section-header-content {
  display: grid;
  grid-template-columns: auto minmax(320px, 1fr);
  align-items: center;
  gap: 0.6rem;
}

.section-header-content input {
  background: #f4f8fe;
  border: 1px solid #9db6d4;
  font-weight: 700;
}

.section-divider-row td {
  background: linear-gradient(90deg, #d8e5f5, #e8f0fb);
  color: #1f3e62;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0.01em;
  border-top: 2px solid #8ea7c5;
  border-bottom: 1px solid #b8c9dd;
  padding: 0.55rem 0.75rem;
}

.line-row-note td {
  background: #fbf8ee;
}

.line-description-row td {
  background: #fbfdff;
  border-top: 0;
  padding-top: 0.35rem;
  padding-bottom: 0.55rem;
}

.line-description-row textarea {
  min-height: 86px;
}

.inline-label {
  display: inline-block;
  margin-bottom: 0.25rem;
  color: #5d7288;
  font-size: 0.78rem;
  font-weight: 700;
}

.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.35rem;
  border-radius: 999px;
  border: 1px solid #9eb4cc;
  color: #2a4b6b;
  background: #eef5fd;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
}

.formula-preview {
  padding: 0.8rem 0.9rem;
  border: 1px solid #d1deea;
  border-radius: 12px;
  background: #f7fbff;
}

.formula-preview-vars {
  margin-top: 0.45rem;
}

.formula-preview-vars label {
  margin: 0;
}

.formula-preview-grid {
  margin-top: 0.65rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.formula-preview-value {
  margin-top: 0.2rem;
  min-height: 2rem;
  display: flex;
  align-items: center;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  border: 1px solid #ccd8e4;
  background: #fff;
  font-weight: 700;
  color: #214867;
}

.formula-preview-value[data-state="idle"] {
  color: #6f8398;
}

.formula-preview-value[data-state="loading"] {
  color: #4c6c89;
}

.formula-preview-value[data-state="error"] {
  color: #9d2f27;
  border-color: #e0b7b4;
  background: #fef6f5;
}

.markdown-preview {
  padding: 0.8rem 0.9rem;
  border: 1px solid #d1deea;
  border-radius: 12px;
  background: #f7fbff;
}

.markdown-preview-body {
  margin-top: 0.4rem;
  min-height: 3.3rem;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  border: 1px solid #ccd8e4;
  background: #fff;
  line-height: 1.45;
}

.markdown-preview-body[data-state="loading"] {
  color: #4c6c89;
}

.markdown-preview-body[data-state="error"] {
  color: #9d2f27;
  border-color: #e0b7b4;
  background: #fef6f5;
}

.markdown-preview-body > :first-child {
  margin-top: 0;
}

.markdown-preview-body > :last-child {
  margin-bottom: 0;
}

.markdown-cheatsheet {
  border: 1px dashed #bfd0e1;
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  background: #f9fcff;
}

.markdown-cheatsheet summary {
  cursor: pointer;
  font-weight: 700;
  color: #2a4b6b;
}

.markdown-cheatsheet pre {
  margin: 0.55rem 0 0;
  border: 1px solid #d7e3ef;
  border-radius: 8px;
  background: #fff;
  padding: 0.55rem 0.65rem;
}

.drag-handle-cell {
  width: 2rem;
  text-align: center;
  color: #748396;
  cursor: grab;
  user-select: none;
}

.line-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
}

.line-kind-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #1f3e62;
  background: #d7e5f8;
}

.line-kind-badge.note {
  color: #6a4c15;
  background: #f6e9c6;
}

.action-cell {
  min-width: 126px;
}

.action-icons {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.icon-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 0.45rem;
  border-radius: 8px;
  border: 1px solid #9eb4cc;
  background: #f3f8ff;
  color: #1f3e62;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.icon-btn:hover {
  background: #e6f0fd;
  border-color: #7fa1c6;
  box-shadow: 0 0 0 1px rgba(71, 113, 156, 0.15);
}

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

.icon-btn.add:hover {
  color: #1f5a2f;
  border-color: #89be97;
  background: #ebf8ef;
}

.icon-btn.move:hover {
  color: #1f4a70;
  border-color: #7ea9cd;
  background: #e9f3fb;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.icon-btn svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn.danger {
  color: #7d2830;
  border-color: #d6a6ab;
  background: #fff4f5;
}

.icon-btn.danger:hover {
  color: #8f1d28;
  border-color: #c98289;
  background: #fdebec;
}

.move-section-panel {
  position: relative;
}

.move-section-panel > summary {
  list-style: none;
}

.move-section-panel > summary::-webkit-details-marker {
  display: none;
}

.move-section-body {
  position: absolute;
  z-index: 5;
  right: 0;
  top: 34px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
  min-width: 230px;
  padding: 0.5rem;
  border: 1px solid #c4d3e3;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.move-section-body select,
.move-section-body input {
  grid-column: 1 / span 2;
}

.move-section-body button {
  justify-self: end;
}

.section-line-input {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 2fr;
  gap: 0.6rem;
}

.article-detail-pane hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1rem 0;
}

.bulk-panel {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: end;
}

.bulk-panel button {
  height: 42px;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    position: static;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
}

@media (max-width: 900px) {
  .content {
    padding: 1rem;
  }

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

  .topbar {
    position: static;
  }

  .button-row {
    width: 100%;
  }

  .button-row > * {
    flex: 1 1 180px;
  }

  .case-summary-grid,
  .quote-card-head {
    grid-template-columns: 1fr;
    display: grid;
  }

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

  .sticky-actions {
    position: static;
  }

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

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

  .planning-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: end;
  }

  .planning-calendar-cell {
    min-height: 90px;
  }

  .alt-delta-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 1300px) {
  .dashboard-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 1300px) {
  .article-workspace {
    grid-template-columns: 1fr;
  }

  .quote-presets-overview {
    grid-template-columns: 1fr;
  }

  .article-tree-pane,
  .article-list-pane,
  .article-detail-pane {
    min-height: auto;
  }
}

@media (max-width: 1000px) {
  .bulk-panel {
    grid-template-columns: 1fr;
  }
}

.users-admin-grid {
  align-items: start;
}

.users-list {
  display: grid;
  gap: 0.6rem;
}

.users-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.3rem 0 0.6rem;
}

.users-filter-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px 210px 220px 190px 150px auto;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
  align-items: end;
}

.users-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0 0 0.45rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.users-quick-filters {
  margin-bottom: 0.5rem;
}

.users-quick-filter-active {
  border-color: #88b2cb;
  color: #1c4d69;
  background: #dfeef6;
}

.users-filter-toolbar input,
.users-filter-toolbar select {
  min-height: 2rem;
}

.users-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}

.users-role-badges {
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.users-edit-dialog {
  width: min(920px, calc(100vw - 2rem));
}

.users-edit-columns {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.users-pagination {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}

.users-page-current {
  background: #dfeef6;
  border-color: #9ec4da;
  color: #1c4d69;
  font-weight: 700;
  cursor: default;
}

.company-role-item {
  align-items: center;
}

.company-role-form {
  display: grid;
  grid-template-columns: 200px minmax(220px, 1fr) auto;
  gap: 0.45rem;
  width: 100%;
  align-items: center;
}

.success-text {
  color: #155724;
  margin: 0.2rem 0 0.7rem;
}

.error-text {
  color: #8a1f1f;
  margin: 0.2rem 0 0.7rem;
}

@media (min-width: 1200px) {
  body {
    font-size: 13.5px;
    line-height: 1.28;
  }

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

  body.sidebar-collapsed .layout {
    grid-template-columns: 66px 1fr;
  }

  .sidebar {
    padding: 0.85rem 0.7rem;
  }

  .brand-wrap {
    margin-bottom: 0.7rem;
    padding: 0.45rem;
  }

  .brand {
    font-size: 1.02rem;
  }

  .brand-subtitle {
    font-size: 0.75rem;
  }

  .nav-link {
    padding: 0.4rem 0.46rem;
  }

  .nav-icon {
    width: 24px;
    min-width: 24px;
    height: 24px;
    margin-right: 0.36rem;
  }

  .nav-icon svg {
    width: 14px;
    height: 14px;
  }

  .nav-sublink {
    font-size: 0.88rem;
    padding-top: 0.42rem;
    padding-bottom: 0.42rem;
  }

  .content {
    padding: 0.62rem 0.84rem 0.86rem;
  }

  .topbar {
    margin-bottom: 0.4rem;
    padding: 0.24rem 0.36rem;
    border-radius: 8px;
  }

  .user-chip,
  .mail-fetch-chip {
    padding: 0.18rem 0.44rem;
    font-size: 0.72rem;
  }

  h1,
  h2,
  h3,
  h4 {
    margin-bottom: 0.3rem;
  }

  .page-header p {
    margin: 0.06rem 0 0.46rem;
    font-size: 0.9rem;
  }

  .card {
    margin-bottom: 0.4rem;
    padding: 0.48rem 0.52rem;
    border-radius: 9px;
  }

  .grid,
  .dashboard-grid,
  .case-summary-grid,
  .dashboard-kpis,
  .planning-board-layout,
  .case-chatter-layout,
  .toolbar {
    gap: 0.4rem;
  }

  button,
  .button-link {
    padding: 0.26rem 0.42rem;
    font-size: 0.8rem;
    border-radius: 7px;
    box-shadow: 0 2px 7px rgba(15, 79, 117, 0.18);
  }

  input,
  textarea,
  select {
    padding: 0.28rem 0.38rem;
    border-radius: 7px;
    margin-top: 0.14rem;
    font-size: 0.84rem;
  }

  textarea {
    min-height: 74px;
  }

  label {
    margin-bottom: 0.35rem;
  }

  .table-wrap {
    border-radius: 10px;
  }

  table {
    min-width: 680px;
  }

  th,
  td {
    padding: 0.24rem 0.24rem;
  }

  thead th {
    font-size: 0.82rem;
  }

  .muted-copy {
    font-size: 0.78rem;
  }

  .task-badge,
  .customer-rating-pill,
  .chip-filter,
  .alt-delta-chip,
  .line-kind-badge,
  .alt-delta-base-label {
    font-size: 0.64rem;
  }

  .dashboard-kpis .summary-chip strong {
    font-size: 1.16rem;
  }

  .summary-chip {
    padding: 0.34rem 0.38rem;
    border-radius: 8px;
  }

  .tab-bar,
  .button-row,
  .users-stats-row,
  .users-pagination,
  .users-quick-filters {
    gap: 0.26rem;
  }

  .users-list-item,
  .mail-item,
  .quote-card,
  .chatter-card,
  .inquiry-rule-row,
  .attachment-item {
    padding: 0.38rem;
    border-radius: 8px;
  }

  .inline-actions-menu > summary,
  .composer-tab,
  .chip-filter {
    padding: 0.26rem 0.44rem;
    font-size: 0.78rem;
    border-radius: 8px;
  }

  .customers-page th,
  .customers-page td {
    padding: 0.3rem 0.28rem;
    font-size: 0.84rem;
  }

  .customers-page .customer-rating-pill {
    font-size: 0.66rem;
    padding: 0.1rem 0.4rem;
  }
}

@media (min-width: 1600px) {
  body {
    font-size: 13px;
    line-height: 1.24;
  }

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

  .content {
    padding: 0.54rem 0.7rem 0.76rem;
  }

  .grid,
  .dashboard-grid,
  .case-summary-grid,
  .dashboard-kpis,
  .planning-board-layout,
  .case-chatter-layout,
  .toolbar {
    gap: 0.3rem;
  }

  .card {
    padding: 0.4rem 0.44rem;
  }

  button,
  .button-link,
  .inline-actions-menu > summary,
  .composer-tab,
  .chip-filter {
    padding: 0.2rem 0.34rem;
    font-size: 0.76rem;
  }

  input,
  textarea,
  select {
    padding: 0.22rem 0.32rem;
    font-size: 0.8rem;
  }

  th,
  td,
  .customers-page th,
  .customers-page td {
    padding: 0.2rem 0.2rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 900px) {
  .users-filter-toolbar {
    grid-template-columns: 1fr;
  }

  .users-edit-columns {
    grid-template-columns: 1fr;
  }

  .users-list-item {
    flex-direction: column;
  }

  .company-role-form {
    grid-template-columns: 1fr;
  }
}
