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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f0f2f5;
  color: #333;
}

/* LOGIN */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1a237e, #283593);
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.login-box h1 { margin-bottom: 5px; }
.login-box > p { color: #666; margin-bottom: 25px; }

.login-box input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}

.login-box button {
  width: 100%;
  padding: 12px;
  background: #1a237e;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

.login-box button:hover { background: #283593; }

.error { color: #d32f2f; margin-top: 10px; font-size: 0.9rem; }

/* PANEL LAYOUT */
.panel {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 240px;
  background: #1a237e;
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 { font-size: 1.3rem; }

.nav-menu {
  list-style: none;
  flex: 1;
  padding: 10px 0;
}

.nav-link {
  display: block;
  padding: 12px 20px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,0.1);
  color: white;
}

.sidebar-footer {
  padding: 15px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer p {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 8px;
}

.btn-logout {
  width: 100%;
  padding: 8px;
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  cursor: pointer;
}

.btn-logout:hover { background: rgba(255,255,255,0.2); }

/* CONTENT */
.content {
  flex: 1;
  margin-left: 240px;
  padding: 30px;
}

/* COMPONENTES REUTILIZABLES */
.page-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #1a237e;
}

.card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.stat-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  text-align: center;
}

.stat-card .value {
  font-size: 1.8rem;
  font-weight: bold;
  color: #1a237e;
}

.stat-card .label {
  font-size: 0.85rem;
  color: #888;
  margin-top: 5px;
}

/* TABLAS */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  background: #f5f5f5;
  font-weight: 600;
  font-size: 0.85rem;
  color: #666;
}

td { font-size: 0.9rem; }

/* BOTONES */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-primary { background: #1a237e; color: white; }
.btn-primary:hover { background: #283593; }
.btn-success { background: #2e7d32; color: white; }
.btn-success:hover { background: #388e3c; }
.btn-danger { background: #c62828; color: white; }
.btn-danger:hover { background: #d32f2f; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }

/* FORMULARIOS */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

/* ALERTAS */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 0.9rem;
}

.alert-warning { background: #fff3e0; color: #e65100; border: 1px solid #ffe0b2; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-danger { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }

/* BADGES */
.badge {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-danger { background: #ffebee; color: #c62828; }
.badge-success { background: #e8f5e9; color: #2e7d32; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-header h2, .nav-link span, .sidebar-footer p { display: none; }
  .content { margin-left: 60px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
