/* Panel de gestión */
:root {
  --p-bg: #0a0a0f;
  --p-card: #14141d;
  --p-line: #262633;
  --p-text: #f2f2f6;
  --p-muted: #9595a8;
  --p-accent: #c6ff3f;
  --p-hot: #ff4d6d;
  --p-ok: #38d996;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--p-bg);
  color: var(--p-text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100dvh;
  padding-bottom: calc(62px + env(safe-area-inset-bottom));
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

.panel-shell { display: flex; min-height: 100dvh; }
.panel-side {
  width: 238px; flex: none; position: sticky; top: 0; height: 100dvh;
  background: #0d0d13; border-right: 1px solid var(--p-line);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 4px;
}
.panel-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; padding: 6px 8px 18px; }
.panel-brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--p-accent); color: #10160a; display: grid; place-items: center; font-weight: 900; }
.panel-brand small { display: block; color: var(--p-muted); font-weight: 600; font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; }

.panel-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 11px; border-radius: 10px; color: var(--p-muted); font-weight: 600; font-size: .9rem;
}
.panel-link svg { width: 18px; height: 18px; flex: none; }
.panel-link:hover { background: #16161f; color: var(--p-text); }
.panel-link.is-active { background: rgba(198, 255, 63, .1); color: var(--p-accent); }
.panel-side .grow { flex: 1; }
.panel-main { flex: 1; min-width: 0; }
.panel-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; background: rgba(10, 10, 15, .9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--p-line);
}
.panel-top h1 { font-size: 1.05rem; margin: 0; letter-spacing: -.01em; }
.panel-content { padding: 18px; max-width: 1100px; }

.cards-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--p-card); border: 1px solid var(--p-line); border-radius: 14px; padding: 14px; }
.stat .n { font-size: 1.6rem; font-weight: 900; letter-spacing: -.03em; }
.stat .l { color: var(--p-muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.stat.accent .n { color: var(--p-accent); }

.box { background: var(--p-card); border: 1px solid var(--p-line); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.box h2 { margin: 0 0 12px; font-size: .95rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--p-line); font-size: .84rem; vertical-align: middle; }
th { color: var(--p-muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }

.thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: #0f0f16; }

.status { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.status-published { background: rgba(56, 217, 150, .14); color: var(--p-ok); }
.status-draft { background: rgba(255, 176, 32, .14); color: #ffc45c; }
.status-rejected { background: rgba(255, 77, 109, .14); color: #ff93a6; }
.status-expired { background: #22222e; color: var(--p-muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--p-accent); color: #10160a; border: 0; border-radius: 10px;
  padding: 9px 14px; font-weight: 800; cursor: pointer; font-size: .85rem;
}
.btn:hover { filter: brightness(1.07); }
.btn-ghost { background: var(--p-card); color: var(--p-text); border: 1px solid var(--p-line); }
.btn-danger { background: var(--p-hot); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: .76rem; border-radius: 8px; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

label { display: block; font-size: .78rem; font-weight: 700; color: var(--p-muted); margin-bottom: 5px; }
.input, textarea.input, select.input {
  width: 100%; background: #0e0e15; border: 1px solid var(--p-line); border-radius: 9px;
  padding: 9px 11px; outline: 0;
}
.input:focus { border-color: var(--p-accent); }
textarea.input { min-height: 120px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.help { color: var(--p-muted); font-size: .74rem; margin-top: 4px; }

.flashes { position: fixed; top: 64px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: 340px; }
.flash { padding: 10px 13px; border-radius: 10px; background: #1b1b26; border: 1px solid var(--p-line); font-size: .84rem; }
.flash-success { border-color: rgba(56, 217, 150, .5); color: #b6ffe0; }
.flash-error { border-color: rgba(255, 77, 109, .5); color: #ffc2cc; }

.log {
  background: #08080c; border: 1px solid var(--p-line); border-radius: 10px;
  padding: 12px; font-family: ui-monospace, Menlo, monospace; font-size: .74rem;
  max-height: 380px; overflow: auto; white-space: pre-wrap; color: #b9b9c8;
}

.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--p-card); border: 1px solid var(--p-line); border-radius: 18px; padding: 26px; }
.login-card h1 { font-size: 1.2rem; margin: 0 0 4px; }
.login-card p { color: var(--p-muted); margin: 0 0 18px; font-size: .85rem; }

.panel-bottom { display: none; }

@media (max-width: 860px) {
  .panel-side { display: none; }
  .panel-content { padding: 14px 12px; }
  .panel-bottom {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(62px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    display: flex; background: #0d0d13ee; backdrop-filter: blur(14px); border-top: 1px solid var(--p-line);
  }
  .panel-bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--p-muted); font-size: .62rem; font-weight: 700; }
  .panel-bottom a.is-active { color: var(--p-accent); }
  .panel-bottom svg { width: 21px; height: 21px; }
  .form-grid { grid-template-columns: 1fr; }
  table .hide-m { display: none; }
}
