/* Virtual Tour Rumah Sakit — gaya dasar.
   Warna tema (--primary, --secondary, dst.) disuntikkan dari pengaturan lewat theme_css().
   Mode gelap aktif lewat atribut data-theme="dark" pada <html>. */
:root {
  --primary: #0E7C86; --primary-dark: #0B666E; --primary-soft: #E7F2F3; --primary-text: #0B666E; --primary-rgb: 14,124,134; --on-primary: #fff;
  --secondary: #1F3A5F; --secondary-dark: #172B47; --on-secondary: #fff;

  --bg: #F4F7F9; --surface: #FFFFFF; --surface-2: #FAFCFD; --input-bg: #FFFFFF;
  --text: #14232E; --text-2: #2E4150; --muted: #5F7180; --border: #DDE5EA; --hover: rgba(16,34,46,.05);
  --danger: #C0392B; --danger-soft: #FDECEA;
  --ok-bg: #EAF7EF; --ok-border: #BFE5CD; --ok-text: #1B5E34;
  --err-bg: #FDECEA; --err-border: #F5C6C0; --err-text: #8E2A1F;
  --warn-bg: #FFF6E5; --warn-border: #F5DDAA; --warn-text: #7A5212;
  --pill-green-bg: #E3F4E9; --pill-green: #1B6B3A;
  --pill-gray-bg: #EDF1F4; --pill-gray: #52636F;
  --pill-red-bg: #FDECEA; --pill-red: #9B2C20;
  --checker: #F2F5F7; --nav-bg: rgba(255,255,255,.94); --switch-off: #C5D0D8;
  --shadow: 0 1px 2px rgba(16,34,46,.06), 0 4px 16px rgba(16,34,46,.06);
  --shadow-lg: 0 10px 30px rgba(16,34,46,.12);

  --radius: 12px; --radius-sm: 8px;
  --nav-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme=dark] {
  --bg: #0E1419; --surface: #161E26; --surface-2: #1B242D; --input-bg: #111920;
  --text: #E4ECF1; --text-2: #C3D0D9; --muted: #8FA1AF; --border: #26323D; --hover: rgba(255,255,255,.06);
  --danger: #F07167; --danger-soft: rgba(240,113,103,.14);
  --ok-bg: rgba(46,160,90,.14); --ok-border: rgba(46,160,90,.35); --ok-text: #86D9A6;
  --err-bg: rgba(240,113,103,.12); --err-border: rgba(240,113,103,.35); --err-text: #F5A39C;
  --warn-bg: rgba(230,170,60,.12); --warn-border: rgba(230,170,60,.35); --warn-text: #F1C879;
  --pill-green-bg: rgba(46,160,90,.18); --pill-green: #86D9A6;
  --pill-gray-bg: rgba(255,255,255,.08); --pill-gray: #AEBBC6;
  --pill-red-bg: rgba(240,113,103,.16); --pill-red: #F5A39C;
  --checker: #1E2932; --nav-bg: rgba(18,25,32,.94); --switch-off: #3A4855;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font: 15px/1.6 var(--font); color: var(--text); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; text-wrap: balance; }
code { font-size: .9em; background: var(--hover); padding: .1em .35em; border-radius: 4px; word-break: break-all; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 32px 20px 56px; }
:root[data-theme=dark] .when-light, :root:not([data-theme=dark]) .when-dark { display: none; }
.when-light, .when-dark { display: inline-flex; }

/* ---------- Tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: 600 14px/1.2 var(--font); cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .bottom-nav a:focus-visible, .bottom-nav button:focus-visible { outline: 3px solid rgba(var(--primary-rgb), .4); outline-offset: 1px; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary-text); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn-ghost.danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-icon { padding: 8px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: var(--hover); }
.icon-btn .icon { width: 20px; height: 20px; }

/* ---------- Header publik ---------- */
.site-header { background: var(--secondary); color: var(--on-secondary); position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 10px rgba(0,0,0,.12); padding-top: env(safe-area-inset-top, 0px); }
.header-inner { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none !important; min-width: 0; }
.brand-logo { height: 42px; width: auto; max-width: 160px; object-fit: contain; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--primary); color: var(--on-primary); flex-shrink: 0; }
.brand-mark .icon { width: 22px; height: 22px; }
.brand-mark-lg { width: 60px; height: 60px; border-radius: 16px; margin: 0 auto; }
.brand-mark-lg .icon { width: 32px; height: 32px; }
.brand-name { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-search { flex: 1; max-width: 380px; margin-left: auto; position: relative; }
.header-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: .7; }
.header-search input[type=search] { width: 100%; padding: 9px 14px 9px 38px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.12); color: inherit; font: inherit; }
.header-search input::placeholder { color: inherit; opacity: .7; }
.header-search input[type=search]:focus { background: var(--input-bg); color: var(--text); outline: none; box-shadow: none; }
.home .header-search { visibility: hidden; }
.header-nav { display: flex; align-items: center; gap: 8px; }
.site-header .icon-btn:hover { background: rgba(255,255,255,.12); }
.header-nav .btn-outline { background: transparent; color: inherit; border-color: rgba(255,255,255,.35); }
.header-nav .btn-outline:hover { background: rgba(255,255,255,.12); color: inherit; border-color: rgba(255,255,255,.6); }

