/* ═══════════════════════════════════════════════════════════════
   UniProy — aprobacion.css
   Bandeja de aprobación Fase 04 · Solo para admin-uniproy y admin
   ═══════════════════════════════════════════════════════════════ */

.apb-main { padding-block: 2rem 5rem; }

/* ── Gate ─────────────────────────────────────────────────────── */
.apb-gate {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 52vh; gap: 1rem; text-align: center;
}
.apb-gate-icon {
  width: 76px; height: 76px; border-radius: 24px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(181,161,96,.12); color: var(--gold); font-size: 2.1rem;
}
.apb-gate h3 {
  font-family: var(--font-heading); font-weight: 800;
  font-size: 1.15rem; color: var(--text); margin: 0;
}
.apb-gate p { color: var(--text-muted); font-size: .86rem; margin: 0; }

/* ── Page header ──────────────────────────────────────────────── */
.apb-header {
  margin-bottom: 28px;
}
.apb-kicker {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .67rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .13em; color: var(--brand); margin-bottom: 6px;
}
.apb-title {
  font-family: var(--font-heading); font-weight: 900;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem); color: var(--text);
  line-height: 1.15; margin: 0 0 8px;
}
.apb-sub {
  color: var(--text-muted); font-size: .88rem; margin: 0;
}

/* ── Stats strip ──────────────────────────────────────────────── */
.apb-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px; margin-bottom: 28px;
}
.apb-stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; padding: 16px 18px;
  box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; gap: 4px;
}
.apb-stat-num {
  font-family: var(--font-heading); font-weight: 900;
  font-size: 1.9rem; line-height: 1; color: var(--text);
}
.apb-stat-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted);
}
.apb-stat.is-pending  .apb-stat-num { color: var(--gold); }
.apb-stat.is-devuelto .apb-stat-num { color: #dc2626; }
.apb-stat.is-approved .apb-stat-num { color: var(--green); }

/* ── Tabs ─────────────────────────────────────────────────────── */
.apb-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 20px;
}
.apb-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: .46rem 1.1rem; border-radius: 14px;
  border: 1px solid var(--border);
  background: transparent; color: var(--text-muted);
  font-size: .82rem; font-weight: 700; cursor: pointer;
  transition: all .14s;
}
.apb-tab:hover {
  color: var(--brand); border-color: rgba(0,89,78,.2);
  background: rgba(0,89,78,.04);
}
.apb-tab.is-active {
  background: rgba(0,89,78,.1); border-color: rgba(0,89,78,.2);
  color: var(--brand);
}
.apb-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; padding: .05rem .45rem;
  border-radius: 999px; font-size: .7rem; font-weight: 800;
  background: rgba(0,89,78,.12); color: var(--brand);
}
.apb-tab.is-active .apb-tab-count {
  background: var(--brand); color: #fff;
}
.apb-tab.tab-devuelto.is-active { background: rgba(220,38,38,.08); border-color: rgba(220,38,38,.2); color: #dc2626; }
.apb-tab.tab-devuelto.is-active .apb-tab-count { background: #dc2626; }
.apb-tab.tab-aprobado.is-active { background: rgba(15,118,110,.1); border-color: rgba(15,118,110,.2); color: var(--green); }
.apb-tab.tab-aprobado.is-active .apb-tab-count { background: var(--green); }

/* ── Search bar ───────────────────────────────────────────────── */
.apb-search {
  position: relative; margin-bottom: 20px;
}
.apb-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: .85rem; pointer-events: none;
}
.apb-search-input {
  width: 100%; padding: .65rem 1rem .65rem 2.4rem;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--card); color: var(--text);
  font-size: .88rem; font-family: var(--font-body);
  transition: border-color .14s, box-shadow .14s;
}
.apb-search-input:focus {
  outline: none; border-color: rgba(0,89,78,.3);
  box-shadow: 0 0 0 3px rgba(0,89,78,.08);
}
.apb-search-input::placeholder { color: var(--text-muted); }

/* ── Project list ─────────────────────────────────────────────── */
.apb-list {
  display: flex; flex-direction: column; gap: 12px;
}
.apb-empty {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted); font-size: .88rem;
}
.apb-empty i { font-size: 2rem; opacity: .4; display: block; margin-bottom: 10px; }

/* ── Project card ─────────────────────────────────────────────── */
.apb-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow-soft);
  overflow: hidden; transition: box-shadow .18s, border-color .18s;
}
.apb-card:hover {
  box-shadow: var(--shadow-md); border-color: var(--border-strong);
}
.apb-card.is-pending   { border-left: 4px solid var(--gold); }
.apb-card.is-devuelto  { border-left: 4px solid #dc2626; }
.apb-card.is-aprobado  { border-left: 4px solid var(--green); }

.apb-card-inner {
  padding: 18px 20px; display: flex; align-items: flex-start;
  gap: 16px;
}
.apb-card-icon {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
}
.is-pending  .apb-card-icon { background: rgba(181,161,96,.12); color: var(--gold); }
.is-devuelto .apb-card-icon { background: rgba(220,38,38,.08);  color: #dc2626; }
.is-aprobado .apb-card-icon { background: rgba(15,118,110,.1);  color: var(--green); }

.apb-card-body { flex: 1; min-width: 0; }
.apb-card-title {
  font-family: var(--font-heading); font-weight: 800;
  font-size: .95rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin: 0 0 3px;
}
.apb-card-id {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted); margin-bottom: 8px;
}
.apb-card-meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}

