/* ═══════════════════════════════════════════════
   Guidev MX — Portfolio Design System
   Paleta: Blanco · Rojo #CC1517 · Café #332525
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Tokens ─────────────────────────────────────────────────────────────────── */
:root {
  /* Marca */
  --brand:        #CC1517;
  --brand-dark:   #a51012;
  --brand-light:  #e8393b;
  --brand-glow:   #CC151720;
  --brand-bg:     #CC151510;

  /* Superficies — blanco limpio */
  --bg:           #FFFFFF;
  --surface:      #F7F4F4;   /* blanco con toque café muy leve */
  --surface2:     #EDE8E8;
  --surface3:     #E0D8D8;

  /* Bordes */
  --border:       #E8E0E0;
  --border2:      #D4C8C8;
  --border3:      #C0B0B0;

  /* Texto */
  --text:         #332525;   /* café oscuro principal */
  --text-muted:   #6B5555;   /* café medio */
  --text-dim:     #9E8888;   /* café claro */
  --text-on-brand:#FFFFFF;

  /* Semánticos */
  --green:        #1a9e6a;
  --green-bg:     #1a9e6a12;
  --green-border: #1a9e6a30;
  --yellow:       #d97706;
  --red-err:      #dc2626;
  --red-err-bg:   #dc262612;

  /* Geometría */
  --radius:       12px;
  --radius-sm:    8px;
  --radius-xs:    6px;
  --shadow-sm:    0 1px 4px #33252515;
  --shadow:       0 4px 20px #33252520;
  --shadow-lg:    0 12px 48px #33252530;

  /* Tipografía */
  --font:         'Inter', system-ui, sans-serif;
}

/* ── Admin dark mode ─────────────────────────────────────────────────────────── */
/* Only applied when body has data-theme="dark" — scoped to admin panel */
[data-theme="dark"] {
  --bg:           #111010;
  --surface:      #1c1818;
  --surface2:     #252020;
  --surface3:     #302828;

  --border:       #3a2d2d;
  --border2:      #4d3b3b;
  --border3:      #614a4a;

  --text:         #ede0e0;
  --text-secondary: #ccb0b0;
  --text-muted:   #a88080;
  --text-dim:     #7a5a5a;

  --shadow-sm:    0 1px 4px #00000060;
  --shadow:       0 4px 20px #00000070;
  --shadow-lg:    0 12px 48px #00000085;

  color-scheme: dark;
}

