/* Painel administrativo - SUA RÁDIO FM */
:root {
  --bg: #050505; --panel: #0d0d0d; --panel-2: #171717; --line: #232323;
  --text: #f5f5f5; --muted: #a5a5a5; --red: #ff3027; --red-dark: #ff5a20;
  --grad: linear-gradient(120deg, #273cff 0%, #6a1bff 38%, #e600ff 72%, #ff3027 100%);
  --font-head: "Inter", Arial, sans-serif; --font-body: "Inter", "Segoe UI", Arial, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 14.5px; line-height: 1.6; }
h1,h2,h3,h4 { font-family: var(--font-head); font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- login ---------- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 30px;
  background:
    radial-gradient(760px 480px at 18% 12%, rgba(39, 60, 255, 0.5), transparent 60%),
    radial-gradient(700px 460px at 85% 85%, rgba(255, 48, 39, 0.4), transparent 60%),
    #050505;
}
.login__box { width: 100%; max-width: 400px; background: rgba(13, 13, 13, 0.92); border: 1px solid var(--line); border-radius: 6px; padding: 34px; backdrop-filter: blur(10px); box-shadow: 0 30px 70px rgba(0,0,0,.6); }
.login__logo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 22px; justify-content: center; margin-bottom: 6px; text-transform: uppercase; letter-spacing: -0.04em; }
.login__logo .m { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-size: 13px; }
.login h1 { font-size: 20px; text-align: center; margin: 14px 0 4px; }
.login p.hint { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; background: #050505; border: 1px solid var(--line); border-radius: 4px;
  padding: 12px 14px; color: var(--text); outline: none; transition: 240ms ease; font-size: 14px;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 48, 39, 0.16); }
