@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary-color: #4f46e5;      /* Indigo 600 */
  --primary-hover: #4338ca;      /* Indigo 700 */
  --secondary-color: #0f172a;    /* Slate 900 */
  --glass-bg: rgba(15, 23, 42, 0.55);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.05);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --success-bg: rgba(34, 197, 94, 0.15);
  --success-border: rgba(74, 222, 128, 0.25);
  --danger-bg: rgba(239, 68, 68, 0.15);
  --danger-border: rgba(248, 113, 113, 0.25);
}

body {
  margin: 0 !important;
  font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
  /* Fondo moderno oscuro con gradiente sutil */
  background: radial-gradient(circle at top right, #1e1b4b, #0f172a 40%, #020617 100%) no-repeat center center fixed !important;
  background-size: cover !important;
  min-height: 100vh;
  color: var(--text-main) !important;
}

.wrap {
  max-width: 1280px !important;
  margin: 40px auto !important;
  padding: 0 24px !important;
}

/* Glassmorphism Refinado */
.card, .box, .tile {
  background: var(--glass-bg) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  color: var(--text-main) !important;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
}

/* Brillo superior en las tarjetas */
.card::before, .box::before, .tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  opacity: 0.6;
}

.card, .box, .tile {
  animation: glassFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes glassFade {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tipografía */
h1, h2, h3, h4, h5, h6, .title, label, th, b {
  color: var(--text-main) !important;
  font-weight: 600;
  letter-spacing: -0.02em;
}

p, td, .sub, .muted, .note {
  color: var(--text-muted) !important;
  line-height: 1.6;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 24px;
}

.title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.sub {
  font-size: 14px;
  margin-top: 6px;
}

/* Grid del Dashboard */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}

@media (max-width: 1024px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

/* Tarjetas interactivas (Tiles) */
.tile {
  padding: 24px !important;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  cursor: default;
}

.tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6), 0 0 40px rgba(79, 70, 229, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  background: rgba(30, 41, 59, 0.6) !important;
}

.tile h3 {
  font-size: 20px;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tile h3 i {
  color: var(--primary-color);
  font-size: 22px;
}

.tile p {
  margin: 0;
  font-size: 14px;
}

.tile .spacer { flex: 1; }

.tile .actions {
  margin-top: 20px;
}

/* Formularios y Botones */
input, select, textarea {
  width: 100%;
  padding: 14px 16px;
  margin-top: 8px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-border) !important;
  background: rgba(0, 0, 0, 0.2) !important;
  color: var(--text-main) !important;
  font-size: 15px;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
  transition: all 0.2s ease;
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted) !important;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary-color) !important;
  background: rgba(0, 0, 0, 0.4) !important;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15) !important;
}

a.btn, button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none !important;
  background: var(--primary-color) !important;
  color: #ffffff !important;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3), 0 2px 4px -2px rgba(79, 70, 229, 0.3) !important;
}

a.btn:hover, button:hover, .btn:hover {
  transform: translateY(-2px);
  background: var(--primary-hover) !important;
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4), 0 4px 6px -4px rgba(79, 70, 229, 0.4) !important;
}

.btn2 {
  background: transparent !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: none !important;
}

.btn2:hover {
  background: var(--glass-highlight) !important;
  border-color: rgba(255,255,255,0.3) !important;
}

/* Alertas */
.msg, .err {
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-weight: 500;
  font-size: 14px;
}

.msg {
  background: var(--success-bg) !important;
  border: 1px solid var(--success-border) !important;
  color: #4ade80 !important;
}

.err {
  background: var(--danger-bg) !important;
  border: 1px solid var(--danger-border) !important;
  color: #f87171 !important;
}

/* Tablas */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
  font-size: 14px;
}

th, td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: rgba(0, 0, 0, 0.2) !important;
  color: var(--text-muted) !important;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.05em;
}

th:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
th:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

td {
  border-bottom: 1px solid var(--glass-border) !important;
}

tbody tr { transition: background-color 0.2s; }
tbody tr:hover { background-color: rgba(255, 255, 255, 0.03); }

/* Cajas centradas (Login, etc) */
.box {
  width: 100%;
  max-width: 440px;
  padding: 40px;
  margin: 60px auto;
}

.logo-wrap {
  text-align: center;
  margin-bottom: 30px;
}

.logo-wrap img {
  max-width: 280px;
  width: 80%;
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
}

.forgot {
  text-align: center;
  margin-top: 24px;
}

.forgot a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.forgot a:hover {
  color: var(--text-main);
}

/* --- ESTILOS DE WHATSAPP --- */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #25d366;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  text-align: center;
  font-size: 30px;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s ease;
}

.whatsapp-float:hover {
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0px 8px 20px rgba(37, 211, 102, 0.4);
  color: white;
}

.whatsapp-float i {
  margin-top: 2px;
}

@media (max-width: 768px) {
  .whatsapp-float {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 20px;
    font-size: 26px;
  }
}