:root {
  color-scheme: dark;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --white: #fff;
  --amber: #f59e0b;
  --amber-light: #fbbf24;
  --green: #10b981;
  --red: #ef4444;
  --line: rgb(51 65 85 / 70%);
  --card: rgb(30 41 59 / 55%);
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font: 14px/1.5 var(--font);
  background: var(--slate-900);
  color: var(--white);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible { outline: 2px solid var(--amber-light); outline-offset: 3px; }
[hidden] { display: none !important; }
.muted { color: var(--slate-400); }
.accent { color: var(--amber); }
.skip { position: fixed; z-index: 5; left: 12px; top: 12px; transform: translateY(-160%); }
.skip:focus { transform: none; background: var(--amber); color: var(--slate-900); padding: 8px 12px; border-radius: 8px; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.icon.small { width: 14px; height: 14px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column;
  padding: 24px 16px 18px; border-right: 1px solid var(--line); background: var(--slate-900);
  overflow-y: auto; z-index: 2;
}
.brand { display: flex; align-items: center; gap: 11px; margin: 0 4px 32px; width: fit-content; }
.brand img { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--slate-700); }
.brand strong { display: block; font-size: 20px; line-height: 1.2; font-weight: 800; letter-spacing: -.04em; }
.brand small { display: block; color: var(--slate-400); font-size: 11px; margin-top: 3px; }
.nav-group + .nav-group { margin-top: 22px; }
.nav-label, .eyebrow {
  color: var(--slate-400); font-size: 10px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
}
.nav-label { display: block; padding: 0 11px 8px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; min-height: 41px; padding: 8px 10px;
  border: 1px solid transparent; border-radius: 10px; margin-bottom: 3px;
  color: var(--slate-300); font-size: 13px; font-weight: 600;
}
.nav-link .icon { color: var(--slate-400); }
.nav-link:hover { background: var(--slate-800); }
.nav-link[aria-current="page"] {
  color: var(--amber-light); background: rgb(245 158 11 / 12%); border-color: rgb(245 158 11 / 25%);
}
.nav-link[aria-current="page"] .icon { color: var(--amber); }
.nav-count { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--slate-400); font-size: 11px; }
.sidebar-footer { margin-top: auto; padding: 14px 6px 0; border-top: 1px solid var(--line); }
.sidebar-footer strong { display: block; font-size: 12px; margin-bottom: 3px; }
.sidebar-footer p { color: var(--slate-400); font-size: 11px; }
.mobile-menu, .nav-close { display: none !important; }

