@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #f2f4ee;
  --card: #ffffff;
  --accent: #5c684e;
  --accent-dark: #20261a;
  --text: #171d13;
  --muted: #66705c;
  --border: #d9ddd2;
  --shadow: 0 12px 30px rgba(23, 29, 19, 0.08);
  --radius: 7px;
  --panel-shadow: 0 20px 45px rgba(23, 29, 19, 0.06);
  --soft-bg: #f8f8f4;
  --line-strong: #d7dccf;
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Public Sans", sans-serif;
  background: radial-gradient(1200px 420px at 20% -10%, #e6eadc, transparent),
              radial-gradient(900px 320px at 90% 0%, #edf1e6, transparent),
              var(--bg);
  color: var(--text);
  font-weight: 400;
}

.site-header {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  background: #20261a;
  color: #fff;
  border-bottom: none;
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.2);
}

.site-header .brand {
  font-weight: 600;
  font-size: 19px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  height: 26px;
  width: auto;
  display: inline-block;
}

.site-header nav a {
  margin-left: 16px;
  text-decoration: none;
  color: #e5eadb;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.site-header nav a:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hamburger {
  display: none;
  width: 36px;
  height: 28px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 2px;
}

.nav-toggle {
  display: none;
}

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

.app-main {
  flex: 1;
  min-width: 0;
}

.sidebar {
  width: 240px;
  background: #20261a;
  color: white;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  margin-bottom: 18px;
}

.sidebar-brand-logo {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: block;
}

.side-user {
  background: rgba(255,255,255,0.07);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 14px;
}

