:root {
  --sunset: #e8622c;
  --sunset-deep: #c94a1c;
  --teal: #0f6b66;
  --teal-deep: #0a4f4b;
  --sand: #faf3e9;
  --sand-card: #ffffff;
  --ink: #2a2521;
  --ink-soft: #6b6259;
  --line: #e9ded0;
  --ok: #1f8a4c;
  --err: #c23b3b;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--sand);
  color: var(--ink);
}

h1, h2, h3, .brand {
  font-family: 'Fraunces', serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: var(--teal-deep);
  color: white;
}
.topbar .brand {
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.3rem;
}
.topbar .brand span { color: #ffcf9e; }
.topbar nav a {
  color: #dfeeec;
  text-decoration: none;
  margin-left: 22px;
  font-weight: 500;
  font-size: .95rem;
}
.topbar nav a:hover { color: white; }

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

.card {
  background: var(--sand-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 18px;
  box-shadow: 0 2px 10px rgba(60, 40, 10, 0.04);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.grupo-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: var(--sand-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.grupo-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(60,40,10,.10); }
.grupo-cover {
  height: 130px;
  background: linear-gradient(135deg, var(--teal), var(--sunset));
  background-size: cover;
  background-position: center;
}
.grupo-body { padding: 14px 16px; }
.grupo-body h3 { margin: 0 0 4px; font-size: 1.1rem; }
.grupo-meta { font-size: .85rem; color: var(--ink-soft); }
.grupo-stats { display: flex; gap: 14px; margin-top: 10px; font-size: .82rem; color: var(--teal-deep); font-weight: 600; }

.btn {
  display: inline-block;
  background: var(--sunset);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-size: .92rem;
}
.btn:hover { background: var(--sunset-deep); }
.btn.secondary { background: var(--teal); }
.btn.secondary:hover { background: var(--teal-deep); }
.btn.ghost { background: transparent; color: var(--teal-deep); border: 1px solid var(--line); }
.btn.danger { background: var(--err); }

form.stack { display: flex; flex-direction: column; gap: 12px; max-width: 520px; }
label { font-weight: 600; font-size: .85rem; color: var(--ink-soft); display: block; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=url], input[type=password], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: .95rem;
  background: white;
}
textarea { min-height: 90px; resize: vertical; }
.field { margin-bottom: 2px; }

.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 2px solid var(--line); }
.tabs a {
  padding: 10px 16px;
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tabs a.active { color: var(--sunset-deep); border-color: var(--sunset); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: .9rem; }
th { color: var(--ink-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge.ok { background: #e2f5e9; color: var(--ok); }
.badge.error { background: #fbe4e4; color: var(--err); }
.badge.pendiente { background: #fdf1de; color: #96650e; }

.link-box {
  display: flex; align-items: center; gap: 8px;
  background: #f4ece0; border: 1px dashed var(--line);
  padding: 6px 10px; border-radius: 8px; font-size: .82rem;
  font-family: monospace; word-break: break-all;
}

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.media-grid .item { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: white; }
.media-grid img, .media-grid video { width: 100%; height: 130px; object-fit: cover; display: block; }
.media-grid .cap { padding: 6px 8px; font-size: .75rem; color: var(--ink-soft); }

.hint { font-size: .8rem; color: var(--ink-soft); }
.checklist { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: white; }
.checklist label { font-weight: 500; color: var(--ink); display: flex; gap: 8px; align-items: center; }

.empty { text-align: center; padding: 50px 20px; color: var(--ink-soft); }

.upload-hero { text-align: center; padding: 30px 10px; }
.upload-hero h1 { margin-bottom: 4px; }

@media (max-width: 640px) {
  main { padding: 18px 12px 50px; }
  .topbar { padding: 14px 16px; }

  table.responsive-table thead { display: none; }
  table.responsive-table, table.responsive-table tbody,
  table.responsive-table tr, table.responsive-table td {
    display: block; width: 100%;
  }
  table.responsive-table tr {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    background: white;
  }
  table.responsive-table tr:last-child { margin-bottom: 0; }
  table.responsive-table td {
    border: none;
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: .9rem;
  }
  table.responsive-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--ink-soft);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    flex-shrink: 0;
  }
  table.responsive-table td.stack-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  table.responsive-table td.stack-cell::before { margin-bottom: 2px; }
  table.responsive-table .link-box { font-size: .74rem; }
  table.responsive-table .row-actions { justify-content: flex-start; flex-wrap: wrap; }
}

.nav-toggle-checkbox { display: none; }
.nav-toggle-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px;
  height: 30px;
  cursor: pointer;
}
.nav-toggle-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: white;
  border-radius: 2px;
}
.main-nav { display: flex; align-items: center; gap: 0; }
.main-nav a { margin-left: 22px; }
.nav-user { margin-left: 22px; color: #dfeeec; }
.nav-logout { margin-left: 12px; }

@media (max-width: 640px) {
  .nav-toggle-btn { display: flex; }
  .topbar { position: relative; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    background: var(--teal-deep);
    padding: 8px 16px 16px;
    box-shadow: 0 8px 16px rgba(0,0,0,.15);
    z-index: 20;
  }
  .main-nav a, .main-nav .nav-user, .main-nav .nav-logout {
    margin-left: 0;
    padding: 10px 0;
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,.12);
  }
  .main-nav a:last-child, .main-nav .nav-logout { border-bottom: none; }
  .nav-toggle-checkbox:checked ~ .main-nav { display: flex; }
}

.help-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.18);
  color: white !important;
  text-decoration: none;
  font-weight: 700;
  font-size: .95rem;
  margin-left: 14px !important;
  flex-shrink: 0;
}
.help-btn:hover { background: rgba(255,255,255,0.32); }

@media (max-width: 640px) {
  .main-nav .help-btn {
    margin-left: 0 !important;
    width: auto;
    height: auto;
    border-radius: 8px;
    justify-content: flex-start;
    padding: 10px 0;
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,.12);
  }
  .main-nav .help-btn::before { content: "Ayuda "; }
}
