:root {
    --bg: #0f172a;
    --panel: #1e293b;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --brand: #22c55e;
    --brand-dark: #15803d;
    --border: #334155;
    --radius: 14px;
    --shadow: 0 12px 25px rgba(0, 0, 0, 0.35);
  }
  
  /* RESET */
  * { box-sizing: border-box; }
  
  html, body {
    height: 100%;
    margin: 0;
    font-family: system-ui, sans-serif;
    background: linear-gradient(135deg, #0f172a, #1e293b 60%, #0f172a);
    color: var(--text);
  }
  
  /* ----- Layout general ----- */
  .wrapper {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 20px;
  }
  
  .card {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 30px;
    box-shadow: var(--shadow);
    max-width: 480px;
    width: 100%;
    text-align: center;
    backdrop-filter: blur(8px);
    overflow: visible !important; /* ✅ permite que los selects se desplieguen hacia abajo */
  }
  
  .logo {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(90deg, var(--brand), #16a34a);
    -webkit-background-clip: text;
    color: transparent;
  }
  
  h1, h2 {
    font-size: 22px;
    margin: 8px 0 24px;
    color: #f8fafc;
  }
  
  .intro {
    color: var(--muted);
    margin-bottom: 24px;
  }
  
  /* ----- Formularios ----- */
  form {
    display: grid;
    gap: 18px;
    text-align: left;
  }
  
  label {
    font-size: 14px;
    font-weight: 500;
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
  }

  /* ===== Link de registro (debajo del login) ===== */
.register-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 15px;
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s, transform 0.1s;
}

.register-link:hover {
  color: var(--brand-dark);
  transform: translateY(-1px);
}

  
  /* Inputs y selects */
  input, select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.7);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: all 0.15s ease;
  }
  
  /* Efectos visuales */
  input:focus, select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
  }
  
  /* Select personalizado con flecha */
  select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23ffffff' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    padding-right: 36px; /* espacio para la flecha */
    cursor: pointer;
  }
  
  select:hover {
    border-color: var(--brand);
  }
  
  /* ----- Botones ----- */
  button {
    background: linear-gradient(90deg, var(--brand), var(--brand-dark));
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    width: 100%;
  }
  
  button:hover {
    background: linear-gradient(90deg, var(--brand-dark), var(--brand));
    transform: translateY(-1px);
  }
  
  /* ----- Mensajes ----- */
  .msg {
    text-align: center;
    font-size: 14px;
    margin-top: 10px;
  }
  
  .msg.error { color: #f87171; }
  .msg.logout { color: #22c55e; }
  
  /* ----- Footer ----- */
  .footer {
    margin-top: 22px;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
  }
  
  /* ----- Responsividad ----- */
  @media (max-width: 480px) {
    .card { padding: 28px 22px; }
  }
  

  /* ===== Dropdown custom (selectx) ===== */
.selectx { position: relative; }
.selectx-toggle{
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(15,23,42,.7);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
}
.selectx-toggle:focus{
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}
.selectx-label{ opacity: .95; }
.selectx svg{ opacity: .8; flex: 0 0 auto; }

.selectx-menu{
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); /* ⬇️ SIEMPRE abajo */
  max-height: 260px; overflow: auto;
  background: #111827;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(0,0,0,.45);
  padding: 6px 0;
  list-style: none; margin: 0;
  z-index: 9999;
  display: none;   /* hidden por defecto */
}
.selectx.open .selectx-menu{ display: block; }

.selectx-option{
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.selectx-option:hover{ background: rgba(255,255,255,.06); }
.selectx-option[aria-selected="true"]{
  background: rgba(34,197,94,.15);
  border-left: 3px solid var(--brand);
}

/* Asegura que la tarjeta no recorte el menú */
.card{ overflow: visible !important; }

/*////////////////////////////////mensaje de error/////////////////////////////*/
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 10px 0;
    font-weight: 500;
    text-align: center;
  }
  
  .alert.success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid #22c55e;
  }
  
  .alert.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid #ef4444;
  }
  
  /* ===== Dashboard ===== */
.card-lg { max-width: 980px; }