/* ---------- Hero & pencarian ---------- */
.hero { position: relative; overflow: hidden; padding: 64px 0 72px; color: var(--on-secondary);
  background: radial-gradient(1200px 400px at 85% -10%, rgba(var(--primary-rgb), .55), transparent 60%), linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%); }
.hero::after { content: ""; position: absolute; right: -120px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255,255,255,.05); }
.hero .container { position: relative; z-index: 1; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.12); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.hero h1 { font-size: clamp(26px, 4.5vw, 44px); margin-bottom: 10px; }
.hero-sub { font-size: 17px; opacity: .85; max-width: 640px; margin: 0 0 28px; }
.hero-search { display: flex; gap: 10px; background: var(--surface); padding: 8px; border-radius: 14px; box-shadow: var(--shadow-lg); max-width: 820px; scroll-margin-top: 90px; }
.hero-search-input { flex: 1; position: relative; min-width: 0; }
.hero-search-input .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.hero-search input[type=search] { width: 100%; height: 100%; min-height: 48px; border: 0; padding: 0 14px 0 44px; font: inherit; font-size: 16px; color: var(--text); background: transparent; border-radius: 8px; box-shadow: none; }
.hero-search input:focus { outline: none; }
.hero-search select { border: 0; border-left: 1px solid var(--border); border-radius: 0; padding: 0 12px; font: inherit; color: var(--text); background: transparent; max-width: 220px; width: auto; box-shadow: none; }
.hero-search .btn { padding: 0 24px; min-height: 48px; font-size: 15px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 14px; font-weight: 500; text-decoration: none !important; white-space: nowrap; }
.chip span { font-size: 12px; color: var(--muted); background: var(--bg); padding: 0 7px; border-radius: 999px; }
.chip:hover { border-color: var(--primary); color: var(--primary-text); }
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip.active span { background: rgba(255,255,255,.22); color: inherit; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { font-size: 20px; margin: 0; }
.link-muted { color: var(--muted); font-size: 14px; white-space: nowrap; }

/* ---------- Kartu ruangan ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.card { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; transition: transform .2s, box-shadow .2s; border: 1px solid var(--border); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card:active { transform: scale(.99); }
.card-thumb { position: relative; aspect-ratio: 16/10; background: var(--primary-soft); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-thumb img { transform: scale(1.05); }
.thumb-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--primary-text); background: linear-gradient(135deg, var(--primary-soft), var(--surface)); }
.thumb-placeholder .icon { width: 56px; height: 56px; opacity: .55; stroke-width: 1.4; }
.badge-360 { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; backdrop-filter: blur(4px); }
.card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.card-body h3 { font-size: 17px; margin: 0; }
.badge { align-self: flex-start; display: inline-block; font-size: 12px; font-weight: 600; color: var(--primary-text); background: var(--primary-soft); padding: 3px 10px; border-radius: 999px; text-decoration: none !important; }
.meta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; color: var(--muted); font-size: 13.5px; margin: 0; }
.meta span, p.meta { display: inline-flex; align-items: center; gap: 5px; }
.meta .icon { width: 15px; height: 15px; }
.card-desc { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; stroke-width: 1.4; color: var(--primary-text); opacity: .6; margin: 0 auto 14px; }
.empty h3 { color: var(--text); font-size: 18px; }
.empty .btn { margin-top: 12px; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination a { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 600; }
.pagination a.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* ---------- Halaman tour ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.back-link.center { display: flex; justify-content: center; margin: 20px 0 0; }
.tour-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.tour-head h1 { font-size: clamp(22px, 3.5vw, 34px); margin: 10px 0 8px; }
.tour-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tour-viewer { position: relative; width: 100%; aspect-ratio: 16/9; max-height: 78vh; background: #0b1117; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.tour-viewer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tour-viewer:fullscreen { border-radius: 0; max-height: none; }
.tour-content { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; margin-top: 28px; }
.tour-content:has(> :only-child) { grid-template-columns: 1fr; }
.tour-desc, .related { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.tour-desc h2, .related h2 { font-size: 18px; }
.prose { color: var(--text-2); max-width: 72ch; }
.related { align-self: start; }
.related-item { display: flex; gap: 12px; align-items: center; padding: 10px; margin: 0 -10px; border-radius: 10px; color: var(--text); text-decoration: none !important; }
.related-item:hover { background: var(--hover); }
.related-item strong { display: block; font-size: 14.5px; }
.related-item small { color: var(--muted); }
.related-thumb { width: 64px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; flex-shrink: 0; }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Gedung ---------- */
.btn-hero { background: #fff; color: var(--secondary-dark); padding: 12px 18px; border-radius: 12px; font-size: 15px; margin: -8px 0 24px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.btn-hero:hover { background: #F2F6F8; }
.btn-hero .icon { color: var(--primary); width: 20px; height: 20px; }
.btn-hero-tag { font-size: 11px; font-weight: 700; background: var(--primary-soft); color: var(--primary-dark); padding: 2px 8px; border-radius: 999px; }
:root[data-theme=dark] .btn-hero { background: var(--surface); color: var(--text); }
:root[data-theme=dark] .btn-hero-tag { color: var(--primary-text); }
.badge .icon { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }
.rooms-section { margin-top: 36px; scroll-margin-top: 84px; }
.buildings-section { margin-top: 0; margin-bottom: 36px; }
.room-filter { max-width: 280px; }
.building-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.building-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: var(--text); text-decoration: none !important; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.building-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.building-thumb { position: relative; aspect-ratio: 16/9; display: grid; place-items: center; background: linear-gradient(135deg, var(--secondary), var(--secondary-dark)); color: var(--on-secondary); }
.building-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.building-thumb > .icon { width: 44px; height: 44px; opacity: .6; stroke-width: 1.4; }
.building-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 2px; }
.building-body strong { font-size: 15.5px; line-height: 1.3; }
.building-body small { color: var(--muted); font-size: 13px; }
.building-cover { border-radius: var(--radius); overflow: hidden; aspect-ratio: 21/9; }
.building-cover img { width: 100%; height: 100%; object-fit: cover; }
.building-desc { margin-top: 20px; }

/* ---------- Viewer layar penuh (Tour Global) ---------- */
.viewer-page { background: #05080B; overflow: hidden; }
.viewer-shell { position: fixed; inset: 0; background: #05080B; }
.viewer-shell iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.viewer-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; pointer-events: none;
  padding: calc(12px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) 12px calc(12px + env(safe-area-inset-left, 0px)); }
.viewer-bar > * { pointer-events: auto; }
.viewer-btn, .viewer-title { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(10,16,22,.62); color: #fff; font: 600 14px var(--font); text-decoration: none !important; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: pointer; white-space: nowrap; }
.viewer-btn:hover { background: rgba(10,16,22,.8); }
.viewer-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.viewer-title .icon { color: #fff; opacity: .85; }
.viewer-actions { display: flex; gap: 8px; }
.viewer-shell:fullscreen .viewer-bar { opacity: .85; }

/* ---------- Footer ---------- */
.site-footer { background: var(--secondary-dark); color: var(--on-secondary); padding: 24px 0; font-size: 14px; }
.site-footer .footer-inner { opacity: .85; text-align: center; }

/* ---------- Menu bawah (mobile, ala aplikasi) ---------- */
.bottom-nav { display: none; }
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); animation: fade .2s ease; }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 75vh; overflow-y: auto; background: var(--surface); border-radius: 20px 20px 0 0; padding: 8px 16px calc(20px + var(--safe-b)); box-shadow: var(--shadow-lg); animation: slide-up .25s ease; }
.sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet-head h2 { font-size: 17px; margin: 0; }
.sheet-list a { display: flex; align-items: center; gap: 12px; padding: 13px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; }
.sheet-list a:hover, .sheet-list a:active { background: var(--hover); }
.sheet-list a .icon { color: var(--primary-text); }
.sheet-list a span { flex: 1; }
.sheet-list small { color: var(--muted); background: var(--bg); padding: 1px 9px; border-radius: 999px; font-size: 12px; }
.sheet-empty { padding: 10px; }
.sheet-label { margin: 14px 10px 4px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sheet-list a.sheet-highlight { background: var(--primary-soft); color: var(--primary-text); margin-bottom: 4px; }
.sheet-list a.sheet-highlight small { background: var(--primary); color: var(--on-primary); }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Alert ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14.5px; border: 1px solid; }
.alert-success { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-text); }
.alert-error { background: var(--err-bg); border-color: var(--err-border); color: var(--err-text); }
.alert-warning { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }

