:root {
  --bg: #eef2f4;
  --bg-strong: #dbe4e6;
  --panel: rgba(255, 255, 252, 0.94);
  --panel-strong: #ffffff;
  --line: rgba(20, 33, 37, 0.11);
  --ink: #122024;
  --muted: #68767b;
  --sidebar: #132226;
  --sidebar-soft: #1c3034;
  --sidebar-line: rgba(239, 244, 242, 0.1);
  --accent: #d95f45;
  --accent-deep: #a63d2d;
  --accent-cool: #0f766e;
  --success: #147a55;
  --danger: #b33b31;
  --shadow: 0 18px 46px rgba(16, 37, 42, 0.11);
  --radius: 8px;
  --space-1: 10px;
  --space-2: 14px;
  --space-3: 18px;
  --space-4: 22px;
  --space-5: 28px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(19, 34, 38, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(19, 34, 38, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, #f4f6f4 0%, #edf3f4 52%, #e4ece9 100%);
  background-size: 44px 44px, 44px 44px, auto;
  font-family: "IBM Plex Sans", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.12), transparent 34%),
    linear-gradient(305deg, rgba(217, 95, 69, 0.1), transparent 38%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 82%);
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-width: 0;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: var(--space-5) var(--space-4);
  border-right: 1px solid var(--sidebar-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 38%),
    var(--sidebar);
  color: #eef4f2;
}

.app-shell.signed-out {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.signed-out .sidebar {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--accent), #f1a24a);
  color: #fff8ef;
  font-family: "Sora", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: 0 16px 30px rgba(203, 90, 42, 0.35);
}

.brand-title,
.page-title {
  font-family: "Sora", sans-serif;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.brand-subtitle,
.eyebrow,
.field-label,
.backend-meta,
.hint,
.muted {
  color: var(--muted);
}

.sidebar .brand-subtitle,
.sidebar .field-label,
.sidebar .backend-meta {
  color: rgba(238, 244, 242, 0.62);
}

.sidebar-block {
  display: grid;
  gap: 8px;
}

.field-label,
.eyebrow {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.backend-meta {
  font-size: 0.85rem;
  line-height: 1.4;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-button,
.button,
.ghost-button,
.chip-button,
.danger-button {
  border: 0;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
  font: inherit;
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  background: transparent;
  color: rgba(238, 244, 242, 0.78);
  text-align: left;
  font-weight: 600;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-button.active {
  box-shadow: inset 3px 0 0 var(--accent), inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.sidebar-footer {
  margin-top: auto;
}

.main {
  min-width: 0;
  padding: 30px clamp(22px, 3vw, 42px) 42px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.topbar-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.menu-button {
  display: none;
  flex: 0 0 auto;
  margin-top: 1px;
}

.page-title {
  margin: 6px 0 0;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1;
}

.session-badge {
  max-width: 100%;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
  box-shadow: 0 10px 28px rgba(16, 37, 42, 0.06);
}

.panel,
.hero,
.split-panel,
.table-card,
.stat-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel {
  padding: var(--space-4);
}

.hero {
  padding: var(--space-5);
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(135deg, rgba(19, 34, 38, 0.96), rgba(22, 55, 57, 0.94)),
    var(--sidebar);
  color: #f6fbf9;
}

.hero::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 44%;
  height: 100%;
  background:
    linear-gradient(135deg, transparent 0 28%, rgba(217, 95, 69, 0.22) 28% 42%, transparent 42% 100%),
    linear-gradient(45deg, transparent 0 54%, rgba(15, 118, 110, 0.34) 54% 68%, transparent 68% 100%);
  opacity: 0.9;
}

.hero-title {
  margin: 0 0 8px;
  font-family: "Sora", sans-serif;
  font-size: 1.5rem;
}

.hero-copy {
  margin: 0;
  max-width: 70ch;
  color: rgba(246, 251, 249, 0.72);
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff, rgba(249, 252, 250, 0.95));
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent-cool), var(--accent));
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-value {
  margin-top: 10px;
  font-family: "Sora", sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.stat-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.section {
  display: grid;
  gap: 18px;
  margin-top: var(--space-3);
}

.section-title {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1.2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.section-header > * {
  min-width: 0;
}

.route-loading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 156px;
  padding: 22px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.92), rgba(242, 248, 247, 0.86)),
    var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.route-loading-title {
  margin-bottom: 4px;
  font-family: "Sora", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.route-loading-spinner {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 3px solid rgba(15, 118, 110, 0.16);
  border-top-color: var(--accent-cool);
  border-radius: 999px;
  animation: button-spin 0.8s linear infinite;
}

.content-load-panel {
  flex-wrap: wrap;
  justify-content: space-between;
}

.content-load-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(15, 118, 110, 0.3);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.16) 1px, transparent 1px),
    linear-gradient(rgba(15, 118, 110, 0.14) 1px, transparent 1px),
    rgba(255, 255, 255, 0.7);
  background-size: 10px 10px;
}

.content-load-button {
  flex: 0 0 auto;
}

.title-with-count {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.title-count {
  white-space: nowrap;
}

.control-row,
.action-row,
.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.reports-header {
  width: 100%;
  min-width: 0;
}

.report-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.report-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, minmax(30px, auto));
  grid-auto-columns: max-content;
  gap: 6px;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 4px;
}