/* badges */
.apb-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: .15rem .55rem; border-radius: 999px;
  font-size: .69rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
}
.apb-badge.pending  { background: rgba(181,161,96,.12); color: #8a6b19; }
.apb-badge.devuelto { background: rgba(220,38,38,.09);  color: #b91c1c; }
.apb-badge.aprobado { background: rgba(15,118,110,.10); color: var(--green); }
.apb-badge.vb-ok    { background: rgba(0,89,78,.10);    color: var(--brand); }
.apb-badge.vb-no    { background: var(--bg-soft);       color: var(--text-muted); }
.apb-badge.checklist-ok  { background: rgba(0,89,78,.1);   color: var(--brand); }
.apb-badge.checklist-no  { background: var(--bg-soft);      color: var(--text-muted); }
.apb-badge.listo    { background: rgba(0,89,78,.15); color: var(--brand); border: 1px solid rgba(0,89,78,.2); animation: apb-pulse 2s ease-in-out infinite; }

@keyframes apb-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .7; }
}

.apb-card-date {
  font-size: .72rem; color: var(--text-muted); margin-left: auto; white-space: nowrap;
}

/* actions */
.apb-card-foot {
  padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; background: var(--bg-soft);
}
.apb-card-owner {
  font-size: .75rem; color: var(--text-muted); flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.apb-card-owner i { margin-right: 4px; }

/* checklist progress bar */
.apb-checklist-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 0 20px 14px; font-size: .72rem; color: var(--text-muted);
}
.apb-bar-track {
  flex: 1; height: 5px; border-radius: 999px;
  background: var(--border); overflow: hidden;
}
.apb-bar-fill {
  height: 100%; border-radius: 999px; background: var(--brand);
  transition: width .4s ease;
}
.is-aprobado .apb-bar-fill { background: var(--green); }
.is-devuelto .apb-bar-fill { background: #dc2626; }

/* ── Loading skeleton ─────────────────────────────────────────── */
.apb-skeleton {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 20px;
  animation: apb-shimmer 1.4s linear infinite;
}
.apb-skeleton-line {
  height: 12px; border-radius: 6px; background: var(--border);
  margin-bottom: 10px;
}
.apb-skeleton-line:last-child { width: 60%; margin-bottom: 0; }
@keyframes apb-shimmer {
  0%   { opacity: 1; }
  50%  { opacity: .55; }
  100% { opacity: 1; }
}

/* ══════════════════════════════════════════════════════════════════
   Responsive · cobertura completa
   xl ≤ 1199.98 · lg ≤ 991.98 · md ≤ 767.98 · sm ≤ 639.98 · xs ≤ 479.98
   ══════════════════════════════════════════════════════════════════ */

/* xl — laptops 13–14" */
@media (max-width: 1199.98px) {
  .apb-stats { gap: 10px; margin-bottom: 22px; }
  .apb-stat  { padding: 14px 16px; }
}

/* lg — iPad landscape, laptops pequeños */
@media (max-width: 991.98px) {
  .apb-stats {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
  }
  .apb-stat-num { font-size: 1.6rem; }

  /* Tabs hacen scroll horizontal cuando son muchas */
  .apb-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    margin-inline: -2px;
    padding: 0 2px 4px;
  }
  .apb-tab { flex: 0 0 auto; }
}

/* md — iPad portrait (768) */
@media (max-width: 767.98px) {
  .apb-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .apb-card-inner { padding: 16px; gap: 12px; }
  .apb-card-icon { width: 40px; height: 40px; font-size: 1rem; border-radius: 12px; }

  .apb-card-foot {
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .apb-checklist-bar { padding: 0 16px 12px; }
}

/* sm — phones grandes (640) */
@media (max-width: 639.98px) {
  .apb-card-inner { flex-wrap: wrap; }
  .apb-card-date  { margin-left: 0; width: 100%; }
  .apb-card-foot  { flex-wrap: wrap; }

  .apb-card-title { white-space: normal; line-height: 1.3; }

  /* Botones del foot al 100% */
  .apb-card-foot .btn {
    flex: 1 1 100%;
    width: 100%;
    justify-content: center;
  }

  .apb-search-input { font-size: .9rem; padding: .6rem 1rem .6rem 2.3rem; }
}

/* xs — phones pequeños (480) */
@media (max-width: 479.98px) {
  .apb-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .apb-stat  { padding: 12px 14px; border-radius: 14px; }
  .apb-stat-num { font-size: 1.4rem; }

  .apb-card { border-radius: 16px; }
  .apb-card-inner { padding: 14px; gap: 10px; }
  .apb-card-foot  { padding: 10px 14px; }
  .apb-checklist-bar { padding: 0 14px 12px; }

  .apb-tab { padding: .38rem .85rem; font-size: .76rem; }
  .apb-tab-count { min-width: 18px; font-size: .66rem; }
}
