:root {
  --bg: #0b1020;
  --bg-soft: #121932;
  --panel: rgba(255,255,255,0.9);
  --panel-strong: #ffffff;
  --text: #162033;
  --muted: #6a768a;
  --line: #d9e2ef;
  --primary: #2563eb;
  --primary-soft: #e8f0ff;
  --success: #12805c;
  --danger: #d14343;
  --shadow: 0 20px 50px rgba(11, 16, 32, 0.16);
  --radius: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37,99,235,0.25), transparent 25%),
    radial-gradient(circle at top right, rgba(16,185,129,0.18), transparent 18%),
    linear-gradient(180deg, var(--bg) 0%, #111a34 100%);
  min-height: 100vh;
}
.shell { padding: 20px 14px 40px; }
.container { max-width: 1180px; margin: 0 auto; }
.topbar {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  color: white; margin-bottom: 18px;
}
.form-topbar { position: sticky; top: 0; z-index: 30; padding: 10px 0 14px; backdrop-filter: blur(12px); }
.eyebrow {
  display: inline-flex; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16); font-size: 12px; letter-spacing: 0.03em; text-transform: uppercase;
}
h1, h2, h3 { margin: 0 0 8px; }
h1 { font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
p { margin: 0; line-height: 1.5; }
.intro { max-width: 760px; opacity: 0.9; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.back-link { color: white; text-decoration: none; display: inline-block; margin-bottom: 8px; }
.topbar-side { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.save-indicator {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.12); color: white; border: 1px solid rgba(255,255,255,0.18);
}
.save-indicator.saving { background: rgba(37,99,235,0.22); }
.save-indicator.error { background: rgba(209,67,67,0.22); }
.panel {
  background: rgba(255,255,255,0.92); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.5);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px;
}
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.section-head.split { align-items: center; }
.nested-head { margin-top: 16px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label {
  display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 700; color: #203047;
}
input[type="text"], input[type="date"], select, textarea {
  width: 100%; border: 1px solid var(--line); background: rgba(248,250,252,0.95); color: var(--text);
  border-radius: 16px; min-height: 52px; padding: 14px 15px; font-size: 16px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
textarea { min-height: 118px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(37,99,235,0.6); box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
}
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel-strong); color: var(--text);
  border-radius: 16px; min-height: 48px; padding: 0 16px; font-size: 15px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); color: white; border-color: #1d4ed8; box-shadow: 0 12px 24px rgba(37,99,235,0.22); }
.btn-danger { color: var(--danger); background: #fff6f6; border-color: #f3caca; }
.btn-light { background: #f8fafc; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.audit-grid { display: grid; gap: 14px; }
.audit-card {
  padding: 18px; border-radius: 20px; background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(15,23,42,0.06);
}
.audit-card-head, .stats-row, .chips-row, .room-head-actions, .photo-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.audit-card-head { justify-content: space-between; align-items: flex-start; }
.stats-row { margin: 14px 0; }
.stats-row > div {
  min-width: 140px; background: #f8fafc; border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px;
}
.stats-row strong { display: block; font-size: 12px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 8px 12px;
  background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 12px; border: 1px solid #d6e4ff;
}
.pill.subtle { background: #f3f6fb; color: #52627b; border-color: #e1e8f2; }
.switch {
  position: relative; display: inline-flex; align-items: center; gap: 10px; background: #f8fafc;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-weight: 700;
}
.switch input { width: 18px; height: 18px; }
.room-card {
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden; margin-bottom: 14px; background: #fcfdff;
}
.room-card[open] { box-shadow: 0 16px 30px rgba(15,23,42,0.07); }
.room-card > summary {
  list-style: none; cursor: pointer; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.room-card > summary::-webkit-details-marker { display: none; }
.room-card > summary:hover { background: #f8fbff; }
.room-body { border-top: 1px solid var(--line); padding: 18px; }
.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 14px;
}
.photo-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 10px 24px rgba(15,23,42,0.06);
}
.photo-card img { display: block; width: 100%; height: 170px; object-fit: cover; background: #eef2f7; }
.photo-meta { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.link-danger {
  appearance: none; border: 0; background: transparent; color: var(--danger); font-weight: 800; padding: 0; cursor: pointer; text-align: left;
}
.hidden-file { display: none; }
.toast {
  margin-bottom: 14px; padding: 14px 16px; border-radius: 16px; background: #e9fff6; color: var(--success); border: 1px solid #c6f2df;
}
.empty-state { padding: 28px; text-align: center; }
.empty-icon { font-size: 34px; margin-bottom: 10px; }
@media (max-width: 860px) {
  .form-grid.cols-2 { grid-template-columns: 1fr; }
  .topbar, .section-head.split, .audit-card-head { flex-direction: column; }
  .btn { width: 100%; }
  .topbar-side { width: 100%; justify-content: stretch; }
  .topbar-side > * { width: 100%; }
  .photo-actions { width: 100%; }
}