.report-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: auto;
  min-width: 0;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, border-color 120ms ease;
}

.report-tab.is-active {
  border-color: rgba(15, 118, 110, 0.48);
  background: linear-gradient(145deg, var(--accent-cool), #169286);
  color: #fff7ef;
  box-shadow: 0 12px 22px rgba(15, 118, 110, 0.2);
}

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

.report-tab:disabled {
  cursor: wait;
  opacity: 0.8;
  transform: none;
}

.report-reload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 66px;
  padding: 0 12px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: rgba(232, 246, 242, 0.78);
  color: var(--accent-cool);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, border-color 120ms ease;
}

.report-reload-button:hover {
  transform: translateY(-1px);
}

.report-reload-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.report-explanation {
  display: grid;
  gap: 8px;
}

.report-explanation-copy {
  max-width: 760px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.card-lookup-row {
  align-items: center;
  padding-bottom: 14px;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid rgba(18, 32, 36, 0.14);
  border-radius: 8px;
  padding: 13px 15px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: 3px solid rgba(15, 118, 110, 0.16);
  border-color: rgba(15, 118, 110, 0.42);
}

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

.input.inline,
.select.inline {
  width: auto;
  min-width: 160px;
}

.translations-filter-row {
  align-items: center;
  margin-bottom: 14px;
}

.translations-filter-row .select {
  flex: 0 0 190px;
  width: auto;
}

.translations-filter-row .input {
  flex: 1 1 260px;
  min-width: 220px;
}

.translations-filter-row .button,
.translations-filter-row .ghost-button {
  flex: 0 0 auto;
}

.button,
.ghost-button,
.chip-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 700;
}

.button {
  background: linear-gradient(145deg, var(--accent-cool), #169286);
  color: #fff7ef;
  box-shadow: 0 12px 22px rgba(15, 118, 110, 0.22);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  border: 1px solid var(--line);
}

.chip-button {
  background: rgba(15, 118, 110, 0.1);
  color: var(--ink);
}

.danger-button {
  background: rgba(166, 53, 34, 0.12);
  color: var(--danger);
}

.button:hover,
.ghost-button:hover,
.chip-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.button:disabled,
.ghost-button:disabled,
.chip-button:disabled,
.danger-button:disabled,
.icon-button:disabled {
  cursor: wait;
  opacity: 0.8;
}

.is-loading {
  pointer-events: none;
}

.button-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: button-spin 0.7s linear infinite;
}

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

.table-card {
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: 0 12px 34px rgba(16, 37, 42, 0.08);
  -webkit-overflow-scrolling: touch;
}

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

th,
td {
  padding: 13px 15px;
  text-align: left;
  border-bottom: 1px solid rgba(18, 32, 36, 0.08);
  vertical-align: top;
}

