/* ================================================
   SysMSP – Global Stylesheet
   ================================================ */

:root {
  --bg:      #0a1f4d;
  --bg-2:    #0e2a66;
  --card:    #0f2a5a;
  --card-2:  #10346f;
  --ink:     #0b1630;
  --white:   #ffffff;
  --muted:   #9bb3d6;
  --ring:    #a6c8ff;
  --shadow:  0 10px 30px rgba(10, 31, 77, 0.24);
}

/* ── Reset ────────────────────────────────────── */
*        { box-sizing: border-box; }
html,body{ height: 100%; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f7fbff 0%, #eef4ff 100%);
}

/* ── Hero / header ────────────────────────────── */
.hero {
  position: relative;
  background: var(--bg);
  color: var(--white);
  padding: 28px 16px 50px;
  border-bottom-left-radius:  16px;
  border-bottom-right-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  text-align: center;
}

.hero__container {
  max-width: 1200px;
  margin: 0 auto;
}

.hero__logos {
  position: absolute;
  top: 5px; left: 5px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  z-index: 2;
}

.hero__logos--right {
  left: auto;
  right: 5px;
}

.hero__logo {
  flex: 0 0 auto;
  height: clamp(55px, 10vw, 122px);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
  border-radius: 6px;
}

.hero__title {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 800;
  font-size: clamp(1.4rem, 2.2vw + 1rem, 2.2rem);
  padding-top: 10px;
}

@media (max-width: 420px) {
  .hero__logos  { justify-content: center; gap: 20px; }
  .hero__logo   { height: 40px; }
}

/* ── Layout ───────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 40px 16px 24px; }

/* ── Card grid (layout genérico para subpáginas) ─ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
  justify-content: center;
  gap: 28px;
  margin-top: 80px;
}

/* ── Card ─────────────────────────────────────── */
@keyframes card-in {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.card {
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  padding: 30px 18px 26px;
  text-decoration: none;
  color: var(--white);
  background: linear-gradient(160deg, var(--card) 0%, var(--card-2) 100%);
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(166, 200, 255, 0.35);
  position: relative;
  isolation: isolate;
  cursor: pointer;

  /* entrance */
  animation: card-in .45s cubic-bezier(.22,1,.36,1) both;

  /* hover / focus transitions */
  transition: transform .28s cubic-bezier(.22,1,.36,1),
              box-shadow .28s ease,
              filter .22s ease;
}

/* Staggered entrance for cards */
.grid > .card:nth-child(1) { animation-delay: .04s; }
.grid > .card:nth-child(2) { animation-delay: .10s; }
.grid > .card:nth-child(3) { animation-delay: .16s; }
.grid > .card:nth-child(4) { animation-delay: .22s; }
.grid > .card:nth-child(5) { animation-delay: .28s; }
.grid > .card:nth-child(6) { animation-delay: .34s; }
.grid > .card:nth-child(7) { animation-delay: .40s; }
.grid > .card:nth-child(8) { animation-delay: .46s; }

/* Inner-glow border overlay */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.50),
    rgba(166,200,255,0.20));
  -webkit-mask: linear-gradient(#000 0 0) content-box,
                linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box,
                linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  transition: opacity .25s ease;
}

.card:hover {
  transform: translateY(-5px);
  filter: brightness(1.07);
  box-shadow: 0 20px 50px rgba(10, 31, 77, 0.36);
}

.card:hover::before { opacity: 0.75; }

.card:active {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(10,31,77,0.28);
}

.card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring), var(--shadow);
}

/* Icon pill – frosted-glass container */
.card__icon {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 22px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #e9f2ff;
}

.card__icon--img {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  padding: 12px;
}

.card__icon-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.30));
}

.card__title {
  font-weight: 700;
  letter-spacing: .4px;
  font-size: 0.82rem;
  text-transform: uppercase;
}

/* Optional short description inside a card */
.card__desc {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.55);
  font-weight: 400;
  line-height: 1.4;
  max-width: 170px;
  margin-top: -2px;
}

/* ── Footer ───────────────────────────────────── */
.footer {
  display: grid;
  place-items: center;
  padding: 22px 16px 36px;
  color: #5a6d93;
  font-size: .9rem;
}

/* ── Reduced-motion override ──────────────────── */
@media (prefers-reduced-motion: reduce) {
  .card { animation: none; transition: none; }
  .card:hover { transform: none; }
}

