/* style.css - Actualizado: solo cambios solicitados para el mensaje de error
   - .error-box: tamaño más pequeño, color de error profesional, fondo y borde sutiles.
   - Mantiene el resto de estilos que ya tenías.
*/

/* =========================
   Paleta y variables globales
   ========================= */
:root {
  --color-black: rgb(20, 20, 20);
  --color-gray-900: rgb(60, 60, 60);
  --color-gray-700: rgb(120, 120, 120);
  --color-gray-300: rgb(220, 220, 220);
  --color-white: rgb(255, 255, 255);

  --color-primary: rgb(6, 52, 79);
  --color-secondary: rgb(60, 140, 90);
  --color-accent: rgb(150, 210, 60);

  --bg-main: var(--color-white);
  --bg-muted: var(--color-gray-300);
  --bg-surface: var(--color-white);

  --text-main: var(--color-gray-900);
  --text-muted: rgb(110, 120, 140);
  --text-inverse: var(--color-white);

  --border-color: rgb(200, 200, 200);

  --success: rgb(60, 140, 90);
  --warning: rgb(240, 180, 60);
  --error: rgb(200, 60, 60);

  /* Bordes redondeados */
  --round: 0.4rem;

  /* Transiciones (más suaves/lentas) */
  --transition-fast: 320ms;
  --transition-medium: 620ms;

  /* Botón transición más lenta y suave */
  --btn-transition: 760ms cubic-bezier(.2,.9,.2,1);

  /* Efectos sutiles */
  --input-hover-shadow: 0 8px 20px rgba(11,17,29,0.06);
  --btn-hover-shadow: 0 14px 40px rgba(29,78,216,0.14);
}

/* Modo oscuro (aplicable con data-theme="dark") */
[data-theme="dark"] {
  --bg-main: rgb(15, 23, 32);
  --bg-muted: rgb(25, 35, 45);
  --bg-surface: rgb(20, 30, 40);

  --text-main: rgb(230, 230, 230);
  --text-muted: rgb(110, 120, 140);

  --border-color: rgb(45, 55, 65);
}

/* =========================
   Reset + base (fuente clara)
   ========================= */
* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-main);
  color: var(--text-main);
  font-weight: 400;
}

/* Links, buttons base */
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* Small utilities */
.mt-10 { margin-top: 12px; }
.mb-8 { margin-bottom: 8px; }
.text-muted { color: var(--text-muted); }

/* =========================
   LOGIN (AISLADO)
   ========================= */
/* Fondo del index */
body.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(0deg,#081228 0%, #020B31 100%);
  color: var(--text-inverse);
}

/* Shell central */
.login-shell {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

/* Logo + título centrados */
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 6px;
}
.login-brand img {
  width: 220px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.45));
}

/* Títulos */
/* Updated: requested values */
.login-title {
  font-size: 26px;
  font-weight: 500;    /* requested */
  letter-spacing: 0px; /* requested */
  color: var(--text-inverse);
  margin: 0;
}
.login-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.72);
  margin: 0;
}

/* Card (form): fondo #F9FAFB y texto negro */
.login-card {
  width: 420px;
  max-width: 96%;
  background: #F9FAFB;
  border-radius: var(--round);
  padding: 26px;
  box-shadow: 0 18px 40px rgba(2,6,23,0.14);
  border: 1px solid rgba(6,52,79,0.04);
  color: var(--color-black);
}