.side-user-name {
  font-weight: 400;
  color: rgba(216, 224, 201, 0.84);
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-link {
  color: rgba(229, 234, 219, 0.74);
  text-decoration: none;
  padding: 9px 11px;
  border-radius: 8px;
  display: block;
  font-weight: 400;
  font-size: 14px;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.side-link.active {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.side-logout {
  width: 100%;
  border: none;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-weight: 500;
  cursor: pointer;
}

.side-logout:hover {
  background: rgba(255, 255, 255, 0.18);
}

.side-support {
  margin-top: 16px;
}

.side-support-link {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #e5eadb;
  background: rgba(255, 255, 255, 0.07);
  font-weight: 500;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.side-support-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.side-footer {
  margin-top: auto;
  padding-top: 18px;
  color: rgba(229, 234, 219, 0.72);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.side-footer a {
  color: rgba(229, 234, 219, 0.9);
  text-decoration: none;
}

.side-footer a:hover {
  color: #fff;
}

.sidebar-backdrop {
  display: none;
}

.container {
  max-width: none;
  margin: 24px auto 60px;
  padding: 0 24px;
}

body.admin .container {
  max-width: none;
}

.impersonation-banner {
  background: #fff7ed;
  color: #b45309;
  padding: 10px 16px;
  font-weight: 600;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  border-bottom: 1px solid #fed7aa;
}

.impersonation-banner a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--panel-shadow);
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.card.admin-wide {
  width: 100%;
  max-width: none;
}

.card.narrow {
  max-width: 420px;
  margin: 40px auto;
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.auth-brand-mark {
  width: 92px;
  height: 92px;
  display: block;
}

h1,
h2,
h3 {
  color: var(--text);
  letter-spacing: -0.02em;
}

h1 {
  font-weight: 700;
}

h2 {
  font-weight: 600;
}

h3 {
  font-weight: 600;
}

.card h2,
.card h3,
.data-panel h2,
.data-panel h3 {
  margin: 0 0 12px;
}

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

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

.split {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

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

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

.stat {
  font-size: 36px;
  font-weight: 700;
  margin: 8px 0 12px;
}

.stat.small {
  font-size: 28px;
}

.card-metric {
  border: 1px solid #e6e3de;
}

.card.subtle {
  border: 1px solid #e6ebf2;
  background: #fbfcfe;
}

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

.analytics-item {
  padding: 12px 14px;
  border-radius: 7px;
  border: 1px solid #e4e8f0;
  background: #ffffff;
}

.analytics-title {
  font-size: 13px;
  font-weight: 400;
  color: #536171;
}

.analytics-value {
  font-size: 24px;
  font-weight: 700;
  margin: 6px 0 4px;
  color: #1f2937;
}

.analytics-sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 350;
}

.support-top {
  align-items: stretch;
}

.support-contact {
  margin: 8px 0;
  font-size: 20px;
  font-weight: 600;
}

.support-contact a {
  color: var(--accent);
  text-decoration: none;
}

.support-tips {
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8f9fb;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.support-admin-list {
  display: grid;
  gap: 16px;
}

.support-admin-item {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 16px;
}

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

.support-admin-subject {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.support-admin-meta {
  color: var(--muted);
  font-size: 13px;
}

.support-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.new {
  background: #e8f0ff;
  color: #1f4fd1;
}

.status-pill.resolved {
  background: #edf8f0;
  color: #1f7a3d;
}

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

.support-admin-message {
  line-height: 1.65;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8f9fb;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.support-note-form {
  margin-top: 0;
}

.support-footer-note {
  margin-top: 16px;
}

.support-footer-note a {
  color: var(--accent);
  text-decoration: none;
}

.steps-inline-strip {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin: 0 0 16px;
  padding: 4px 0 0;
}

.steps-inline-label {
  padding-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.steps-inline-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.steps-inline-item {
  position: relative;
  display: grid;
  gap: 4px;
  padding-top: 6px;
  color: inherit;
  text-decoration: none;
}

.steps-inline-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line-strong);
}

.steps-inline-item.done::before {
  background: #bfcab1;
}

.steps-inline-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.steps-inline-sub {
  font-size: 11px;
  color: var(--muted);
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.6fr);
  gap: 20px;
  padding: 26px 28px;
  margin-bottom: 22px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fbfbf7 0%, #f1f3eb 100%);
  border: 1px solid #d9ddd2;
  box-shadow: 0 18px 48px rgba(23, 29, 19, 0.08);
}

.page-eyebrow,
.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 700;
  color: #6b745f;
  margin-bottom: 10px;
}

.page-hero h1 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.page-intro {
  max-width: 60ch;
  color: #6f7966;
  font-size: 14px;
  line-height: 1.82;
  margin: 0;
  font-weight: 300;
}

.hero-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -2px 0 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ece7db;
  border: 1px solid #ddd1bb;
  color: #7a6540;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero-mode-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.hero-mode-row .hero-mode-badge {
  margin: 0;
}

.hero-mode-back {
  margin: 0;
}

.page-hero-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 20px;
  border-radius: 7px;
  background: #edf1e6;
  color: var(--text);
  border: 1px solid #d9ddd2;
}

.page-hero-history .page-hero-meta {
  background: #f3ede2;
  border-color: #e1d4bc;
}

.page-hero-history .hero-meta-label {
  color: #8a7448;
}

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

.page-grid-2.client-events-layout {
  grid-template-columns: minmax(240px, 0.65fr) minmax(520px, 1.35fr);
}

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

.page-grid-3.client-status-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr);
}

.client-status-grid-wide {
  min-width: 0;
}

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

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

.admin-hero {
  background: linear-gradient(135deg, #f6f7f1 0%, #ecefe4 100%);
}

.admin-hero .page-eyebrow,
.admin-hero .page-intro,
.admin-hero h1 {
  color: var(--text);
}

.admin-hero .page-intro {
  color: var(--muted);
}

.hero-meta-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b745f;
}

.hero-meta-value {
  font-size: 32px;
  line-height: 1;
  margin: 10px 0 8px;
  font-weight: 600;
}

.hero-meta-sub {
  color: #73806f;
  font-size: 12px;
  font-weight: 300;
  line-height: 1.7;
}

.data-panel {
  border-color: #dfe6ef;
}

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

.section-heading h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.section-note {
  max-width: 36ch;
  margin: 0;
  color: #7b8898;
  font-size: 13px;
  line-height: 1.75;
  font-weight: 300;
}

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

.compact-panel {
  padding-top: 18px;
  padding-bottom: 18px;
}

.toolbar {
  margin-bottom: 14px;
}

.month-filter-compact {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-fields {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.month-year-inline {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.month-year-inline select {
  width: auto;
  min-width: 96px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-fields button,
.toolbar-actions button {
  width: auto;
  min-width: 110px;
}

.ical-debug-stats {
  gap: 16px;
}

.mono-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  word-break: break-all;
}

.ical-debug-raw-row td {
  background: #fbfcf8;
}

.ical-debug-pre {
  margin: 10px 0 0;
  padding: 14px 16px;
  border: 1px solid #d9ddd2;
  border-radius: 14px;
  background: #f8f8f4;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.55;
  overflow-x: auto;
}

.dashboard-primary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.dashboard-metric {
  min-height: 184px;
}

.dashboard-metric h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.dashboard-metric-wide {
  grid-column: span 4;
  min-height: auto;
}

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

.admin-metrics-grid .card-metric {
  min-height: 136px;
  padding: 16px 16px 14px;
}

.admin-metrics-grid h2 {
  font-size: 14px;
  margin-bottom: 6px;
}

.admin-metrics-grid .stat {
  font-size: 26px;
  margin: 4px 0 8px;
}

.admin-metrics-grid .metric-sub {
  font-size: 12px;
}

.admin-section-stack {
  display: grid;
  gap: 18px;
}

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

.admin-inline-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.admin-compact-kv {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-compact-kv strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #4d5a4a;
}

.admin-log-block {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #d9ddd2;
  border-radius: 12px;
  background: #f8f8f4;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.6;
  overflow: auto;
  max-height: 360px;
}

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

.admin-note-list .hint {
  margin: 0;
}

.analytics-section {
  padding-top: 22px;
}

.analytics-detail-grid {
  align-items: start;
}

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

.compact-create-form {
  row-gap: 10px;
}

.client-create-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) 110px 110px minmax(150px, 1fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.client-top-grid .client-create-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 18px;
  row-gap: 12px;
  align-items: start;
}

.client-top-grid .client-create-name {
  grid-column: 1 / 3;
}

.client-top-grid .client-create-price {
  grid-column: 3 / 4;
}

.client-top-grid .client-create-duration {
  grid-column: 4 / 5;
}

.client-top-grid .client-create-phone {
  grid-column: 1 / 3;
}

.client-top-grid .client-create-email {
  grid-column: 3 / 5;
}

.client-top-grid .client-create-submit {
  grid-column: 1 / 2;
  justify-self: start;
}

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

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

.form-grid-actions {
  align-items: center;
}

.span-2 {
  grid-column: span 2;
}

.client-summary-panel .analytics-grid {
  margin-top: 0;
}

.table-refined th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #728196;
  font-weight: 600;
  border-bottom: 1px solid var(--line-strong);
  padding-top: 10px;
  padding-bottom: 10px;
}

.table-refined td {
  vertical-align: top;
  padding-top: 10px;
  padding-bottom: 10px;
}

.dashboard-todo-row td {
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.dashboard-todo-row.is-open td {
  background: rgba(255, 243, 240, 0.72);
}

.dashboard-todo-row.is-warning td {
  background: rgba(250, 247, 236, 0.78);
}

.dashboard-todo-row.is-ready td {
  background: rgba(242, 246, 238, 0.78);
}

.dashboard-todo-row td:first-child {
  border-left: 3px solid transparent;
}

.dashboard-todo-row.is-open td:first-child {
  border-left-color: #d97363;
}

.dashboard-todo-row.is-warning td:first-child {
  border-left-color: #cf9f45;
}

.dashboard-todo-row.is-ready td:first-child {
  border-left-color: #7e9a62;
}

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

.client-table th:nth-child(1) { width: 14%; }
.client-table th:nth-child(2) { width: 8%; }
.client-table th:nth-child(3) { width: 7%; }
.client-table th:nth-child(4) { width: 12%; }
.client-table th:nth-child(5) { width: 14%; }
.client-table th:nth-child(6) { width: 25%; }
.client-table th:nth-child(7) { width: 20%; }

.client-name-cell a {
  font-weight: 600;
  color: #0f1a28;
  text-decoration: none;
}

.client-inline-form {
  display: contents;
}

.client-table td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.client-table input {
  width: 100%;
  min-width: 0;
}

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

.client-table td:nth-child(1) input,
.client-table td:nth-child(4) input,
.client-table td:nth-child(5) input {
  max-width: 100%;
}

.client-actions {
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
}

.client-main-row td {
  border-bottom: none;
  padding-bottom: 8px;
}

.client-note-row td {
  padding-top: 0;
  padding-bottom: 14px;
}

.client-note-wrap {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.client-note-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7a889b;
  font-weight: 500;
}

.client-note-form {
  margin: 0;
}

.client-note-form input {
  margin-top: 0;
}

.steps-banner {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: #f4f6fa;
  border: 1px solid #e0e6ef;
  border-radius: 10px;
  margin-bottom: 16px;
}

.steps-banner a {
  font-size: 13px;
  font-weight: 600;
  color: #1f4f8a;
  text-decoration: none;
}

details {
  border-bottom: 1px solid #e6e3de;
  padding: 10px 0;
}

details:last-child {
  border-bottom: none;
}

summary {
  cursor: pointer;
  font-weight: 600;
  color: #1f2937;
  list-style: none;
  margin-bottom: 8px;
}

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

details > summary::after {
  content: '+';
  float: right;
  color: #8a94a6;
}

details[open] > summary::after {
  content: '–';
}

.workflow-stack {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.workflow-card {
  margin-bottom: 0;
  padding: 18px 20px 20px;
}

.workflow-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.workflow-summary-main h2 {
  margin: 0;
}

.workflow-summary-note {
  margin: 8px 0 0;
  color: #71806c;
  font-size: 13px;
  line-height: 1.72;
  font-weight: 300;
}

.workflow-summary-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 120px;
}

.workflow-count-badge {
  min-width: 52px;
  min-height: 34px;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 12px;
}

.workflow-summary-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
  text-align: right;
  max-width: 14ch;
}

.workflow-summary-hint {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: #7b8898;
  text-align: right;
  max-width: 24ch;
  font-weight: 300;
}

.workflow-panel-body {
  padding-top: 10px;
}

.workflow-table-toggle {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.66);
  padding: 0;
}

.workflow-table-toggle > summary {
  margin: 0;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.workflow-table-toggle > summary span {
  color: var(--muted);
  font-weight: 500;
}

.workflow-table-toggle[open] {
  background: rgba(255,255,255,0.92);
}

.workflow-table-toggle .table-wrap {
  padding: 0 14px 14px;
}

.client-combobox {
  position: relative;
  min-width: 180px;
  flex: 1 1 180px;
}

.client-combobox-input {
  width: 100%;
}

.client-combobox-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  display: block;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.98);
  box-shadow: 0 18px 32px rgba(23, 29, 19, 0.12);
}

