:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface2: #f0eee9;
  --border: rgba(0, 0, 0, 0.08);
  --border2: rgba(0, 0, 0, 0.14);
  --text: #1a1a18;
  --text2: #5c5c58;
  --text3: #9c9c96;
  --blue: #185fa5;
  --blue-bg: #e6f1fb;
  --blue-text: #0c447c;
  --green: #1a7f37;
  --green-bg: #e8f5e9;
  --green-text: #155d2b;
  --amber: #854f0b;
  --amber-bg: #faeeda;
  --red: #a32d2d;
  --red-bg: #fcebeb;
  --gray-bg: #ecebe7;
  --gray-text: #5c5c58;
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-w: 228px;
  --font: "DM Sans", sans-serif;
  --mono: "DM Mono", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.app-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.logo-icon,
.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-icon {
  width: 28px;
  height: 28px;
  background: var(--blue);
  border-radius: 6px;
  color: #fff;
}

.logo-icon-svg {
  width: 18px;
  height: 18px;
  display: block;
}

.logo-name {
  font-size: 14px;
  font-weight: 600;
}

.logo-sub {
  font-size: 11px;
  color: var(--text3);
  padding-left: 36px;
}

.nav-group {
  padding: 16px 0 4px;
}

.nav-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 0 18px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  font-size: 13px;
  color: var(--text2);
  border-left: 2px solid transparent;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}

.nav-item.active {
  color: var(--blue);
  background: var(--blue-bg);
  border-left-color: var(--blue);
  font-weight: 500;
}

.nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text2);
}

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

.nav-item.active .nav-icon {
  background: rgba(24, 95, 165, 0.12);
  color: var(--blue-text);
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text3);
}

.sidebar-footer strong {
  display: block;
  color: var(--text2);
  font-size: 12px;
  margin-bottom: 2px;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  gap: 16px;
}

.page-title {
  font-size: 16px;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  margin-right: 4px;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
}

.user-role {
  font-size: 11px;
  color: var(--text3);
}

.content {
  flex: 1;
  padding: 20px 24px;
}

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

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

.metric-card {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 14px;
}

.metric-label {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 4px;
}

.metric-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

.metric-sub {
  font-size: 11px;
  margin-top: 3px;
}

.clr-green {
  color: var(--green);
}

.clr-red {
  color: var(--red);
}

.clr-amber {
  color: var(--amber);
}

.clr-blue {
  color: var(--blue);
}

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

.section-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 14px;
}

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

.card-title {
  font-size: 13px;
  font-weight: 600;
}

.card-hint {
  font-size: 11px;
  color: var(--text3);
}

.card-divider {
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.flash {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}

.flash-success {
  background: var(--green-bg);
  color: var(--green-text);
  border: 1px solid rgba(26, 127, 55, 0.18);
}

.flash-error {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(163, 45, 45, 0.16);
}

.flash-link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  margin-left: 6px;
}

.compact-flash {
  margin-bottom: 10px;
}

.error-list {
  margin-top: 8px;
  padding-left: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text);
}

.btn:hover {
  background: var(--surface2);
}

.btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.btn-primary:hover {
  background: var(--blue-text);
}

.btn-green {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.btn-green:hover {
  background: var(--green-text);
}

.btn-danger-soft {
  background: var(--red-bg);
  color: var(--red);
  border-color: rgba(163, 45, 45, 0.16);
}

.btn-danger-soft:hover {
  background: #f7dfdf;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
}

.b-green {
  background: var(--green-bg);
  color: var(--green-text);
}

.b-amber {
  background: var(--amber-bg);
  color: var(--amber);
}

.b-red {
  background: var(--red-bg);
  color: var(--red);
}

.b-blue {
  background: var(--blue-bg);
  color: var(--blue-text);
}

.b-gray {
  background: var(--gray-bg);
  color: var(--gray-text);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--blue-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--blue-text);
  flex-shrink: 0;
}

.avatar-sm {
  width: 26px;
  height: 26px;
  font-size: 10px;
}

.deadline-item,
.client-row,
.doc-item,
.sched-item,
.wa-activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.deadline-item {
  justify-content: space-between;
}

.deadline-item:last-child,
.client-row:last-child,
.doc-item:last-child,
.sched-item:last-child,
.wa-activity-item:last-child {
  border-bottom: none;
}

.dl-title,
.client-name,
.doc-name {
  font-size: 12px;
  font-weight: 500;
}

.dl-client,
.client-meta,
.doc-info,
.wa-msg-text,
.wa-ts {
  font-size: 11px;
  color: var(--text3);
}

.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.task-item:last-child {
  border-bottom: none;
}

.task-toggle-form {
  flex-shrink: 0;
}

