/* ============================================================
   SEO Command Center — Panel Admin CSS
   Tema: Dark industrial / utilitarian
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg:          #0d0f12;
  --bg-2:        #141720;
  --bg-3:        #1c2030;
  --bg-4:        #242840;
  --border:      #2a2f45;
  --border-2:    #343a52;
  --text:        #e8eaf0;
  --text-2:      #9499b0;
  --text-3:      #5a6080;
  --accent:      #4f7cff;
  --accent-2:    #7a9fff;
  --accent-glow: rgba(79,124,255,.15);
  --green:       #2dce7c;
  --green-bg:    rgba(45,206,124,.1);
  --yellow:      #f4c542;
  --yellow-bg:   rgba(244,197,66,.1);
  --red:         #ff4f6a;
  --red-bg:      rgba(255,79,106,.1);
  --orange:      #ff8c42;

  --radius:      6px;
  --radius-lg:   10px;
  --shadow:      0 4px 24px rgba(0,0,0,.4);
  --font:        'IBM Plex Sans', sans-serif;
  --mono:        'IBM Plex Mono', monospace;
  --sidebar-w:   240px;
  --header-h:    56px;
  --transition:  .15s ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; display: flex; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--text); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── Layout ────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; width: 100%; }

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  top: 0; left: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar__logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
}

.sidebar__logo-icon {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.sidebar__logo-icon svg { width: 16px; height: 16px; fill: #fff; }

.sidebar__nav { padding: 8px 0; flex: 1; }

.sidebar__section {
  padding: 16px 12px 4px;
  font-size: .65rem;
  font-family: var(--mono);
  color: var(--text-3);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: var(--text-2);
  font-size: .875rem;
  transition: background var(--transition), color var(--transition);
  border-radius: 0;
  position: relative;
}

.sidebar__link:hover {
  background: var(--bg-3);
  color: var(--text);
}

.sidebar__link.active {
  background: var(--accent-glow);
  color: var(--accent-2);
  border-left: 2px solid var(--accent);
  padding-left: 14px;
}

.sidebar__link svg { width: 16px; height: 16px; opacity: .7; flex-shrink: 0; }
.sidebar__link.active svg { opacity: 1; }

.sidebar__badge {
  margin-left: auto;
  background: var(--bg-4);
  color: var(--text-3);
  font-size: .65rem;
  font-family: var(--mono);
  padding: 2px 6px;
  border-radius: 3px;
}

.sidebar__footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .8rem;
  color: var(--text-3);
}

.sidebar__avatar {
  width: 28px; height: 28px;
  background: var(--bg-4);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-2);
  flex-shrink: 0;
}

/* ── Main ──────────────────────────────────────────────────── */
.main { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar__title { font-size: .95rem; font-weight: 500; flex: 1; }
.topbar__breadcrumb { font-size: .8rem; color: var(--text-3); font-family: var(--mono); }
.topbar__breadcrumb span { color: var(--text-2); }

/* ── Content ───────────────────────────────────────────────── */
.content { padding: 28px; flex: 1; max-width: 1400px; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card__title { font-size: .9rem; font-weight: 500; }
.card__body  { padding: 20px; }

/* ── Stats grid ────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }

.stat {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.stat--blue::before  { background: var(--accent); }
.stat--green::before { background: var(--green); }
.stat--yellow::before{ background: var(--yellow); }
.stat--red::before   { background: var(--red); }

.stat__label { font-size: .72rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; font-family: var(--mono); margin-bottom: 8px; }
.stat__value { font-size: 2rem; font-weight: 300; letter-spacing: -.02em; line-height: 1; }
.stat__sub   { font-size: .75rem; color: var(--text-3); margin-top: 6px; }

/* ── Table ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: .85rem; }

thead th {
  text-align: left;
  padding: 10px 16px;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-family: var(--mono);
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-3); }

td.text--main { color: var(--text); font-weight: 500; }
td code { font-family: var(--mono); font-size: .8rem; color: var(--accent-2); background: var(--bg-4); padding: 2px 6px; border-radius: 3px; }

/* ── Badges / Status ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: .7rem;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: .05em;
}

.badge--green  { background: var(--green-bg);  color: var(--green); }
.badge--yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge--red    { background: var(--red-bg);    color: var(--red); }
.badge--blue   { background: var(--accent-glow); color: var(--accent-2); }
.badge--gray   { background: var(--bg-4); color: var(--text-3); }

.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: .84rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn svg { width: 15px; height: 15px; }

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: #6b93ff; color: #fff; }

.btn--ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border-2);
}
.btn--ghost:hover { background: var(--bg-3); color: var(--text); }

.btn--danger {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red-bg);
}
.btn--danger:hover { background: var(--red-bg); }

.btn--green {
  background: var(--green);
  color: #0d1a12;
}
.btn--green:hover { opacity: .9; }

.btn--sm { padding: 5px 10px; font-size: .78rem; }
.btn--icon { padding: 7px; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.form-full  { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field--row { flex-direction: row; align-items: center; gap: 10px; }

label {
  font-size: .75rem;
  font-family: var(--mono);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.input, .select, .textarea {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 12px;
  font-size: .875rem;
  transition: border-color var(--transition);
  width: 100%;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.textarea { resize: vertical; min-height: 120px; font-family: inherit; }
.input--mono { font-family: var(--mono); font-size: .82rem; }

.field__hint  { font-size: .72rem; color: var(--text-3); }
.field__error { font-size: .72rem; color: var(--red); }

.char-counter { font-size: .7rem; font-family: var(--mono); color: var(--text-3); text-align: right; }
.char-counter.warn { color: var(--yellow); }
.char-counter.over { color: var(--red); }

/* ── Section titles ────────────────────────────────────────── */
.section-title {
  font-size: .68rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--text-3);
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

/* ── Page header ───────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-header__title { font-size: 1.3rem; font-weight: 300; }
.page-header__title strong { font-weight: 600; }
.page-header__actions { display: flex; gap: 10px; }

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .85rem;
  border: 1px solid;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert--success { background: var(--green-bg);  border-color: var(--green);  color: var(--green); }
.alert--error   { background: var(--red-bg);    border-color: var(--red);    color: var(--red); }
.alert--warning { background: var(--yellow-bg); border-color: var(--yellow); color: var(--yellow); }
.alert--info    { background: var(--accent-glow); border-color: var(--accent); color: var(--accent-2); }

/* ── Editor específico ──────────────────────────────────────── */
.editor-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }

.editor-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.editor-panel__header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  font-family: var(--mono);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.editor-panel__body { padding: 16px; }

/* Textarea de contenido grande */
.content-editor {
  font-family: var(--mono);
  font-size: .82rem;
  min-height: 400px;
  line-height: 1.6;
}

/* AI Generate button */
.btn--ai {
  background: linear-gradient(135deg, #4f7cff 0%, #7c4fff 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.btn--ai::before {
  content: '✦';
  font-size: .75rem;
}
.btn--ai:hover { opacity: .9; }

/* FAQ rows */
.faq-row {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}

.faq-row__q { margin-bottom: 8px; }

/* ── Login ──────────────────────────────────────────────────── */
.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(79,124,255,.05) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(124,79,255,.05) 0%, transparent 60%);
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
}

.login-box__logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-box__icon {
  width: 52px; height: 52px;
  background: var(--accent);
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  box-shadow: 0 8px 32px rgba(79,124,255,.3);
}

.login-box__title { font-size: 1.1rem; font-weight: 500; text-align: center; margin-bottom: 4px; }
.login-box__sub   { font-size: .8rem; color: var(--text-3); text-align: center; font-family: var(--mono); }

.login-form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }

/* ── Dashboard specifics ────────────────────────────────────── */
.websites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.website-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--transition);
}

.website-card:hover { border-color: var(--border-2); }

.website-card__name { font-weight: 500; font-size: .95rem; }
.website-card__domain { font-family: var(--mono); font-size: .78rem; color: var(--accent-2); }
.website-card__meta { font-size: .78rem; color: var(--text-3); display: flex; gap: 12px; }
.website-card__actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }

/* ── Utility ────────────────────────────────────────────────── */
.flex   { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.text-muted  { color: var(--text-3); }
.text-small  { font-size: .8rem; }
.text-mono   { font-family: var(--mono); }
.text-right  { text-align: right; }
.hidden { display: none; }

/* Spinner */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
  .editor-layout { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
