/* Painel administrativo — Anjos da Sopa do ABC */
:root {
  --navy: #052a5e; --navy2: #031c3f; --navy3: #0a3a7a;
  --blue: #0093fd; --blue-d: #005cce; --sky: #e8f5ff; --sky2: #f4faff;
  --gold: #ffc700; --gold-d: #e6a800;
  --text: #122338; --muted: #5b6e84; --line: #dfe7f0; --bg: #f1f5fa; --white: #fff;
  --red: #d93a3a; --green: #1f9d62;
  --radius: 14px; --shadow: 0 6px 24px rgba(5, 42, 94, .08); --shadow-lg: 0 24px 60px rgba(3, 28, 63, .28);
  --side: 272px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 10% -10%, #0a4fa3 0, transparent 60%), radial-gradient(900px 500px at 100% 110%, #0093fd55 0, transparent 60%), linear-gradient(160deg, var(--navy2), var(--navy)); }
.login-card { width: 100%; max-width: 410px; background: #fff; border-radius: 24px; padding: 38px 34px 30px; box-shadow: var(--shadow-lg); text-align: center; }
.login-card img { width: 92px; height: 92px; object-fit: contain; margin: 0 auto 14px; }
.login-card h1 { font-size: 1.4rem; color: var(--navy); font-weight: 700; }
.login-card .sub { color: var(--muted); margin: 4px 0 24px; font-size: .9rem; }
.login-card form { text-align: left; display: grid; gap: 14px; }
.login-err { background: #fdecec; color: var(--red); border-radius: 10px; padding: 10px 12px; font-size: .86rem; font-weight: 500; }
.login-foot { margin-top: 18px; font-size: .8rem; }
.login-foot a { color: var(--blue-d); text-decoration: none; font-weight: 600; }

/* ---------- campos ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field > label, .lbl { font-weight: 600; font-size: .82rem; color: var(--navy); }
.hint { color: var(--muted); font-size: .78rem; font-weight: 400; }
input[type=text], input[type=password], input[type=url], input[type=number], input[type=email], textarea, select {
  width: 100%; font: inherit; color: var(--text); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 147, 253, .14); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: .85rem; color: var(--navy); cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch i { width: 40px; height: 22px; border-radius: 99px; background: #c5d1df; position: relative; transition: .2s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { left: 21px; }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid transparent; background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 99px; font-weight: 600; font-size: .86rem; transition: transform .12s, background .15s, box-shadow .15s; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--navy3); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.gold { background: var(--gold); color: var(--navy2); box-shadow: 0 6px 16px rgba(255, 199, 0, .35); }
.btn.gold:hover { background: #ffd433; }
.btn.blue { background: var(--blue); }
.btn.blue:hover { background: var(--blue-d); }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn.ghost:hover { background: var(--sky2); border-color: var(--blue); }
.btn.danger { background: #fff; color: var(--red); border-color: #f2c9c9; }
.btn.danger:hover { background: #fdecec; }
.btn.sm { padding: 7px 13px; font-size: .78rem; }
.btn.block { width: 100%; padding: 12px; }
.btn svg { width: 17px; height: 17px; flex: none; }
.icon-btn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--navy); display: inline-grid; place-items: center; padding: 0; transition: .12s; }
.icon-btn:hover:not(:disabled) { background: var(--sky); border-color: var(--blue); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.danger { color: var(--red); }
.icon-btn.danger:hover:not(:disabled) { background: #fdecec; border-color: #f2c9c9; }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100%; }
.side { background: linear-gradient(180deg, var(--navy2), var(--navy)); color: #cfe0f5; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 40; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-brand img { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 12px; padding: 4px; }
.side-brand b { display: block; color: #fff; font-size: 1rem; line-height: 1.15; }
.side-brand small { color: var(--gold); font-weight: 600; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.nav { flex: 1; overflow-y: auto; padding: 10px 12px 16px; }
.nav::-webkit-scrollbar { width: 6px; } .nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 9px; }
.nav-group { margin-top: 14px; }
.nav-group > span { display: block; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: #7f9cc4; font-weight: 700; padding: 6px 12px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0; border-radius: 11px; color: #cfe0f5; text-decoration: none; font-weight: 500; font-size: .88rem; transition: background .15s, color .15s; cursor: pointer; }
.nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: var(--gold); color: var(--navy2); font-weight: 700; box-shadow: 0 6px 18px rgba(255,199,0,.25); }
.nav a.active svg { opacity: 1; }
.side-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; text-transform: uppercase; flex: none; }
.side-foot div { min-width: 0; flex: 1; }
.side-foot b { display: block; color: #fff; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot small { color: #7f9cc4; font-size: .72rem; }
.side-foot button { background: rgba(255,255,255,.08); border: 0; color: #fff; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.side-foot button:hover { background: rgba(255,255,255,.18); }
.side-foot button svg { width: 17px; height: 17px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(241,245,250,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 14px 32px; }
.burger { display: none; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: #fff; place-items: center; }
.burger svg { width: 20px; height: 20px; }
.topbar h1 { font-size: 1.25rem; color: var(--navy); font-weight: 700; }
.topbar .crumb { color: var(--muted); font-size: .78rem; }
.topbar .grow { flex: 1; min-width: 0; }
.save-state { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.save-state i { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.save-state.dirty { color: #b45f06; font-weight: 600; }
.save-state.dirty i { background: var(--gold-d); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.content { padding: 28px 32px 90px; max-width: 1180px; width: 100%; margin: 0 auto; }
.page-desc { color: var(--muted); margin-bottom: 22px; max-width: 760px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 22px; }
.card > h3 { font-size: 1.02rem; color: var(--navy); margin-bottom: 4px; }
.card > .sub { color: var(--muted); font-size: .82rem; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head h3 { font-size: 1.02rem; color: var(--navy); }
.card-head .sub { color: var(--muted); font-size: .82rem; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--radius); background: var(--sky2); }

/* ---------- dashboard ---------- */
.hello { background: linear-gradient(135deg, var(--navy) 0, var(--blue-d) 100%); color: #fff; border-radius: 22px; padding: 30px 32px; margin-bottom: 22px; position: relative; overflow: hidden; }
.hello::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,199,0,.18); }
.hello h2 { font-size: 1.5rem; margin-bottom: 6px; position: relative; }
.hello p { color: #d4e6fb; max-width: 560px; position: relative; }
.hello .btn { margin-top: 18px; position: relative; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); cursor: pointer; transition: .15s; text-align: left; }
.stat:hover { transform: translateY(-3px); border-color: var(--blue); }
.stat svg { width: 24px; height: 24px; color: var(--blue); margin-bottom: 10px; }
.stat b { display: block; font-size: 1.8rem; color: var(--navy); line-height: 1; }
.stat span { color: var(--muted); font-size: .82rem; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.quick button { display: flex; gap: 14px; align-items: center; text-align: left; background: var(--sky2); border: 1px solid var(--sky); border-radius: 14px; padding: 14px 16px; color: var(--navy); transition: .15s; }
.quick button:hover { border-color: var(--blue); background: #fff; }
.quick svg { width: 26px; height: 26px; color: var(--blue); flex: none; }
.quick b { display: block; font-size: .9rem; }
.quick small { color: var(--muted); }

/* ---------- listas / cartões ---------- */
.lcard { border: 1.5px solid var(--line); border-radius: 14px; background: #fff; margin-bottom: 16px; overflow: hidden; }
.lcard-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--sky2); border-bottom: 1px solid var(--line); }
.lcard-num { width: 26px; height: 26px; border-radius: 8px; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: .75rem; font-weight: 700; flex: none; }
.lcard-head strong { flex: 1; min-width: 0; color: var(--navy); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcard-tools { display: flex; gap: 6px; align-items: center; }
.lcard-body { padding: 16px; }
.lcard-body .field:last-child { margin-bottom: 0; }
.lcard.off { opacity: .6; }
.row2 { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
@media (max-width: 760px) { .row2 { grid-template-columns: 1fr; } }
.str-row { display: flex; gap: 10px; margin-bottom: 10px; align-items: flex-start; }
.str-row textarea, .str-row input { flex: 1; }
.str-row textarea { min-height: 70px; }

/* campo de imagem */
.imgf { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.imgf-prev { width: 150px; height: 100px; border-radius: 12px; background: var(--sky2); border: 1.5px dashed #b7c8dc; overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: .76rem; flex: none; }
.imgf-prev img { width: 100%; height: 100%; object-fit: cover; }
.imgf-prev.contain img { object-fit: contain; padding: 8px; }
.imgf-prev.tall { width: 112px; height: 150px; }
.imgf-prev.sq { width: 110px; height: 110px; }
.imgf-prev.empty { border-style: dashed; }
.imgf-btns { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* grade de fotos da galeria */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.pcard { border: 1.5px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; display: flex; flex-direction: column; }
.pcard .thumb { aspect-ratio: 4 / 3; background: #0b1c33; position: relative; }
.pcard .thumb img, .pcard .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard .thumb video { object-fit: contain; }
.pcard .badge { position: absolute; left: 8px; top: 8px; background: rgba(3,28,63,.8); color: #fff; border-radius: 99px; font-size: .68rem; padding: 3px 9px; font-weight: 600; }
.pcard .tools { position: absolute; right: 8px; top: 8px; gap: 5px; }
.pcard .tools .icon-btn { width: 30px; height: 30px; background: rgba(255,255,255,.95); }
.pcard .body { padding: 10px 12px 12px; display: grid; gap: 8px; }
.pcard .body input { padding: 8px 10px; font-size: .84rem; }
.pcard .body .btn { width: 100%; }

/* chips de valores */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.chip { display: flex; align-items: center; gap: 4px; background: var(--sky2); border: 1.5px solid var(--line); border-radius: 12px; padding: 4px 4px 4px 12px; }
.chip span { font-weight: 600; color: var(--navy); }
.chip input { width: 78px; border: 0; background: transparent; padding: 6px 4px; box-shadow: none !important; font-weight: 700; color: var(--navy); }

/* biblioteca */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.mtile { border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; text-align: left; padding: 0; position: relative; transition: .12s; }
.mtile:hover { border-color: var(--blue); }
.mtile.sel { border-color: var(--gold-d); box-shadow: 0 0 0 3px rgba(255,199,0,.4); }
.mtile .th { aspect-ratio: 1; background: #0b1c33; display: block; }
.mtile .th img, .mtile .th video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.mtile .nm { display: block; padding: 7px 9px; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtile .tick { position: absolute; right: 7px; top: 7px; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: var(--navy2); display: none; place-items: center; font-weight: 800; font-size: .8rem; }
.mtile.sel .tick { display: grid; }
.mtile .vb { position: absolute; left: 7px; top: 7px; background: rgba(3,28,63,.8); color: #fff; font-size: .64rem; padding: 2px 8px; border-radius: 99px; }
.mtile .del { position: absolute; right: 6px; bottom: 30px; }

/* modal */
.mback { position: fixed; inset: 0; background: rgba(3,28,63,.62); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 18px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 860px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal.sm { max-width: 460px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { color: var(--navy); font-size: 1.1rem; }
.tabs { display: flex; gap: 6px; padding: 10px 22px 0; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; font-size: .87rem; }
.tabs button.active { color: var(--navy); border-bottom-color: var(--gold); }
.modal-body { padding: 22px; overflow: auto; flex: 1; min-height: 280px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--sky2); }
.modal-foot .grow { flex: 1; color: var(--muted); font-size: .84rem; }
.drop { border: 2.5px dashed #9db8d6; border-radius: 18px; background: var(--sky2); text-align: center; padding: 44px 20px; transition: .15s; }
.drop.over { border-color: var(--blue); background: var(--sky); }
.drop svg { width: 46px; height: 46px; color: var(--blue); margin: 0 auto 10px; }
.drop b { display: block; color: var(--navy); font-size: 1.02rem; }
.drop p { color: var(--muted); margin: 4px 0 16px; font-size: .84rem; }
.uplist { margin-top: 18px; display: grid; gap: 8px; }
.up { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: .82rem; align-items: center; }
.up .bar { grid-column: 1 / -1; height: 6px; background: var(--line); border-radius: 9px; overflow: hidden; }
.up .bar i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .15s; }
.up.ok .bar i { background: var(--green); } .up.err .bar i { background: var(--red); width: 100% !important; }
.up.err small { color: var(--red); }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 10px; }
.toast { background: var(--navy2); color: #fff; padding: 13px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 500; font-size: .88rem; display: flex; gap: 10px; align-items: center; animation: slide .25s; max-width: 380px; }
.toast.ok { border-left: 5px solid var(--green); } .toast.err { border-left: 5px solid var(--red); } .toast.info { border-left: 5px solid var(--gold); }
@keyframes slide { from { transform: translateY(14px); opacity: 0; } }

.bk { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .86rem; }
.bk:last-child { border: 0; }
.note { background: #fff8de; border: 1px solid #f5e1a0; color: #6f5400; padding: 12px 14px; border-radius: 12px; font-size: .84rem; margin-bottom: 18px; }
.note.blue { background: var(--sky2); border-color: var(--sky); color: var(--navy); }

/* ---------- responsivo ---------- */
.scrim { display: none; }
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 290px; transform: translateX(-100%); transition: transform .25s; }
  body.menu-open .side { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(3,28,63,.5); z-index: 35; }
  .burger { display: grid; }
  .topbar { padding: 12px 16px; }
  .content { padding: 20px 16px 90px; }
  .save-state span { display: none; }
}
