:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #111827;
  --muted: #64748b;
  --line: #dbe3ef;
  --nav: #0b1220;
  --nav-soft: #111c31;
  --brand: #2563eb;
  --danger: #b45309;
  --ok: #047857;
  --radius: 8px;
  --shadow: 0 18px 48px rgba(15, 23, 42, .08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  min-height: 100dvh;
  background: #eef4fb;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, #eef4fb 0, #f7f9fc 240px, var(--bg) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
input {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #0b1220 0%, #101a2d 100%);
  color: #e5edf8;
}

.sidebar-backdrop {
  display: none;
}

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

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: #e5edf8;
  color: var(--nav);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: #93a4bd;
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 18px;
  margin-top: 34px;
  padding-bottom: 18px;
}

.side-nav section {
  display: grid;
  gap: 4px;
}

.nav-app-group {
  position: relative;
  margin: 0 -8px;
  padding: 12px 8px 14px;
  border: 1px solid rgba(148, 163, 184, .1);
  border-radius: 8px;
  background: rgba(15, 23, 42, .18);
}

.nav-app-group::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  border-radius: 999px;
  background: var(--group-accent, #60a5fa);
  opacity: .45;
  content: "";
}

.nav-app-group.active-group {
  border-color: color-mix(in srgb, var(--group-accent, #60a5fa) 38%, rgba(148, 163, 184, .16));
  background: linear-gradient(180deg, var(--group-bg), rgba(15, 23, 42, .16));
}

.nav-app-group.active-group::before {
  opacity: 1;
}

.nav-app-group-photovibe {
  --group-accent: #60a5fa;
  --group-bg: rgba(37, 99, 235, .14);
}

.nav-app-group-motiva {
  --group-accent: #34d399;
  --group-bg: rgba(5, 150, 105, .14);
}

.nav-app-group-common {
  --group-accent: #f59e0b;
  --group-bg: rgba(245, 158, 11, .12);
}

.side-nav section > span {
  padding: 0 10px;
  color: #7f91ad;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.side-nav section.active-group > span {
  color: #dbeafe;
}

.nav-subgroup {
  display: grid;
  gap: 3px;
  margin: 7px 0;
  padding: 7px 8px;
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 8px;
  background: rgba(15, 23, 42, .18);
}

.nav-subgroup > span {
  padding: 0 6px;
  color: #7f91ad;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav-subgroup.active-subgroup > span {
  color: #dbeafe;
}

.nav-subgroup a {
  padding-left: 16px;
}

.side-nav a,
.logout-form button,
.mobile-topbar button,
.menu-toggle {
  border: 0;
  border-radius: 8px;
}

.side-nav a {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 9px 12px;
  color: #bfd0e6;
  background: transparent;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-nav a.active {
  padding-right: 28px;
}

.side-nav a:hover,
.side-nav a.active {
  color: #fff;
  background: var(--nav-soft);
}

.side-nav a.active {
  box-shadow: inset 3px 0 0 #60a5fa;
}

.side-nav a.active::after {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #60a5fa;
  content: "";
  transform: translateY(-50%);
}

.page-action-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
}

.content-workspace {
  padding: 0;
  overflow: hidden;
}

.content-toolbar {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.content-search {
  display: grid;
  gap: 6px;
  min-width: min(100%, 360px);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.content-search input,
.content-editor-fields input,
.content-editor-fields select,
.content-editor-side select,
.content-create-form input,
.content-create-form select,
.content-block input,
.content-block textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
}

.content-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.content-workspace .table-wrap { overflow-x: hidden; }

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

.content-table th,
.content-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.content-table th:nth-child(1),
.content-table td:nth-child(1) { width: 140px; }

.content-table th:nth-child(3),
.content-table td:nth-child(3) { width: 112px; }

.content-title-link {
  display: block;
  color: #172554;
  font-weight: 800;
}

.content-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.content-state,
.content-service-transition {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 8px;
  color: #475569;
  background: #eef2f7;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.content-state.state--50 { color: #9a3412; background: #ffedd5; }
.content-state.state--10 { color: #075985; background: #e0f2fe; }
.content-state.state-1 { color: #047857; background: #d1fae5; }

.content-row-actions { display: grid; gap: 6px; justify-items: stretch; }
.content-row-actions a,
.content-row-actions button {
  border: 0;
  border-radius: 6px;
  padding: 7px 9px;
  color: #1e3a8a;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 680px) {
  .content-workspace .table-wrap { overflow-x: auto; }
  .content-table { min-width: 480px; }
}

.empty-table { padding: 28px !important; text-align: center; color: var(--muted); }

.content-load-more {
  display: flex;
  justify-content: center;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.content-load-more button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 15px;
  color: #1e3a8a;
  background: #eff6ff;
  font-weight: 800;
}

.content-load-more button:disabled { opacity: .7; cursor: wait; }

.firebase-usage-panel {
  overflow: hidden;
}

.firebase-cache-card {
  display: grid;
  gap: 6px;
}

.firebase-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  min-height: 280px;
  align-items: end;
}

.firebase-chart-day {
  display: grid;
  min-width: 0;
  gap: 8px;
  text-align: center;
}

.firebase-bars {
  display: flex;
  height: 210px;
  align-items: end;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 8px;
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
}

.firebase-bar {
  display: block;
  width: 18px;
  min-height: 2px;
  border-radius: 999px 999px 3px 3px;
}

.firebase-bar.read,
.firebase-chart-legend .read {
  background: #2563eb;
}

.firebase-bar.write,
.firebase-chart-legend .write {
  background: #0f766e;
}

.firebase-bar.delete,
.firebase-chart-legend .delete {
  background: #b45309;
}

.firebase-chart-day strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.firebase-chart-day small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.firebase-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.firebase-chart-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.firebase-chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.content-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .24);
}

.content-dialog::backdrop { background: rgba(15, 23, 42, .46); }

.content-create-form { display: grid; gap: 16px; padding: 22px; }
.content-create-form label,
.content-editor-fields label,
.content-editor-side label,
.content-block label { display: grid; gap: 7px; color: #475569; font-size: 13px; font-weight: 800; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.dialog-head h2 { margin: 4px 0 0; font-size: 22px; }
.icon-button { width: 32px; height: 32px; border: 0; border-radius: 6px; color: #334155; background: #eef2f7; font-size: 22px; line-height: 1; }
.dialog-actions { display: flex; justify-content: end; gap: 10px; }
.dialog-actions button,
.primary-full,
.danger-full,
.content-block-add button { min-height: 40px; border: 0; border-radius: 7px; padding: 0 13px; font-weight: 800; }
.dialog-actions button[type="submit"], .primary-full { color: #fff; background: var(--brand); }
.secondary, .quiet { color: #334155; background: #e9eff8; }
.form-message { min-height: 18px; margin: 0; color: var(--muted); font-size: 13px; }
.form-message.error { color: #b91c1c; }.form-message.success { color: #047857; }

.content-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.content-editor-main { padding: 20px; }
.content-editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.content-editor-fields .wide { grid-column: 1 / -1; }
.content-block-list { display: grid; gap: 12px; margin-top: 20px; }
.content-block { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: var(--surface-soft); }
.content-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: #334155; font-size: 13px; }
.content-block textarea { min-height: 116px; resize: vertical; }
.content-image-editor { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 14px; align-items: start; }
.content-image-preview { position: relative; display: block; min-height: 148px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #e2e8f0; cursor: zoom-in; text-decoration: none; }
.content-image-preview img { display: block; width: 100%; height: 148px; object-fit: cover; }
.content-image-preview.is-empty::after { position: absolute; inset: auto 0 0; padding: 7px; color: #7f1d1d; background: rgba(254, 226, 226, .92); content: "Görsel yüklenemedi"; font-size: 12px; font-weight: 800; text-align: center; }
.content-image-controls { display: grid; gap: 10px; }
.content-image-controls button { justify-self: start; }
.content-image-controls .image-alt-text { min-height: 82px; }
.image-candidate-dialog { max-height: min(720px, calc(100vh - 32px)); }
.image-candidate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-height: 480px; overflow-y: auto; }
.image-candidate { display: grid; gap: 7px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; padding: 0 0 8px; color: #334155; background: #fff; text-align: left; }
.image-candidate:hover { border-color: #60a5fa; box-shadow: 0 0 0 2px #dbeafe; }
.image-candidate img { display: block; width: 100%; aspect-ratio: 1.2; object-fit: cover; }
.image-candidate span { padding: 0 8px; font-size: 12px; font-weight: 700; line-height: 1.35; }
.content-block + .content-block { margin-top: 0; }
.content-block-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.content-editor-side { display: grid; gap: 14px; padding: 18px; }
.primary-full, .danger-full { width: 100%; }
.quick-state-action { background: #0f766e; }
.danger-full { color: #991b1b; background: #fee2e2; }
.content-service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.content-service-card { padding: 20px; }.content-service-card h2 { margin: 16px 0 7px; font-size: 20px; }.content-service-card p,.service-note p { margin: 0; color: var(--muted); line-height: 1.6; }
.content-service-transition { color: #1d4ed8; background: #dbeafe; }.service-note { margin-top: 18px; padding: 20px; }
.service-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
.service-actions button { min-height: 38px; border: 1px solid #bfdbfe; border-radius: 7px; padding: 0 12px; color: #1e3a8a; background: #eff6ff; font-weight: 900; }

.logout-form {
  margin-top: auto;
}

.logout-form button,
.mobile-topbar button {
  width: 100%;
  padding: 11px 14px;
  color: #fff;
  background: #22314d;
}

.content {
  min-width: 0;
  padding: 30px;
}

.mobile-topbar {
  display: none;
}

.mobile-topbar strong {
  display: none;
}

.menu-toggle {
  display: inline-grid;
  gap: 4px;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 10px;
  background: var(--nav);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .14);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
}

.page-heading {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.secondary-page-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: #334155;
  background: #fff;
  font-weight: 800;
}

.preview-link.is-disabled {
  pointer-events: none;
  opacity: .5;
}

.page-heading h1 {
  margin: 4px 0 6px;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: 0;
}

.page-heading p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.page-heading a,
.app-card-head a,
.login-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--accent, var(--brand));
  font-weight: 700;
}

.eyebrow {
  color: var(--accent, var(--brand));
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

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

.app-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.app-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent);
  content: "";
}

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

.app-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
}

.app-card h2 {
  margin: 10px 0 2px;
  font-size: 26px;
}

.app-card p {
  margin: 0;
  color: var(--muted);
}

.metric-row,
.stats-grid,
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric-row {
  margin-top: 22px;
}

.metric-row div,
.inventory-grid div {
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.metric-row span,
.stat-card span,
.inventory-grid span,
.mini-stats,
.collection-list small,
.panel-title span {
  color: var(--muted);
  font-size: 13px;
}

.metric-row strong,
.stat-card strong,
.inventory-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 27px;
}

.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.firebase-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.mini-stats span,
.firebase-mini-stats span,
.status {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef2f7;
}

.firebase-mini-stats span {
  justify-content: center;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.firebase-mini-stats b {
  margin-right: 4px;
  color: var(--text);
}

.firebase-mini-error {
  display: block;
  margin-top: 8px;
  color: var(--danger);
}

.alert-strip {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: var(--danger);
  background: #fff7ed;
}

.alert-strip.large {
  margin: 0 0 20px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-tabs a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: #475569;
  background: #fff;
  font-weight: 800;
  text-decoration: none;
}

.admin-tabs a.active {
  border-color: #111827;
  color: #fff;
  background: #111827;
}

.status-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #475569;
  background: #eef2f7;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.success {
  color: #047857;
  background: #dcfce7;
}

.status-pill.danger {
  color: #b91c1c;
  background: #fee2e2;
}

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

.stat-card,
.panel {
  padding: 18px;
}

.stat-card,
.summary-card {
  position: relative;
  overflow: hidden;
}

.stat-card::after,
.summary-card::after {
  position: absolute;
  right: -40px;
  bottom: -46px;
  width: 116px;
  height: 116px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
  content: "";
}

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

.mobile-priority-stats article {
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #111827, #334155);
  box-shadow: 0 16px 34px rgba(15, 23, 42, .16);
}

.mobile-priority-stats span {
  display: block;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.mobile-priority-stats strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  line-height: 1;
}

.dashboard-summary-grid {
  margin-bottom: 18px;
}

.summary-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary-card > span,
.summary-card small,
.summary-card em {
  color: var(--muted);
}

.summary-card > span {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-card > strong {
  display: block;
  margin-top: 10px;
  font-size: 36px;
}

.summary-card small {
  display: block;
}

.summary-card div {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 5px 8px;
  align-items: baseline;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.summary-card em {
  font-size: 12px;
  font-style: normal;
}

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

.wide-first {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr);
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eef2f7;
}

.panel-title h2 {
  margin: 0;
  font-size: 18px;
}

.bar-row {
  display: grid;
  grid-template-columns: 132px minmax(80px, 1fr) 48px;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}

.bar-row span strong,
.bar-row span small {
  display: block;
}

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

.bar-row div {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5edf6;
}

.bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent, var(--brand));
}

.collection-list,
.model-list {
  display: grid;
  gap: 10px;
}

.collection-list div,
.model-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #edf2f7;
  background: linear-gradient(180deg, #fff, var(--surface-soft));
}

.collection-list small {
  grid-column: 1 / -1;
}

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

.table-wrap {
  overflow-x: auto;
}

.panel:has(.user-list-table) .table-wrap {
  overflow-x: hidden;
}

.user-list-table {
  table-layout: fixed;
}

.user-list-table th,
.user-list-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.user-list-table code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.motiva-user-list-table th,
.motiva-user-list-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.motiva-user-list-table th:nth-child(1),
.motiva-user-list-table td:nth-child(1) { width: 23%; }
.motiva-user-list-table th:nth-child(2),
.motiva-user-list-table td:nth-child(2) { width: 9%; text-align: center; }
.motiva-user-list-table th:nth-child(3),
.motiva-user-list-table td:nth-child(3) { width: 22%; }
.motiva-user-list-table th:nth-child(4),
.motiva-user-list-table td:nth-child(4) { width: 14%; }
.motiva-user-list-table th:nth-child(5),
.motiva-user-list-table td:nth-child(5) { width: 12%; }
.motiva-user-list-table th:nth-child(6),
.motiva-user-list-table td:nth-child(6),
.motiva-user-list-table th:nth-child(7),
.motiva-user-list-table td:nth-child(7) { width: 10%; }

.motiva-user-list-table code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.photovibe-auth-user-list-table th:nth-child(1),
.photovibe-auth-user-list-table td:nth-child(1) { width: 28%; }
.photovibe-auth-user-list-table th:nth-child(2),
.photovibe-auth-user-list-table td:nth-child(2) { width: 29%; }
.photovibe-auth-user-list-table th:nth-child(3),
.photovibe-auth-user-list-table td:nth-child(3),
.photovibe-auth-user-list-table th:nth-child(4),
.photovibe-auth-user-list-table td:nth-child(4) { width: 17%; }
.photovibe-auth-user-list-table th:nth-child(5),
.photovibe-auth-user-list-table td:nth-child(5) { width: 9%; }

.photovibe-firestore-user-list-table th,
.photovibe-firestore-user-list-table td {
  padding: 11px 7px;
  font-size: 12px;
}

.photovibe-firestore-user-list-table th:nth-child(1),
.photovibe-firestore-user-list-table td:nth-child(1) { width: 14%; }
.photovibe-firestore-user-list-table th:nth-child(2),
.photovibe-firestore-user-list-table td:nth-child(2) { width: 8%; }
.photovibe-firestore-user-list-table th:nth-child(3),
.photovibe-firestore-user-list-table td:nth-child(3) { width: 10%; }
.photovibe-firestore-user-list-table th:nth-child(4),
.photovibe-firestore-user-list-table td:nth-child(4) { width: 7%; }
.photovibe-firestore-user-list-table th:nth-child(5),
.photovibe-firestore-user-list-table td:nth-child(5),
.photovibe-firestore-user-list-table th:nth-child(6),
.photovibe-firestore-user-list-table td:nth-child(6) { width: 6%; }
.photovibe-firestore-user-list-table th:nth-child(7),
.photovibe-firestore-user-list-table td:nth-child(7) { width: 13%; }
.photovibe-firestore-user-list-table th:nth-child(8),
.photovibe-firestore-user-list-table td:nth-child(8),
.photovibe-firestore-user-list-table th:nth-child(9),
.photovibe-firestore-user-list-table td:nth-child(9) { width: 11%; }
.photovibe-firestore-user-list-table th:nth-child(10),
.photovibe-firestore-user-list-table td:nth-child(10) { width: 8%; }

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

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

code {
  color: #334155;
}

.status.ok {
  color: var(--ok);
  background: #dcfce7;
}

.status.muted {
  color: #64748b;
}

.admin-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.admin-filter-form input {
  min-width: min(320px, 100%);
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.admin-filter-form input:focus {
  border-color: #334155;
  outline: 3px solid rgba(51, 65, 85, .12);
}

.admin-filter-form button,
.admin-filter-form a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  color: #fff;
  background: #111827;
  font-weight: 700;
}

.admin-filter-form a,
.admin-filter-form button.secondary {
  border: 1px solid var(--line);
  color: var(--text);
  background: #fff;
}

.admin-filter-form.compact {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #eef2f7;
}

.admin-filter-form.compact span {
  color: var(--muted);
  font-size: 13px;
}

.page-action-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  background: #111827;
  font-weight: 800;
}

.store-language-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.store-language-bar .admin-tabs {
  margin-bottom: 0;
}

.store-language-bar > button,
.store-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: #111827;
  background: #fff;
  font-weight: 800;
}

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

.store-form-grid label {
  display: grid;
  gap: 6px;
}

.store-form-grid label.wide {
  grid-column: 1 / -1;
}

.store-form-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.store-form-grid input,
.store-form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.store-form-grid input {
  min-height: 42px;
}

.store-form-grid textarea {
  min-height: 96px;
  resize: vertical;
}

.store-form-grid textarea.large {
  min-height: 240px;
}

.store-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.store-actions button.danger {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fff5f5;
}

.screenshot-studio {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.screenshot-slot-panel {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 16px 18px;
}

.screenshot-slot-panel h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.screenshot-slot-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  width: min(100%, 340px);
}

.screenshot-slot-selector {
  display: flex;
  flex: 1;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.screenshot-slot-selector button {
  flex: 0 0 54px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #475569;
  background: #fff;
  font-size: 16px;
  font-weight: 900;
}

.screenshot-slot-selector button.active {
  border-color: #1e3a8a;
  color: #fff;
  background: #1e3a8a;
  box-shadow: 0 10px 22px rgba(30, 58, 138, .16);
}

.screenshot-add-slot {
  flex: 0 0 auto;
  min-height: 44px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 0 12px;
  color: #1e3a8a;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.screenshot-controls {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
}

.screenshot-controls::-webkit-scrollbar {
  width: 8px;
}

.screenshot-controls::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cbd5e1;
}

.screenshot-danger-zone {
  display: grid;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.screenshot-danger-zone button {
  min-height: 40px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  background: #fff5f5;
  font-size: 13px;
  font-weight: 900;
}

.screenshot-danger-zone button:hover {
  border-color: #fca5a5;
  background: #fee2e2;
}

.screenshot-controls label {
  display: grid;
  gap: 7px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.screenshot-controls input[type="number"],
.screenshot-controls select,
.studio-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
}

.studio-textarea { min-height: 108px; resize: vertical; }
.studio-textarea.compact { min-height: 78px; }
.text-editor-group { display: grid; gap: 8px; color: #475569; font-size: 13px; font-weight: 800; }
.rich-editor-toolbar.ql-toolbar.ql-snow { border: 1px solid var(--line); border-radius: 7px 7px 0 0; background: #f8fafc; }
.rich-editor-toolbar.ql-toolbar.ql-snow .ql-formats { margin-right: 8px; }
.custom-color-control { display: inline-flex; gap: 6px; align-items: center; margin-left: 4px; vertical-align: middle; }
.custom-color-control input[type="color"] { width: 30px; height: 28px; border: 1px solid var(--line); border-radius: 6px; padding: 2px; background: #fff; }
.custom-color-control input[type="text"] { width: 82px; height: 28px; border: 1px solid var(--line); border-radius: 6px; padding: 0 7px; color: var(--text); background: #fff; font-size: 12px; font-weight: 800; }
.custom-color-control button { height: 28px; border: 1px solid #bfdbfe; border-radius: 6px; padding: 0 8px; color: #1e3a8a; background: #eff6ff; font-size: 11px; font-weight: 900; }
.studio-rich-editor.ql-container.ql-snow { min-height: 108px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 7px 7px; background: #fff; font-family: inherit; }
.studio-rich-editor.compact.ql-container.ql-snow { min-height: 78px; }
.studio-rich-editor .ql-editor { min-height: 108px; color: var(--text); font-size: 14px; line-height: 1.45; }
.studio-rich-editor.compact .ql-editor { min-height: 78px; }
.studio-rich-editor .ql-editor.ql-blank::before { color: #94a3b8; font-style: normal; }
.text-align-toolbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; align-items: center; }
.text-align-toolbar button { min-height: 36px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; color: #475569; background: #fff; font-size: 12px; font-weight: 900; white-space: nowrap; }
.text-align-toolbar button.active { border-color: #1e3a8a; color: #fff; background: #1e3a8a; }
.studio-position-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.studio-position-grid .wide { grid-column: 1 / -1; }

.store-selector { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 4px; border-radius: 8px; background: #edf2f7; }
.store-selector button { min-height: 36px; border: 0; border-radius: 6px; color: #475569; background: transparent; font-size: 12px; font-weight: 900; }
.store-selector button.active { color: #fff; background: #1e3a8a; }
.studio-field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.screenshot-controls input[type="color"] { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 7px; padding: 4px; background: #fff; }
.opacity-control { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 8px; align-items: center; min-height: 42px; }
.opacity-control input { width: 100%; accent-color: #2563eb; }
.opacity-control strong { color: #475569; font-size: 12px; text-align: right; }

.recipe-filters-panel { padding: 18px; margin-bottom: 18px; }
.recipe-page-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: end; }.recipe-batch-status { max-width: 300px; color: var(--muted); font-size: 12px; font-weight: 800; line-height: 1.4; text-align: right; }
.recipe-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.recipe-filter-grid label,
.recipe-ai-panel label,
.recipe-core-grid label,
.recipe-localized-editor label,
.recipe-macros label { display: grid; gap: 7px; color: #475569; font-size: 13px; font-weight: 800; }
.recipe-filter-grid input, .recipe-filter-grid select, .recipe-ai-panel input, .recipe-ai-panel textarea, .recipe-core-grid input, .recipe-core-grid select, .recipe-localized-editor input, .recipe-localized-editor textarea, .recipe-macros input { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; color: var(--text); background: #fff; }
.recipe-list-count { margin: 14px 0 12px; color: var(--muted); font-size: 13px; font-weight: 900; letter-spacing: .02em; text-transform: uppercase; }
.recipe-publish-status { min-height: 20px; margin: -6px 0 14px; color: #166534; font-size: 12px; font-weight: 800; }
.recipe-publish-status.error { color: #b91c1c; }
.recipe-list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); gap: 16px; }
.recipe-card-admin { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, .05); }
.recipe-card-admin-image { position: relative; aspect-ratio: 1.55; display: grid; place-items: center; overflow: hidden; color: #64748b; background: #e9eff8; font-size: 13px; }
.recipe-card-admin-image img { width: 100%; height: 100%; object-fit: cover; }.recipe-card-admin-image img + span { display: none; }
.recipe-card-admin-body { display: grid; gap: 10px; padding: 14px; }.recipe-card-admin-body h2 { margin: 0; font-size: 18px; line-height: 1.25; }.recipe-card-admin-body p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.recipe-card-admin-badges, .recipe-card-admin-tags, .recipe-card-admin-meta { display: flex; flex-wrap: wrap; gap: 6px; }.recipe-card-admin-badges span, .recipe-card-admin-tags small, .recipe-card-admin-badges strong { border-radius: 999px; padding: 4px 7px; font-size: 11px; font-weight: 800; }.recipe-card-admin-badges span { color: #7c2d12; background: #ffedd5; }.recipe-card-admin-badges strong { font-style: normal; }.recipe-status-active { color: #166534; background: #dcfce7; }.recipe-status-passive { color: #991b1b; background: #fee2e2; }.recipe-card-admin-tags small { color: #065f46; background: #d1fae5; }.recipe-card-admin-meta { color: #64748b; font-size: 12px; }.recipe-card-admin-meta span + span::before { margin-right: 6px; content: "·"; }
.recipe-card-admin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.recipe-card-admin button, .recipe-card-admin a { justify-self: start; display: inline-flex; min-height: 34px; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; color: #1e3a8a; background: #eff6ff; font-weight: 800; white-space: nowrap; }
.recipe-card-admin .recipe-quick-activate { border-color: #bbf7d0; color: #166534; background: #dcfce7; }
.recipe-empty { padding: 30px; color: var(--muted); }
.recipe-editor-topbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }.recipe-editor-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.recipe-editor-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }.recipe-ai-panel { position: sticky; top: 20px; display: grid; gap: 13px; padding: 18px; }.recipe-ai-panel textarea { min-height: 100px; resize: vertical; }.recipe-ai-panel p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }.recipe-ai-panel hr { width: 100%; border: 0; border-top: 1px solid var(--line); }
.recipe-editor-main { padding: 20px; }.recipe-editor-header { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }.recipe-editor-header h2 { margin: 3px 0 0; font-size: 24px; }.recipe-editor-flags { display: flex; flex-wrap: wrap; gap: 10px; justify-content: end; }.recipe-core-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }.recipe-check-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 18px 0; }.recipe-check-groups > div { display: grid; gap: 8px; }.recipe-check-groups > div > span { color: #475569; font-size: 13px; font-weight: 900; }.recipe-check-groups label { display: flex; gap: 7px; align-items: center; color: #475569; font-size: 13px; }.recipe-macros { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.recipe-image-optimization { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; min-height: 20px; margin-top: 10px; color: var(--muted); font-size: 12px; font-weight: 800; }.recipe-image-optimization button { min-height: 32px; border: 1px solid #bfdbfe; border-radius: 6px; padding: 0 10px; color: #1e3a8a; background: #eff6ff; font-weight: 800; }
.recipe-language-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 12px; }.recipe-language-tabs button { min-height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 11px; color: #475569; background: #fff; font-weight: 900; }.recipe-language-tabs button.active { border-color: #1e3a8a; color: #fff; background: #1e3a8a; }
.recipe-localized-editor { display: grid; gap: 14px; }.recipe-localized-editor textarea { min-height: 112px; resize: vertical; }
.studio-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.screenshot-canvas-panel { min-width: 0; padding: 20px; }
.screenshot-language-cards { display: grid; gap: 18px; }
.screenshot-language-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: var(--surface-soft); }
.screenshot-language-card.selected { border-color: #60a5fa; box-shadow: 0 0 0 2px rgba(96, 165, 250, .18); }
.screenshot-language-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.screenshot-language-card-head strong { display: block; color: #1e3a8a; font-size: 13px; letter-spacing: .06em; }
.screenshot-language-card-head span { color: var(--muted); font-size: 13px; }
.screenshot-language-card-head button { min-height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; color: #334155; background: #fff; font-weight: 800; }
.canvas-wrap { display: flex; justify-content: center; overflow: hidden; border-radius: 7px; background: #dbe4f0; }
.canvas-wrap canvas { display: block; width: min(100%, 360px); height: auto; }

.db-log-panel {
  overflow: hidden;
}

.db-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.db-tab {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: #475569;
  background: #fff;
  font-weight: 700;
}

.db-tab:hover,
.db-tab.active {
  border-color: #111827;
  color: #fff;
  background: #111827;
}

.db-status {
  min-height: 22px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
}

.db-field {
  display: inline-flex;
  gap: 4px;
  margin: 0 10px 6px 0;
  white-space: nowrap;
}

.db-field b {
  color: #475569;
}

.ci-link {
  border: 0;
  padding: 0;
  color: #2563eb;
  background: transparent;
  font: inherit;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-soft);
}

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

.detail-summary-grid article,
.quota-grid div,
.data-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.detail-summary-grid article {
  min-width: 0;
  padding: 16px;
}

.detail-summary-grid span,
.quota-grid span,
.quota-grid small,
.data-block span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.detail-summary-grid strong {
  display: block;
  overflow: hidden;
  margin-top: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-stack-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.admin-stack-form label {
  display: grid;
  gap: 6px;
}

.admin-stack-form .checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-stack-form .checkbox-row input {
  min-height: auto;
  width: 18px;
  height: 18px;
  padding: 0;
}

.admin-stack-form input,
.admin-stack-form select,
.admin-stack-form textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.admin-stack-form textarea {
  min-height: 112px;
  padding: 12px;
  resize: vertical;
}

.admin-stack-form button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #111827;
  font-weight: 800;
}

.admin-stack-form.danger button {
  background: #b91c1c;
}

.detail-dl,
.compact-dl {
  display: grid;
  grid-template-columns: minmax(90px, .35fr) minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
}

.detail-dl dt,
.compact-dl dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.detail-dl dd,
.compact-dl dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.compact-dl {
  grid-template-columns: minmax(70px, .35fr) minmax(0, 1fr);
  margin-top: 10px;
  font-size: 12px;
}

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

.quota-grid div {
  padding: 14px;
  box-shadow: none;
  background: var(--surface-soft);
}

.quota-grid strong {
  display: block;
  margin: 6px 0;
  font-size: 24px;
}

.data-block-grid {
  display: grid;
  gap: 14px;
}

.data-block {
  overflow: hidden;
  box-shadow: none;
}

.data-block > div {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.data-block p {
  margin: 0;
  padding: 16px;
  color: var(--muted);
}

.data-block pre {
  max-height: 420px;
  margin: 0;
  overflow: auto;
  padding: 16px;
  color: #dbeafe;
  background: #0f172a;
  font-size: 12px;
}

.alert-strip.success {
  border-color: #bbf7d0;
  color: #047857;
  background: #f0fdf4;
}

.actions-cell {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  white-space: nowrap;
}

.actions-cell a,
.actions-cell button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
  font-weight: 700;
}

.actions-cell button {
  color: #b91c1c;
}

.scenario-ai-columns {
  align-items: start;
  margin-bottom: 18px;
}

.scenario-ai-panel .scenario-toolbar {
  margin-top: 0;
}

.scenario-ai-grid {
  display: grid;
  grid-template-columns: .45fr 1fr;
  gap: 12px;
}

.scenario-ai-preview {
  display: grid;
  gap: 10px;
}

.scenario-ai-preview article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.scenario-ai-preview article.warn {
  border-color: #fed7aa;
  background: #fff7ed;
}

.scenario-ai-preview strong,
.scenario-ai-preview span,
.scenario-ai-preview small {
  display: block;
}

.scenario-ai-preview strong,
.scenario-ai-preview small {
  overflow-wrap: anywhere;
}

.scenario-ai-preview span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.scenario-ai-preview p {
  margin: 8px 0;
  color: #475569;
}

.scenario-ai-preview small {
  color: var(--muted);
}

.scenario-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.scenario-toolbar input[type="text"],
.scenario-full-text {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.scenario-toolbar input[type="text"] {
  flex: 1;
  min-width: min(320px, 100%);
  min-height: 44px;
}

.scenario-toolbar button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  color: #fff;
  background: #111827;
  font-weight: 800;
}

.scenario-toolbar.secondary button {
  border: 1px solid var(--line);
  color: var(--text);
  background: #fff;
}

.scenario-save-message {
  display: none;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 700;
}

.scenario-save-message.ok,
.scenario-save-message.err {
  display: block;
}

.scenario-save-message.ok {
  color: #047857;
  background: #ecfdf5;
}

.scenario-save-message.err {
  color: #b91c1c;
  background: #fef2f2;
}

.scenario-full-text {
  min-height: 116px;
  margin-bottom: 12px;
  resize: vertical;
}

.scenario-full-text.summary {
  min-height: 180px;
  background: var(--surface-soft);
}

.scenario-rows {
  display: grid;
  gap: 14px;
}

.scenario-row {
  display: grid;
  grid-template-columns: 34px 156px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid #e8eef6;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.scenario-row-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  color: #475569;
  background: #eef2f7;
  font-weight: 800;
}

.scenario-image-box {
  display: grid;
  gap: 8px;
}

.scenario-image-box label {
  position: relative;
  display: grid;
  width: 156px;
  height: 112px;
  place-items: center;
  overflow: hidden;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  color: var(--muted);
  background: #f8fafc;
  cursor: pointer;
}

.scenario-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scenario-image-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.image-remove,
.row-delete {
  border: 0;
  border-radius: 8px;
  color: #b91c1c;
  background: #fee2e2;
  font-weight: 800;
}

.image-remove {
  min-height: 32px;
}

.row-delete {
  min-height: 34px;
  padding: 0 10px;
}

.scenario-row-fields {
  display: grid;
  gap: 10px;
}

.scenario-row-mini-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.scenario-row-mini-toolbar button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: #111827;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}

.speech-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #047857;
  background: #dcfce7;
  font-size: 12px;
  font-weight: 900;
}

.speech-badge.warn {
  color: #b45309;
  background: #ffedd5;
}

.scenario-row-fields label {
  display: grid;
  gap: 6px;
}

.scenario-row-fields span,
.inline-check {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.scenario-row-fields textarea {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  resize: vertical;
}

.inline-check {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  margin-right: auto;
}

.login-page {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  place-items: center;
  background: #f6f8fb;
}

.login-panel {
  width: min(340px, 100%);
  overflow: hidden;
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .08);
}

.login-form {
  display: grid;
  gap: 12px;
  padding: 22px;
  background: #fff;
}

.login-form label {
  display: grid;
  gap: 7px;
}

.login-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
}

.login-form input:focus {
  border-color: #475569;
  outline: 3px solid rgba(71, 85, 105, .12);
}

.login-form button {
  width: 100%;
  margin-top: 2px;
  background: #111827;
}

.login-form [data-valmsg-for],
.validation-summary {
  color: #b91c1c;
  font-size: 13px;
}

.check-row {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

@media (max-width: 960px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    inset: 0 auto 0 0;
    display: flex;
    width: min(290px, 86vw);
    transform: translateX(-104%);
    transition: transform .18s ease;
  }

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

  .sidebar-backdrop {
    position: fixed;
    z-index: 30;
    inset: 0;
    display: none;
    border: 0;
    background: rgba(15, 23, 42, .42);
  }

  .sidebar-open .sidebar-backdrop {
    display: block;
  }

  .content {
    padding: 10px 14px max(18px, env(safe-area-inset-bottom));
  }

  .mobile-topbar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 10px;
  }

  .mobile-topbar strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #111827;
    font-size: 20px;
    font-weight: 850;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-topbar button {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    padding: 10px;
  }

  .app-grid,
  .dashboard-columns,
  .wide-first,
  .stats-grid,
  .detail-summary-grid,
  .store-form-grid,
  .content-editor-layout,
.content-service-grid,
.screenshot-studio,
.recipe-editor-layout {
    grid-template-columns: 1fr;
  }

  .screenshot-controls { position: static; max-height: none; overflow: visible; }
  .screenshot-slot-panel { display: grid; }
  .screenshot-slot-actions { width: 100%; }
  .recipe-ai-panel { position: static; }
  .recipe-page-actions { width: 100%; justify-content: stretch; }
  .recipe-page-actions button { flex: 1 1 auto; }
  .recipe-batch-status { order: -1; max-width: none; flex-basis: 100%; text-align: left; }

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

  .mobile-priority-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
  }

  .mobile-priority-stats article {
    padding: 16px;
  }
}

@media (max-width: 900px) {
  .scenario-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .scenario-image-box,
  .scenario-row-fields,
  .row-delete {
    grid-column: 2;
  }
}

@media (max-width: 680px) {
  .panel:has(.user-list-table) .table-wrap { overflow-x: auto; }
  .motiva-user-list-table { min-width: 760px; }
  .photovibe-auth-user-list-table { min-width: 680px; }
  .photovibe-firestore-user-list-table { min-width: 1040px; }

  .page-heading {
    margin-bottom: 14px;
  }

  .page-heading h1 {
    font-size: 28px;
  }

  .page-heading p,
  .app-heading .eyebrow {
    display: none;
  }

  .page-heading,
  .app-card-head,
  .panel-title {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-row {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 104px minmax(70px, 1fr) 34px;
    font-size: 13px;
  }

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

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

  .content-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .content-search {
    min-width: 0;
  }

  .content-editor-fields {
    grid-template-columns: 1fr;
  }

  .content-image-editor {
    grid-template-columns: 1fr;
  }

  .content-image-preview,
  .content-image-preview img {
    height: min(54vw, 240px);
  }

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

  .content-editor-fields .wide {
    grid-column: auto;
  }

  .content-row-actions {
    align-items: start;
    flex-direction: column;
  }

  .studio-field-row { grid-template-columns: 1fr; }

  .recipe-filter-grid,
  .recipe-core-grid,
  .recipe-check-groups,
  .recipe-macros { grid-template-columns: 1fr; }

  .login-form {
    padding: 22px;
  }
}

@media (max-width: 560px) {
  .scenario-row {
    grid-template-columns: 1fr;
  }

  .scenario-row-number,
  .scenario-image-box,
  .scenario-row-fields,
  .row-delete {
    grid-column: auto;
  }

  .scenario-image-box label {
    width: 100%;
  }
}

.company-admin-page {
  display: grid;
  gap: 18px;
}

.dashboard-cache-status {
  display: grid;
  min-width: 190px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .04);
  text-align: right;
}

.dashboard-cache-status span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-cache-status strong {
  color: var(--ok);
  font-size: 15px;
}

.company-search-form {
  align-items: end;
  grid-template-columns: minmax(220px, 520px) auto auto;
}

.company-list-header {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  color: var(--muted);
}

.company-list-header strong {
  color: var(--text);
}

.company-list {
  display: grid;
  gap: 10px;
}

.superadmin-company-header {
  margin-top: 4px;
}

.superadmin-company-list {
  margin-bottom: 6px;
}

.company-row.is-superadmin-company {
  border-color: rgba(15, 118, 110, .24);
  background: linear-gradient(180deg, #ffffff, #f0fdfa);
}

.company-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .04);
}

.company-row-main,
.company-row-meta {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.company-row-main a {
  overflow: hidden;
  color: var(--text);
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-row code,
.company-detail-page code {
  overflow: hidden;
  max-width: 100%;
  color: #475569;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-row-meta {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.row-action,
.secondary-page-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--brand);
  font-weight: 800;
  white-space: nowrap;
}

.notice.success {
  border-color: rgba(4, 120, 87, .22);
  background: #ecfdf5;
  color: #047857;
}

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

.company-summary-grid article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.company-summary-grid span,
.company-summary-grid small,
.muted {
  color: var(--muted);
}

.company-summary-grid strong {
  font-size: 24px;
}

.company-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 16px;
  align-items: start;
}

.admin-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}

.admin-card h2 {
  margin: 0;
  font-size: 18px;
}

.superadmin-access-card {
  grid-template-columns: minmax(0, 1fr) minmax(240px, auto) auto;
  align-items: center;
}

.superadmin-access-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.superadmin-access-status {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.superadmin-access-status.is-active {
  border-color: rgba(4, 120, 87, .2);
  background: #ecfdf5;
}

.superadmin-access-status strong {
  color: var(--text);
}

.superadmin-access-status span {
  color: var(--muted);
  font-size: 13px;
}

.company-card-wide {
  min-width: 0;
}

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

.company-form-grid .full {
  grid-column: 1 / -1;
}

.company-form-grid label,
.admin-stack-form label,
.company-search-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.company-form-grid input,
.company-form-grid select,
.admin-stack-form input,
.admin-stack-form select,
.company-search-form input,
.company-inline-form input,
.company-mini-row input,
.company-role-row input,
.company-role-row select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
}

.company-form-grid input[type="color"],
.company-role-row input[type="color"] {
  padding: 4px;
}

.company-form-grid button,
.admin-stack-form button,
.company-search-form button,
.company-inline-form button,
.company-mini-row button,
.company-role-row button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 850;
  white-space: nowrap;
}

.company-mini-row button:last-child,
.company-role-row button:last-child {
  background: #fee2e2;
  color: #991b1b;
}

.company-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.company-checks label,
.company-inline-check {
  display: inline-flex !important;
  gap: 8px;
  align-items: center;
  color: var(--text);
}

.company-checks input,
.company-inline-check input {
  width: 18px;
  min-height: 18px;
}

.company-inline-check.compact {
  justify-content: center;
  font-size: 13px;
}

.company-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.company-mini-list,
.company-role-list,
.company-usage-list,
.raw-blocks {
  display: grid;
  gap: 10px;
}

.company-mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.company-role-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) repeat(2, minmax(90px, .7fr)) 54px 78px minmax(140px, .85fr) minmax(120px, .8fr) 92px auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
}

.role-person {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.role-person strong,
.role-person span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.company-usage-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.raw-blocks details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.raw-blocks summary {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  cursor: pointer;
  font-weight: 800;
}

.raw-blocks pre {
  max-height: 320px;
  margin: 0;
  overflow: auto;
  border-top: 1px solid var(--line);
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 1100px) {
  .company-role-row {
    grid-template-columns: minmax(0, 1fr) repeat(2, minmax(90px, .6fr)) 54px 78px;
  }
}

@media (max-width: 960px) {
  .company-detail-grid,
  .company-summary-grid,
  .company-row,
  .company-search-form,
  .company-role-row,
  .superadmin-access-card {
    grid-template-columns: 1fr;
  }

  .company-row-meta {
    text-align: left;
  }
}

@media (max-width: 680px) {
  .company-form-grid,
  .company-inline-form,
  .company-mini-row {
    grid-template-columns: 1fr;
  }

  .company-form-grid .full {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  .firebase-chart {
    grid-template-columns: repeat(7, minmax(58px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .firebase-bars {
    height: 150px;
  }

  .firebase-bar {
    width: 12px;
  }

  .dashboard-compact-heading {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
  }

  .dashboard-compact-heading .eyebrow,
  .dashboard-compact-heading p {
    display: none;
  }

  .dashboard-compact-heading h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.05;
  }

  .dashboard-cache-status {
    min-width: 0;
    grid-template-columns: auto 1fr;
    align-items: center;
    padding: 8px 10px;
    text-align: left;
  }

  .dashboard-cache-status span {
    font-size: 10px;
  }

  .dashboard-cache-status strong {
    justify-self: end;
    font-size: 13px;
  }

  .dashboard-compact-grid {
    gap: 10px;
  }

  .dashboard-compact-grid .app-card {
    padding: 12px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
  }

  .dashboard-compact-grid .app-card::before {
    height: 3px;
  }

  .dashboard-compact-grid .app-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 10px;
    align-items: center;
  }

  .dashboard-compact-grid .app-dot {
    width: 7px;
    height: 7px;
  }

  .dashboard-compact-grid .app-card h2 {
    margin: 3px 0 0;
    font-size: 22px;
    line-height: 1.05;
  }

  .dashboard-compact-grid .app-card p {
    display: none;
  }

  .dashboard-compact-grid .app-card-head a {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .dashboard-compact-grid .metric-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
  }

  .dashboard-compact-grid .metric-row div {
    min-height: 58px;
    padding: 8px;
  }

  .dashboard-compact-grid .metric-row span {
    display: block;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dashboard-compact-grid .metric-row strong {
    margin-top: 3px;
    font-size: 24px;
    line-height: 1;
  }

  .dashboard-compact-grid .mini-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
  }

  .dashboard-compact-grid .mini-stats span {
    display: block;
    overflow: hidden;
    padding: 6px 7px;
    font-size: 10px;
    line-height: 1.1;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dashboard-compact-grid .firebase-mini-stats {
    gap: 6px;
    margin-top: 6px;
  }

  .dashboard-compact-grid .firebase-mini-stats span {
    overflow: hidden;
    padding: 5px 6px;
    font-size: 10px;
    line-height: 1.1;
    text-overflow: ellipsis;
  }
}

@media (max-width: 390px) {
  .dashboard-compact-grid .app-card h2 {
    font-size: 20px;
  }

  .dashboard-compact-grid .metric-row strong {
    font-size: 21px;
  }

  .dashboard-compact-grid .mini-stats span {
    font-size: 10px;
  }
}
