:root {
  --primary: #1b396a;
  --secondary: #d1d5db;
  --accent: #f59e0b;
  --bg: #f3f4f6;
  --text: #1f2937;
}
* { box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { margin: 0; padding: 0; background-color: var(--bg); color: var(--text); display: flex; flex-direction: column; height: 100vh; }

header {
  background-color: var(--primary); color: white; padding: 1rem; font-size: 1.2rem; font-weight: bold;
  display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.user-info { font-size: 0.9rem; font-weight: normal; }
.logout-btn { background: #dc2626; border: none; padding: 5px 10px; color: white; border-radius: 4px; cursor: pointer; margin-left: 10px; }

#loginScreen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, #0d1b33 100%);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.login-box {
  background: white; padding: 2rem; border-radius: 8px; width: 90%; max-width: 400px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5); text-align: center;
}
.login-tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid #ddd; }
.tab { flex: 1; padding: 10px; cursor: pointer; background: #f9fafb; border: none; border-bottom: 3px solid transparent; }
.tab.active { border-bottom-color: var(--primary); font-weight: bold; background: white; }
.login-form { display: none; flex-direction: column; gap: 15px; }
.login-form.active { display: flex; }
.login-input { padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; }
.login-btn { padding: 10px; background: var(--primary); color: white; border: none; border-radius: 4px; font-size: 1rem; cursor: pointer; transition: 0.3s; }
.login-btn:hover { background: #142b52; }
.error-msg { color: #dc2626; font-size: 0.9rem; margin-top: 10px; display: none; }

.main-container { display: flex; flex: 1; overflow: hidden; height: 100%; }

aside.tablero {
  width: 280px; background: white; border-right: 1px solid #e5e7eb;
  padding: 1rem; overflow-y: auto; display: flex; flex-direction: column;
}
aside h3 { margin-top: 0; color: var(--primary); border-bottom: 2px solid var(--accent); padding-bottom: 5px; }

#statusCounts { display: flex; flex-direction: column; gap: 10px; }
.color-item { display: flex; align-items: center; font-size: 0.9rem; justify-content: space-between; }
.color-box { width: 15px; height: 15px; border-radius: 3px; margin-right: 8px; flex-shrink: 0; }
.count { background: #e5e7eb; padding: 2px 6px; border-radius: 10px; font-size: 0.8rem; font-weight: bold; }

.cafe { background: #8D6E63; }
.amarillo { background: #FFEB3B; }
.azul { background: #2196F3; }
.naranja { background: #FF9800; }
.rosa { background: #E91E63; }
.gris { background: #9E9E9E; }
.verde { background: #4CAF50; }

section.content { flex: 1; padding: 1.5rem; overflow-y: auto; display: flex; flex-direction: column; }

.botonera { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #ddd; }
.botonera button { background: white; border: 1px solid var(--primary); color: var(--primary); padding: 8px 15px; border-radius: 20px; cursor: pointer; transition: 0.2s; }
.botonera button:hover, .botonera button.active { background: var(--primary); color: white; }

.formulario { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); max-width: 800px; animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.formulario h3 { margin-top: 0; color: var(--primary); }
.formulario input, .formulario select { width: 100%; padding: 10px; margin: 8px 0 15px 0; border: 1px solid #ccc; border-radius: 4px; }
.formulario label { font-weight: 600; font-size: 0.9rem; }

.acciones { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.acciones button { padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; color: white; font-weight: bold; }
.guardar { background-color: #4CAF50; }
.buscar { background-color: #2196F3; }
.modificar { background-color: #FF9800; }
.eliminar { background-color: #F44336; }
.disabled { opacity: 0.5; pointer-events: none; }

/* .role-student .admin-only { display: none !important; } */
.role-student .acciones { display: none !important; }
.role-supervisor .delete-btn { display: none !important; }

.demo-badge { background: var(--accent); color: white; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; margin-left: 10px; }

@media (max-width: 768px) {
  .main-container { flex-direction: column; }
  aside.tablero { width: 100%; max-height: 200px; border-right: none; border-bottom: 1px solid #ccc; }
}