:root {
  --bg: #eef3f1;
  --surface: #ffffff;
  --surface-soft: #f7faf9;
  --sidebar: #113c36;
  --sidebar-soft: #1c544d;
  --primary: #0f7a68;
  --primary-strong: #095d50;
  --accent: #f3a712;
  --danger: #d64550;
  --warning: #d98f0b;
  --success: #1a936f;
  --text: #16322d;
  --muted: #5c726c;
  --border: #d8e5e1;
  --shadow: 0 22px 60px rgba(16, 48, 42, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Source Sans 3", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 122, 104, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(243, 167, 18, 0.14), transparent 22%),
    var(--bg);
}

body.mobile-nav-open {
  overflow: hidden;
}

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

a { color: inherit; }

.screen-center {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-screen {
  padding: 32px;
}

.login-stage {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(300px, 1.15fr) minmax(380px, 0.95fr);
  gap: 28px;
  align-items: stretch;
}

.login-showcase {
  position: relative;
  padding: 40px 42px;
  border: 1px solid rgba(15, 122, 104, 0.14);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.9)),
    radial-gradient(circle at top left, rgba(15, 122, 104, 0.16), transparent 36%),
    radial-gradient(circle at bottom right, rgba(243, 167, 18, 0.16), transparent 30%);
  box-shadow: 0 26px 70px rgba(16, 48, 42, 0.08);
  overflow: hidden;
}

.login-showcase::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(15, 122, 104, 0.08);
  border-radius: 22px;
  pointer-events: none;
}

.login-showcase-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 122, 104, 0.1);
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-showcase h1 {
  margin: 22px 0 14px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(42px, 5vw, 60px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: #17312d;
}

.login-showcase > p {
  max-width: 500px;
  margin: 0;
  font-size: 19px;
  line-height: 1.45;
  color: #4f6761;
}

.login-showcase-note {
  margin-top: 30px;
  display: grid;
  gap: 8px;
  max-width: 360px;
  padding: 18px 20px;
  border: 1px solid rgba(15, 122, 104, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.login-showcase-note strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  color: #17312d;
}

.login-showcase-note span {
  color: #5b716c;
  line-height: 1.45;
}

.login-card,
.card,
.panel,
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(460px, 100%);
  padding: 0;
  border-color: rgba(17, 60, 54, 0.08);
  box-shadow: 0 28px 72px rgba(16, 48, 42, 0.12);
}

.login-card-shell {
  padding: 34px 32px 30px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.login-brand img {
  width: 96px;
  height: 62px;
  object-fit: contain;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 247, 0.96));
  padding: 7px 9px;
  border: 1px solid rgba(15, 122, 104, 0.08);
}

.login-brand h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 28px;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.login-brand p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.login-fields {
  display: grid;
  gap: 2px;
}

.login-field label {
  font-size: 13px;
  font-weight: 700;
  color: #38524d;
  letter-spacing: 0.02em;
}

