/* ============================================================
   Grupo Astra · Panel privado (admin)
   Reusa tokens de styles.css (--ink, --accent, --line, etc.)
   ============================================================ */
body.admin { background: var(--bg); min-height: 100dvh; }

/* Topbar */
.ad-top {
  display: flex; align-items: center; gap: 16px;
  padding: 16px clamp(18px,4vw,40px);
  border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 20;
}
.ad-top .brand { color: var(--ink); font-size: 18px; }
.ad-top .brand span { display: inline; }
.ad-top .brand .a2 { color: var(--accent); margin-left: 4px; }
.ad-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.ad-top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.ad-user { font-size: 13px; color: var(--muted); }

/* Centered (login / no-config) */
.ad-center { min-height: calc(100dvh - 62px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.ad-card { background: var(--surface); border: 1px solid var(--line); width: min(420px, 100%); padding: clamp(28px,4vw,44px); }
.ad-card h1 { margin: 0 0 6px; font-size: clamp(24px,3vw,32px); font-weight: 400; letter-spacing: -0.03em; }
.ad-sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.ad-card code { background: #f0f0f0; padding: 1px 6px; font-size: 12px; }

/* Fields */
.ad-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; margin-bottom: 16px; }
.ad-field input, .ad-field select, .ad-field textarea {
  font: inherit; font-weight: 400; font-size: 15px; color: var(--ink);
  padding: 11px 13px; border: 1px solid var(--line); background: #fff; border-radius: 0;
  width: 100%; transition: border-color 0.2s var(--ease);
}
.ad-field input:focus, .ad-field select:focus, .ad-field textarea:focus { border-color: var(--accent); }
.ad-field input:focus-visible, .ad-field select:focus-visible, .ad-field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ad-field textarea { resize: vertical; }
.ad-loginform .btn { width: 100%; justify-content: center; margin-top: 4px; }

.ad-error { color: #9a2436; font-size: 13px; margin: 0 0 14px; }

/* Dashboard */
.ad-dash { max-width: 1000px; margin: 0 auto; padding: clamp(24px,4vw,48px) clamp(18px,4vw,40px) 80px; }
.ad-dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.ad-dash-head h1 { margin: 0; font-size: clamp(26px,3.4vw,40px); font-weight: 400; letter-spacing: -0.03em; }
.ad-list { display: flex; flex-direction: column; gap: 12px; }

.ad-row { display: grid; grid-template-columns: 84px 1fr auto; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); padding: 12px; }
.ad-row-thumb { width: 84px; height: 64px; object-fit: cover; background: #ececec; display: block; }
.ad-row-main h3 { margin: 0 0 3px; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.ad-row-meta { font-size: 12px; color: var(--faint); display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; }
.ad-badge { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 8px; border: 1px solid var(--line); }
.ad-badge.oculta { color: #9a2436; border-color: #d9b3b8; }
.ad-row-actions { display: flex; gap: 8px; }
.ad-btn-sm { font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; padding: 8px 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.ad-btn-sm:hover { border-color: rgba(20,20,20,0.25); }
.ad-btn-sm.danger { color: #9a2436; }
.ad-empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* Editor modal */
.ad-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: clamp(12px,3vw,40px); overflow: auto; }
.ad-modal-bd { position: fixed; inset: 0; background: rgba(10,16,13,0.55); }
.ad-form { position: relative; z-index: 1; background: var(--surface); width: min(720px, 100%); padding: clamp(22px,3vw,36px); border: 1px solid var(--line); margin: auto; }
.ad-form-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.ad-form-head h2 { margin: 0; font-size: clamp(20px,2.4vw,26px); font-weight: 400; letter-spacing: -0.02em; }
.ad-x { background: none; border: none; cursor: pointer; color: var(--ink); display: flex; padding: 6px; }
.ad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.ad-grid .col2 { grid-column: 1 / -1; }

.ad-photos { margin: 8px 0 4px; }
.ad-photos-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.ad-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.ad-thumb { position: relative; width: 96px; height: 72px; border: 1px solid var(--line); overflow: hidden; background: #ececec; }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad-thumb-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: none; background: rgba(10,16,13,0.72); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.ad-thumb-cover { position: absolute; bottom: 0; left: 0; right: 0; background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; text-align: center; padding: 2px; }
.ad-hint { font-size: 12px; color: var(--faint); margin: 6px 0 0; }

.ad-form-foot { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.btn[disabled], .btn-ghost[disabled] { opacity: 0.55; cursor: default; pointer-events: none; }

@media (max-width: 620px) {
  .ad-grid { grid-template-columns: 1fr; }
  .ad-grid .col2 { grid-column: auto; }
  .ad-row { grid-template-columns: 64px 1fr; }
  .ad-row-thumb { width: 64px; height: 52px; }
  .ad-row-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