/* Admin-specific dark overrides for hardcoded colors */
[data-theme="dark"] .sidebar { background: #0a0808; }
[data-theme="dark"] .login-wrap {
  background: linear-gradient(135deg, var(--bg) 0%, var(--surface) 100%);
}
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .form-group select {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border2);
}
[data-theme="dark"] .form-group input::placeholder,
[data-theme="dark"] .form-group textarea::placeholder {
  color: var(--text-dim);
}
[data-theme="dark"] .upload-zone {
  background: var(--surface2);
  border-color: var(--border2);
  color: var(--text-muted);
}
[data-theme="dark"] .upload-zone:hover {
  border-color: var(--brand);
  background: var(--surface3);
}
[data-theme="dark"] .adv-section,
[data-theme="dark"] .editor-essential {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .tag-pill {
  background: var(--surface3);
  color: var(--text);
  border-color: var(--border2);
}
[data-theme="dark"] .tag-suggest-drop {
  background: var(--surface2);
  border-color: var(--border2);
}
[data-theme="dark"] .tag-suggest-item:hover {
  background: var(--surface3);
}
[data-theme="dark"] .score-compact {
  border-color: var(--border);
}
[data-theme="dark"] .computed-score-display {
  background: var(--surface2);
}
[data-theme="dark"] .project-card,
[data-theme="dark"] .file-item,
[data-theme="dark"] .media-card {
  background: var(--surface2);
  border-color: var(--border);
}
[data-theme="dark"] .project-card:hover {
  border-color: var(--brand);
}
[data-theme="dark"] .btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border2);
}
[data-theme="dark"] .btn-secondary:hover {
  background: var(--surface3);
  border-color: var(--border3);
}
[data-theme="dark"] .top-bar,
[data-theme="dark"] .pane.active {
  background: var(--bg);
}
[data-theme="dark"] .tabs {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .tab-btn {
  color: var(--text-muted);
}
[data-theme="dark"] .tab-btn.active,
[data-theme="dark"] .tab-btn:hover {
  color: var(--text);
  background: var(--surface2);
}
[data-theme="dark"] .alert-success { background: #0d2e1e; border-color: #1a5c3a; color: #4ade80; }
[data-theme="dark"] .alert-error   { background: #2e0d0d; border-color: #5c1a1a; color: #f87171; }
[data-theme="dark"] .toast-success { background: #0d2e1e; color: #4ade80; }
[data-theme="dark"] .toast-error   { background: #2e0d0d; color: #f87171; }

/* ── Reset ───────────────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; }
img { display: block; }

/* ── Layout ──────────────────────────────────────────────────────────────────── */
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ── Header ──────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--brand);
  border-bottom: 3px solid var(--brand-dark);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px #CC151730;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.header-logo img {
  height: 36px; width: auto; display: block;
}
.header-logo-text {
  font-size: 22px; font-weight: 900; color: #fff;
  letter-spacing: -0.5px;
}
.header-logo-text em { font-style: normal; opacity: .7; }

.header-cta {
  background: #fff;
  color: var(--brand);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 2px 8px #00000020;
}
.header-cta:hover {
  background: var(--brand);
  color: #fff;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ── Hero ────────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--bg) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 64px 0 48px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-bg);
  border: 1px solid #CC151730;
  border-radius: 99px;
  padding: 6px 16px;
  font-size: 12px; font-weight: 600;
  color: var(--brand);
  margin-bottom: 24px;
  text-transform: uppercase; letter-spacing: .5px;
}
.hero-badge .dot {
  width: 7px; height: 7px;
  background: var(--brand);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .6; transform: scale(1.3); }
}
.hero h1 {
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 16px;
}
.hero h1 strong { color: var(--brand); }
.hero p {
  color: var(--text-muted);
  font-size: 18px;
  max-width: 500px;
  margin: 0 auto 32px;
  font-weight: 400;
}

/* ── Niche Filter ────────────────────────────────────────────────────────────── */
.niche-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0;
  position: sticky; top: 66px; z-index: 90;
  box-shadow: var(--shadow-sm);
}
.niche-list {
  display: flex; gap: 0; overflow-x: auto;
  scrollbar-width: none;
}
.niche-list::-webkit-scrollbar { display: none; }
.niche-btn {
  padding: 14px 20px;
  font-size: 13px; font-weight: 600;
  border: none; border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.niche-btn:hover { color: var(--text); border-bottom-color: var(--border2); }
.niche-sep {
  display: inline-block; width: 1px;
  background: var(--border2);
  margin: 10px 6px;
  flex-shrink: 0; align-self: stretch;
}
.niche-btn-industry { font-style: italic; }
.niche-btn-industry.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: var(--brand-bg);
  font-style: italic;
}
.niche-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: var(--brand-bg);
}