/* Card heading */
.login-card h3 {
  margin: 0 0 6px 0;
  font-size: 20px;
  text-align: center;
  color: var(--color-black);
  font-weight: 600;
}
.login-card p.lead {
  margin: 0 0 18px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ERROR BOX - estilo nuevo y profesional */
.error-box {
  display: block;
  width: auto;
  margin: 8px auto 14px auto;
  padding: 8px 12px;
  font-size: 12px;                  /* más pequeño */
  line-height: 1;
  color: var(--error);              /* color de error definido en variables */
  background: rgba(200,60,60,0.06); /* fondo sutil */
  border: 1px solid rgba(200,60,60,0.12);
  border-radius: calc(var(--round) - 0.08rem);
  text-align: center;
  box-shadow: none;
}

/* Inputs: fondo blanco y borde #d1d5db; inputs con padding 6px 0px */
.input-group,
.input-password,
.input-group input,
.input-password input,
.form-row input,
.form-row select {
  background: #FFFFFF;
  border: 1px solid #d1d5db;
  border-radius: var(--round);
  color: var(--color-black);
  transition: box-shadow var(--transition-medium), border-color var(--transition-medium);
}

/* Input group with icon on left (gap reducido) */
.input-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
}
.input-group .icon {
  width: 28px; height: 28px;
  display:flex; align-items:center; justify-content:center;
  color: var(--color-primary);
  font-size: 14px;
  flex: 0 0 28px;
}
.input-group input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-black);
  width: 100%;
  font-size: 15px;
  padding: 6px 0px;
}

/* Password group: icon left + eye right */
.input-password {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
}
.input-password .icon {
  width: 28px; height: 28px;
  display:flex; align-items:center; justify-content:center;
  color: var(--color-primary);
  font-size: 14px;
  flex: 0 0 28px;
}
.input-password input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-black);
  width: 100%;
  font-size: 15px;
  padding: 6px 0px;
}
.input-password .toggle-eye {
  width: 28px; height: 28px; display:flex; align-items:center; justify-content:center; color: var(--color-primary); cursor:pointer;
  flex: 0 0 28px;
}

/* Hover & focus effect for input-group and password group:
   - Change the outer container border to #90a0b5 and add a subtle shadow.
   - Smooth transitions use --transition-medium.
*/
.input-group:hover,
.input-password:hover,
.input-group:focus-within,
.input-password:focus-within {
  border-color: #90a0b5;
  box-shadow: var(--input-hover-shadow);
}

/* Placeholder color */
.input-group input::placeholder,
.input-password input::placeholder {
  color: #9ca3af;
}

/* Labels */
.form-label {
  display:block;
  margin: 12px 0 2px 2px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

/* Botones: base gradient (con capa ::before para invertir gradiente al hover) */
.btn-login {
  position: relative;
  overflow: hidden;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 0;
  padding: 12px 16px;
  border-radius: calc(var(--round));
  background: linear-gradient(to right, #2563eb 0%, #1d4ed8 100%);
  color: var(--text-inverse);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transform: translateY(0);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
  transition:
    transform 0.65s ease,
    box-shadow 0.65s ease;
}
/* Capa del gradiente invertido */
.btn-login::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, #1d4ed8 0%, #2563eb 100%);
  opacity: 0;
  transition: opacity 0.9s ease;
  z-index: 0;
}
/* Mantener el contenido encima */
.btn-login > * {
  position: relative;
  z-index: 1;
}
/* Hover */
.btn-login:hover,
.btn-login:focus {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.22);
}
.btn-login:hover::before,
.btn-login:focus::before {
  opacity: 1;
}