.login-field input {
  min-height: 50px;
  border-radius: 16px;
  border-color: rgba(17, 60, 54, 0.08);
  background: linear-gradient(180deg, #fbfdfc, #f5f9f7);
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.login-field input:focus {
  outline: none;
  border-color: rgba(15, 122, 104, 0.35);
  box-shadow:
    0 0 0 4px rgba(15, 122, 104, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.login-error {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(214, 69, 80, 0.08);
  border: 1px solid rgba(214, 69, 80, 0.12);
  color: var(--danger);
  font-weight: 600;
}

.login-actions {
  margin-top: 8px;
}

.login-submit {
  min-width: 160px;
  padding-inline: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.brand > div {
  display: grid;
  gap: 4px;
}

.brand img {
  width: 88px;
  height: 58px;
  object-fit: contain;
  object-position: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  padding: 6px 8px;
}

.brand h1,
.page-title,
.section-title,
.stat-value { font-family: "Space Grotesk", sans-serif; }

.brand h1 {
  margin: 0;
  font-size: 28px;
}

.brand p,
.page-subtitle,
.muted,
.table-subtle { color: var(--muted); }

.brand .brand-tagline {
  margin: 0;
  color: rgba(236, 247, 245, 0.78);
  font-size: 14px;
  line-height: 1.35;
}

.brand .brand-user {
  color: rgba(236, 247, 245, 0.68);
  font-size: 12px;
  line-height: 1.35;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field input,
.field select,
.field textarea,
.search-input,
.pill-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface-soft);
  color: var(--text);
}

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

.btn-row,
.toolbar,
.inline-actions,
.pagination,
.chip-row,
.stats-grid,
.grid-2,
.grid-3,
.grid-4 {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

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

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
}

.btn-secondary {
  background: #e6f1ee;
  color: var(--primary-strong);
}

.btn-danger {
  background: rgba(214, 69, 80, 0.1);
  color: var(--danger);
}

.btn-warning {
  background: rgba(217, 143, 11, 0.12);
  color: var(--warning);
}

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

.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    var(--sidebar);
  color: #ecf7f5;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand { margin-bottom: 18px; }

.sidebar .brand p { color: rgba(236, 247, 245, 0.72); }

.mobile-nav-toggle,
.mobile-nav-close,
.mobile-nav-backdrop {
  display: none;
}

.mobile-nav-toggle {
  margin: 0 0 12px;
  border: 1px solid rgba(15, 122, 104, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary-strong);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.mobile-nav-close {
  margin-left: auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #ecf7f5;
  border-radius: 999px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 22, 0.48);
  z-index: 35;
}

.mobile-nav-backdrop[hidden] {
  display: none !important;
}

.nav-list {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.nav-link {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 14px 16px;
  text-align: left;
  border-radius: 16px;
  cursor: pointer;
}

.nav-link.active,
.nav-link:hover { background: rgba(255, 255, 255, 0.1); }

.nav-link small {
  display: block;
  margin-top: 4px;
  color: rgba(236, 247, 245, 0.7);
}

.content-wrap { padding: 26px; }
.content-wrap,
#route-content {
  min-width: 0;
}

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

.topbar-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  align-items: flex-start;
}

.global-search {
  position: relative;
  width: min(360px, 100%);
}

.global-search-input {
  width: 100%;
  min-width: 280px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  box-shadow: 0 10px 26px rgba(16, 48, 42, 0.05);
}

.global-search-input:focus {
  outline: none;
  border-color: rgba(15, 122, 104, 0.3);
  box-shadow: 0 0 0 4px rgba(15, 122, 104, 0.08);
}

.global-search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(16, 48, 42, 0.12);
}

.global-search-results[hidden] {
  display: none;
}

.global-search-result {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.global-search-result:hover {
  background: rgba(15, 122, 104, 0.08);
}

.global-search-result-page {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-strong);
  letter-spacing: 0.02em;
}

.global-search-result-title {
  color: var(--text);
  font-size: 15px;
}

.global-search-empty {
  padding: 12px 14px;
  color: var(--muted);
  text-align: center;
}

.page-title {
  margin: 0;
  font-size: 34px;
}

.page-subtitle {
  margin: 6px 0 0;
  font-size: 15px;
}

.user-chip,
.tag,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
}

.user-chip {
  background: rgba(15, 122, 104, 0.08);
  border: 1px solid rgba(15, 122, 104, 0.12);
}

.stats-grid { margin: 18px 0 26px; }

.stat-card {
  flex: 1 1 220px;
  min-width: 220px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 250, 0.94));
  border: 1px solid var(--border);
  border-radius: 20px;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
}

.stat-foot {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

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

.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }

.panel { padding: 18px; }

.section-title {
  margin: 0 0 6px;
  font-size: 22px;
}

.chart-bars {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 240px;
  margin-top: 18px;
}

.chart-bar {
  display: grid;
  gap: 8px;
  align-items: end;
  text-align: center;
}

.chart-bar-fill {
  background: linear-gradient(180deg, var(--accent), var(--primary));
  border-radius: 14px 14px 8px 8px;
  min-height: 10px;
}

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

.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 14px;
}

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

