:root {
  --primary-red: #D91A2A;
  --dark-text: #222222;
  --bg-gray: #F4F6F8;
  --border-color: #E2E8F0;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background-color: var(--bg-gray); color: var(--dark-text); }

.layout { display: flex; min-height: 100vh; }

.sidebar { width: 260px; background: #ffffff; border-right: 1px solid var(--border-color); display: flex; flex-direction: column; }
.logo-box { padding: 1.5rem; border-bottom: 1px solid var(--border-color); text-align: center; }
.logo { max-width: 190px; height: auto; }

.nav-menu { padding: 1rem 0.75rem; flex: 1; }
.nav-group-title { font-size: 0.75rem; text-transform: uppercase; color: #888; font-weight: 700; margin: 1rem 0.5rem 0.4rem; }
.nav-btn { width: 100%; text-align: left; padding: 0.65rem 0.75rem; background: none; border: none; border-radius: 6px; cursor: pointer; font-size: 0.9rem; color: #444; font-weight: 500; margin-bottom: 2px; }
.nav-btn:hover { background-color: #f1f5f9; }
.nav-btn.active { background-color: var(--primary-red); color: #ffffff; font-weight: 600; }

.sidebar-footer { padding: 1rem; border-top: 1px solid var(--border-color); color: #999; text-align: center; }

.main-content { flex: 1; padding: 2rem; }
.topbar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.user-badge { background: #e2e8f0; padding: 0.4rem 0.8rem; border-radius: 20px; font-size: 0.85rem; font-weight: 600; }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.btn-action { background: #0f172a; color: white; border: none; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem; }

table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-top: 0.5rem; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border-color); font-size: 0.9rem; }
th { background: #f8fafc; font-weight: 600; color: #475569; }

.cards-grid { display: grid; gap: 1rem; margin-top: 1rem; }
.card { background: white; padding: 1.5rem; border-radius: 8px; border: 1px solid var(--border-color); }
.card h4 { margin-bottom: 0.5rem; color: var(--primary-red); }

/* Modal de alegaciones */
.modal-backdrop {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: white; border-radius: 8px; width: 500px; max-width: 90%;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2); overflow: hidden;
}
.modal-header {
  padding: 1rem 1.5rem; background: #f8fafc; border-bottom: 1px solid var(--border-color);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { font-size: 1.1rem; color: #1e293b; margin: 0; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #64748b; }

#form-alegacion { padding: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: #334155; }
.info-tag { background: #f1f5f9; padding: 0.6rem; border-radius: 6px; font-size: 0.85rem; color: #475569; }
textarea, input[type="file"] {
  width: 100%; border: 1px solid var(--border-color); border-radius: 6px; padding: 0.6rem; font-size: 0.9rem;
}
textarea:focus { outline: none; border-color: var(--primary-red); }

.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.5rem; }
.btn-secondary { background: #e2e8f0; border: none; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem; }
.btn-primary { background: var(--primary-red); color: white; border: none; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem; font-weight: 600; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }