/* Reset & base */
* { box-sizing: border-box; }
:root {
  --bg1: #0b1020;
  --bg2: #121a36;
  --card: rgba(255,255,255,0.08);
  --card-border: rgba(255,255,255,0.12);
  --text: #e7e9f0;
  --muted: #a4acc4;
  --primary: #5aa2ff; /* acorde con theme.css */
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}
html, body { height: 100%; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: #0d1228;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background gradient */
.bg-gradient {
  background: radial-gradient(1200px 800px at 20% 20%, #203069 0%, transparent 60%),
              radial-gradient(1200px 800px at 80% 80%, #0b3b6d 0%, transparent 55%),
              linear-gradient(180deg, var(--bg1), var(--bg2));
}

/* Layout login */
.login-wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  height: 100%;
  padding: 32px;
}
@media (max-width: 980px) {
  .login-wrap { grid-template-columns: 1fr; padding: 18px; }
}

/* Brand panel (izquierda) */
.brand-panel {
  border: 1px solid var(--card-border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.brand-panel::after {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 50%;
  background: radial-gradient(600px 300px at 50% 0%, rgba(90,162,255,.15), transparent 60%);
  pointer-events: none;
}
.brand-content { padding: 42px; max-width: 660px; text-align: center; }
.brand-logo { width: 96px; height: 96px; object-fit: contain; filter: drop-shadow(0 8px 20px rgba(90,162,255,.25)); }
.brand-title { margin: 16px 0 6px; font-size: 40px; letter-spacing: .5px; }
.brand-subtitle { margin: 0; color: var(--muted); }

.brand-kpis { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.kpi-pill {
  padding: 6px 10px;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  font-size: 13px;
  color: #cdd6f4;
}
.brand-footer { margin-top: 30px; color: var(--muted); }

/* Card login (derecha) */
.glass {
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.login-card {
  padding: 28px;
  align-self: center;
}
.login-header h2 { margin: 0 0 6px; font-size: 28px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.login-form { margin-top: 16px; display: grid; gap: 10px; }
label { font-size: 13px; color: #cdd6f4; }
input[type="email"], input[type="password"], input[type="text"], input[type="number"], input[type="date"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  outline: none;
}
input::placeholder { color: #97a0bc; }

.input-with-action { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.input-with-action .ghost.small { height: 40px; padding: 0 10px; }

button, .btn {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease, background .15s ease;
}
.btn:hover { filter: brightness(1.03); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary), #2f70ff);
  border-color: rgba(255,255,255,.2);
  color: #fff;
}
.btn.stretch { width: 100%; }

.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  color: #cdd6f4;
}
.ghost.small { font-size: 14px; padding: 6px 10px; }

.spinner {
  display: none;
  margin-left: 8px;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.6);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading .spinner { display: inline-block; }
.loading { opacity: .9; }

.login-meta { margin-top: 12px; }
.msg { margin-top: 8px; min-height: 18px; }
code { background: rgba(255,255,255,.07); padding: 2px 6px; border-radius: 6px; }

/* Reutilizables que ya usamos en otras vistas */
.container { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.topbar {
  display:flex; justify-content: space-between; align-items:center;
  padding: 12px 16px; background: rgba(255,255,255,.04);
  border-bottom: 1px solid var(--card-border);
}
.brand { font-weight: 600; }
.link { color: var(--primary); text-decoration: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--card); border:1px solid var(--card-border); border-radius:12px; padding:16px; box-shadow: var(--shadow); }
.progress { background:#2a2f45; border-radius: 8px; overflow: hidden; height: 10px; margin-top:8px; width: 100%; }
.progress > div { height: 10px; background: var(--ok); width: 0%; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 12px; }
.kpi { background: var(--card); border:1px solid var(--card-border); border-radius:10px; padding:12px; }
.kpi .label { font-size: 12px; color:#c7cbe3; }
.kpi .value { font-size: 18px; font-weight: 700; }
.tabs { display:flex; gap:8px; margin-top: 16px; }
.tab { padding:8px 12px; border:1px solid var(--card-border); background: rgba(255,255,255,.06); border-radius:8px; color: var(--text); }
.tab.active { background:#1f2937; color:#fff; border-color:#1f2937; }
.tabpane { display:none; margin-top:12px; }
.tabpane.active { display:block; }
.row { display:flex; gap:10px; align-items: center; margin-top: 12px; }
.badge {
  display:inline-block; padding:2px 6px; border-radius: 6px;
  background:#eef2ff1a; color:#a5b4fc; font-size: 12px; border: 1px solid #818cf826;
}
.doc {
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  background: var(--card); border:1px solid var(--card-border); border-radius:8px; padding:10px; margin-top:8px;
}