.title { 
  font-size: 1.6rem; 
  font-weight: 700; 
  color: #e5e7eb; 
  margin: .25rem 0 0.25rem; 
}
.subtitle { 
  color: #9ca3af; 
  margin-bottom: 1.25rem; 
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

.panel {
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 1rem;
  backdrop-filter: blur(6px);
}
.panel-title {
  color: #d1d5db;
  font-weight: 600;
  margin: 0 0 .75rem;
}

.keyval { 
  display: flex; gap: .5rem; align-items: center; 
  color: #cbd5e1; 
  margin: .5rem 0;
}
.keyval span:first-child { color: #94a3b8; min-width: 110px; }

.chip {
  display: inline-block;
  font-size: .85rem;
  padding: .25rem .5rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.chip-green { 
  background: rgba(34,197,94,.15);
  color: #86efac;
  border-color: rgba(34,197,94,.35);
}
.chip-gray {
  background: rgba(148,163,184,.12);
  color: #cbd5e1;
  border-color: rgba(148,163,184,.25);
}

/* Progreso */
.progress {
  width: 100%;
  height: 10px;
  background: rgba(148,163,184,.15);
  border-radius: 999px;
  overflow: hidden;
  margin: .75rem 0 .25rem;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  transition: width .6s ease;
}
.progress-meta {
  display: flex; justify-content: space-between; align-items: center;
  color: #94a3b8; font-size: .9rem; margin-bottom: .25rem;
}
.progress-meta strong { color: #e5e7eb; }

/* Lista de pendientes */
.todo { list-style: none; padding: 0; margin: 0; }
.todo li { 
  display: flex; gap: .5rem; align-items: center;
  padding: .4rem 0; color: #e5e7eb; 
}
.todo .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}

.empty { 
  color: #a7f3d0; 
  background: rgba(16,185,129,.12);
  border: 1px solid rgba(16,185,129,.25);
  padding: .65rem .75rem; border-radius: 10px;
}

/* Alerts (reusa estilos suaves) */
.alert { 
  padding: .6rem .75rem; border-radius: 10px; margin-bottom: .75rem; 
  font-size: .95rem; 
}
.alert.success { 
  background: rgba(34,197,94,.12);
  color: #86efac; 
  border: 1px solid rgba(34,197,94,.3);
}
.alert.error { 
  background: rgba(239,68,68,.12);
  color: #fca5a5; 
  border: 1px solid rgba(239,68,68,.3);
}

/* Botones */
.actions { margin-top: 1rem; }
.actions-row { display: flex; gap: .5rem; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  background: linear-gradient(180deg, #22c55e, #16a34a);
  color: white;
  font-weight: 600;
  padding: .6rem .9rem;
  border-radius: 12px;
  text-decoration: none;
  transition: transform .05s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }

.btn-secondary {
  background: rgba(99,102,241,.14);
  color: #c7d2fe;
  border: 1px solid rgba(99,102,241,.35);
}
.btn-secondary:hover { filter: brightness(1.08); }

/* ===== Layout base con sidebar ===== */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100dvh;
  background: #0f172a; /* tu fondo */
}

/* ===== Sidebar ===== */
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: rgba(11, 18, 32, 0.9);
  border-right: 1px solid rgba(255,255,255,.06);
  padding: 1rem .75rem;
  overflow-y: auto;
  backdrop-filter: blur(6px);
}

.sidebar-logo {
  color: #86efac; /* verde */
  font-weight: 800;
  letter-spacing: .3px;
  font-size: 1.05rem;
  margin: .25rem .5rem 1rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.sidebar .item {
  display: block;
  padding: .55rem .75rem;
  border-radius: 10px;
  color: #cbd5e1;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.sidebar .item:hover {
  background: rgba(148,163,184,.10);
  color: #e6f6ee;
  border-color: rgba(148,163,184,.15);
}
.sidebar .item.active {
  background: rgba(34,197,94,.14);
  color: #bbf7d0;
  border-color: rgba(34,197,94,.35);
  box-shadow: inset 0 0 0 1px rgba(34,197,94,.25);
}

/* ===== Contenido ===== */
.main {
  min-width: 0; /* evita overflow */
  display: flex;
  flex-direction: column;
}
.content-wrap {
  padding: 1.25rem;
}
@media (min-width: 1024px) {
  .content-wrap { padding: 1.75rem; }
}

/* ===== Botón toggle móvil ===== */
.menu-toggle {
  position: fixed;
  z-index: 60;
  top: .75rem;
  left: .75rem;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(17,24,39,.65);
  color: #e5e7eb;
  display: none; /* visible solo en móvil */
  align-items: center; justify-content: center;
}

/* ===== Responsive: sidebar colapsable ===== */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: 0 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 50;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .menu-toggle { display: inline-flex; }
  /* empuja el contenido cuando el menú está abierto (opcional) */
  body.sidebar-open .main::before {
    content: "";
    position: fixed; inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 40;
  }

  /*//////////////////////////VALIDACIONES REGISTRO.HTML////////////////////////////////*/
  /* Mensajes de error debajo de inputs */
.error-msg {
  display: block;
  font-size: 13px;
  color: #f87171;
  margin-top: 4px;
  min-height: 18px; /* evita salto de layout */
}

/* ===== Validación visual ===== */
.field-feedback {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-top: 6px;
  min-height: 18px;
}

.field-feedback.ok {
  color: #22c55e;                /* verde brillante */
  text-shadow: 0 0 6px rgba(34,197,94,.35);
}

.field-feedback.bad {
  color: #ff5757;                /* rojo neón */
  text-shadow: 0 0 6px rgba(255,87,87,.35);
}

/* Borde del input según estado */
.is-valid {
  border-color: #22c55e !important;
  box-shadow: 0 0 0 2px rgba(34,197,94,.25) !important;
}
.is-invalid {
  border-color: #ff5757 !important;
  box-shadow: 0 0 0 2px rgba(255,87,87,.25) !important;
}

/* ===== Barra de fortaleza de contraseña ===== */
.password-strength {
  height: 8px;
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  margin-top: 6px;
  overflow: hidden;
  visibility: hidden; /* se muestra cuando el usuario escribe */
}

.password-bar {
  height: 100%;
  width: 0%;
  background: #ef4444; /* rojo por defecto */
  border-radius: 999px;
  transition: width 0.25s ease, background 0.25s ease;
}

.password-text {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
  text-align: right;
  color: #f87171; /* rojo por defecto */
}

.error-msg {
  display: block;
  font-size: 13px;
  margin-top: 4px;
  font-weight: 500;
  color: #f87171; /* rojo más visible */
}

#password-strength {
  background: rgba(255,255,255,0.15);
  height: 6px;
  border-radius: 5px;
  overflow: hidden;
  margin-top: 6px;
}

#password-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ef4444, #22c55e);
  transition: width 0.3s ease;
}

}