.employee-table {
  min-width: 1120px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.table-actions-cell {
  vertical-align: middle;
  white-space: nowrap;
  width: 220px;
  min-width: 220px;
}

.table-actions-head {
  width: 220px;
  min-width: 220px;
}

.table-actions-inline {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: center;
  justify-content: start;
  gap: 8px;
}

.table-actions-inline .btn {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 8px 12px;
  font-size: 14px;
}

.btn-table-preview {
  background: rgba(15, 122, 104, 0.1);
  color: var(--primary-strong);
}

.btn-table-edit {
  background: rgba(28, 84, 77, 0.12);
  color: var(--sidebar-soft);
}

.letter-preview-wrap {
  padding: 8px 0 4px;
}

.letter-sheet {
  width: min(860px, 100%);
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #d9e4de;
  border-radius: 22px;
  box-shadow: 0 20px 46px rgba(16, 48, 42, 0.06);
  overflow: hidden;
}

.letter-sheet-header {
  padding: 30px 34px 22px;
  border-bottom: 1px solid #dfe8e3;
  background: #ffffff;
}

.letter-brand-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.letter-brand-block {
  max-width: 60%;
}

.letter-logo {
  width: 170px;
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 18px;
}

.letter-company {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.1;
  color: #1c2b38;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.letter-subtitle {
  margin: 8px 0 0;
  color: #1c2b38;
  font-size: 12px;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.letter-meta {
  min-width: 252px;
  display: grid;
  gap: 9px;
  padding: 14px 16px;
  border: 1px solid #dfe8e3;
  border-radius: 12px;
  background: #ffffff;
}

.letter-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 11px;
  color: #1c2b38;
}

.letter-meta-label {
  color: #5e6b75;
  font-weight: 600;
}

.letter-meta-value {
  text-align: right;
  font-weight: 600;
}

.letter-address {
  margin-top: 16px;
  font-size: 11px;
  color: #5e6b75;
  line-height: 1.35;
  max-width: 520px;
}

.letter-sheet-body {
  padding: 34px;
  font-family: "Inter", Arial, sans-serif;
  color: #1c2b38;
}

.letter-recipient,
.letter-subject {
  margin: 0 0 18px;
  line-height: 1.3;
  font-size: 11px;
}

.letter-subject {
  padding: 10px 0 8px;
  border-top: 1px solid rgba(47, 175, 154, 0.45);
  border-bottom: 1px solid rgba(47, 175, 154, 0.45);
  background: transparent;
  border-radius: 0;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #1c2b38;
}

.letter-body-text {
  margin: 0 0 18px;
  line-height: 1.3;
  font-size: 11px;
  text-align: justify;
  text-justify: inter-word;
}

.letter-list {
  margin: 0 0 18px 18px;
  padding: 0;
  font-family: "Inter", Arial, sans-serif;
  font-size: 11px;
  line-height: 1.3;
  color: #1c2b38;
}

.letter-list-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  column-gap: 8px;
  margin: 0 0 6px;
  font-family: "Inter", Arial, sans-serif;
  font-size: 11px;
  line-height: 1.3;
  color: #1c2b38;
}

.letter-list-marker {
  display: block;
  min-width: 18px;
  text-align: center;
  font-family: "Inter", Arial, sans-serif;
  font-size: 11px;
  line-height: 1.3;
  color: #1c2b38;
}

.letter-list-content {
  display: block;
  font-family: "Inter", Arial, sans-serif;
  font-size: 11px;
  line-height: 1.3;
  color: #1c2b38;
  text-align: justify;
  text-justify: inter-word;
}

.letter-signoff {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
}

.letter-signature-card {
  padding-top: 18px;
  border-top: 1px solid #d9e4de;
}

.letter-signature-card:last-child {
  text-align: right;
  justify-self: end;
  width: 100%;
}

.letter-signature-title {
  margin: 0;
  font-weight: 700;
  font-size: 11px;
}

.letter-signature-sub {
  margin: 8px 0 0;
  font-size: 10.5px;
  color: #5e6b75;
  line-height: 1.3;
}

.status-pill {
  font-size: 12px;
  font-weight: 700;
}

.status-success { background: rgba(26, 147, 111, 0.12); color: var(--success); }
.status-warning { background: rgba(217, 143, 11, 0.14); color: var(--warning); }
.status-danger { background: rgba(214, 69, 80, 0.12); color: var(--danger); }
.status-info { background: rgba(15, 122, 104, 0.12); color: var(--primary); }

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.field-rich-text {
  display: grid;
  gap: 8px;
}

.format-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  width: fit-content;
  border: 1px solid #d9e4de;
  border-radius: 10px;
  background: #f7faf8;
}

.format-btn {
  min-width: 34px;
  height: 34px;
  border: 1px solid #d9e4de;
  border-radius: 8px;
  background: #ffffff;
  color: #1c2b38;
  cursor: pointer;
  font-size: 14px;
}

.format-btn:hover {
  border-color: rgba(15, 122, 104, 0.35);
  background: rgba(15, 122, 104, 0.08);
}

.rich-text-input {
  width: 100%;
}

.card-list {
  display: grid;
  gap: 12px;
}

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

.list-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.list-card h4 { margin: 0 0 6px; }
.list-card p { margin: 0; }

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

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border-radius: 14px;
}

.slot-grid {
  display: grid;
  gap: 10px;
}

.slot-card {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.subnav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 18px;
  -webkit-overflow-scrolling: touch;
}

.subnav button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
}

.subnav button.active {
  background: rgba(15, 122, 104, 0.1);
  color: var(--primary-strong);
  border-color: rgba(15, 122, 104, 0.18);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 22, 0.54);
  display: grid;
  place-items: center;
  padding: 22px;
  z-index: 1000;
}