/* ── Buttons (base) ──────────────────────────── */
.btn, .nav-btn, .back, .logout-btn {
  display: inline-block;
  background: #fff;
  color: #0e2a66;
  border: 1px solid rgba(166,200,255,0.45);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}

.btn {
  padding: 6px 12px;
  border-radius: 6px;
}

.nav-btn, .back, .logout-btn {
  padding: 8px 16px;
  border-radius: 8px;
  letter-spacing: .3px;
  box-shadow: 0 4px 14px rgba(10,31,77,0.18);
}

.btn:hover, .nav-btn:hover, .back:hover, .logout-btn:hover {
  background: #f0f6ff;
  transform: translateY(-2px);
  box-shadow: 0 7px 22px rgba(10,31,77,0.28);
}
.btn:hover   { transform: translateY(-1px); }

.btn:active, .nav-btn:active, .back:active, .logout-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(10,31,77,0.2);
}

.btn:disabled{ opacity: 0.4; cursor: default; transform: none; }

.nav-btn:focus-visible, .back:focus-visible, .logout-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring), 0 4px 14px rgba(10,31,77,0.28);
}

.floating-left  { position: absolute; top: 16px; left:  152px; z-index: 10; width: 180px; text-align: center; }
.floating-right { position: absolute; top: 16px; right: 100px; z-index: 10; width: 180px; text-align: center; }