.client-combobox-menu[hidden] {
  display: none;
}

.client-combobox-option {
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  padding: 7px 9px;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  appearance: none;
}

.client-combobox-option:hover,
.client-combobox-option:focus-visible {
  background: var(--soft-bg);
  outline: none;
}

.client-combobox-option + .client-combobox-option {
  margin-top: 2px;
}

.client-combobox-empty {
  padding: 9px 10px;
  color: var(--muted);
  font-size: 13px;
}

.compact-table table {
  font-size: 12px;
}

.compact-table th,
.compact-table td {
  padding: 6px 8px;
}

.compact-table .hint {
  font-size: 11px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 12px;
}

.guide-item {
  padding: 8px 10px;
}

.guide-item h3 {
  margin-bottom: 8px;
}

.guide-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.guide-list li {
  margin-bottom: 8px;
}

.guide-images {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.guide-images img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #e6e3de;
  display: block;
  cursor: zoom-in;
}

.guide-item figure {
  margin: 0;
}

.guide-item img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
}

.guide-images figcaption {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.metric-green {
  background: #eef3e9;
  border-color: #d7dfcf;
}

.metric-yellow {
  background: #f7f1de;
  border-color: #e5dcc0;
}

.metric-amber {
  background: #f5ebe2;
  border-color: #e5d5c8;
}

.metric-blue {
  background: #edf1e6;
  border-color: #d7dfcf;
}

.metric-gray {
  background: #f1f3ee;
  border-color: #d9ddd2;
}

.stat.green {
  color: #466043;
}

.stat.yellow {
  color: #8d7440;
}

.stat.amber {
  color: #8f6244;
}

.stat.blue {
  color: #56644a;
}

.stat.gray {
  color: #475045;
}

.metric-sub {
  font-weight: 400;
  color: var(--muted);
}

.metric-lines {
  display: grid;
  gap: 6px;
}

.metric-line {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.form label {
  display: block;
  font-weight: 600;
  margin-bottom: 12px;
  color: #172334;
}

.form input,
.form textarea,
.form select,
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]),
textarea,
select {
  width: 100%;
  min-height: 38px;
  padding: 7px 11px;
  margin-top: 6px;
  border-radius: 6px;
  border: 1px solid #cbd6e4;
  font-size: 14px;
  line-height: 1.4;
  color: #102033;
  background: #f9fbfd;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.form textarea,
textarea {
  min-height: 104px;
  resize: vertical;
}

.form input:hover,
.form textarea:hover,
.form select:hover,
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):hover,
textarea:hover,
select:hover {
  border-color: #b9c7d9;
  background: #ffffff;
}

