/* ============================================================
   Estilo "Aero Glass" (inspirado en Windows Vista) — vidriado,
   translúcido, glossy. Pensado para pantalla completa.
   ============================================================ */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "Segoe UI Web", Tahoma, Verdana, Arial, sans-serif;
  color: #10202e;
}

/* Estas reglas (viewport fijo, sin scroll, fondo Aero) solo aplican a las
   pantallas del panel (body.app-shell). Las páginas de impresión NO llevan
   esta clase a propósito: necesitan poder crecer más allá de un viewport y
   no deben quedar recortadas por overflow:hidden. */
body.app-shell {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(255,255,255,0.55), rgba(255,255,255,0) 60%),
    linear-gradient(180deg, #bfe3ff 0%, #6fb3e6 22%, #2f7cc4 48%, #0d4f8b 72%, #08325e 100%);
  background-attachment: fixed;
}

/* textura sutil tipo "burbujas" de fondo Aero */
body.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(180px 180px at 80% 20%, rgba(255,255,255,0.18), transparent 60%),
    radial-gradient(260px 260px at 92% 75%, rgba(255,255,255,0.12), transparent 60%),
    radial-gradient(160px 160px at 8% 85%, rgba(255,255,255,0.10), transparent 60%);
  z-index: 0;
}

.aero-app {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Barra superior tipo título de ventana ---------- */
.aero-titlebar {
  height: 46px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.75), rgba(210,230,245,0.35) 45%, rgba(150,190,220,0.25) 100%);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset, 0 4px 12px rgba(0,20,40,0.25);
}
.aero-titlebar .buttons { display: flex; gap: 8px; }
.aero-orb {
  width: 14px; height: 14px; border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.9), 0 0 0 1px rgba(0,0,0,0.08);
}
.aero-orb.red { background: radial-gradient(circle at 30% 30%, #ff8a8a, #e0413a); }
.aero-orb.yellow { background: radial-gradient(circle at 30% 30%, #ffe28a, #e0a72e); }
.aero-orb.green { background: radial-gradient(circle at 30% 30%, #b6ffb0, #2fa63a); }
.aero-titlebar .title {
  font-weight: 600;
  font-size: 15px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
  letter-spacing: 0.2px;
}
.aero-titlebar .spacer { flex: 1; }
.aero-titlebar .empresa-switch select {
  font-size: 12.5px;
}
.aero-titlebar .user-chip {
  font-size: 12.5px;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 20px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.aero-titlebar .badge-role {
  background: linear-gradient(180deg,#4f9bd6,#1f5e9c);
  color: #fff;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.aero-titlebar .badge-demo {
  background: linear-gradient(180deg,#ffd76a,#e0a72e);
  color: #4a3300;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ---------- Cuerpo: sidebar + contenido ---------- */
.aero-body { flex: 1 1 auto; display: flex; min-height: 0; }

.aero-sidebar {
  width: 220px;
  flex: 0 0 auto;
  padding: 16px 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.30), rgba(255,255,255,0.08));
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-right: 1px solid rgba(255,255,255,0.35);
  overflow-y: auto;
}
.aero-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 8px;
  color: #0c2947;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.15s, border 0.15s;
}
.aero-nav a .ico { font-size: 15px; width: 18px; text-align: center; }
.aero-nav a:hover {
  background: rgba(255,255,255,0.35);
  border-color: rgba(255,255,255,0.55);
}
.aero-nav a.active {
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.45));
  border-color: rgba(255,255,255,0.9);
  box-shadow: 0 1px 4px rgba(0,30,60,0.25), 0 1px 0 rgba(255,255,255,0.9) inset;
  color: #06253f;
}
.aero-nav .section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(10,40,70,0.55);
  margin: 14px 10px 6px;
  font-weight: 700;
}

.aero-content {
  flex: 1 1 auto;
  padding: 18px 22px;
  overflow-y: auto;
}

/* ---------- "Ventanas" de contenido (glass panel) ---------- */
.glass-panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.62), rgba(255,255,255,0.28));
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,20,45,0.28), 0 1px 0 rgba(255,255,255,0.8) inset;
  margin-bottom: 18px;
  overflow: hidden;
}
.glass-panel > .panel-titlebar {
  padding: 9px 14px;
  background: linear-gradient(180deg, rgba(120,180,225,0.85), rgba(45,110,170,0.75));
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-shadow: 0 1px 1px rgba(0,20,40,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.35);
}
.glass-panel > .panel-body { padding: 16px; }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.3));
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(0,20,45,0.2), 0 1px 0 rgba(255,255,255,0.85) inset;
}
.stat-card .num { font-size: 26px; font-weight: 700; color: #0b3a63; }
.stat-card .lbl { font-size: 12px; color: #234a68; opacity: 0.85; margin-top: 2px;}
.stat-card.warn .num { color: #a45c00; }
.stat-card.danger .num { color: #b3261e; }

/* ---------- Botones glossy ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.6);
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(210,225,240,0.7));
  color: #0c2947;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 2px 6px rgba(0,20,45,0.18);
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, #6fb3ea, #2b74b8);
  color: #fff;
  border-color: rgba(255,255,255,0.55);
  text-shadow: 0 1px 1px rgba(0,30,60,0.35);
}
.btn-danger {
  background: linear-gradient(180deg, #ff9f8f, #d0473a);
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}
.btn-sm { padding: 4px 9px; font-size: 11.5px; }

/* ---------- Formularios ---------- */
label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; color: #12324f;}
input[type=text], input[type=password], input[type=date], input[type=number], input[type=file], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(20,60,100,0.35);
  background: rgba(255,255,255,0.8);
  font-size: 13px;
  margin-bottom: 12px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid #4f9bd6;
  background: #fff;
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 0 14px; }

/* ---------- Tablas ---------- */
table.aero-table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
table.aero-table th {
  text-align: left;
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.2));
  border-bottom: 2px solid rgba(20,60,100,0.25);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #123a5c;
}
table.aero-table td { padding: 7px 10px; border-bottom: 1px solid rgba(20,60,100,0.12); }
table.aero-table tr:hover td { background: rgba(255,255,255,0.35); }

.pill { padding: 2px 9px; border-radius: 10px; font-size: 10.8px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.pill-activa { background:#dff3e0; color:#1c7a2e; }
.pill-confirmada { background:#dbe9ff; color:#1a4fa0; }
.pill-anulada { background:#f4dede; color:#a02020; }
.pill-contingencia { background:#fff0d0; color:#a1650a; }
.pill-pendiente { background:#eee; color:#555; }
.pill-vencido { background:#fddede; color:#a02020; }
.pill-ok { background:#dff3e0; color:#1c7a2e; }
.pill-proximo { background:#fff0d0; color:#a1650a; }

.badge-alert {
  background: linear-gradient(180deg,#ff8f7c,#d0392a);
  color: #fff; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  padding: 1px 7px; margin-left: 6px;
}

a.link { color: #1a4fa0; }

.helptext { font-size: 11.5px; color: #345; opacity: 0.85; margin-top: -8px; margin-bottom: 12px;}

.flash {
  padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; font-weight: 600;
}
.flash-ok { background: #dff3e0; color: #1c7a2e; border: 1px solid #b7e4bc; }
.flash-error { background: #fde0e0; color: #a02020; border: 1px solid #f2b6b6; }
.flash-info { background: #dbe9ff; color: #1a4fa0; border: 1px solid #b7cdf2; }

/* ---------- Login ---------- */
.login-wrap {
  width: 100vw; height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  width: 380px;
  padding: 0;
}
.login-card .panel-body { padding: 26px 28px 22px; }
.login-logo {
  text-align: center;
  font-size: 21px;
  font-weight: 700;
  color: #0b3a63;
  margin-bottom: 4px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}
.login-sub { text-align: center; font-size: 11.5px; color: #345; margin-bottom: 18px; }
.demo-box {
  margin-top: 14px; padding: 10px 12px; border-radius: 8px;
  background: rgba(255,255,255,0.5); border: 1px dashed rgba(20,60,100,0.35);
  font-size: 11.5px;
}
.demo-box code { background: rgba(0,0,0,0.06); padding: 1px 5px; border-radius: 4px; }

/* ---------- Impresión ---------- */
@media print {
  body { background: #fff !important; }
  .no-print { display: none !important; }
  .aero-titlebar, .aero-sidebar { display: none !important; }
  .aero-content { padding: 0 !important; overflow: visible !important; }
  .glass-panel { box-shadow: none !important; backdrop-filter: none !important; background: #fff !important; border: 1px solid #999 !important; }
  .glass-panel > .panel-titlebar { background: #eee !important; color: #000 !important; text-shadow: none !important; }
}

.scroll-y { overflow-y: auto; }

.toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.toolbar .spacer { flex: 1; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5,20,35,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.modal-backdrop.hidden { display: none; }
.modal-card { width: 480px; max-width: 92vw; max-height: 86vh; overflow: auto; }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 10px; font-size: 13px; }
.kv .k { font-weight: 600; color: #12324f; }
