/* ═══════════════════════════════════════
   TechGuía — Estilos principales
   ═══════════════════════════════════════ */

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #1e2530;
  --border: #2a3340;
  --accent: #00d4a8;
  --accent2: #ff6b35;
  --accent3: #4a9eff;
  --text: #e8edf3;
  --text-muted: #7a8796;
  --text-dim: #4a5568;
  --danger: #ff4757;
  --success: #00d4a8;
  --warn: #ffa502;
  --radius: 10px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── GRID BACKGROUND ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,168,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,168,.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ════════════════════════════════
   LOGIN
   ════════════════════════════════ */
#login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: var(--bg);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(0,212,168,.15), transparent 70%);
  pointer-events: none;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.login-logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}

.login-logo-text {
  font-family: 'Syne', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}

.login-logo-text span { color: var(--accent); }

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.role-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  background: var(--bg);
  border-radius: 8px;
  padding: 4px;
}

.role-tab {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: var(--text-muted);
  transition: all .2s;
}

.role-tab.active {
  background: var(--surface2);
  color: var(--text);
}

/* ════════════════════════════════
   FORM ELEMENTS (compartidos)
   ════════════════════════════════ */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.form-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  transition: border-color .2s;
  outline: none;
}

.form-input:focus { border-color: var(--accent); }

.form-select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%237a8796' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

.form-select:focus { border-color: var(--accent); }

.form-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  resize: vertical;
  min-height: 100px;
  transition: border-color .2s;
  line-height: 1.6;
}

.form-textarea:focus { border-color: var(--accent); }
.form-textarea::placeholder { color: var(--text-dim); }

.hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 20px;
  background: var(--surface2);
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid var(--accent3);
}

/* ════════════════════════════════
   BOTONES
   ════════════════════════════════ */
.btn-primary {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent), #00b894);
  border: none;
  border-radius: var(--radius);
  color: #0d1117;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
}

.btn-primary:hover { opacity: .9; }
.btn-primary:active { transform: scale(.98); }

.btn-add {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--accent), #00b894);
  border: none;
  border-radius: var(--radius);
  color: #0d1117;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
}

.btn-add:hover { opacity: .9; }
.btn-add:active { transform: scale(.97); }

.btn-cancel {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}

.btn-cancel:hover { border-color: var(--text-muted); color: var(--text); }

.btn-save {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--accent), #00b894);
  border: none;
  border-radius: var(--radius);
  color: #0d1117;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: opacity .2s;
}

.btn-save:hover { opacity: .9; }

/* ════════════════════════════════
   APP PRINCIPAL
   ════════════════════════════════ */
#app { display: none; min-height: 100vh; position: relative; z-index: 1; }

/* ── TOPBAR ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13,17,23,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 20px;
}

.topbar-logo {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-logo span { color: var(--accent); }

.topbar-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.badge-admin { background: rgba(255,107,53,.15); color: var(--accent2); border: 1px solid rgba(255,107,53,.3); }
.badge-teacher { background: rgba(74,158,255,.15); color: var(--accent3); border: 1px solid rgba(74,158,255,.3); }

.topbar-search {
  flex: 1;
  max-width: 400px;
  position: relative;
  margin-left: auto;
}

.topbar-search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px 8px 36px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}

.topbar-search input:focus { border-color: var(--accent); }
.topbar-search input::placeholder { color: var(--text-dim); }

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 14px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 16px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.avatar-admin { background: linear-gradient(135deg, var(--accent2), #ff3f34); }
.avatar-teacher { background: linear-gradient(135deg, var(--accent3), #2e86de); }

.logout-btn {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all .2s;
}

.logout-btn:hover { border-color: var(--danger); color: var(--danger); }

/* ── LAYOUT ── */
.layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

/* ── SIDEBAR ── */
.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  flex-shrink: 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.sidebar-section { margin-bottom: 24px; }

.sidebar-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 0 8px;
  margin-bottom: 8px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: all .15s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.sidebar-item:hover { background: var(--surface2); color: var(--text); }