.modal-card {
  width: min(1120px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 22px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.close-btn {
  border: 0;
  background: #edf4f2;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  cursor: pointer;
}

.toast-root {
  position: fixed;
  top: 18px;
  right: 18px;
  display: grid;
  gap: 10px;
  z-index: 1100;
}

.toast {
  min-width: 240px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 16px;
  color: #fff;
  box-shadow: var(--shadow);
}

.toast.success { background: linear-gradient(135deg, #1a936f, #0f7a68); }
.toast.error { background: linear-gradient(135deg, #d64550, #962d36); }
.toast.info { background: linear-gradient(135deg, #1768ac, #0e4b7a); }

.loader {
  padding: 40px 10px;
  text-align: center;
  color: var(--muted);
}

.empty {
  padding: 30px 18px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  text-align: center;
  color: var(--muted);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.media-box {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: var(--surface-soft);
}

.media-preview {
  width: 100%;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
  background: #ddeae6;
}

.chat-message {
  max-width: 74%;
  padding: 12px 14px;
  border-radius: 18px;
  margin: 8px 0;
}

.chat-left {
  background: #eaf0ee;
  margin-right: auto;
}

.chat-right {
  background: #d8f1ea;
  margin-left: auto;
}

.payments-table td:nth-child(n + 2),
.payments-table th:nth-child(n + 2) {
  white-space: nowrap;
}

.divider-label {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 16px 0 10px;
}

@media (max-width: 1200px) {
  .span-8,
  .span-6,
  .span-4 { grid-column: span 12; }
}

@media (max-width: 980px) {
  .login-stage { grid-template-columns: 1fr; }
  .login-showcase { padding: 30px 24px; }
  .login-showcase h1 { font-size: 40px; }
  .login-card-shell { padding: 28px 24px 24px; }
  .content-wrap { padding: 20px; }
  .topbar-tools {
    width: 100%;
    justify-content: stretch;
  }
  .global-search {
    width: 100%;
  }
  .global-search-input {
    min-width: 0;
  }
  .user-chip {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .shell { grid-template-columns: 1fr; }
  .mobile-nav-toggle,
  .mobile-nav-close,
  .mobile-nav-backdrop {
    display: block;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(320px, 86vw);
    height: 100vh;
    padding: 18px 14px;
    z-index: 40;
    transform: translateX(-104%);
    transition: transform 0.22s ease;
    box-shadow: 0 24px 54px rgba(16, 48, 42, 0.24);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar .brand {
    align-items: flex-start;
  }
  .nav-list { margin-top: 18px; }
  .nav-link { padding: 12px 14px; }
  .split { grid-template-columns: 1fr; }
  .slot-card { grid-template-columns: 1fr; }
  .letter-sheet-header,
  .letter-sheet-body {
    padding-left: 24px;
    padding-right: 24px;
  }
  .letter-brand-row {
    flex-direction: column;
    align-items: stretch;
  }
  .letter-brand-block {
    max-width: 100%;
  }
  .letter-meta {
    min-width: 0;
    width: 100%;
  }
  .letter-signoff {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .letter-signature-card:last-child {
    text-align: left;
    justify-self: stretch;
  }
  .modal-backdrop { padding: 16px; }
  .modal-card {
    width: 100%;
    max-height: 94vh;
    padding: 18px;
  }
}

@media (max-width: 640px) {
  .login-screen { padding: 18px; }
  .content-wrap { padding: 16px; }
  .topbar { flex-direction: column; }
  .topbar-tools { gap: 10px; }
  .mobile-nav-toggle {
    width: fit-content;
    margin-bottom: 10px;
  }
  .page-title { font-size: 28px; }
  .panel { padding: 16px; }
  .login-card,
  .modal-card { padding: 18px; }
  .login-showcase { padding: 24px 18px; }
  .login-showcase h1 { font-size: 34px; }
  .brand h1 { font-size: 24px; }
  .global-search-results {
    left: 0;
    right: 0;
  }
  .subnav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .subnav button { white-space: nowrap; }
  .btn-row,
  .toolbar,
  .inline-actions,
  .pagination,
  .chip-row {
    gap: 10px;
  }
  .btn-row .btn,
  .toolbar .btn {
    width: 100%;
    justify-content: center;
  }
  .filters,
  .check-grid {
    grid-template-columns: 1fr;
  }
  .letter-sheet {
    border-radius: 18px;
  }
  .letter-sheet-header,
  .letter-sheet-body {
    padding: 20px 18px;
  }
  .letter-logo {
    width: 138px;
    margin-bottom: 14px;
  }
  .letter-company { font-size: 16px; }
  .letter-subtitle,
  .letter-address,
  .letter-recipient,
  .letter-subject,
  .letter-body-text,
  .letter-list,
  .letter-list-item,
  .letter-list-marker,
  .letter-list-content,
  .letter-signature-title,
  .letter-signature-sub {
    font-size: 10.5px;
  }
  .table-actions-inline {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    justify-items: stretch;
  }
  .table-actions-inline .btn {
    width: 100%;
  }
  .toast-root {
    left: 12px;
    right: 12px;
    top: 12px;
  }
  .toast {
    min-width: 0;
    max-width: none;
  }
}
