:root {
  --bg: #050b18; --bg-2: #081226; --surface: #0c1830; --surface-2: #11203d;
  --line: rgba(148, 180, 230, .14); --line-strong: rgba(148, 180, 230, .28);
  --text: #eaf1fb; --muted: #92a4c3; --blue: #1f7fd0; --cyan: #2fb8f0; --red: #e2432b; --green: #3ddc97;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2 { font-family: 'Sora', system-ui, sans-serif; letter-spacing: -.02em; margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.muted { color: var(--muted); margin: 4px 0 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 999px; border: 1px solid transparent; font-weight: 600; white-space: nowrap; transition: transform .2s, background .2s, border-color .2s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn--primary { background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #fff; }
.btn--ghost { border-color: var(--line-strong); background: transparent; }
.btn--ghost:hover { border-color: var(--cyan); }
.btn--danger { border-color: rgba(226, 67, 43, .5); color: #ff9585; background: transparent; }
.btn--danger:hover { background: rgba(226, 67, 43, .12); }
.btn--sm { padding: 8px 14px; font-size: 13px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; font-size: 22px; line-height: 1; }

label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
input, textarea, select { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(5, 11, 24, .6); color: var(--text); font: inherit; }
input:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(47, 184, 240, .15); }
textarea { resize: vertical; }
.msg { margin: 0; font-size: 14px; min-height: 1.3em; color: #ff8a78; }
.msg.ok { color: var(--green); }

/* Login */
.login { min-height: 100svh; display: grid; place-items: center; padding: 16px; background: radial-gradient(60% 60% at 80% 0%, rgba(31, 127, 208, .25), transparent 70%), var(--bg); }
.login__card { width: min(400px, 100%); display: grid; gap: 16px; padding: 36px 30px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); }
.login__logo { height: 46px; width: auto; margin-bottom: 8px; }
.login__card h1 { font-size: 26px; }
.login__card p { margin: -8px 0 4px; color: var(--muted); }
.login__back { font-size: 14px; color: var(--muted); text-align: center; }
.login__back:hover { color: var(--text); }

/* App */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px clamp(16px, 4vw, 40px); background: rgba(5, 11, 24, .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar__logo { height: 36px; width: auto; }
.topbar__right { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.link { color: var(--muted); } .link:hover { color: var(--cyan); }
.user { color: var(--muted); }
@media (max-width: 560px) { .user, .link { display: none; } }
.wrap { width: min(1100px, 100% - 32px); margin: 0 auto; padding: 40px 0 80px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.head h1 { font-size: 32px; }

.list { display: grid; gap: 12px; }
.item { display: grid; grid-template-columns: 120px 1fr auto; gap: 18px; align-items: center; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.item__thumb { aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, var(--surface-2), var(--bg)); display: grid; place-items: center; font-family: 'Sora'; font-size: 13px; color: var(--muted); text-align: center; padding: 4px; }
.item__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.item h3 { margin: 0 0 4px; font-size: 17px; font-family: 'Sora'; }
.item__meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.pill { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.pill--on { border-color: rgba(61, 220, 151, .4); color: var(--green); }
.pill--off { border-color: rgba(226, 67, 43, .4); color: #ff9585; }
.pill--star { border-color: rgba(47, 184, 240, .4); color: var(--cyan); }
.item__actions { display: flex; gap: 8px; }
@media (max-width: 640px) {
  .item { grid-template-columns: 90px 1fr; }
  .item__actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(2, 6, 14, .7); backdrop-filter: blur(4px); }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(640px, 100%); display: flex; flex-direction: column; background: var(--bg-2); border-left: 1px solid var(--line); animation: slide .35s cubic-bezier(.2, .7, .2, 1); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer__head, .drawer__foot { display: flex; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.drawer__head { justify-content: space-between; }
.drawer__head h2 { font-size: 20px; }
.drawer__foot { border-top: 1px solid var(--line); border-bottom: 0; justify-content: flex-end; flex-wrap: wrap; }
.drawer__foot .msg { margin-right: auto; }
.drawer__body { flex: 1; overflow-y: auto; padding: 24px; display: grid; gap: 18px; align-content: start; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row--3 { grid-template-columns: auto auto 1fr; align-items: end; gap: 22px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); padding-bottom: 12px; }
.check input { width: 18px; height: 18px; accent-color: var(--cyan); }

.field { display: grid; gap: 10px; }
.field__label { font-size: 13px; font-weight: 500; color: var(--muted); }
.field__actions { display: flex; gap: 8px; }
.file-btn { display: inline-flex; color: var(--text); font-size: 13px; }
.cover { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 1px dashed var(--line-strong); display: grid; place-items: center; background: rgba(5, 11, 24, .5); }
.cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cover__empty { color: var(--muted); font-size: 13px; padding: 16px; text-align: center; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.gallery:empty { display: none; }
.thumb { position: relative; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); cursor: grab; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; pointer-events: none; }
.thumb.is-dragging { opacity: .4; }
.thumb.is-uploading::after { content: 'Enviando…'; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5, 11, 24, .7); font-size: 12px; }
.thumb__tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.thumb__tools button { width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(5, 11, 24, .85); font-size: 13px; line-height: 1; }
.thumb__tools button:hover { background: var(--red); }
.thumb__tools .mk-cover:hover { background: var(--blue); }
.thumb__n { position: absolute; left: 6px; bottom: 6px; font-size: 11px; padding: 2px 7px; border-radius: 6px; background: rgba(5, 11, 24, .85); }

.drop { display: grid; place-items: center; gap: 4px; padding: 26px; border-radius: 12px; border: 1.5px dashed var(--line-strong); text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.drop strong { color: var(--text); font-size: 14px; }
.drop span { font-size: 12px; }
.drop:hover, .drop.is-over { border-color: var(--cyan); background: rgba(47, 184, 240, .06); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 99; padding: 12px 20px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-strong); box-shadow: 0 20px 40px -20px #000; font-size: 14px; }