.sidebar-item.active {
  background: rgba(0,212,168,.1);
  color: var(--accent);
  border: 1px solid rgba(0,212,168,.2);
}

.sidebar-item-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-count {
  margin-left: auto;
  background: var(--surface2);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ── MAIN CONTENT ── */
.main { flex: 1; padding: 28px 32px; overflow-y: auto; }

.view { display: none; }
.view.active { display: block; }

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-family: 'Syne', sans-serif;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.page-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: .07;
}

.stat-card.teal::after { background: var(--accent); }
.stat-card.orange::after { background: var(--accent2); }
.stat-card.blue::after { background: var(--accent3); }
.stat-card.yellow::after { background: var(--warn); }

.stat-icon { font-size: 22px; margin-bottom: 10px; }

.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card.teal .stat-value { color: var(--accent); }
.stat-card.orange .stat-value { color: var(--accent2); }
.stat-card.blue .stat-value { color: var(--accent3); }
.stat-card.yellow .stat-value { color: var(--warn); }

.stat-label { font-size: 12px; color: var(--text-muted); }

/* ── FILTERS ── */
.filters-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all .15s;
}

.filter-btn:hover { background: var(--surface2); color: var(--text); }
.filter-btn.active { background: rgba(0,212,168,.1); border-color: rgba(0,212,168,.4); color: var(--accent); }

/* ── GUIDE CARDS ── */
.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  overflow: hidden;
}

