/* ═══ DANIA Ads — panel editorial ═══ */
:root {
  --paper: #faf6ee;
  --paper-2: #f3ecdf;
  --ink: #1b1712;
  --ink-60: rgba(27, 23, 18, .62);
  --ink-30: rgba(27, 23, 18, .30);
  --ink-12: rgba(27, 23, 18, .12);
  --flame: #ff4d00;
  --flame-soft: #ffe8dd;
  --ok: #1d7a4f;
  --ok-soft: #e3f2ea;
  --danger: #c0392b;
  --radius: 14px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Instrument Sans", -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 60% at 70% -10%, rgba(255, 77, 0, .06), transparent),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
}

[hidden] { display: none !important; }

.reveal { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.wordmark { font-family: var(--font-display); font-weight: 640; font-size: 1.4rem; letter-spacing: -.02em; }
.wordmark em { font-style: italic; font-weight: 380; color: var(--flame); }
.wordmark .flame { color: var(--flame); display: inline-block; animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── login ── */
.center-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.card {
  width: min(500px, 100%);
  background: #fffdf8;
  border: 1px solid var(--ink-12);
  border-radius: 22px;
  padding: 42px 40px;
  box-shadow: 0 30px 70px -30px rgba(27, 23, 18, .28);
}
.card .sub { color: var(--ink-60); margin: 12px 0 22px; line-height: 1.55; }

/* ── inputs / botones ── */
input {
  font: inherit; color: var(--ink);
  background: #fffdf8; border: 1.5px solid var(--ink-12);
  border-radius: 10px; padding: 11px 14px; width: 100%;
  transition: border-color .15s;
}
input:focus { outline: none; border-color: var(--flame); }
button { font: inherit; cursor: pointer; border: none; border-radius: 10px; transition: transform .12s, box-shadow .12s; }
button:active { transform: scale(.97); }
button:disabled { opacity: .55; cursor: wait; }
.btn-primary { background: var(--ink); color: var(--paper); padding: 11px 20px; font-weight: 600; }
.btn-primary:hover { box-shadow: 0 8px 20px -8px rgba(27, 23, 18, .5); }
.btn-flame { background: var(--flame); color: #fff; padding: 11px 20px; font-weight: 600; }
.btn-flame:hover { box-shadow: 0 8px 22px -6px rgba(255, 77, 0, .55); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink-12); padding: 9px 16px; font-weight: 500; }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { padding: 6px 12px; font-size: .82rem; }
.error { color: var(--danger); font-size: .9rem; margin-top: 10px; }

/* ── topbar ── */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 18px clamp(18px, 4vw, 44px);
  border-bottom: 1px solid var(--ink-12);
  background: rgba(250, 246, 238, .9);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.topbar .spacer { flex: 1; }
.user-chip { font-size: .82rem; color: var(--ink-60); }

/* ── layout ── */
.main { display: grid; grid-template-columns: 240px 1fr; gap: 28px; padding: 28px clamp(18px, 4vw, 44px) 60px; max-width: 1280px; margin: 0 auto; }

/* marcas (sidebar) */
.brands-panel h2 { font-family: var(--font-display); font-weight: 560; font-size: 1.1rem; margin-bottom: 12px; }
.brand-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: transparent; border: 1.5px solid transparent; border-radius: 12px;
  padding: 10px 12px; margin-bottom: 4px; font-weight: 500;
}
.brand-item:hover { background: var(--paper-2); }
.brand-item.on { background: #fffdf8; border-color: var(--ink-12); box-shadow: 0 6px 16px -10px rgba(27,23,18,.3); }
.brand-dot { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.brands-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

/* contenido de marca */
.brand-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.brand-title { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 480; letter-spacing: -.02em; }
.brand-sub { color: var(--ink-60); margin-bottom: 22px; }

.platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.platform-card {
  background: #fffdf8; border: 1px solid var(--ink-12); border-radius: var(--radius);
  padding: 18px;
  transition: transform .15s, box-shadow .15s;
}
.platform-card:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -16px rgba(27, 23, 18, .3); }
.platform-card .head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pdot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: .75rem; font-weight: 700; }
.platform-card .name { font-weight: 600; }
.status-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-top: 1px dashed var(--ink-12); font-size: .85rem; }
.badge { font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.off { background: var(--paper-2); color: var(--ink-60); }
.acct-line { font-size: .8rem; color: var(--ink-60); }

/* ad accounts */
.ad-acct {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--paper); border: 1px solid var(--ink-12); border-radius: 10px;
  padding: 9px 12px; margin-top: 8px; font-size: .85rem;
}
.ad-acct .id { color: var(--ink-60); font-size: .75rem; }
.ad-acct.default { border-color: var(--flame); background: var(--flame-soft); }

.section-title { font-family: var(--font-display); font-weight: 560; font-size: 1.2rem; margin: 26px 0 10px; }
.empty { color: var(--ink-60); font-size: .9rem; padding: 18px; border: 1.5px dashed var(--ink-12); border-radius: var(--radius); text-align: center; }

/* toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  padding: 12px 22px; border-radius: 999px; font-size: .9rem; font-weight: 500;
  z-index: 100; animation: rise .3s;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .5);
}
.toast.err { background: var(--danger); }

@media (max-width: 820px) {
  .main { grid-template-columns: 1fr; }
}