/* ---------- Form ---------- */
.form .field { margin-bottom: 18px; }
.field label:not(.btn):not(.checkbox):not(.radio-card):not(.switch) { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.req { color: var(--danger); }
input[type=text], input[type=password], input[type=email], input[type=search], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; color: var(--text); background: var(--input-bg); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .18); outline: none; }
input:disabled { background: var(--bg); color: var(--muted); }
textarea { resize: vertical; min-height: 44px; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 13px; margin: 6px 0 0; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 10px; cursor: pointer; }
.checkbox input { accent-color: var(--primary); }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { width: 42px; height: 24px; border-radius: 999px; background: var(--switch-off); position: relative; transition: background .2s; flex-shrink: 0; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .switch-ui { background: var(--primary); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid rgba(var(--primary-rgb), .35); }
.radio-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.radio-cards.cols-3 { grid-template-columns: repeat(3, 1fr); }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.radio-card input { margin-top: 4px; accent-color: var(--primary); }
.radio-card strong { display: block; font-size: 14px; }
.radio-card small { color: var(--muted); font-size: 12.5px; line-height: 1.4; display: block; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.form-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.form-actions.inline { flex-direction: row; }

/* ---------- Login ---------- */
.login-page { background: radial-gradient(900px 500px at 100% 0%, rgba(var(--primary-rgb), .35), transparent 60%), linear-gradient(135deg, var(--secondary), var(--secondary-dark)); }
.login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; position: relative; }
.login-theme { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; color: var(--on-secondary); }
.login-theme:hover { background: rgba(255,255,255,.12); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 16px; padding: 32px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-brand { text-align: center; margin-bottom: 24px; }
.login-logo { max-height: 72px; width: auto; margin: 0 auto; }
.login-brand h1 { font-size: 21px; margin: 14px 0 4px; }
.login-brand p { color: var(--muted); margin: 0; font-size: 14px; }
.login-foot { color: var(--on-secondary); opacity: .7; font-size: 13px; text-align: center; margin-top: 20px; }
.captcha-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.captcha-img { border-radius: 8px; border: 1px solid var(--border); background: #F4F8FA; }
.captcha-remote { display: flex; justify-content: center; }

/* ---------- Admin ---------- */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 250px; flex-shrink: 0; background: var(--secondary); color: var(--on-secondary); display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 4px 8px 20px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 14px; }
.sidebar .brand-logo { height: 36px; }
.sidebar .brand-name { font-size: 15px; white-space: normal; line-height: 1.3; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-nav a, .side-foot a, .side-foot button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: inherit; opacity: .8; font: 500 14.5px var(--font); text-decoration: none; background: none; border: 0; width: 100%; cursor: pointer; text-align: left; }
.side-nav a:hover, .side-foot a:hover, .side-foot button:hover { background: rgba(255,255,255,.08); opacity: 1; }
.side-nav a.active { background: var(--primary); color: var(--on-primary); opacity: 1; }
.side-foot { border-top: 1px solid rgba(255,255,255,.1); padding-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.admin-topbar h1 { font-size: 19px; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-topbar .icon-btn { color: var(--muted); }
.menu-toggle { display: none; }
.whoami { display: flex; align-items: center; gap: 10px; }
.whoami-text { display: flex; flex-direction: column; line-height: 1.25; }
.whoami-text strong { font-size: 14px; }
.whoami-text small { font-size: 12px; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.admin-content { padding: 24px 28px 40px; flex: 1; }
.admin-footer { padding: 16px 28px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); }
.sidebar-backdrop { display: none; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; flex-shrink: 0; }
.stat-icon .icon { width: 22px; height: 22px; }
.stat strong { display: block; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 13px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-head p { margin: 0; max-width: 600px; font-size: 14px; }
.panel-title { font-size: 15px; margin: 4px 0 12px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.toolbar select { width: auto; }
.input-icon { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.input-icon .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon input[type=search] { padding-left: 36px; }

.table-wrap { overflow-x: auto; margin: 0 -22px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table tbody tr:hover, .table tr.is-editing { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form { display: inline; }
.cell-tour { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.cell-tour strong { display: block; }
.cell-tour small, .cell-sub { color: var(--muted); font-size: 13px; display: block; }
.mini-thumb { width: 56px; height: 40px; border-radius: 6px; overflow: hidden; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; flex-shrink: 0; }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill-green { background: var(--pill-green-bg); color: var(--pill-green); }
.pill-gray { background: var(--pill-gray-bg); color: var(--pill-gray); }
.pill-red { background: var(--pill-red-bg); color: var(--pill-red); }
.pill-primary { background: var(--primary-soft); color: var(--primary-text); }

.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.split-side { position: sticky; top: 84px; scroll-margin-top: 84px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.form-grid .panel { margin-bottom: 20px; }
.form-side { position: sticky; top: 84px; }
.form-narrow { max-width: 720px; }
.tour-preview { margin-top: 12px; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: #0b1117; }
.tour-preview iframe { width: 100%; height: 100%; border: 0; }
.image-drop { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.image-drop img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

.settings-section header { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.settings-section header h2 { font-size: 17px; margin: 0 0 2px; }
.settings-section header p { margin: 0; color: var(--muted); font-size: 14px; }
.section-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; flex-shrink: 0; }
.upload-box { display: flex; gap: 16px; align-items: flex-start; }
.upload-preview { flex-shrink: 0; border: 1px dashed var(--border); border-radius: 10px; display: grid; place-items: center; background: repeating-conic-gradient(var(--checker) 0 25%, var(--surface) 0 50%) 0 0/16px 16px; color: var(--muted); }
.logo-preview { width: 160px; height: 80px; padding: 8px; }
.logo-preview img { max-height: 100%; width: auto; object-fit: contain; }
.favicon-preview { width: 80px; height: 80px; }
.favicon-preview img { width: 48px; height: 48px; object-fit: contain; }
.color-field { display: flex; gap: 10px; align-items: center; }
.color-field input[type=color] { width: 48px; height: 42px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; flex-shrink: 0; }
.color-field input[data-color-text] { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; max-width: 140px; }
.swatches { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.swatches .hint { margin: 0 4px 0 0; }
.swatch { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; padding: 0; cursor: pointer; background: none; }
.swatch span { width: 20px; height: 26px; }
.swatch:hover { box-shadow: 0 0 0 2px var(--border); }
.theme-preview { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; max-width: 460px; }
.tp-header { background: var(--tp-secondary, var(--secondary)); color: var(--tp-on-secondary, var(--on-secondary)); padding: 12px 16px; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.tp-dot { width: 18px; height: 18px; border-radius: 5px; background: var(--tp-primary, var(--primary)); }
.tp-body { padding: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: #fff; }
.tp-btn { background: var(--tp-primary, var(--primary)); color: var(--tp-on-primary, var(--on-primary)); padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.tp-badge { background: var(--tp-primary-soft, var(--primary-soft)); color: var(--tp-primary, var(--primary)); padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tp-link { color: var(--tp-primary, var(--primary)); font-weight: 600; font-size: 14px; text-decoration: underline; }
.captcha-keys { margin-top: 6px; padding: 14px 16px 2px; background: var(--bg); border-radius: 10px; }
.captcha-keys .hint { margin: 0 0 12px; }
.sticky-actions { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 30%); display: flex; justify-content: flex-end; z-index: 5; }

/* ---------- Urutan drag & drop ---------- */
.sort-hint { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: -4px 0 12px; }
.sort-hint .icon { width: 16px; height: 16px; flex-shrink: 0; }
.drag-handle { display: inline-grid; place-items: center; width: 28px; height: 36px; margin-left: -6px; flex-shrink: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: grab; touch-action: none; }
.drag-handle:hover, .drag-handle:focus-visible { background: var(--hover); color: var(--text); }
.drag-handle:focus-visible { outline: 3px solid rgba(var(--primary-rgb), .4); }
.drag-handle .icon { width: 18px; height: 18px; fill: currentColor; }
tbody.is-sorting, tbody.is-sorting * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.table tr.dragging, .table tr.dragging:hover { background: var(--surface); box-shadow: var(--shadow-lg), 0 0 0 2px var(--primary); position: relative; z-index: 3; }
.table tr.dragging td { border-bottom-color: transparent; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 90; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-error { background: var(--danger); color: #fff; }

/* ---------- Responsif ---------- */
@media (max-width: 960px) {
  .tour-content, .form-grid, .split { grid-template-columns: 1fr; }
  .form-side, .split-side { position: static; }
  .radio-cards.cols-3 { grid-template-columns: 1fr 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 70; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .sidebar.open + .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 65; }
  .menu-toggle { display: inline-flex; }
}

@media (max-width: 720px) {
  /* Menu bawah ala aplikasi */
  body.public, body.admin { padding-bottom: calc(var(--nav-h) + var(--safe-b)); }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: var(--nav-bg); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-top: 1px solid var(--border); }
  .bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; border: 0; background: none; padding: 6px 2px;
    color: var(--muted); font: 600 11px/1.1 var(--font); text-decoration: none; cursor: pointer; position: relative; }
  .bottom-nav .icon { width: 22px; height: 22px; }
  .bottom-nav .when-light, .bottom-nav .when-dark { display: contents; }
  :root[data-theme=dark] .bottom-nav .when-light, :root:not([data-theme=dark]) .bottom-nav .when-dark { display: none; }
  .bottom-nav a.active { color: var(--primary-text); }
  .bottom-nav a.active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
  .bottom-nav a:active, .bottom-nav button:active { transform: scale(.94); }
  .bottom-nav a.fab .icon { width: 26px; height: 26px; padding: 10px; box-sizing: content-box; border-radius: 16px; background: var(--primary); color: var(--on-primary); margin-top: -26px; box-shadow: 0 6px 16px rgba(var(--primary-rgb), .45); }
  .bottom-nav a.fab.active::before { display: none; }
  .site-footer { padding: 18px 0; font-size: 13px; }

  .container, .section { padding-left: 16px; padding-right: 16px; }
  .section { padding-top: 24px; padding-bottom: 32px; }
  .header-inner { height: 58px; gap: 10px; }
  .header-search, .header-nav .btn { display: none; }
  .header-nav { margin-left: auto; }
  .brand-name { font-size: 15.5px; }
  .brand-logo { height: 36px; }
  .brand-mark { width: 36px; height: 36px; }
  .hero { padding: 28px 0 32px; }
  .hero-eyebrow { margin-bottom: 10px; }
  .hero-sub { font-size: 15px; margin-bottom: 20px; }
  .hero-search { flex-direction: column; gap: 6px; padding: 6px; }
  .hero-search select { border-left: 0; border-top: 1px solid var(--border); padding: 12px; max-width: none; width: 100%; }
  .hero-search-input input[type=search] { min-height: 46px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 20px; padding: 0 16px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .chips::-webkit-scrollbar { display: none; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .card { flex-direction: row; }
  .btn-hero { width: 100%; justify-content: center; margin-top: -4px; }
  .building-row { display: flex; overflow-x: auto; gap: 12px; margin: 0 -16px; padding: 2px 16px 8px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .building-row::-webkit-scrollbar { display: none; }
  .building-card { flex: 0 0 62%; max-width: 240px; scroll-snap-align: start; }
  .building-card:hover { transform: none; }
  .section-head { flex-wrap: wrap; }
  .room-filter { max-width: none; flex-basis: 100%; }
  .rooms-section { margin-top: 28px; }
  .viewer-btn span, .viewer-actions .viewer-btn span { display: none; }
  .viewer-btn { width: 42px; height: 42px; padding: 0; justify-content: center; }
  .viewer-title { height: 42px; font-size: 13px; flex: 1; justify-content: center; }
  .card-thumb { width: 38%; max-width: 150px; aspect-ratio: auto; min-height: 120px; flex-shrink: 0; }
  .badge-360 { top: 6px; right: auto; left: 6px; font-size: 10.5px; padding: 2px 7px; }
  .card-body { padding: 12px 14px; gap: 4px; min-width: 0; }
  .card-body h3 { font-size: 15.5px; }
  .card-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; }
  .card:hover { transform: none; }
  .field-row, .radio-cards, .radio-cards.cols-3 { grid-template-columns: 1fr; }
  .tour-page { padding-top: 16px; }
  .back-link { margin-bottom: 10px; }
  .tour-viewer { aspect-ratio: 3/4; max-height: 64vh; margin: 0 -16px; width: calc(100% + 32px); border-radius: 0; }
  .tour-actions { width: 100%; }
  .tour-actions .btn { flex: 1; padding-left: 10px; padding-right: 10px; }
  .tour-content { margin-top: 18px; gap: 16px; }
  .tour-desc, .related { padding: 18px; }

  .admin-topbar { padding: 10px 12px 10px 8px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  .admin-topbar h1 { font-size: 17px; }
  .admin-content { padding: 16px 12px 24px; }
  .admin-footer { display: none; }
  .whoami-text { display: none; }
  .panel { padding: 16px; }
  .panel-head > .btn-primary { display: none; }
  .input-icon { max-width: none; min-width: 0; flex-basis: 100%; }
  .toolbar select { flex: 1; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
  .stat { padding: 12px; gap: 10px; }
  .stat-icon { width: 36px; height: 36px; }
  .stat strong { font-size: 19px; }
  .upload-box { flex-direction: column; }
  .sticky-actions { bottom: calc(var(--nav-h) + var(--safe-b)); }
  .toast { bottom: calc(var(--nav-h) + var(--safe-b) + 14px); }
  .drag-handle { width: 34px; height: 40px; }
  .sticky-actions .btn { width: 100%; }
  .form-actions.inline .btn { flex: 1; }

  /* Tabel menjadi kartu */
  .table-wrap { margin: 0; overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; padding: 12px 14px; background: var(--surface); }
  .table tbody tr:hover { background: var(--surface); }
  .table td, .table th:first-child, .table td:first-child, .table td:last-child { padding: 4px 0; border: 0; }
  .table td[data-label] { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  .table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; font-weight: 500; }
  .table tr { position: relative; }
  .table td:first-child:not([data-label]) { padding: 0 112px 10px 0; margin-bottom: 6px; border-bottom: 1px solid var(--border); min-height: 40px; }
  .table td.actions { position: absolute; top: 8px; right: 8px; width: auto; display: flex; gap: 0; padding: 0; }
  .cell-tour { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
