:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #14b8a6;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #16a34a;
  --bg: #f4f7fb;
  --text: #1f2937;
  --muted: #64748b;
  --card: #ffffff;
  --border: #dbe3ef;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

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

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding-bottom: 4rem;
}

.navbar {
  max-width: 1180px;
  margin: auto;
  padding: 1.2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon { font-size: 1.8rem; }
.nav-actions, .hero-actions, .button-row, .form-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }

.hero {
  max-width: 1180px;
  margin: auto;
  padding: 4rem 1.5rem 1rem;
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.8rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  font-weight: 700;
}

.hero-content h1 {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 1.05;
  margin-bottom: 1rem;
}

.hero-content p {
  font-size: 1.15rem;
  max-width: 720px;
  margin-bottom: 1.8rem;
  opacity: 0.95;
}

.hero-card {
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
}

.stats { margin-top: 1.5rem; display: flex; gap: 1rem; }
.stats div { background: rgba(255,255,255,0.2); padding: 1rem; border-radius: 18px; flex: 1; }
.stats strong { font-size: 2rem; display: block; }

.container {
  max-width: 1180px;
  margin: -2rem auto 0;
  padding: 0 1.5rem 3rem;
}

.card, .status-box {
  background: var(--card);
  border-radius: 22px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.compact-card { padding: 1rem; }
.auth-grid, .dashboard-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-bottom: 1.5rem; }

.status-box { border-left: 5px solid var(--primary); margin-bottom: 2rem; }
#messageBox { font-weight: 700; margin-top: 0.3rem; word-break: break-word; }

.section { margin-top: 2.5rem; }
.section-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.section-header.inline { align-items: center; }
.section-header h2 { font-size: 1.75rem; }
.section-subtitle, .small-text { color: var(--muted); font-size: 0.95rem; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.8rem;
  font-size: 1rem;
  outline: none;
  background: #f8fafc;
}

textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: white; }
.form-row, .filters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
.filters { grid-template-columns: 1.5fr 1fr 1fr auto; align-items: start; margin-bottom: 1rem; }
.form-card { max-width: 820px; }
.mini-form { margin-top: 1rem; }

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1.15rem;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: white; color: var(--primary); }
.container .btn-primary, .card .btn-primary { background: var(--primary); color: white; }
.btn-outline { background: transparent; border: 1px solid currentColor; color: inherit; }
.container .btn-outline, .card .btn-outline { color: var(--primary); background: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-small { padding: 0.55rem 0.8rem; font-size: 0.86rem; }
.full { width: 100%; }
.hidden { display: none !important; }

.chips { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.chip { background: white; color: var(--primary); border: 1px solid #bfdbfe; padding: 0.7rem 1rem; border-radius: 999px; font-weight: 800; box-shadow: 0 6px 18px rgba(15,23,42,0.06); }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }
.item-card, .publicacion-card { background: white; border-radius: 22px; padding: 1.4rem; box-shadow: var(--shadow); border-top: 5px solid var(--secondary); }
.item-card h3, .publicacion-card h3 { margin-bottom: 0.5rem; color: #0f172a; }
.card-actions { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.55rem; }

.badges { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0; }
.badge { font-size: 0.78rem; font-weight: 800; background: #e0f2fe; color: #0369a1; padding: 0.35rem 0.7rem; border-radius: 999px; }
.badge.estado { background: #dcfce7; color: #166534; }
.badge.puntos { background: #fef3c7; color: #92400e; }
.badge.warning { background: #ffedd5; color: #9a3412; }
.badge.muted { background: #e2e8f0; color: #475569; }

.info-list { display: grid; gap: 0.65rem; }
.info-row { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid #edf2f7; padding-bottom: 0.5rem; }
.info-row strong { color: #0f172a; }
.info-row span { color: var(--muted); text-align: right; }

.table-wrapper { overflow-x: auto; background: white; border-radius: 18px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; min-width: 650px; }
th, td { padding: 0.85rem 1rem; border-bottom: 1px solid #e5e7eb; text-align: left; }
th { background: #f8fafc; color: #334155; }

.footer { text-align: center; padding: 2rem; color: var(--muted); }

@media (max-width: 900px) {
  .hero, .auth-grid, .dashboard-grid, .form-row, .filters { grid-template-columns: 1fr; }
  .filters .btn { width: 100%; }
}

@media (max-width: 640px) {
  .navbar, .section-header { flex-direction: column; align-items: stretch; }
  .nav-actions, .hero-actions, .button-row, .form-actions { flex-direction: column; }
  .btn { width: 100%; }
  .container { padding: 0 1rem 2rem; }
  .hero { padding-top: 2rem; }
}

#valoracionesContainer {
    margin-top: 2rem;
}

.toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  background: #0f172a;
  color: white;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-weight: 700;
  z-index: 9999;
  max-width: 360px;
}

.toast.error {
  background: var(--danger);
}

.toast.success {
  background: var(--success);
}

input[readonly],
button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}