.form input:focus,
.form textarea:focus,
.form select:focus,
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #86a8de;
  box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.10);
  background: #fff;
}

.form input::placeholder,
.form textarea::placeholder,
input::placeholder,
textarea::placeholder {
  color: #8a98ab;
}

.form select,
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 42px;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%23566578' d='M3.2 5.1 7 8.9l3.8-3.8.9.9L7 10.7 2.3 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
}

.form input[type="date"],
.form input[type="datetime-local"],
.form input[type="month"],
.form input[type="time"] {
  padding-right: 12px;
}

.form input[type="date"]::-webkit-calendar-picker-indicator,
.form input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.form input[type="month"]::-webkit-calendar-picker-indicator,
.form input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0.7;
  cursor: pointer;
}

.inline input,
.inline select,
.inline textarea {
  margin-top: 0;
}

.compact-inline-form select {
  min-width: 220px;
}

.compact-stack-form {
  margin-top: 8px;
}

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

.compact-check {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.compact-reschedule-form .form-grid {
  grid-template-columns: minmax(220px, 320px) auto auto;
  align-items: center;
}

.compact-reschedule-form button {
  width: auto;
  min-width: 120px;
}

.table-actions {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

.section-intro {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.table-subline {
  margin-top: 4px;
  color: #7b8795;
  font-size: 11px;
  line-height: 1.55;
  font-weight: 300;
}

.admin-users-table th:nth-child(1) { width: 18%; }
.admin-users-table th:nth-child(2) { width: 22%; }
.admin-users-table th:nth-child(3) { width: 22%; }
.admin-users-table th:nth-child(4) { width: 18%; }
.admin-users-table th:nth-child(5) { width: 20%; }

.admin-users-table td {
  vertical-align: top;
}

.acquisition-table th:nth-child(1) { width: 16%; }
.acquisition-table th:nth-child(2) { width: 14%; }
.acquisition-table th:nth-child(3) { width: 15%; }
.acquisition-table th:nth-child(4) { width: 14%; }
.acquisition-table th:nth-child(5) { width: 15%; }
.acquisition-table th:nth-child(6) { width: 12%; }
.acquisition-table th:nth-child(7) { width: 9%; }
.acquisition-table th:nth-child(8) { width: 5%; }

.admin-user-main {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
}

.admin-user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-user-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #f4f6f9;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.admin-user-badge.ok {
  background: #edf8f0;
  border-color: #cfe5d7;
  color: #1f6e3d;
}

.admin-user-badge.warn {
  background: #fff4e9;
  border-color: #f0d2b4;
  color: #a85b15;
}

.admin-user-badge.muted {
  background: #f4f6f9;
  border-color: #dde3eb;
  color: #667183;
}

.admin-user-badge.free {
  background: #eef3ff;
  border-color: #d5dff5;
  color: #355fc0;
}

.admin-user-badge.cancel {
  background: #fff7df;
  border-color: #ecd9a6;
  color: #8c6820;
}

.admin-user-stack {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-user-stack strong {
  color: var(--text);
  font-weight: 600;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  align-content: flex-start;
  min-width: 220px;
}

.admin-user-actions .inline {
  display: flex;
  align-items: center;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

a.icon-action {
  text-decoration: none;
}

.table-actions form {
  margin: 0;
}

.series-actions {
  display: grid;
  gap: 8px;
  align-items: start;
}

.series-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  align-items: center;
}

.series-actions-grid.single {
  grid-template-columns: 1fr;
}

.series-actions-grid > div,
.series-actions-grid > form {
  min-width: 0;
}

.series-actions-grid button {
  width: 100%;
}

.compact-series-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.compact-series-form select {
  min-width: 220px;
}

.client-combobox-compact {
  min-width: 0;
  width: 100%;
}

.client-combobox-compact .client-combobox-input {
  min-width: 0;
}

.row-focus td {
  background: rgba(148, 163, 184, 0.12);
}

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

button.small,
.button.small,
.save.small {
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
  border-radius: 6px;
}

table input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]),
table select,
table textarea {
  min-height: 30px;
  font-size: 12px;
  padding: 5px 8px;
}

.table-refined .button-link,
.table-refined button {
  box-shadow: none;
}

.table-refined .button-link.compact,
.table-refined button.small,
.table-refined .small {
  min-height: 28px;
}

.table-refined .client-combobox-compact .client-combobox-input {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
  border-radius: 6px;
}

.input-narrow {
  max-width: 120px;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 13px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(32, 38, 26, 0.12);
}

button.save {
  background: #476144;
}

button.save:hover {
  background: #365037;
}

button.compact {
  padding: 6px 10px;
  font-size: 13px;
}

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

.actions-row form {
  margin: 0;
}

button.outline-warning {
  background: transparent;
  color: #a15b1a;
  border: 2px solid #e0b083;
}

button.outline-warning:hover {
  background: #fff4e6;
}

button.outline-danger {
  background: transparent;
  color: #8d4a20;
  border: 2px solid #d8a27c;
}

button.outline-danger:hover {
  background: #f8ebe1;
}

button.outline-neutral {
  background: transparent;
  color: #56644a;
  border: 2px solid #c7d0ba;
}

button.outline-neutral:hover {
  background: #eef2e9;
}

.button-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #eef2e7;
  color: #2e4630;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  border: 1px solid #d9ddd2;
}

