/* =========================================================
   ADMIN - Patrimônio 360°
   ========================================================= */
.admin-body { background: var(--paper-2); }
.hidden { display: none !important; }

/* ---------- LOGIN ---------- */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 2rem;
  background: radial-gradient(ellipse at 30% 20%, rgba(166,123,58,.18), transparent 60%), var(--ink); }
.login__box { background: var(--paper); width: 100%; max-width: 400px; padding: 2.5rem; border-top: 4px solid var(--gold); }
.login__title { font-size: 2rem; text-align: center; }
.login__sub { text-align: center; color: var(--ink-mute); font-size: .9rem; margin: .5rem 0 1.5rem; }
.login__err { color: var(--terracotta); font-size: .85rem; text-align: center; margin-top: 1rem; min-height: 1.2em; }

/* ---------- inputs ---------- */
.inp, .ta, .sel { width: 100%; padding: .8rem 1rem; border: 1px solid var(--line); background: var(--paper);
  font-family: var(--sans); font-size: .95rem; color: var(--ink); transition: border-color .2s; }
.inp:focus, .ta:focus, .sel:focus { outline: none; border-color: var(--gold); }
.ta { min-height: 90px; resize: vertical; line-height: 1.5; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-mute); margin-bottom: .4rem; font-weight: 500; }
.field--row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.help { font-size: .78rem; color: var(--ink-mute); margin-top: .3rem; }
.check { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }

/* ---------- TOP BAR ---------- */
.admin__top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 1.5rem;
  padding: .9rem var(--gutter); background: var(--paper); border-bottom: 1px solid var(--line); }
.admin__crumb { flex: 1; display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--ink-mute); flex-wrap: wrap; }
.admin__crumb a { transition: color .2s; } .admin__crumb a:hover { color: var(--gold); }
.admin__crumb b { color: var(--ink); font-weight: 600; }
.admin__crumb .sep { opacity: .4; }
.admin__top-actions { display: flex; gap: .5rem; }
.admin__view { max-width: 1200px; margin: 0 auto; padding: var(--c-4) var(--gutter) var(--c-7); }

/* ---------- headers de seção ---------- */
.vhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.8rem; flex-wrap: wrap; }
.vhead__title { font-size: 2.2rem; }
.vhead__sub { color: var(--ink-mute); font-size: .9rem; margin-top: .2rem; }

/* ---------- listas / cards ---------- */
.rows { display: grid; gap: .8rem; }
.row { display: flex; align-items: center; gap: 1.2rem; padding: 1rem 1.2rem; background: var(--paper); border: 1px solid var(--line); transition: border-color .2s; }
.row:hover { border-color: var(--gold); }
.row__thumb { width: 84px; height: 56px; flex-shrink: 0; background-size: cover; background-position: center;
  background-color: var(--paper-3); border-radius: 2px; }
.row__main { flex: 1; min-width: 0; }
.row__title { font-family: var(--serif); font-size: 1.25rem; line-height: 1.1; }
.row__meta { font-size: .8rem; color: var(--ink-mute); margin-top: .2rem; }
.row__tags { display: flex; gap: .4rem; margin-top: .4rem; flex-wrap: wrap; }
.tag { font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; padding: .2rem .5rem; background: var(--paper-2); color: var(--ink-mute); border-radius: 2px; }
.tag--on { background: var(--moss); color: #fff; }
.tag--off { background: var(--paper-3); }
.tag--gold { background: var(--gold); color: #fff; }
.row__actions { display: flex; gap: .4rem; flex-shrink: 0; }

/* botões pequenos de ação */
.iconbtn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line);
  background: var(--paper); transition: all .2s; border-radius: 2px; }
.iconbtn:hover { border-color: var(--gold); color: var(--gold); }
.iconbtn--danger:hover { border-color: var(--terracotta); color: var(--terracotta); }
.iconbtn svg { width: 16px; height: 16px; }

/* empty / loading */
.box-empty { text-align: center; padding: 3rem; border: 1px dashed var(--line); color: var(--ink-mute); font-family: var(--serif); font-style: italic; font-size: 1.2rem; }

/* ---------- TOUR EDITOR ---------- */
.editor { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; align-items: start; }
.scenelist { display: grid; gap: .6rem; }
.scenelist__add { width: 100%; padding: .9rem; border: 1px dashed var(--line); background: var(--paper);
  color: var(--ink-mute); transition: all .2s; font-size: .85rem; }
.scenelist__add:hover { border-color: var(--gold); color: var(--gold); }
.scenecard { position: relative; border: 1px solid var(--line); background: var(--paper); cursor: pointer; transition: all .2s; overflow: hidden; }
.scenecard:hover { border-color: var(--gold); }
.scenecard--active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.scenecard__thumb { width: 100%; height: 90px; background-size: cover; background-position: center; background-color: var(--paper-3); }
.scenecard__name { padding: .5rem .7rem; font-size: .85rem; display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.scenecard__def { font-size: .6rem; background: var(--gold); color: #fff; padding: .1rem .35rem; border-radius: 2px; letter-spacing: .05em; }

.stage { position: relative; height: 460px; }
/* o Pannellum adiciona .pnlm-container (height:100%) ao mount; por isso a altura
   fixa fica no pai .stage e o viewer preenche 100%. */
.stage__viewer { width: 100%; height: 100%; background: #0d0c0b; position: relative; overflow: hidden; }
.stage__overlay { position: absolute; inset: 0; z-index: 5; cursor: crosshair; display: none;
  background: rgba(166,123,58,.08); }
.stage__overlay.is-active { display: block; }
.stage__hint { position: absolute; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 6;
  background: rgba(13,12,11,.85); color: var(--paper); padding: .5rem 1rem; font-size: .82rem; border-radius: 40px; display: none; }
.stage__hint.is-active { display: block; }

.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; padding: 1rem; background: var(--paper); border: 1px solid var(--line); }
.toolbar__group { display: flex; gap: .4rem; align-items: center; }
.toolbar__label { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); margin-right: .3rem; }
.addbtn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .9rem; border: 1px solid var(--line);
  background: var(--paper); font-size: .8rem; transition: all .2s; border-radius: 2px; }
.addbtn:hover { border-color: var(--gold); }
.addbtn__dot { width: 12px; height: 12px; border-radius: 50%; }
.addbtn--scene .addbtn__dot { background: var(--gold); }
.addbtn--info .addbtn__dot { background: #6b6258; }
.addbtn--image .addbtn__dot { background: var(--moss); }
.addbtn--video .addbtn__dot { background: var(--terracotta); }
.addbtn.is-armed { border-color: var(--gold); background: var(--gold); color: #fff; }
.addbtn.is-armed .addbtn__dot { background: #fff; }

/* tabela de hotspots */
.hslist { margin-top: 1.2rem; }
.hslist__title { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: .6rem; }
.hsrow { display: flex; align-items: center; gap: .8rem; padding: .6rem .8rem; border: 1px solid var(--line); background: var(--paper); margin-bottom: .4rem; }
.hsrow__type { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.hsrow__label { flex: 1; font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hsrow__coords { font-size: .72rem; color: var(--ink-mute); font-family: monospace; }

/* preview de upload */
.uploaded { margin-top: .5rem; display: flex; align-items: center; gap: .8rem; font-size: .82rem; color: var(--moss); }
.uploaded img { width: 80px; height: 50px; object-fit: cover; border: 1px solid var(--line); }
.uploading { font-size: .82rem; color: var(--gold); margin-top: .5rem; }

/* ---------- AMODAL (formulários) ---------- */
.amodal { position: fixed; inset: 0; z-index: 200; display: none; align-items: flex-start; justify-content: center;
  padding: 4vh 1rem; background: rgba(13,12,11,.6); backdrop-filter: blur(4px); overflow-y: auto; }
.amodal.is-open { display: flex; }
.amodal__box { background: var(--paper); width: 100%; max-width: 560px; padding: 2rem; position: relative; margin: auto; }
.amodal__box--wide { max-width: 680px; }
.amodal__close { position: absolute; top: 1rem; right: 1rem; width: 36px; height: 36px; display: grid; place-items: center; font-size: 1.4rem; color: var(--ink-mute); }
.amodal__close:hover { color: var(--terracotta); }
.amodal__title { font-size: 1.6rem; margin-bottom: 1.4rem; padding-right: 2rem; }
.amodal__foot { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1.5rem; }

/* ---------- TOAST ---------- */
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(120%);
  background: var(--ink); color: var(--paper); padding: .9rem 1.5rem; border-radius: 3px; z-index: 300;
  font-size: .9rem; transition: transform .35s var(--ease); box-shadow: 0 8px 30px rgba(0,0,0,.3); max-width: 90vw; }
.toast.is-show { transform: translateX(-50%) translateY(0); }
.toast--ok { border-left: 3px solid var(--moss); }
.toast--err { border-left: 3px solid var(--terracotta); }

@media (max-width: 820px) {
  .editor { grid-template-columns: 1fr; }
  .scenelist { grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); }
  .field--row { grid-template-columns: 1fr; }
}

/* ---------- lote / reordenar / biblioteca ---------- */
.scenelist.is-drop { outline: 2px dashed var(--gold); outline-offset: 3px; background: rgba(166,123,58,.06); }
.scenecard__ord { position: absolute; top: 4px; right: 4px; display: flex; flex-direction: column; gap: 3px; opacity: 0; transition: opacity .15s; }
.scenecard:hover .scenecard__ord { opacity: 1; }
.scenecard__ord button { width: 22px; height: 20px; display: grid; place-items: center; background: rgba(13,12,11,.72); color: #fff; font-size: .8rem; border-radius: 2px; line-height: 1; }
.scenecard__ord button:hover { background: var(--gold); }

.libgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; margin-top: 1rem; max-height: 48vh; overflow-y: auto; }
.libitem { position: relative; aspect-ratio: 1; }
.libitem img { width: 100%; height: 100%; object-fit: cover; border: 1px solid var(--line); cursor: pointer; transition: border-color .15s; }
.libitem img[data-pick]:hover { border-color: var(--gold); }
.libitem__del { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; display: grid; place-items: center; background: rgba(13,12,11,.78); color: #fff; border-radius: 50%; font-size: 1rem; line-height: 1; opacity: 0; transition: opacity .15s; }
.libitem:hover .libitem__del { opacity: 1; }
.libitem__del:hover { background: var(--terracotta); }

.libstrip { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: 1rem; }
.libstrip img { width: 64px; height: 64px; flex-shrink: 0; object-fit: cover; border: 1px solid var(--line); cursor: pointer; transition: border-color .15s; }
.libstrip img:hover { border-color: var(--gold); }
.libstrip img.is-sel { border: 2px solid var(--gold); }