/* ── Stats bar ───────────────────────────────────────────────────────────────── */
.stats-bar {
  display: flex; gap: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.stat {
  flex: 1; text-align: center;
  padding: 20px 16px;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat-value { font-size: 26px; font-weight: 900; color: var(--brand); }
.stat-label {
  font-size: 11px; color: var(--text-dim);
  margin-top: 3px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600;
}

/* ── Section header ──────────────────────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 32px 0 20px;
}
.section-title {
  font-size: 12px; font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 1px;
}
.toggle-all {
  font-size: 13px; font-weight: 600;
  color: var(--brand); cursor: pointer;
  background: none; border: none;
  padding: 6px 14px; border-radius: var(--radius-xs);
  transition: background .15s;
}
.toggle-all:hover { background: var(--brand-bg); }

/* ── Grid ────────────────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  padding-bottom: 48px;
}

/* ── Card ────────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  cursor: pointer;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: 0 8px 32px #CC151715;
}
.card.featured {
  border-color: #CC151730;
  box-shadow: 0 0 0 1px #CC151720;
}

.card-thumb {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 40px;
  overflow: hidden; position: relative;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb-featured-badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: .5px;
}

.card-body { padding: 18px 20px; }
.card-meta {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px; flex-wrap: wrap;
}

/* Badges */
.badge {
  font-size: 10px; font-weight: 700;
  padding: 3px 9px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: .4px;
  white-space: nowrap;
}
.badge-featured { background: var(--brand-bg); color: var(--brand); border: 1px solid #CC151730; }
.badge-mrr      { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.badge-category { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }
.badge-hidden   { background: var(--red-err-bg); color: var(--red-err); }
.badge-score    { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }

.card h3 { font-size: 16px; font-weight: 800; margin-bottom: 6px; line-height: 1.3; color: var(--text); }
.card p.desc {
  font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.tag {
  font-size: 11px; padding: 3px 9px; border-radius: var(--radius-xs);
  background: var(--surface); color: var(--text-dim);
  border: 1px solid var(--border);
}

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; border-top: 1px solid var(--border); margin-top: 12px;
}
.score-block { display: flex; align-items: center; gap: 5px; }
.score-stars { color: var(--brand); font-size: 13px; }
.score-num { font-size: 14px; font-weight: 800; color: var(--text); }
.score-label { font-size: 11px; color: var(--text-dim); }
.card-value { font-size: 13px; color: var(--text-muted); }
.card-value strong { color: var(--green); font-weight: 700; }

/* ── Modal base ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: #33252580;
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 32px 16px; overflow-y: auto;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 16px;
  width: 100%; max-width: 860px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px); transition: transform .3s;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-close {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted); font-size: 16px;
  width: 34px; height: 34px; border-radius: var(--radius-xs);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-weight: 700; transition: all .15s;
}
.modal-close:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ── Modal Proyecto ──────────────────────────────────────────────────────────── */
.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-body { padding: 28px 32px; }

.modal-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 8px; margin-bottom: 24px;
}
.modal-gallery img {
  width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border);
  aspect-ratio: 16/9; object-fit: cover;
}

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.detail-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.detail-label {
  font-size: 10px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px; font-weight: 600;
}
.detail-value { font-size: 15px; font-weight: 700; color: var(--text); }
.detail-value.green { color: var(--green); }
.detail-value.accent { color: var(--brand); }

.score-breakdown { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.score-item {
  flex: 1; min-width: 90px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; text-align: center;
}
.score-item .s-val { font-size: 22px; font-weight: 900; color: var(--brand); }
.score-item .s-bar { height: 4px; background: var(--border2); border-radius: 2px; margin: 8px 0; }
.score-item .s-bar-fill { height: 100%; background: var(--brand); border-radius: 2px; transition: width .5s; }
.score-item .s-name { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }

.attachments-list { display: flex; flex-direction: column; gap: 8px; }
.attachment-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13px;
  transition: border-color .15s;
}
.attachment-item:hover { border-color: var(--brand); }
.att-icon { font-size: 20px; }
.att-label { flex: 1; font-weight: 500; }
.att-dl { color: var(--brand); font-size: 12px; font-weight: 600; }

.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 10px; }
.result-item {
  background: var(--green-bg); border: 1px solid var(--green-border);
  border-radius: var(--radius-sm); padding: 12px;
}
.result-item .r-val { font-size: 17px; font-weight: 800; color: var(--green); }
.result-item .r-key { font-size: 10px; color: var(--text-dim); margin-top: 2px; text-transform: uppercase; letter-spacing: .4px; }

.section-label {
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .8px;
  margin-bottom: 10px; margin-top: 20px;
}

.tech-list { display: flex; gap: 7px; flex-wrap: wrap; }
.tech-pill {
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--brand);
  font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: var(--radius-xs);
}

.links-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.link-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  border: 1px solid var(--border2); color: var(--text-muted);
  cursor: pointer; background: transparent; transition: all .2s;
}
.link-btn:hover { border-color: var(--brand); color: var(--brand); }
.link-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.link-btn.primary:hover { background: var(--brand-dark); }

/* ── Authors ─────────────────────────────────────────────────────────────────── */
.authors-strip { display: flex; flex-direction: column; gap: 8px; }
.author-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.author-card:hover { border-color: var(--brand); box-shadow: 0 2px 10px #CC151715; }
.author-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  overflow: hidden; background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  border: 2px solid var(--border);
}
.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-info { flex: 1; }
.author-name { font-size: 14px; font-weight: 700; color: var(--text); }
.author-role { font-size: 12px; color: var(--brand); margin-top: 1px; font-weight: 500; }
.author-cv-hint { font-size: 11px; color: var(--text-dim); white-space: nowrap; }