.button-link.compact {
  padding: 6px 10px;
  font-size: 13px;
}

button:hover {
  background: var(--accent-dark);
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 19, 12, 0.42);
  backdrop-filter: blur(2px);
}

.confirm-modal-dialog {
  position: relative;
  width: min(520px, calc(100% - 32px));
  margin: 10vh auto 0;
  padding: 22px 22px 18px;
  border-radius: 20px;
  border: 1px solid rgba(83, 95, 71, 0.18);
  background: #fbfcf7;
  box-shadow: 0 28px 80px rgba(23, 29, 19, 0.22);
}

.confirm-modal-eyebrow {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.confirm-modal h2 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.08;
}

.confirm-modal p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .site-header { display: flex; }
  .app-shell { flex-direction: column; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 10;
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 9;
  }
  .nav-toggle:checked ~ .app-shell .sidebar {
    transform: translateX(0);
  }
  .nav-toggle:checked ~ .app-shell .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .hamburger {
    display: flex;
  }

  .page-grid-2.client-events-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-header { flex-direction: column; gap: 8px; }
  .container { padding: 16px; }
  .app-main { padding-top: 8px; }
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table-compact th,
.table-compact td {
  padding: 6px 6px;
  font-size: 0.85rem;
}

.table-compact .button-link,
.table-compact button {
  padding: 6px 10px;
  font-size: 0.8rem;
}