.field textarea { min-height: 110px; resize: vertical; }
.logo-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.logo-tools input[type="file"] { font-size: 12.5px; color: var(--muted); max-width: 240px; }
.logo-tools .muted { font-size: 12.5px; }
.logo-preview { display: flex; align-items: center; gap: 14px; margin-top: 14px; min-height: 54px; }
.logo-preview img { height: 52px; width: auto; max-width: 260px; object-fit: contain; background: #050505; border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; }
.logo-preview .muted { font-size: 12.5px; }
.field input[type="checkbox"] { width: auto; accent-color: var(--red); }

/* olho da senha: mostra/esconde o que foi digitado (login, troca de senha, chave da CDN) */
.pwd-wrap { position: relative; }
.pwd-wrap input { width: 100%; padding-right: 42px; }
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 6px; color: var(--muted); cursor: pointer;
}
.pwd-eye:hover, .pwd-eye:focus-visible { color: var(--text); background: rgba(255,255,255,.07); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; background: var(--red); color: #fff; border: 0; cursor: pointer;
  font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; padding: 12px 22px; border-radius: 999px; transition: 240ms ease;
}
.btn:hover { background: var(--red-dark); transform: translateY(-2px); }
.btn--ghost { background: #131313; border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--panel-2); border-color: var(--red); }
.btn--sm { padding: 8px 15px; font-size: 11.5px; }
.btn--danger { background: transparent; border: 1px solid rgba(255,48,39,.5); color: var(--red); }
.btn--danger:hover { background: var(--red); color: #fff; }
.btn--block { width: 100%; justify-content: center; }
.msg { margin-top: 14px; font-size: 13px; padding: 10px 13px; border-radius: 4px; display: none; }
.msg.ok { display: block; background: rgba(46,204,113,.12); border: 1px solid rgba(46,204,113,.4); color: #7ee9b1; }
.msg.err { display: block; background: rgba(255,48,39,.1); border: 1px solid rgba(255,48,39,.4); color: #ff8b85; }
.login__back { display: block; text-align: center; margin-top: 18px; color: var(--muted); font-size: 13px; }
.login__back:hover { color: var(--red); }

/* ---------- layout painel ---------- */
.app { display: grid; grid-template-columns: 246px 1fr; min-height: 100vh; }
.side { background: #0a0a0a; border-right: 1px solid var(--line); padding: 22px 14px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; }
.side__logo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 19px; padding: 0 8px 20px; border-bottom: 1px solid var(--line); margin-bottom: 16px; text-transform: uppercase; letter-spacing: -0.04em; flex: 0 0 auto; }
.side__logo .m { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-size: 12px; }
/* logo em imagem (logomarca escolhida em Configurações) */
.login__logo img, .side__logo img, .brand-img { width: auto; object-fit: contain; display: block; }
.login__logo img[hidden], .side__logo img[hidden], .brand-img[hidden] { display: none; }
.login__logo img { height: 35px; max-width: 202px; }   /* = caixa da logo em texto no login (202 × 35) */
.side__logo img { height: 30px; max-width: 178px; }    /* = caixa da logo em texto na barra lateral (178 × 30) */
.side nav { display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; }
.side nav button {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: transparent; border: 0;
  color: var(--muted); padding: 11px 13px; border-radius: 4px; cursor: pointer; font-size: 13.5px; font-weight: 600; transition: 240ms ease;
}
.side nav button:hover { background: var(--panel-2); color: #fff; }
.side nav button.on { background: linear-gradient(120deg, rgba(255,48,39,.95), rgba(230,0,255,.75)); color: #fff; }
.side nav .badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 1px 8px; }
/* rodapé do menu: em fluxo normal (não sobrepõe os itens quando a lista cresce) e
   encosta no fundo quando há espaço (margin-top: auto) */
.side__out { position: static; flex: 0 0 auto; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 18px 26px; border-bottom: 1px solid var(--line); background: rgba(5,5,5,.9); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); }
.topbar h1 { font-size: 19px; text-transform: uppercase; }
.topbar .user { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.content { padding: 26px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 26px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 20px; transition: 240ms ease; }
.card:hover { border-color: rgba(255,48,39,.5); transform: translateY(-3px); }
.card b { display: block; font-size: 30px; background: linear-gradient(120deg, #ff3027, #ff5a20); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel__head h2 { font-size: 16px; text-transform: uppercase; }
.panel__body { padding: 20px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
th { color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
tr:hover td { background: rgba(255,255,255,.02); }
td img { width: 54px; height: 40px; object-fit: cover; border-radius: 3px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.pill { display: inline-block; background: rgba(255,48,39,.14); color: var(--red); border: 1px solid rgba(255,48,39,.4); font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.pill--green { background: rgba(46,204,113,.12); border-color: rgba(46,204,113,.4); color: #7ee9b1; }
.pill--gray { background: rgba(255,255,255,.06); border-color: var(--line); color: var(--muted); }

/* ---------- modal editor ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.78); display: none; place-items: center; padding: 24px; z-index: 60; }
.modal.open { display: grid; }
.modal__box { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; width: 100%; max-width: 640px; max-height: 88vh; overflow: auto; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.modal__head h3 { font-size: 17px; text-transform: uppercase; }
.modal__body { padding: 22px; }
.modal__foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 22px 22px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.close { background: #131313; border: 1px solid var(--line); color: var(--muted); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.close:hover { color: #fff; border-color: var(--red); }

.toast { position: fixed; right: 22px; bottom: 22px; background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--red); padding: 14px 18px; border-radius: 4px; font-size: 13.5px; z-index: 90; transform: translateY(120px); opacity: 0; transition: .3s; }
.toast.show { transform: translateY(0); opacity: 1; }

.msg-item { border: 1px solid var(--line); border-radius: 4px; padding: 16px 18px; margin-bottom: 12px; background: var(--panel); }
.msg-item.unread { border-left: 4px solid var(--red); }
.msg-item h4 { font-size: 15px; }
.msg-item .meta { color: var(--muted); font-size: 12.5px; margin: 4px 0 8px; }
.msg-item p { color: #d5d5d5; font-size: 14px; }
.msg-item .actions { justify-content: flex-start; margin-top: 12px; }

/* cores básicas (Configurações) */
.cores { display: flex; flex-wrap: wrap; gap: 16px 20px; align-items: center; margin: 6px 0 4px; }
.cor { display: grid; justify-items: center; gap: 5px; text-align: center; }
.cor input[type="color"] { width: 48px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); cursor: pointer; }
.cor input[type="color"]:hover { border-color: var(--red); }
.cor input[type="color"]:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.cor b { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }
.cor small { font-size: 11px; color: var(--muted); max-width: 96px; line-height: 1.35; }
.cores .btn { align-self: center; }
.check-row { display: flex; gap: 9px; align-items: center; text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--text); }
.check-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--red); }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side__out { position: static; margin-top: 14px; }
  .row2 { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
}