/* ── Author Modal ────────────────────────────────────────────────────────────── */
.author-modal-header {
  display: flex; align-items: flex-start; gap: 20px;
  padding: 28px 32px 20px; border-bottom: 1px solid var(--border);
}
.author-modal-avatar {
  width: 80px; height: 80px; border-radius: 50%; flex-shrink: 0;
  overflow: hidden; background: var(--surface);
  display: flex; align-items: center; justify-content: center; font-size: 36px;
  border: 3px solid var(--brand);
}
.author-modal-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-modal-name { font-size: 22px; font-weight: 900; color: var(--text); }
.author-modal-title { color: var(--brand); font-size: 14px; margin-top: 3px; font-weight: 600; }
.author-modal-headline { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.author-modal-bio {
  color: var(--text-muted); font-size: 14px; line-height: 1.7; margin: 16px 0;
}

.cv-section { margin-bottom: 16px; }
.cv-entry {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px; margin-bottom: 8px;
}
.cv-entry-title { font-size: 14px; font-weight: 700; color: var(--text); }
.cv-entry-sub { font-size: 12px; color: var(--brand); margin-top: 2px; font-weight: 600; }
.cv-entry-period { font-size: 11px; color: var(--text-dim); }
.cv-entry-desc { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.6; }

.skill-group { margin-bottom: 14px; }
.skill-group-label {
  font-size: 10px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 7px; font-weight: 700;
}

.author-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.author-link-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  border: 1px solid var(--border2); color: var(--text-muted);
  background: var(--surface); transition: all .2s; cursor: pointer;
}
.author-link-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ── Empty state ─────────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 80px 24px; color: var(--text-dim); }
.empty .icon { font-size: 48px; margin-bottom: 16px; }
.empty p { font-size: 16px; }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--text);       /* café oscuro #332525 */
  color: #ffffff80;
  padding: 40px 0;
  text-align: center;
  font-size: 13px;
  margin-top: 0;
  border-top: 3px solid var(--brand);
}
.site-footer img { margin: 0 auto 16px; height: 28px; filter: brightness(0) invert(1); }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--brand-light); }

/* ══════════════════════════════════════════════
   ADMIN — estilos exclusivos del panel
   ══════════════════════════════════════════════ */

/* Login */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fff 0%, #f7f0f0 100%);
}
.login-box {
  background: var(--bg); border: 1px solid var(--border2);
  border-radius: 16px; padding: 48px; width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--brand);
}
.login-logo { display: block; height: 40px; margin: 0 auto 20px; }
.login-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; text-align: center; }