.table-compact .actions-row,
.table-compact td.inline {
  gap: 6px;
  flex-wrap: wrap;
}

tr.report-summary {
  background: #f2f4f7;
}

.report-detail-wrap td {
  background: #fbfcf8;
  border-bottom: 1px solid #e1e6d8;
}

.report-detail-cell {
  padding-top: 10px;
  padding-bottom: 12px;
  border-top: none;
}

.report-detail-row {
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.55;
  color: #526173;
  font-weight: 350;
}

.report-detail-row:last-child {
  margin-bottom: 0;
}

.report-detail-label {
  color: #243447;
  font-weight: 500;
}

.client-month-closure {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.client-month-closure-meta {
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.45;
}

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

.client-month-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.client-month-history {
  margin-top: 18px;
}

.client-month-history-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.client-month-history-item {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  color: inherit;
}

.client-month-history-item.active {
  border-color: rgba(92, 104, 78, 0.35);
  background: rgba(227, 232, 216, 0.55);
}

.client-month-history-month {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.client-month-history-state {
  font-size: 12px;
  color: var(--muted);
}

.weight-bold {
  font-weight: 700;
}

.weight-medium {
  font-weight: 400;
}

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

.inline select {
  min-width: 180px;
}

.flash {
  background: #e0f0ff;
  border: 1px solid #bcd7f4;
  color: #1a3f5b;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.flash.error {
  background: #ffe6e2;
  border-color: #f3b4a8;
  color: #7a2f23;
}

.hint {
  color: #707c6b;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.75;
}

@media (max-width: 1100px) {
  .admin-action-grid,
  .admin-compact-kv {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.content-footer {
  margin-top: 28px;
  padding: 18px 0 4px;
}

.content-footer-links {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.content-footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.content-footer-links a:hover {
  color: var(--text);
}

.public-footer {
  padding: 18px 24px 8px;
}

.legal-card {
  max-width: 960px;
}

.legal-content h3 {
  margin-top: 22px;
}

.legal-preview {
  margin: 6px 0 18px;
}

p {
  font-weight: 300;
}

@media (max-width: 700px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .site-header nav a {
    margin-left: 0;
    margin-right: 12px;
  }

  .content-footer-links {
    justify-content: flex-start;
  }
}

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

  .page-grid-2,
  .page-grid-3,
  .page-grid-4 {
    grid-template-columns: 1fr;
  }

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

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

  .dashboard-metric-wide {
    grid-column: span 2;
  }

  .client-top-grid {
    grid-template-columns: 1fr;
  }

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

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

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

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

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

  .steps-inline-strip {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .steps-inline-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 700px) {
  .workflow-card > summary {
    padding: 0;
  }

  .workflow-summary {
    flex-direction: column;
  }

  .workflow-summary-side {
    align-items: flex-start;
    min-width: 0;
  }

  .workflow-count-badge {
    min-width: 48px;
  }

  .workflow-summary-label {
    text-align: left;
    max-width: none;
  }

  .workflow-summary-hint {
    text-align: left;
    max-width: none;
  }

  .workflow-panel-body {
    padding: 10px 0 0;
  }

  .workflow-card {
    padding: 16px;
  }

  .client-month-header {
    flex-direction: column;
  }

  .client-month-actions {
    justify-content: flex-start;
  }

  .client-month-closure {
    align-items: flex-start;
  }

  .section-heading {
    flex-direction: column;
  }

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

  .client-top-grid .client-create-grid {
    grid-template-columns: 1fr;
  }

  .client-top-grid .client-create-name,
  .client-top-grid .client-create-price,
  .client-top-grid .client-create-duration,
  .client-top-grid .client-create-phone,
  .client-top-grid .client-create-email,
  .client-top-grid .client-create-submit {
    grid-column: auto;
  }

  .client-top-grid .client-create-grid,
  .client-create-price-time {
    grid-template-columns: 1fr;
  }

  .client-top-grid .client-create-grid {
    grid-template-areas:
      "name"
      "priceTime"
      "phone"
      "email"
      "submit";
  }

  .admin-metrics-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-metric-wide {
    grid-column: span 1;
  }

  .form-grid-compact,
  .compact-stack-form .form-grid,
  .compact-reschedule-form .form-grid,
  .form-grid-actions {
    grid-template-columns: 1fr;
  }

  .client-create-grid,
  .client-note-wrap {
    grid-template-columns: 1fr;
  }

  .month-filter-compact,
  .toolbar-fields,
  .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .compact-reschedule-form .form-grid {
    grid-template-columns: 1fr;
  }

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

  .support-admin-grid {
    grid-template-columns: 1fr;
  }

  .support-admin-head {
    flex-direction: column;
  }

  .admin-users-table th,
  .admin-users-table td {
    white-space: normal;
  }

  .admin-user-actions {
    min-width: 0;
  }

  .admin-action-grid,
  .admin-compact-kv {
    grid-template-columns: 1fr;
  }

  .table-refined th,
  .table-refined td {
    padding: 9px 8px;
    font-size: 13px;
  }

  .table-refined th {
    font-size: 10px;
    letter-spacing: 0.06em;
  }

  .table-refined .button-link,
  .table-refined button,
  .table-refined select,
  .table-refined input {
    font-size: 13px;
  }

  .table-refined .button-link.compact,
  .table-refined button.small,
  .table-refined .small {
    padding: 7px 10px;
  }

  .report-detail-row {
    font-size: 12px;
    line-height: 1.6;
  }

  .section-note {
    max-width: none;
  }
}

@media (max-width: 700px) {
  .billing-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

.payment-qr {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 6px;
  background: #fff;
}

.billing-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(191, 219, 254, 0.9);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.95), rgba(248, 250, 252, 0.98));
}

.billing-banner-copy {
  display: grid;
  gap: 4px;
}

.billing-banner-copy strong {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.billing-banner-copy span {
  font-size: 13px;
  color: #475569;
}

.billing-banner a {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
}

.legal-preview {
  padding: 0;
  overflow: hidden;
}

.legal-preview summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
}

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

.legal-preview[open] summary {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.legal-content {
  padding: 16px;
}

.template-grid {
  align-items: start;
}

.template-card {
  margin: 0;
}