.task-check {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1.5px solid var(--border2);
  background: transparent;
  color: transparent;
  font-size: 8px;
  font-family: var(--mono);
}

.task-check.done {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.task-label-wrap {
  flex: 1;
  min-width: 0;
}

.task-label {
  font-size: 12px;
}

.task-label.done {
  text-decoration: line-through;
  color: var(--text3);
}

.task-time {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.tbl th {
  text-align: left;
  font-weight: 500;
  color: var(--text3);
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.tbl td {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.tbl tr:last-child td {
  border-bottom: none;
}

.tbl td:last-child,
.tbl th:last-child {
  text-align: right;
}

.mono {
  font-family: var(--mono);
}

.strong {
  font-weight: 600;
}

.empty-row {
  color: var(--text3);
  padding: 14px 0;
}

.search-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}

.search-row.compact {
  margin-bottom: 0;
}

.search-input,
select,
.textarea-input,
.payment-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 12px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
  outline: none;
}

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

.search-input:focus,
select:focus,
.textarea-input:focus,
.payment-input:focus {
  border-color: var(--blue);
  background: var(--surface);
}

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

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

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

.form-label {
  display: block;
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 4px;
}

.form-help {
  font-size: 11px;
  color: var(--text3);
  margin-top: 6px;
}

.form-actions {
  display: flex;
  align-items: flex-end;
}

.token-helper-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.form-span-2 {
  grid-column: 1 / -1;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text2);
}

.stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.stat-pill {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  color: var(--text2);
}

.stat-pill span {
  font-weight: 600;
  color: var(--text);
}

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

.folder-card {
  background: linear-gradient(180deg, #fbfaf7 0%, #f2f0ea 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 94px;
  padding: 16px 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: inherit;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.folder-card:hover {
  border-color: #d8c7a6;
  box-shadow: 0 10px 22px rgba(42, 34, 16, 0.08);
  transform: translateY(-1px);
}

.folder-card.active {
  border-color: #d9b66b;
  box-shadow: inset 0 0 0 1px rgba(217, 182, 107, 0.35);
}

.folder-icon {
  width: 42px;
  height: 32px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.folder-icon svg {
  width: 42px;
  height: 32px;
  display: block;
  filter: drop-shadow(0 2px 1px rgba(215, 151, 25, 0.08));
}

.folder-name {
  font-size: 12px;
  font-weight: 500;
}

.folder-count {
  font-size: 10px;
  color: var(--text3);
  margin-top: 1px;
}

.doc-icon {
  width: 34px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-icon-svg {
  width: 30px;
  height: 36px;
  display: block;
}

.doc-pdf {
  color: var(--red);
}

.doc-xlsx {
  color: var(--green-text);
}

.doc-docx {
  color: var(--blue-text);
}

.doc-meta {
  flex: 1;
}

.doc-actions,
.inline-form,
.payment-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.invoice-actions-cell {
  min-width: 265px;
}

.invoice-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.action-icon {
  width: 13px;
  height: 13px;
  display: block;
}

.client-row-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wa-status-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.wa-status-green {
  background: var(--green-bg);
  border-color: rgba(26, 127, 55, 0.18);
}

.wa-status-amber {
  background: var(--amber-bg);
  border-color: rgba(133, 79, 11, 0.14);
}

.wa-status-red {
  background: var(--red-bg);
  border-color: rgba(163, 45, 45, 0.16);
}

.wa-dot,
.sched-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.wa-dot,
.dot-green {
  background: var(--green);
}

.dot-red {
  background: var(--red);
}

.dot-amber {
  background: var(--amber);
}

.wa-status-text {
  font-size: 12px;
  font-weight: 500;
}

.wa-status-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.wa-status-sub {
  font-size: 11px;
  color: var(--text2);
}

.wa-status-green .wa-status-text {
  color: var(--green-text);
}

.wa-status-amber .wa-status-text {
  color: var(--amber);
}

.wa-status-red .wa-status-text {
  color: var(--red);
}

.wa-status-meta {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.wa-provider {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wa-number {
  font-size: 11px;
  font-family: var(--mono);
}

.wa-status-green .wa-number {
  color: var(--green-text);
}

.wa-status-amber .wa-number {
  color: var(--amber);
}

.wa-status-red .wa-number {
  color: var(--red);
}

.tpl-card {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}

.tpl-header,
.tpl-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tpl-name {
  font-size: 12px;
  font-weight: 600;
}

.tpl-mode {
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px;
}

.tpl-preview {
  font-size: 11px;
  color: var(--text2);
  line-height: 1.5;
  border-left: 2px solid var(--border2);
  padding-left: 8px;
  margin: 6px 0;
}

.toggle {
  min-width: 52px;
  padding: 3px 10px;
  border-radius: 999px;
  border: none;
  color: #fff;
  cursor: pointer;
}

.toggle.on {
  background: var(--green);
}

.toggle.off {
  background: #a1a1aa;
}

.tpl-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tpl-toolbar,
.tpl-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sync-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tpl-meta-row {
  margin-bottom: 8px;
}

.wa-message-body {
  flex: 1;
}

.compact-empty {
  padding: 8px 0;
}

.sched-time {
  min-width: 118px;
  font-size: 11px;
  color: var(--text3);
}

.sched-msg {
  font-size: 12px;
}

.quick-send-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.payment-input {
  max-width: 92px;
}

.month-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 0 4px;
}

.empty-state {
  padding: 12px 0;
  color: var(--text3);
  font-size: 12px;
}

.access-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.18)),
    var(--surface2);
  display: grid;
  gap: 12px;
}

.access-card:last-child {
  margin-bottom: 0;
}

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

.access-summary {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.access-identity {
  min-width: 0;
}

.access-subline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.access-role {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--blue-text);
  background: rgba(24, 95, 165, 0.1);
}

.access-email {
  min-width: 0;
  font-size: 11px;
  color: var(--text3);
  overflow-wrap: anywhere;
}

.access-card-head .badge {
  flex-shrink: 0;
}

.access-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.access-stat {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  color: var(--text3);
}

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

.access-card .form-grid {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

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

.choice-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 12px;
  color: var(--text2);
}

.choice-chip input {
  accent-color: var(--blue);
}

.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(24, 95, 165, 0.18), transparent 34%),
    linear-gradient(135deg, #f7f1e5 0%, #f1efe8 45%, #e7edf4 100%);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr minmax(320px, 460px);
  align-items: stretch;
}

.auth-hero,
.auth-card-wrap {
  padding: 40px;
  display: flex;
}

.auth-hero {
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.auth-kicker {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-text);
  font-weight: 600;
}

.auth-title {
  font-size: clamp(32px, 6vw, 56px);
  line-height: 0.96;
  max-width: 520px;
}

.auth-copy {
  max-width: 520px;
  font-size: 15px;
  color: var(--text2);
}

.auth-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 720px;
}

.auth-highlight {
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.07);
}

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