.guide-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.guide-card.cat-hardware::before { background: linear-gradient(90deg, var(--accent2), #ff9f43); }
.guide-card.cat-software::before { background: linear-gradient(90deg, var(--accent3), #a29bfe); }
.guide-card.cat-red::before      { background: linear-gradient(90deg, var(--accent), #00b894); }
.guide-card.cat-perifericos::before { background: linear-gradient(90deg, var(--warn), #fd9644); }
.guide-card.cat-sistema::before  { background: linear-gradient(90deg, #a29bfe, var(--accent3)); }

.guide-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,212,168,.1);
}

.guide-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.guide-card-title {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
}

.category-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.tag-hardware   { background: rgba(255,107,53,.15); color: var(--accent2); }
.tag-software   { background: rgba(74,158,255,.15); color: var(--accent3); }
.tag-red        { background: rgba(0,212,168,.12);  color: var(--accent); }
.tag-perifericos{ background: rgba(255,165,2,.12);  color: var(--warn); }
.tag-sistema    { background: rgba(162,155,254,.15);color: #a29bfe; }

.guide-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.guide-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
}

.guide-difficulty { display: flex; gap: 3px; align-items: center; }

.diff-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border);
}

.diff-dot.filled      { background: var(--warn); }
.diff-dot.filled.easy { background: var(--success); }
.diff-dot.filled.hard { background: var(--danger); }

.guide-views { display: flex; gap: 4px; align-items: center; }

/* ── CARD ADMIN ACTIONS ── */
.card-actions {
  display: none;
  position: absolute;
  top: 12px; right: 12px;
  gap: 6px;
}

.guide-card:hover .card-actions { display: flex; }

.card-action-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
}

.card-action-btn:hover       { background: var(--surface2); }
.card-action-btn.del:hover   { border-color: var(--danger); color: var(--danger); }
.card-action-btn.edit:hover  { border-color: var(--accent3); color: var(--accent3); }

/* ── ADMIN ACTIONS (header) ── */
.admin-actions { display: flex; gap: 10px; align-items: center; }

/* ════════════════════════════════
   MODALES
   ════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  padding: 24px 28px 0;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-title {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.modal-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }

.modal-close {
  position: absolute;
  top: 20px; right: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  transition: all .15s;
}

.modal-close:hover { color: var(--danger); border-color: var(--danger); }

.modal-body { padding: 4px 28px 24px; }

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group-full { grid-column: 1 / -1; }

.modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ── STEPS EDITOR ── */
.steps-editor { margin-top: 8px; }

.step-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.step-num {
  width: 26px; height: 26px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 10px;
}

.step-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}

.step-input:focus { border-color: var(--accent); }
.step-input::placeholder { color: var(--text-dim); }

.step-del {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 14px;
  transition: all .15s;
  margin-top: 8px;
  flex-shrink: 0;
}

.step-del:hover { color: var(--danger); border-color: rgba(255,71,87,.3); }

.add-step-btn {
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  width: 100%;
  transition: all .15s;
  margin-top: 4px;
  text-align: center;
}

.add-step-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── DETAIL MODAL ── */
.detail-header {
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--border);
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.detail-title {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.2;
}

.detail-desc { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

.detail-body { padding: 24px 28px; }

.detail-section-title {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.steps-list { list-style: none; }

.step-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.step-badge {
  min-width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent), #00b894);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #0d1117;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-text { font-size: 14px; line-height: 1.6; color: var(--text); padding-top: 4px; }

.detail-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}

.detail-author { font-size: 12px; color: var(--text-dim); }
.detail-author strong { color: var(--text-muted); }

.btn-useful {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all .2s;
}

.btn-useful.liked { background: rgba(0,212,168,.1); border-color: var(--accent); color: var(--accent); }

/* ════════════════════════════════
   ADJUNTOS — ZONA DE SUBIDA
   ════════════════════════════════ */

.attachments-section { margin-top: 4px; }

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--bg);
  position: relative;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(0,212,168,.04);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-zone-icon  { font-size: 28px; margin-bottom: 8px; opacity: .6; }
.drop-zone-label { font-size: 13px; color: var(--text-muted); }
.drop-zone-label strong { color: var(--accent); }
.drop-zone-hint  { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* ── LISTA DE ADJUNTOS (editor) ── */
.attachments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}

.attachment-thumb {
  width: 40px; height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.attachment-file-icon {
  width: 40px; height: 40px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.attachment-info { flex: 1; min-width: 0; }

.attachment-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-size {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.attachment-remove {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 13px;
  flex-shrink: 0;
  transition: all .15s;
}

.attachment-remove:hover { color: var(--danger); border-color: rgba(255,71,87,.3); }

/* ── IMÁGENES EN DETALLE ── */
.detail-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.detail-image-wrap {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform .2s;
}

.detail-image-wrap:hover { transform: scale(1.02); }

.detail-image-wrap img {
  width: 100%;
  display: block;
  object-fit: cover;
  max-height: 220px;
}

/* ── ARCHIVOS EN DETALLE ── */
.detail-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s;
}

.detail-file-item:hover { border-color: var(--accent3); }

.detail-file-icon { font-size: 20px; flex-shrink: 0; }

.detail-file-info { flex: 1; min-width: 0; }

.detail-file-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-file-size { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.detail-file-dl {
  font-size: 11px;
  color: var(--accent3);
  flex-shrink: 0;
}

/* ── LIGHTBOX ── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 500;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

#lightbox.open { display: flex; }

#lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  pointer-events: none;
}

#lightbox-close {
  position: absolute;
  top: 20px; right: 20px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 18px;
  transition: background .15s;
}

#lightbox-close:hover { background: rgba(255,71,87,.4); }

/* ════════════════════════════════
   EMPTY STATE
   ════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon  { font-size: 48px; margin-bottom: 16px; opacity: .5; }
.empty-state-title { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.empty-state-desc  { font-size: 13px; }

/* ════════════════════════════════
   TOAST
   ════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--accent);
  z-index: 999;
  transform: translateY(80px);
  opacity: 0;
  transition: all .3s;
  pointer-events: none;
}

.toast.show { transform: translateY(0); opacity: 1; }

/* ════════════════════════════════
   SCROLLBAR
   ════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ════════════════════════════════
   RESPONSIVE
   ════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { padding: 20px 16px; }
  .modal-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .guides-grid { grid-template-columns: 1fr; }
}