/* Admin layout */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: #1e1414; /* siempre oscuro */
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh; z-index: 50;
}
.sidebar-logo {
  padding: 20px; border-bottom: 1px solid #ffffff15;
}
.sidebar-logo img { height: 32px; }
.sidebar-logo .version { font-size: 10px; color: #ffffff40; margin-top: 6px; }

.nav { flex: 1; padding: 12px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: #ffffff80;
  cursor: pointer; transition: all .15s;
  margin-bottom: 2px; border: none; background: none;
  width: 100%; text-align: left;
}
.nav-item:hover { background: #ffffff10; color: #fff; }
.nav-item.active { background: var(--brand); color: #fff; }
.nav-icon { font-size: 15px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto; background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px;
}
.nav-item.active .nav-badge { background: #ffffff30; }

.sidebar-footer { padding: 12px; border-top: 1px solid #ffffff15; }

.main-content { margin-left: 240px; flex: 1; padding: 32px; max-width: calc(100vw - 240px); }

/* Top bar */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.page-title { font-size: 22px; font-weight: 900; color: var(--text); }
.page-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* Forms */
.form-section { margin-bottom: 28px; }
.form-section-title {
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-full   { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.form-label .required { color: var(--brand); margin-left: 2px; }

input[type=text], input[type=url], input[type=number], input[type=date],
input[type=password], textarea, select {
  background: var(--bg);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
textarea { resize: vertical; min-height: 90px; }

.input-prefix-wrap { display: flex; }
.input-prefix {
  background: var(--surface); border: 1px solid var(--border2); border-right: none;
  padding: 10px 12px; font-size: 13px; color: var(--text-dim);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm); white-space: nowrap;
}
.input-prefix + input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Score sliders */
.score-sliders { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; }
.score-slider-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.score-slider-label { font-size: 11px; color: var(--text-dim); text-align: center; font-weight: 600; }
.score-slider-val { font-size: 22px; font-weight: 900; color: var(--brand); min-width: 36px; text-align: center; }
input[type=range] {
  -webkit-appearance: none; height: 4px; background: var(--border2);
  border-radius: 2px; outline: none; cursor: pointer; padding: 0; border: none; width: 100%;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px;
  border-radius: 50%; background: var(--brand); cursor: pointer;
  box-shadow: 0 0 8px #CC151730;
}
.computed-score-display {
  background: var(--brand-bg); border: 2px solid #CC151730;
  border-radius: var(--radius-sm); padding: 16px; text-align: center; margin-top: 12px;
}
.computed-score-display .big { font-size: 40px; font-weight: 900; color: var(--brand); }
.computed-score-display .label { font-size: 12px; color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

/* Toggles */
.toggle-group { display: flex; gap: 12px; flex-wrap: wrap; }
.toggle-item { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle-item input[type=checkbox] { display: none; }
.toggle-track {
  width: 40px; height: 22px; background: var(--surface3);
  border-radius: 11px; position: relative; transition: background .2s;
  border: 1px solid var(--border2);
}
.toggle-track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-dim); transition: all .2s;
}
.toggle-item input:checked + .toggle-track { background: var(--brand); border-color: var(--brand); }
.toggle-item input:checked + .toggle-track::after { left: 20px; background: #fff; }
.toggle-label { font-size: 13px; font-weight: 500; color: var(--text); }

/* Tags input */
.tags-input-wrap {
  background: var(--bg); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 8px;
  display: flex; flex-wrap: wrap; gap: 6px; cursor: text; transition: border-color .15s;
  min-height: 44px;
}
.tags-input-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.tag-pill {
  background: var(--brand-bg); border: 1px solid #CC151730;
  color: var(--brand); font-size: 12px; padding: 3px 10px; border-radius: var(--radius-xs);
  display: flex; align-items: center; gap: 6px; font-weight: 600;
}
.tag-pill .remove { color: var(--brand); cursor: pointer; font-size: 10px; opacity: .7; }
.tag-pill .remove:hover { opacity: 1; }
.tags-input {
  background: none; border: none; outline: none; color: var(--text);
  font-size: 13px; min-width: 120px; flex: 1; padding: 2px 4px;
}

/* Botones */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; border: none; transition: all .15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary {
  background: var(--surface); border: 1px solid var(--border2); color: var(--text-muted);
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: var(--red-err-bg); border: 1px solid #dc262630; color: var(--red-err); }
.btn-danger:hover { background: #dc262620; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-icon { padding: 8px; }

/* Proyecto row */
.project-list { display: flex; flex-direction: column; gap: 10px; }
.project-row {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 20px;
  display: grid; grid-template-columns: 64px 1fr auto;
  gap: 16px; align-items: center; transition: border-color .15s;
}
.project-row:hover { border-color: var(--brand); }
.project-thumb {
  width: 64px; height: 44px; border-radius: var(--radius-xs);
  background: var(--surface2); object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0; overflow: hidden;
}
.project-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-xs); }
.project-info h4 { font-size: 15px; font-weight: 700; color: var(--text); }
.project-info .meta { display: flex; gap: 8px; margin-top: 4px; align-items: center; flex-wrap: wrap; }
.project-actions { display: flex; gap: 8px; }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border2); border-radius: var(--radius-sm);
  padding: 24px; text-align: center; cursor: pointer;
  transition: all .2s; background: var(--surface);
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--brand); background: var(--brand-bg); }
.upload-zone .icon { font-size: 32px; margin-bottom: 8px; }
.upload-zone p { font-size: 13px; color: var(--text-muted); }
.upload-zone input[type=file] { display: none; }

.file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.file-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
}
.file-item-info { flex: 1; font-size: 13px; color: var(--text); }
.file-item-url { font-size: 11px; color: var(--text-dim); margin-top: 2px; word-break: break-all; }

/* Alerts */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  margin-bottom: 16px; display: none;
}
.alert-success { background: var(--green-bg); border: 1px solid var(--green-border); color: var(--green); }
.alert-error { background: var(--red-err-bg); border: 1px solid #dc262630; color: var(--red-err); }
.alert.show { display: block; }

/* Stat cards admin */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 28px; }
.stat-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 20px;
  border-top: 3px solid var(--brand);
}
.stat-card .s-val { font-size: 28px; font-weight: 900; color: var(--brand); }
.stat-card .s-label { font-size: 12px; color: var(--text-dim); margin-top: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

/* Tabs */
.tabs {
  display: flex; gap: 4px; background: var(--surface);
  padding: 4px; border-radius: var(--radius-sm); margin-bottom: 24px;
  border: 1px solid var(--border);
}
.tab-btn {
  flex: 1; padding: 8px 16px; border-radius: var(--radius-xs);
  font-size: 13px; font-weight: 700; border: none;
  background: none; color: var(--text-muted); cursor: pointer; transition: all .15s;
}
.tab-btn.active { background: var(--brand); color: #fff; }

/* Pane */
.pane { display: none; }
.pane.active { display: block; }

/* Misc */
.separator { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.text-muted { color: var(--text-muted); font-size: 13px; }
.gap-8 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Nicho editor en config */
.niche-editor-list { display: flex; flex-direction: column; gap: 8px; }
.niche-editor-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 10px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
}
.niche-editor-row .drag-handle { color: var(--text-dim); cursor: grab; font-size: 16px; }

/* Responsive */
@media (max-width: 768px) {
  .main-content { margin-left: 0; padding: 16px; max-width: 100vw; }
  .sidebar { display: none; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .score-sliders { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .modal-body, .modal-header, .author-modal-header { padding: 16px; }
  .hero h1 { letter-spacing: -1px; }
  .stats-bar { flex-direction: column; }
  .stat { border-right: none; border-bottom: 1px solid var(--border); }
}

/* ── Header buttons ──────────────────────────────────────────────────────── */
.header-buttons { display: flex; gap: 10px; align-items: center; }

/* ── Header team button ──────────────────────────────────────────────────── */
.header-team-btn {
  background: transparent; border: 1.5px solid rgba(255,255,255,.5);
  color: #fff; border-radius: var(--radius-xs);
  padding: 7px 14px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: border-color .2s, background .2s;
  white-space: nowrap;
}
.header-team-btn:hover { border-color: #fff; background: rgba(255,255,255,.15); }

.header-cta {
  white-space: nowrap;
  padding: 8px 16px;
  font-size: 13px;
}

/* ── Team section ────────────────────────────────────────────────────────── */
.team-section { padding: 48px 0; border-top: 1px solid var(--border); }
.team-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
  gap: 16px; margin-top: 20px;
}
.team-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  cursor: pointer; transition: border-color .2s, box-shadow .2s;
}
.team-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.team-avatar {
  width: 52px; height: 52px; border-radius: 50%; overflow: hidden;
  flex-shrink: 0; background: var(--surface2);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.team-avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-info { flex: 1; min-width: 0; }
.team-name  { font-weight: 700; font-size: 15px; color: var(--text); }
.team-title { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.team-exp   { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ── Video embed ──────────────────────────────────────────────────────────── */
.video-wrap {
  position: relative; width: 100%; padding-bottom: 56.25%; /* 16:9 */
  margin-bottom: 20px; border-radius: var(--radius); overflow: hidden;
  background: #000;
}
.video-wrap iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: none;
}

/* ── Loading spinner (index.php) ──────────────────────────────────────────── */
.projects-loading {
  display: flex; justify-content: center; align-items: center;
  min-height: 200px; grid-column: 1 / -1;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error state ──────────────────────────────────────────────────────────── */
.projects-error {
  text-align: center; padding: 2rem; color: var(--red-err);
  border: 1px solid var(--red-err-bg); border-radius: var(--radius);
  margin: 1rem 0;
}
.projects-error button {
  background: none; border: none; color: var(--brand);
  cursor: pointer; font-weight: 600; text-decoration: underline;
}

/* ── Niche filter: active state y scroll hint ────────────────────────────── */
.niche-btn.active {
  background: var(--brand); color: #fff;
  border-bottom-color: var(--brand); font-weight: 600;
}
/* Wrapper con fade lateral para indicar scroll */
.niche-bar-scroll-wrap {
  position: relative;
}
.niche-bar-scroll-wrap::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 48px;
  background: linear-gradient(to right, transparent, var(--bg));
  pointer-events: none;
  transition: opacity .3s;
}
.niche-bar-scroll-wrap.at-end::after { opacity: 0; }

@media (max-width: 600px) {
  .header-inner {
    padding: 10px 0;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .header-logo img { height: 28px; }
  .header-buttons {
    display: flex; gap: 8px; width: 100%;
  }
  .header-team-btn, .header-cta {
    flex: 1; padding: 8px 0; font-size: 13px; text-align: center;
  }
  .niche-list { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .niche-btn { flex-shrink: 0; padding: 12px 14px; font-size: 12px; }
  .niche-arrow { display: none; }
  /* Modal: más compacto en mobile */
  .modal-overlay { padding: 12px 8px; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; overflow-y: auto; }
}

/* ── Niche arrows ─────────────────────────────────────────────────────────── */
.niche-arrow {
  position: absolute; top: 0; bottom: 0;
  width: 36px; z-index: 2;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-muted);
  transition: color .15s, opacity .15s;
}
.niche-arrow:hover { color: var(--brand); }
.niche-arrow.left  { left: 0;  background: linear-gradient(to right, var(--bg) 60%, transparent); }
.niche-arrow.right { right: 0; background: linear-gradient(to left,  var(--bg) 60%, transparent); }
.niche-arrow[hidden] { display: none; }

/* ── Toast notifications (admin) ─────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 9998; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: #1e1e1e; color: #fff;
  padding: .75rem 1.25rem; border-radius: var(--radius-sm);
  font-size: 14px; max-width: 320px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  pointer-events: auto;
}
.toast.show   { opacity: 1; transform: translateY(0); }
.toast.toast-success { border-left: 4px solid #4caf50; }
.toast.toast-error   { border-left: 4px solid var(--red-err); }

/* ── Admin: mobile sidebar toggle ────────────────────────────────────────── */
.sidebar-toggle {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 300;
  background: var(--brand); color: #fff;
  border: none; border-radius: 8px; padding: 8px 10px;
  cursor: pointer; flex-direction: column; gap: 4px;
}
.sidebar-toggle span {
  display: block; width: 20px; height: 2px; background: #fff;
  transition: transform .2s, opacity .2s;
}
@media (max-width: 768px) {
  .sidebar-toggle { display: flex; }
  .sidebar {
    display: flex !important; position: fixed; left: -260px; top: 0;
    height: 100vh; z-index: 250; transition: left .28s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { left: 0; }
  .sidebar-backdrop {
    display: none; position: fixed; inset: 0;
    background: #00000050; z-index: 240;
  }
  .sidebar-backdrop.show { display: block; }
  .main-content { padding: 16px; padding-top: 56px; }
}

/* ── Search bar ── */
.search-bar-wrap {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 0 10px;
}
.search-box-outer {
  display: flex; align-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border2);
  border-radius: 10px;
  padding: 0 14px;
  gap: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.search-box-outer:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.search-icon { font-size: 16px; flex-shrink: 0; }
.search-box {
  flex: 1; border: none; background: none;
  font-size: 15px; padding: 12px 0;
  color: var(--text); outline: none;
}
.search-box::placeholder { color: var(--text-dim); }
.search-clear {
  display: none; align-items: center; justify-content: center;
  background: var(--surface3); border: none;
  border-radius: 50%; width: 22px; height: 22px;
  font-size: 11px; color: var(--text-muted);
  cursor: pointer; flex-shrink: 0;
  transition: background .15s;
}
.search-clear:hover { background: var(--border3); }
.search-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px; min-height: 0;
}
.search-tag-pill {
  background: var(--brand-bg); color: var(--brand);
  border: 1px solid var(--brand-glow);
  border-radius: 99px; padding: 3px 10px;
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.search-tag-pill:hover { background: var(--brand); color: #fff; }

/* ── Skeleton cards (pre-load CLS prevention) ── */
.skeleton-card { pointer-events: none; }
@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton-pulse {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.4s infinite;
}
.sk-line {
  height: 12px; border-radius: 6px; margin-bottom: 8px;
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.4s infinite;
}
.sk-title { width: 70%; height: 16px; margin-bottom: 12px; }
.sk-desc  { width: 90%; }

/* ── Project Editor: essentials + collapsible advanced ── */
.editor-scroll {
  max-width: 800px;
}
.editor-essential {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 8px;
}

/* Score compact row */
.score-compact {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.score-compact-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.score-compact-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sc-item {
  display: grid;
  grid-template-columns: 130px 1fr 28px;
  align-items: center;
  gap: 10px;
}
.sc-label { font-size: 13px; color: var(--text-secondary); }
.score-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface3); color: var(--text-muted);
  font-size: 10px; cursor: help;
  position: relative; vertical-align: middle; margin-left: 3px;
}
#score-tooltip {
  position: fixed; z-index: 99999;
  background: #1a1a2e; color: #e8e8f0;
  font-size: 12px; line-height: 1.5;
  padding: 8px 12px; border-radius: 8px;
  width: 240px; white-space: normal;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
  pointer-events: none;
  display: none;
}
.sc-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-color);
  text-align: right;
}
.score-compact-result {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}
.score-compact-result strong {
  color: var(--accent-color);
  font-size: 18px;
}

/* Advanced collapsible sections */
.adv-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--surface1);
  overflow: hidden;
}
.adv-summary {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  user-select: none;
}
.adv-summary::-webkit-details-marker { display: none; }
.adv-summary::after {
  content: '›';
  margin-left: auto;
  font-size: 16px;
  transition: transform .2s;
  color: var(--text-muted);
}
details.adv-section[open] > .adv-summary::after {
  transform: rotate(90deg);
}
details.adv-section[open] > .adv-summary {
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}
.adv-body {
  padding: 16px;
}
.adv-sub {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin: 0 0 8px;
}

/* Compact upload zone */
.upload-zone-sm {
  padding: 10px 16px !important;
  min-height: unset !important;
  flex-direction: row !important;
  justify-content: flex-start !important;
  gap: 8px;
  font-size: 13px;
}
.upload-zone-sm span { pointer-events: none; }

@media (max-width: 600px) {
  .sc-item { grid-template-columns: 100px 1fr 24px; }
  .editor-essential { padding: 14px; }
}

/* ── Tag autocomplete dropdown ── */
.tag-suggest-drop {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
}
.tag-suggest-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background .1s;
}
.tag-suggest-item:hover { background: var(--surface3); color: var(--text-primary); }
.tag-suggest-item strong { color: var(--accent-color); font-weight: 700; }

/* ── Media page ── */
.media-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); margin-bottom: 12px;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

/* ── Importador ───────────────────────────────────────────────────────────── */
.import-zone {
  border: 2px dashed var(--border2);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  background: var(--surface2);
  transition: border-color .2s, background .2s;
  margin-bottom: 12px;
}
.import-zone.drag-over {
  border-color: var(--brand);
  background: var(--brand-bg);
}
.import-drop-label p { color: var(--text-muted); margin: 10px 0; font-size: 14px; }
.import-textarea {
  width: 100%; min-height: 160px; resize: vertical;
  font-family: monospace; font-size: 12px;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; box-sizing: border-box;
}
.import-summary {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 16px;
  font-size: 14px; margin-bottom: 12px;
}
.import-list { display: flex; flex-direction: column; gap: 8px; }
.import-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
}
.import-row.import-conflict { border-color: #f8717150; background: #f8717108; }
.import-row-thumb {
  width: 48px; height: 48px; border-radius: 6px;
  overflow: hidden; flex-shrink: 0;
  background: var(--surface3);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.import-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.import-row-info { flex: 1; min-width: 0; }
.import-row-info strong { font-size: 14px; display: block; }
.import-error {
  background: #f8717115; border: 1px solid #f8717140;
  color: var(--red); border-radius: 8px; padding: 12px 16px; font-size: 14px;
}
.media-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.media-card-img {
  width: 100%; aspect-ratio: 16/9;
  background-size: cover; background-position: center;
  background-color: var(--surface3);
}
.media-card-name {
  font-size: 11px; color: var(--text-secondary); padding: 6px 8px 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.media-card-size { font-size: 11px; color: var(--text-muted); padding: 0 8px 4px; }
.media-card-actions {
  display: flex; gap: 4px; padding: 4px 8px 8px;
}
.media-attach-list { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 600px) {
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