.auth-highlight span {
  font-size: 12px;
  color: var(--text2);
}

.auth-card-wrap {
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(14, 26, 40, 0.12);
  padding: 28px;
}

.auth-card h2 {
  font-size: 24px;
  margin-bottom: 6px;
}

.auth-card p {
  color: var(--text2);
  margin-bottom: 18px;
}

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

.btn-block {
  width: 100%;
}

.auth-note {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: #16222f;
  color: #eef4fb;
}

.auth-note-title {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(238, 244, 251, 0.68);
  margin-bottom: 10px;
}

.auth-credential {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
}

.auth-credential:last-child {
  margin-bottom: 0;
}

.auth-credential-label {
  font-size: 12px;
  font-weight: 600;
}

.auth-credential code {
  font-family: var(--mono);
  font-size: 12px;
  color: #bcd6ef;
}

.log-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface2);
  margin-bottom: 12px;
}

.log-card:last-child {
  margin-bottom: 0;
}

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

.log-detail {
  margin-top: 8px;
}

.log-detail summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}

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

.log-pre {
  background: #151c24;
  color: #dbe8f5;
  border-radius: var(--radius);
  padding: 12px;
  font-size: 11px;
  line-height: 1.45;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 999px;
}

@media (max-width: 1180px) {
  .metrics,
  .metrics-3,
  .folder-grid,
  .form-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .checkbox-grid,
  .auth-highlights,
  .log-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: 0;
  }

  .grid2,
  .form-grid-2,
  .form-grid-3,
  .metrics,
  .metrics-3,
  .folder-grid,
  .quick-send-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
  }

  .topbar-right {
    width: 100%;
    flex-wrap: wrap;
  }

  .topbar-user {
    align-items: flex-start;
    margin-right: 0;
  }

  .content {
    padding: 16px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-hero,
  .auth-card-wrap {
    padding: 24px 20px;
  }
}

@media (max-width: 640px) {
  .search-row,
  .card-header,
  .doc-item,
  .client-row,
  .wa-status-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .wa-status-meta {
    margin-left: 0;
    align-items: flex-start;
  }

  .tbl {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .payment-form {
    justify-content: flex-end;
  }

  .access-summary,
  .access-card-head,
  .access-meta,
  .access-actions,
  .log-header,
  .tpl-actions,
  .tpl-toolbar,
  .sync-actions,
  .invoice-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .access-card .form-grid {
    padding-top: 10px;
  }
}