th {
  background: #eef4f2;
  font-size: 0.8rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.payments-table table {
  font-size: 0.88rem;
  table-layout: fixed;
}

.payments-table th,
.payments-table td {
  padding: 9px 10px;
  vertical-align: middle;
}

.payments-table th:nth-child(1),
.payments-table td:nth-child(1) {
  width: 16%;
}

.payments-table th:nth-child(2),
.payments-table td:nth-child(2) {
  width: 24%;
}

.payments-table th:nth-child(3),
.payments-table td:nth-child(3),
.payments-table th:nth-child(4),
.payments-table td:nth-child(4),
.payments-table th:nth-child(5),
.payments-table td:nth-child(5),
.payments-table th:nth-child(6),
.payments-table td:nth-child(6) {
  width: 12%;
  white-space: nowrap;
}

.payments-table th:nth-child(7),
.payments-table td:nth-child(7) {
  width: 12%;
  text-align: right;
}

.payment-external-id,
.payment-provider {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-provider,
.payment-currency {
  font-weight: 700;
}

.payment-refund-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.84rem;
}

.daily-stats-table table {
  min-width: 760px;
}

.daily-stats-table th:first-child,
.daily-stats-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 180px;
}

.daily-stats-table th:first-child {
  z-index: 2;
}

.daily-stats-table td:first-child {
  background: var(--panel-strong);
  font-weight: 600;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: rgba(15, 118, 110, 0.07);
}

.link-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent-deep);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

.split-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 0;
  overflow: hidden;
}

.split-panel > * {
  padding: 22px;
}

.split-panel > :first-child {
  border-right: 1px solid var(--line);
}

.detail-stack,
.card-stack {
  display: grid;
  gap: 16px;
}

.user-action-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.action-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid rgba(18, 32, 36, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 247, 246, 0.92));
}

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

.action-card-compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.action-card-title {
  font-family: "Sora", sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.action-card-copy {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

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

.ref-tool-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 100%;
  padding: 18px;
  border: 1px solid rgba(18, 32, 36, 0.08);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 247, 0.92));
}

.events-export-grid {
  grid-template-columns: minmax(0, 1fr);
}

.events-export-card {
  width: 100%;
}

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

.ref-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 2px;
}

.ref-action-button {
  width: 148px;
  min-width: 148px;
}

.action-card-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.action-card-button {
  min-width: 132px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(18, 32, 36, 0.06);
  color: var(--ink);
  font-size: 0.88rem;
}

.pill.success {
  background: rgba(42, 125, 79, 0.12);
  color: var(--success);
}

.pill.danger {
  background: rgba(166, 53, 34, 0.12);
  color: var(--danger);
}

.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(38, 27, 15, 0.08);
}

.kv:last-child {
  border-bottom: 0;
}

.kv-key {
  color: var(--muted);
}

.card-title {
  margin: 0 0 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

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

.list-item {
  padding: 16px 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(18, 32, 36, 0.08);
}

.list-item strong {
  display: block;
  margin-bottom: 6px;
}

.results-table {
  display: grid;
  margin-top: 10px;
  border: 1px solid rgba(18, 32, 36, 0.08);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.76);
}

.predefined-prompts-toolbar {
  padding-bottom: 18px;
}

.styles-toolbar {
  padding-bottom: 18px;
}

.photo-shoots-toolbar {
  padding-bottom: 18px;
}

.copyable-link-cell {
  max-width: 100%;
  overflow-wrap: anywhere;
  user-select: text;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
}

.results-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(220px, 1.5fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) 56px;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(18, 32, 36, 0.08);
  cursor: pointer;
}

.results-row:last-child {
  border-bottom: 0;
}

.results-row:hover,
.results-row.active {
  background: rgba(15, 118, 110, 0.07);
}

