/* ==========================================================================
   base.css - Capa 2: fundacion (reset, tipografia, enlaces, topbar base,
   container, botones, tarjetas, tablas, status, listas, responsive).
   Fase 1: reglas movidas TAL CUAL desde el inicio de tqc.css (orden
   preservado => cascada identica). Depura/sub-divide en fases posteriores.
   ========================================================================== */
* { box-sizing: border-box; }
html { overflow-x: clip; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
a { color: var(--primary); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px; background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px); box-shadow: 0 2px 16px rgba(16, 24, 40, .08);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: grid; place-items: center; background: var(--primary); color: white;
  font-weight: 900; letter-spacing: .5px;
}
.brand strong { display: block; font-size: 16px; }
.brand span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.main-nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.main-nav a { color: var(--primary); }
.user-pill { padding: 8px 10px; background: var(--soft-blue); border-radius: var(--radius-pill); color: var(--primary); font-weight: 700; font-size: 13px; }
.container { width: 100%; max-width: 1280px; margin: 28px auto; padding: 0 18px 48px; flex: 1 0 auto; }
h1, h2 { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -1px; }
h1.page-title-compact { font-size: 1.5rem; line-height: 1.2; letter-spacing: -.025em; }
h2 { font-size: 20px; }
p { color: var(--muted); line-height: 1.5; }
.eyebrow { margin: 0 0 8px; color: var(--primary); text-transform: uppercase; letter-spacing: .09em; font-size: 12px; font-weight: 900; }
.hero, .page-heading, .profile-header {
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #eef5ff 100%);
  border: 1px solid var(--line); border-radius: var(--radius-2xl); padding: 26px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.primary-action, .secondary-action, button, .row-action {
  border: 0; border-radius: var(--radius-md); padding: 11px 16px; font-weight: 800; cursor: pointer; white-space: nowrap;
}
.primary-action, button { background: var(--primary); color: white; }
.secondary-action { background: #fff; color: var(--primary); border: 1px solid var(--line); }
.row-action { background: var(--soft-blue); color: var(--primary); padding: 8px 10px; font-size: 13px; }
.cards { display: grid; gap: 16px; margin: 18px 0; }
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.summary-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 20px; box-shadow: var(--shadow); }
.metric span { display: block; color: var(--muted); margin-bottom: 8px; font-weight: 700; }
.metric strong { display: block; font-size: 38px; letter-spacing: -1px; }
.metric.small strong { font-size: 30px; }
.metric small { color: var(--muted); display: block; margin-top: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.section-title span { color: var(--muted); font-size: 13px; font-weight: 800; }
.search-panel { display: grid; grid-template-columns: 1fr 200px auto auto; gap: 10px; margin: 18px 0; }
input, select { width: 100%; padding: 12px 13px; border-radius: var(--radius-md); border: 1px solid #cfd7e6; background: white; font-size: 14px; }
.result-info { color: var(--muted); font-size: 13px; font-weight: 700; margin: 8px 0 14px; }
.table-wrap { width: 100%; overflow: auto; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid var(--line); }
.table-wrap.no-shadow { box-shadow: none; border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px 14px; border-bottom: 1px solid #eef1f6; text-align: left; vertical-align: top; }
th { background: #f0f3f9; color: #344054; font-size: 13px; white-space: nowrap; }
td { font-size: 14px; }
.compact th, .compact td { padding: 10px 12px; font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 18px !important; }
.status { display: inline-flex; padding: 6px 10px; border-radius: var(--radius-pill); font-weight: 900; font-size: 12px; background: #eef2f6; color: #344054; }
.status-activo { background: #e8f7ef; color: var(--success); }
.status-retirado, .status-inactivo { background: #fff1f0; color: var(--danger); }
.status-vencido, .status-suspendido { background: #fff7e6; color: var(--warning); }
.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.simple-list li:last-child { border-bottom: 0; }
.simple-list span { color: var(--muted); }
.simple-list strong { color: var(--primary); }
.profile-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.profile-meta > span:not(.status) { color: var(--muted); font-weight: 800; }
.back-link { display: inline-block; margin-bottom: 12px; }
.current-contract { min-width: 250px; background: var(--primary); color: white; border-radius: var(--radius-xl); padding: 18px; }
.current-contract span, .current-contract small { display: block; opacity: .86; }
.current-contract strong { display: block; font-size: 30px; margin: 8px 0; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 0; }
.detail-list div { padding: 10px 0; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 900; margin-bottom: 4px; }
dd { margin: 0; font-weight: 700; }
.section-card { margin-top: 16px; }
.messages { margin-bottom: 16px; }
.message { padding: 12px 14px; border-radius: var(--radius-md); background: var(--soft-blue); border: 1px solid var(--line); }
@media (max-width: 900px) {
  .topbar, .hero, .page-heading, .profile-header { align-items: flex-start; flex-direction: column; }
  .grid-2 { grid-template-columns: 1fr; }
  .search-panel { grid-template-columns: 1fr; }
  .detail-list { grid-template-columns: 1fr; }
  .current-contract { width: 100%; }
}