/* ── Action buttons (inside table rows) ───────── */
.action-btn {
  background: none;
  border: 1px solid rgba(166,200,255,0.45);
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  color: #0e2a66;
  font-size: 1rem;
  line-height: 1;
  font-family: inherit;
  transition: background .15s, transform .1s;
}
.action-btn:hover               { background: #e8f0fe; transform: translateY(-1px); }
.action-btn--delete             { color: #b91c1c; border-color: rgba(185,28,28,0.25); }
.action-btn--delete:hover       { background: #fee2e2; }

/* ── Image cards (indicadores / estadísticas) ─── */
.image-card {
  border: 1px solid #e6e8ec;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(10,24,64,0.07);
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.image-card:hover {
  box-shadow: 0 10px 28px rgba(10,24,64,0.12);
  transform: translateY(-2px);
}
.image-card__body { padding: 14px; }
.image-card img   { display: block; width: 100%; height: auto; border-radius: 8px; }

/* ── Status badges ────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge--ok      { background: #dcfce7; color: #166534; }
.badge--off     { background: #fee2e2; color: #b91c1c; }
.badge--neutral { background: #f3f4f6; color: #374151; }

/* ── Toolbar / search row ─────────────────────── */
.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.toolbar-row h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0a1f4d;
}
.toolbar-row label {
  font-size: 0.88rem;
  color: #374151;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.toolbar-row .meta-info {
  color: #5a6d93;
  font-size: 0.82rem;
  margin-left: auto;
}

.toolbar-input {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  min-width: 200px;
}
.toolbar-input:focus {
  border-color: #10346f;
  box-shadow: 0 0 0 3px rgba(16,52,111,0.12);
}
input.toolbar-input[type="text"] { min-width: 280px; }

/* ── Pagination row ───────────────────────────── */
.pagination-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}
/* ── Numbered page buttons ────────────────────── */
.page-numbers { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pg-btn {
  min-width: 32px; height: 32px; padding: 0 6px;
  border-radius: 7px; border: 1px solid #d1d5db;
  background: #fff; cursor: pointer;
  font-size: 0.82rem; font-weight: 600; color: #374151;
  font-family: inherit;
  transition: background .12s, color .12s, border-color .12s;
}
.pg-btn:hover:not(:disabled) { background: #f0f4ff; border-color: #93a8d6; }
.pg-btn--active {
  background: linear-gradient(160deg, #0f2a5a, #10346f);
  color: #fff; border-color: #0f2a5a;
}
.pg-ellipsis { color: #94a3b8; padding: 0 4px; font-size: 0.88rem; user-select: none; }
.per-page-label {
  margin-left: auto;
  font-size: 0.82rem; color: #374151; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.per-page-label select { min-width: 0; width: auto; padding: 6px 8px; }

/* ── Inventory table ──────────────────────────── */
.inv-wrap {
  overflow: auto;
  border: 1px solid rgba(166,200,255,0.45);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(10,31,77,0.08);
}

.inv-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.inv-table th {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #f5f9ff 0%, #eef4ff 100%);
  text-align: center;
  padding: 11px 14px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #0e2a66;
  border-bottom: 2px solid rgba(166,200,255,0.50);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.inv-table td {
  padding: 10px 14px;
  font-size: 0.875rem;
  color: #0b1630;
  border-bottom: 1px solid #eef4ff;
  vertical-align: middle;
  text-align: center;
}

.inv-table tbody tr               { transition: background .12s ease; }
.inv-table tbody tr:nth-child(even)       { background: #fafcff; }
.inv-table tbody tr:hover                 { background: #eef5ff; }
.inv-table tbody tr:nth-child(even):hover { background: #e8f1ff; }
.inv-table tbody tr:last-child td         { border-bottom: none; }

/* Stacked cell typography */
.cell-primary   { font-size: .875rem; font-weight: 600; color: #0b1630; line-height: 1.35; }
.cell-secondary { font-size: .76rem;  color: #6b7280;   margin-top: 2px; line-height: 1.3; }
.cell-tag {
  display: inline-block;
  font-size: .65rem; font-weight: 700;
  color: #6b7280; background: #f1f5f9;
  border-radius: 4px; padding: 1px 5px;
  margin-right: 4px; letter-spacing: .2px;
  vertical-align: middle;
}

/* Truncating cell (unidad, observaciones) */
.cell-truncate {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .875rem;
  color: #0b1630;
  vertical-align: middle;
}

/* Actions column */
.inv-table .th-actions,
.inv-table .td-actions {
  text-align: center;
  white-space: nowrap;
  width: 90px;
  vertical-align: middle;
}

.inv-table .td-center {
  text-align: center;
  vertical-align: middle;
  font-size: .875rem;
  color: #0b1630;
}

/* ── PDL info card (visualizacion-horas) ──────── */
.pdl-card {
  max-width: 1200px;
  margin: 20px auto;
  background: #fff;
  border: 1px solid rgba(166,200,255,.45);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(10,31,77,.08);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: row;
}
.pdl-card__header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  background: linear-gradient(135deg, var(--bg), var(--bg-2));
  color: #fff;
  flex-shrink: 0;
  min-width: 240px;
}
.pdl-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
}
.pdl-card__avatar::after { content: "\1F464"; }
.pdl-card__info       { display: flex; flex-direction: column; }
.pdl-card__name       { font-size: 1.1rem; color: #fff; font-weight: 800; }
.pdl-card__cedula     { font-size: 0.78rem; color: rgba(255,255,255,0.7); }
.pdl-card__metrics    { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 20px; flex: 1; align-content: center; }
.pdl-metric {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(166,200,255,.35);
  min-width: 140px;
  flex: 1 1 140px;
  display: flex;
  flex-direction: column;
  transition: all .2s ease;
}
.pdl-metric:hover {
  box-shadow: 0 4px 14px rgba(10,31,77,.08);
  transform: translateY(-1px);
}
.pdl-metric span   { font-size: 0.68rem; font-weight: 600; color: #0e2a66; margin-bottom: 3px; text-transform: uppercase; letter-spacing: .3px; }
.pdl-metric strong { font-size: 0.84rem; color: #1e293b; font-weight: 600; }

@media (max-width: 800px) {
  .pdl-card { flex-direction: column; }
  .pdl-card__header { min-width: auto; }
}

/* ── Planes productivos link bar ─────────────── */
.planes-link-bar {
  max-width: 1200px;
  margin: 0 auto 8px;
  padding: 0 24px;
  display: flex;
  justify-content: center;
}
.planes-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0e2a66, #1e40af);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(14,42,102,.25);
  transition: all .25s ease;
  letter-spacing: .3px;
}
.planes-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(14,42,102,.35);
  filter: brightness(1.1);
}
.planes-link-btn:active { transform: translateY(0); }
.planes-link-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Overlay de carga ────────────────────────────── */
.msp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(128, 128, 128, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.msp-overlay--visible {
  display: flex;
}
.msp-overlay__text {
  background: #121212d0;
  color: #fff;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  text-align: center;
  max-width: 400px;
}

/* ── SurveyJS: layout compartido ───────────────────────────── */
.survey-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 100%;
  height: 100%;
}

.survey-container .sd-body,
.survey-container .sd-body.sd-body--static,
.survey-container .sd-body.sd-body--responsive {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