/* Keep .btn-primary base style but no hover inversion */
.btn-primary {
  background: linear-gradient(to right,#2563eb 0%,#1d4ed8 100%);
  color: var(--text-inverse);
  border: 0;
  box-shadow: 0 8px 24px rgba(37,99,235,0.12);
  transition: none;
}

/* secure-badge */
.secure-badge {
  display:flex;
  align-items:center;
  gap:10px;
  background: #172b56;
  color: var(--text-inverse);
  padding: 10px 30px;
  border-radius: calc(var(--round));
  margin-top: 14px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 400;
  align-self: center;
}

/* Footer small note */
.login-footer-note {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
}

/* Responsiveness */
@media (max-width: 520px) {
  .login-card { width: 100%; padding: 18px; }
  .login-brand img { width: 160px; }
}

/* =========================
   REST OF APP: dashboard, header, sidebar, modals
   Keep styles stable; removed unwanted hover/transform effects
   ========================= */

/* Topbar */
.topbar{
  position:fixed; top:0; left:0; right:0; height:64px;
  background: linear-gradient(90deg,#fff,#fbfdff);
  box-shadow:0 1px 4px rgba(12,15,20,0.04);
  z-index:60;
  border-bottom:1px solid rgba(15,23,42,0.04);
}
.topbar-inner{height:100%;display:flex;align-items:center;justify-content:space-between;padding:10px 20px}
.brand{display:flex;align-items:center;gap:12px}
.brand-logo{width:44px;height:44px;object-fit:contain;border-radius:var(--round)}
.brand-title{font-weight:700}
.brand-sub{font-size:12px;color:var(--text-muted)}

/* Sidebar */
.sidebar{
  position:fixed;top:64px;left:0;bottom:0;width:260px;background:var(--bg-surface);padding:18px;border-right:1px solid rgba(15,23,42,0.04);overflow:auto;
}
.sidebar nav ul{list-style:none;padding:0;margin:0}
.sidebar nav li{margin-bottom:6px}
.sidebar nav li.nav-header{font-size:12px;color:var(--text-muted);padding:8px 0}
.sidebar nav a{display:flex;align-items:center;gap:10px;padding:10px;border-radius:var(--round);color:var(--text-main)}
.sidebar nav a i{width:18px;text-align:center;font-size:14px;color:var(--text-muted)}
.sidebar nav li.active a{background:linear-gradient(90deg,rgba(6,52,79,0.06),rgba(60,140,90,0.03));border-left:4px solid var(--color-primary);padding-left:8px;font-weight:600}

/* Content wrapper */
.content-wrapper{margin-top:64px;margin-left:260px;padding:28px 24px 80px}
.container{max-width:1200px;margin:0 auto}

/* Cards & panels (no hover transforms) */
.card{
  display:flex;align-items:center;gap:12px;
  background:var(--bg-surface);
  padding:16px;
  border-radius:var(--round);
  box-shadow:0 6px 18px rgba(15,23,42,0.03);
}
.card-icon{width:56px;height:56px;border-radius:var(--round);display:flex;align-items:center;justify-content:center;color:#fff;font-size:20px}
.card-icon.bg-blue{background:#2563eb}
.card-icon.bg-green{background:#16a34a}
.card-icon.bg-yellow{background:#f59e0b}
.card-body{flex:1}
.card-title{font-size:13px;color:var(--text-muted)}
.card-value{font-size:22px;font-weight:700}
.card-note{font-size:12px;color:var(--text-muted)}

/* Modal */
.modal-overlay{position:fixed;inset:0;background:rgba(2,6,23,0.5);opacity:0;pointer-events:none;transition:all .18s}
.modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:all .18s}
.modal.open{opacity:1;pointer-events:auto}
.modal-card{width:520px;max-width:95%;background:var(--bg-surface);border-radius:var(--round);box-shadow:0 8px 30px rgba(2,6,23,0.12);overflow:hidden}
.modal-header{display:flex;justify-content:space-between;align-items:center;padding:14px 18px;border-bottom:1px solid #eef2f7}
.modal-body{padding:16px}
.modal-close{background:transparent;border:none;font-size:20px;cursor:pointer}
.form-row{margin-bottom:12px}
.form-row label{display:block;font-size:13px;color:var(--text-muted);margin-bottom:6px}
.form-row input,.form-row select{width:100%;padding:10px;border-radius:var(--round);border:1px solid #e6e9ef}
.form-actions{text-align:right;display:flex;gap:8px;justify-content:flex-end}

/* Responsive adjustments for dashboard */
@media (max-width: 900px) {
  .content-wrapper{margin-left:0;padding:16px}
  .sidebar{position:fixed;left:-100%;transition:left .18s}
  .sidebar.open{left:0;z-index:80}
  .mobile-only{display:inline-flex}
}
@media (min-width:901px){
  .mobile-only{display:none}
}