.frame { min-width: 0; }
.topbar {
  min-height: 64px; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding: 10px 30px;
}
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: var(--slate-400); font-size: 12px; }
.breadcrumbs strong { color: var(--slate-300); font-weight: 600; }
.preview-pill {
  display: inline-flex; gap: 7px; align-items: center; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 10px; background: var(--card); color: var(--slate-300); font-size: 11px; font-weight: 600;
}
.preview-pill::before { content: ''; width: 7px; height: 7px; border-radius: 100%; background: var(--amber); }
.workspace { max-width: 1512px; padding: 26px 30px 40px; margin: 0 auto; }
.workspace:focus { outline: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 32px; line-height: 1.18; letter-spacing: -.035em; margin-bottom: 6px; font-weight: 800; }
.page-head p { color: var(--slate-400); }
.page-date { display: flex; gap: 7px; align-items: center; white-space: nowrap; color: var(--slate-400); font-size: 12px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  border: 1px solid var(--slate-700); border-radius: 12px; background: var(--slate-800);
  color: var(--white); min-height: 41px; padding: 8px 14px; font-weight: 700; font-size: 13px;
}
.button:hover { border-color: var(--slate-500); }
.button.primary { background: var(--amber); border-color: var(--amber); color: var(--slate-900); }
.button.primary:hover { background: var(--amber-light); border-color: var(--amber-light); }
.button.danger { color: #fca5a5; }
.button:disabled { opacity: .48; cursor: default; }
.button.icon-button { padding: 0; width: 38px; min-height: 38px; }
.button.quiet { background: transparent; }
.button.small-button { min-height: 34px; padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.text-link { color: var(--amber-light); display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; }
.text-link:hover { text-decoration: underline; }

.hero {
  position: relative; isolation: isolate; display: flex; align-items: center; min-height: 215px;
  padding: 24px 28px; border: 1px solid var(--line); border-radius: 24px; overflow: hidden;
  background: linear-gradient(90deg, #0f172a 0%, rgb(15 23 42 / 97%) 35%, rgb(15 23 42 / 57%) 70%, rgb(15 23 42 / 20%) 100%),
    url('/assets/image-1767359197.jpeg') right 55% / 72% auto no-repeat var(--slate-800);
}
.hero-copy { max-width: 470px; }
.hero .eyebrow { display: inline-flex; gap: 7px; align-items: center; color: var(--amber-light); margin-bottom: 9px; }
.hero h2 { font-size: 28px; line-height: 1.15; letter-spacing: -.035em; font-weight: 800; margin-bottom: 8px; }
.hero p { color: var(--slate-300); font-size: 13px; margin-bottom: 17px; max-width: 350px; }
.hero-location {
  display: inline-flex; align-items: center; gap: 6px; position: absolute; right: 16px; bottom: 14px;
  color: var(--slate-300); border-radius: 999px; padding: 5px 9px; background: rgb(15 23 42 / 83%);
  font-size: 11px; font-weight: 600;
}
.hero-location .icon { color: var(--amber); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0 20px; }
.stat, .panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; min-width: 0;
}
.stat { padding: 14px 16px; min-height: 113px; transition: border-color .15s ease; }
.stat:hover { border-color: var(--slate-500); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.stat-icon, .thumb {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; flex: none;
  color: var(--tone, var(--amber)); background: color-mix(in srgb, var(--tone, var(--amber)) 14%, transparent);
}
.stat-top > .icon { color: var(--slate-400); }
.stat strong { display: block; margin-top: 7px; font-size: 24px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.stat-label { color: var(--slate-400); font-size: 12px; display: block; margin-top: 4px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(260px, 1fr); gap: 14px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 16px;
}
.section-head h2 { font-size: 17px; font-weight: 750; letter-spacing: -.015em; }
.section-head p { color: var(--slate-400); font-size: 12px; margin-top: 2px; }
.overview-row, .city-row {
  display: flex; gap: 10px; align-items: center; width: 100%; padding: 11px 16px; text-align: left;
  border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--white);
}
.overview-row:hover, .city-row:hover { background: rgb(51 65 85 / 32%); }
.overview-row:last-child, .city-row:last-child { border-radius: 0 0 16px 16px; }
.record-title { display: block; font-weight: 700; font-size: 13px; overflow-wrap: anywhere; }
.record-sub { display: block; color: var(--slate-400); font-size: 11px; margin-top: 2px; overflow-wrap: anywhere; }
.grow { flex: 1; min-width: 0; }
.thumb { overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.city-row .thumb { width: 42px; height: 36px; }
.city-row > .icon { color: var(--slate-400); }
.badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--tone, #94a3b8) 27%, transparent);
  background: color-mix(in srgb, var(--tone, #94a3b8) 11%, transparent);
  color: var(--tone, var(--slate-300)); font-weight: 650; font-size: 11px; padding: 3px 8px;
}
.status-published { --tone: #34d399; }
.status-draft, .status-pending { --tone: var(--amber-light); }
.status-rejected { --tone: #fca5a5; }
.status-archived { --tone: var(--slate-300); }
.featured { color: var(--amber-light); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: 8px; position: relative; flex: 1 1 240px; max-width: 390px; }
.search .icon { position: absolute; left: 12px; color: var(--slate-400); pointer-events: none; }
.search input { width: 100%; padding-left: 38px; }
input, select, textarea {
  min-height: 39px; border-radius: 10px; border: 1px solid var(--slate-700);
  background: var(--slate-800); color: var(--white); padding: 8px 10px;
}
input::placeholder, textarea::placeholder { color: var(--slate-400); }
select { max-width: 100%; }
textarea { min-height: 100px; resize: vertical; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: 11px 15px; border-bottom: 1px solid var(--line); }
th { color: var(--slate-400); font-weight: 650; font-size: 11px; letter-spacing: .04em; white-space: nowrap; }
td { color: var(--slate-300); font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgb(51 65 85 / 23%); }
td:last-child { text-align: right; }
.cell-record { display: flex; align-items: center; gap: 10px; min-width: 156px; color: var(--white); }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 11px 15px; border-top: 1px solid var(--line); }
.pagination span { font-size: 12px; color: var(--slate-400); }
.pagination .controls { display: flex; gap: 6px; }
.empty { padding: 48px 16px; text-align: center; }
.empty .stat-icon { margin: 0 auto 10px; width: 46px; height: 46px; border-radius: 12px; }
.empty h2 { font-size: 18px; margin-bottom: 5px; }
.empty p { color: var(--slate-400); max-width: 460px; margin: 0 auto; }

.editor {
  margin: 0 0 0 auto; max-width: 100vw; width: min(520px, 100vw); height: 100dvh; max-height: 100dvh;
  border: 0; border-left: 1px solid var(--slate-700); padding: 0; background: var(--slate-900); color: var(--white);
}
.editor::backdrop { background: rgb(15 23 42 / 78%); }
.editor form { display: flex; flex-direction: column; min-height: 100%; }
.editor-header, .editor-footer { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; gap: 8px; }
.editor-header { border-bottom: 1px solid var(--line); }
.editor-header h2 { font-size: 22px; letter-spacing: -.02em; }
.editor-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 18px 20px; gap: 14px; }
.editor-body label { display: flex; flex-direction: column; gap: 6px; color: var(--slate-300); font-size: 12px; font-weight: 650; }
.editor-body label input, .editor-body label select, .editor-body label textarea { width: 100%; font-weight: 400; }
.wide { grid-column: 1 / -1; }
.editor-footer { margin-top: auto; border-top: 1px solid var(--line); flex-wrap: wrap; }
.editor-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.editor-note { font-size: 12px; color: var(--slate-400); }
.form-error { color: #fca5a5; font-size: 13px; }
.review-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.photo-preview { width: 100%; height: 112px; border-radius: 12px; object-fit: cover; background: var(--slate-800); }
.upload {
  display: flex !important; flex-direction: row !important; align-items: center; justify-content: center;
  padding: 12px; border-radius: 12px; border: 1px dashed var(--amber); background: rgb(245 158 11 / 10%);
  color: var(--amber-light) !important; cursor: pointer;
}
.upload:focus-within { outline: 2px solid var(--amber-light); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px !important; height: 1px; min-height: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.toast {
  position: fixed; z-index: 4; bottom: 18px; right: 18px; max-width: calc(100% - 36px);
  padding: 10px 14px; border-radius: 12px; color: var(--white); background: var(--slate-800);
  border: 1px solid var(--slate-600); box-shadow: 0 12px 24px rgb(0 0 0 / 25%);
}
.toast:empty { display: none; }

.mode-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 10px; }
.backup-button { margin-top: 9px; }
.auth-panel { max-width: 460px; }
.auth-panel > .button { margin: 18px; }
.auth-qr { width: 150px; height: 150px; padding: 6px; border-radius: 8px; background: var(--white); margin-bottom: 10px; }
.auth-secret { overflow-wrap: anywhere; margin: 7px 0 12px; }

@media (min-width: 1500px) {
  .shell { grid-template-columns: 244px minmax(0, 1fr); }
  .topbar, .workspace { padding-inline: 36px; }
}
@media (max-width: 1050px) {
  .shell { grid-template-columns: 192px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .workspace, .topbar { padding-inline: 20px; }
  .overview-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
}
@media (max-width: 760px) {
  input, select, textarea { font-size: 16px; }
  .shell { display: block; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: min(265px, 86vw);
    transform: translateX(-100%); visibility: hidden;
  }
  .sidebar.open { transform: none; visibility: visible; box-shadow: 0 0 0 100vmax rgb(0 0 0 / 50%); }
  .mobile-menu, .nav-close { display: inline-flex !important; }
  .nav-close { position: absolute; right: 10px; top: 24px; }
  .workspace, .topbar { padding-inline: 15px; }
  .workspace { padding-top: 18px; }
  .page-head h1 { font-size: 27px; }
  .page-head p { font-size: 13px; }
  .page-date { display: none; }
  .hero { padding: 20px; background-size: auto, cover; min-height: 205px; }
  .hero h2 { font-size: 24px; }
  .hero-location { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar { padding: 12px; }
}
@media (max-width: 410px) {
  .page-head { align-items: flex-start; }
  .page-head .button { min-height: 36px; padding: 6px 8px; font-size: 11px; }
  .editor-body { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