.results-head {
  background: #eef4f2;
  color: var(--muted);
  cursor: default;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.results-head:hover {
  background: #eef4f2;
}

.results-action {
  display: flex;
  justify-content: flex-end;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(18, 32, 36, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.icon-chevron,
.icon-close,
.icon-menu {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
}

.icon-chevron::before,
.icon-chevron::after,
.icon-close::before,
.icon-close::after,
.icon-menu::before,
.icon-menu::after {
  content: "";
  position: absolute;
  background: var(--ink);
  border-radius: 999px;
}

.icon-chevron::before,
.icon-chevron::after {
  right: 3px;
  width: 9px;
  height: 2px;
  transform-origin: right center;
}

.icon-chevron::before {
  top: 4px;
  transform: rotate(45deg);
}

.icon-chevron::after {
  bottom: 2px;
  transform: rotate(-45deg);
}

.icon-close::before,
.icon-close::after {
  top: 6px;
  left: 0;
  width: 14px;
  height: 2px;
}

.icon-close::before {
  transform: rotate(45deg);
}

.icon-close::after {
  transform: rotate(-45deg);
}

.icon-menu {
  width: 16px;
}

.icon-menu::before,
.icon-menu::after {
  left: 0;
  width: 16px;
  height: 2px;
  box-shadow: 0 6px 0 var(--ink);
}

.icon-menu::before {
  top: 2px;
}

.icon-menu::after {
  top: 14px;
  box-shadow: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: var(--space-4);
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(38, 27, 15, 0.34);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(247, 250, 249, 0.98);
  box-shadow: 0 30px 80px rgba(18, 32, 36, 0.24);
}

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

.modal-title {
  margin: 6px 0 0;
  font-family: "Sora", sans-serif;
  font-size: 1.6rem;
}

.modal-close {
  flex: 0 0 auto;
}

.alert {
  margin-bottom: 14px;
  padding: 15px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.alert.info {
  background: rgba(18, 32, 36, 0.07);
}

.alert.success {
  background: rgba(42, 125, 79, 0.12);
  border-color: rgba(42, 125, 79, 0.22);
  color: var(--success);
}

.alert.error {
  background: rgba(166, 53, 34, 0.12);
  border-color: rgba(166, 53, 34, 0.2);
  color: var(--danger);
}

.modal-alert {
  margin: 0 0 18px;
}

.login-panel {
  max-width: 760px;
}

.login-grid {
  display: grid;
  gap: 18px;
}

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

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(18, 32, 36, 0.12);
}

.empty-state {
  padding: 36px 32px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.64);
}

.pre {
  padding: 16px;
  border-radius: 8px;
  background: rgba(18, 32, 36, 0.06);
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
}

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(82vw, 320px);
    min-height: 100vh;
    border-right: 1px solid var(--sidebar-line);
    border-bottom: 0;
    transform: translateX(-104%);
    transition: transform 180ms ease;
    box-shadow: 18px 0 40px rgba(18, 32, 36, 0.24);
  }

  .app-shell.menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    border: 0;
    background: rgba(18, 32, 36, 0.42);
  }

  .sidebar-backdrop.hidden,
  .app-shell.signed-out .sidebar-backdrop {
    display: none;
  }

  .menu-button {
    display: inline-flex;
  }

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

  .split-panel {
    grid-template-columns: 1fr;
  }

  .split-panel > :first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .sidebar {
    padding: 22px 18px;
  }

  .main {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    gap: 12px;
  }

  .session-badge {
    font-size: 0.78rem;
    padding: 8px 10px;
  }

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

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

  .compact-stats-grid .stat-card {
    padding: 11px 12px;
  }

  .compact-stats-grid .stat-label {
    font-size: 0.66rem;
  }

  .compact-stats-grid .stat-value {
    margin-top: 6px;
    font-size: 1.18rem;
  }

  .compact-stats-grid .stat-sub {
    margin-top: 5px;
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .topbar,
  .section-header,
  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .report-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .report-reload-button {
    min-height: 34px;
    width: 100%;
  }

  .section .panel {
    width: 100%;
    min-width: 0;
  }

  .action-row > .button,
  .action-row > .ghost-button,
  .action-row > .chip-button,
  .action-row > .danger-button {
    flex: 1 1 140px;
    min-width: 0;
  }

  .kv {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .action-card-compact,
  .action-card-controls,
  .ref-tools-grid,
  .ref-date-grid {
    grid-template-columns: 1fr;
  }

  .action-card-button,
  .ref-action-button {
    width: 100%;
  }

  .results-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .results-action {
    justify-content: flex-start;
  }

  .modal-overlay {
    padding: 12px;
  }

  .modal-card {
    width: 100%;
    max-height: calc(100vh - 24px);
    padding: 20px;
    border-radius: 12px;
  }
}
