/* =============================================================================
   components.css — CSS de módulos migrado de bloques <style> embebidos.

   MIGRACIÓN: todo el CSS que antes vivía en <style> de cada template
   ahora se centraliza aquí. Las clases se mantienen intactas para no
   romper el HTML existente.

   ROADMAP: reemplazar gradualmente las clases personalizadas por
   equivalentes DaisyUI en los HTML (ej. emp-card → card card-body).
   ============================================================================= */

/* ── modulos/empleados/departamentos.html ──────────────────────────────────────── */
.departamentos-page .area-card {
      border: 1px solid #dbe3ef;
      border-radius: 14px;
      background: #fff;
      padding: 14px;
      margin-bottom: 12px;
    }
    .departamentos-page .area-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }
    .departamentos-page .field {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .departamentos-page .field.field-full {
      grid-column: 1 / -1;
    }
    .departamentos-page .field input,
    .departamentos-page .field select,
    .departamentos-page .field textarea {
      border: 1px solid color-mix(in srgb, var(--button-bg, #0f172a) 20%, #ffffff 80%);
      border-radius: 10px;
      padding: 10px 12px;
      font: inherit;
      color: var(--navbar-text, #1f172a);
      background: var(--field-color, #ffffff);
    }
    .departamentos-page .field textarea {
      min-height: 92px;
      resize: vertical;
    }
    .departamentos-page .color-field-row {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .departamentos-page .color-swatch {
      width: 40px;
      height: 40px;
      border-radius: 10px;
      border: 1px solid color-mix(in srgb, var(--button-bg, #0f172a) 22%, #ffffff 78%);
      background: #1d4ed8;
      flex: 0 0 40px;
    }
    .departamentos-page .btn-icon {
      width: 34px;
      height: 34px;
      padding: 0;
      border-radius: 10px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .departamentos-page .btn-icon img {
      width: 16px;
      height: 16px;
      object-fit: contain;
      display: block;
    }
    .departamentos-page .save-status {
      min-height: 20px;
      font-size: .9rem;
      font-weight: 600;
      align-self: center;
    }
    .departamentos-page .save-status.is-pending { color: #334155; }
    .departamentos-page .save-status.is-ok { color: #166534; }
    .departamentos-page .save-status.is-error { color: #b91c1c; }
    .departamentos-page .list {
      display: grid;
      gap: 10px;
    }
    .departamentos-page .list-item {
      border: 1px solid #dbe3ef;
      border-radius: 12px;
      padding: 10px 12px;
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: center;
      cursor: pointer;
      background: #fff;
    }
    .departamentos-page .list-item:hover {
      background: #f8fafc;
    }
    .departamentos-page .badge {
      border: 1px solid #dbe3ef;
      border-radius: 999px;
      padding: 3px 8px;
      font-size: .8rem;
    }
    .departamentos-page .kanban {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
      gap: 14px;
    }
    .departamentos-page .kanban-col {
      border: 1px dashed #cbd5e1;
      border-radius: 12px;
      padding: 10px;
      background: #fff;
    }
    .departamentos-page .kanban-col h4 {
      margin: 0 0 10px;
    }
    .departamentos-page .org-root {
      margin-bottom: 8px;
      font-weight: 700;
    }
    .departamentos-page .dept-org-modal {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.5);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 1200;
      padding: 16px;
    }
    .departamentos-page .dept-org-modal.open {
      display: flex;
    }
    .departamentos-page .dept-org-dialog {
      width: min(980px, 96vw);
      max-height: 90vh;
      overflow: auto;
      background: #ffffff;
      border-radius: 14px;
      border: 1px solid #dbe3ef;
      box-shadow: 0 18px 48px rgba(15, 23, 42, 0.24);
      padding: 14px;
    }
    .departamentos-page .dept-org-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      margin-bottom: 10px;
    }
    .departamentos-page .dept-org-title {
      margin: 0;
      font-size: 1rem;
      color: #0f172a;
    }
    .departamentos-page .dept-org-close {
      border: 1px solid #cbd5e1;
      border-radius: 10px;
      background: #fff;
      color: #0f172a;
      padding: 6px 10px;
      cursor: pointer;
      font-weight: 700;
    }
    .departamentos-page .emp-note {
      margin-top: 12px;
      border: 1px solid #dbe3ef;
      border-radius: 12px;
      background: #fff;
      overflow: hidden;
    }
    .departamentos-page .emp-note-tabs {
      display: flex;
      overflow-x: auto;
      scrollbar-width: none;
      border-bottom: 1px solid #e2e8f0;
      background: #f8fafc;
    }
    .departamentos-page .emp-note-tabs::-backendkit-scrollbar { display: none; }
    .departamentos-page .emp-note-tab {
      border: 0;
      background: transparent;
      padding: 10px 14px;
      font-weight: 700;
      cursor: pointer;
      color: #0f172a;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      white-space: nowrap;
      flex-shrink: 0;
    }
    .departamentos-page .emp-note-tab .tab-icon {
      width: 16px;
      height: 16px;
      display: inline-block;
      flex: 0 0 auto;
    }
    .departamentos-page .emp-note-tab.active {
      background: #ffffff;
      border-bottom: 2px solid #0f172a;
    }
    .departamentos-page .emp-note-tab .tab-label { display: inline; }
    .departamentos-page .emp-note-panel {
      padding: 10px 12px 12px;
    }
    .departamentos-page .emp-assigned-list {
      margin: 0;
      padding-left: 18px;
      display: grid;
      gap: 4px;
    }
    .departamentos-page .emp-assigned-meta {
      color: #334155;
      margin: 0 0 8px;
      font-weight: 600;
      font-size: .92rem;
    }
    .departamentos-page{
      --bg:#f6f8fb;
      --card:#ffffff;
      --border:#e7edf5;
      --text:#0f172a;
      --muted:#64748b;
      --shadow: 0 14px 32px rgba(15,23,42,.10);
      --radius:16px;
    }
    .departamentos-page .oc-card{
      width: 320px;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: hidden;
      transition: transform .18s ease, box-shadow .18s ease;
    }
    .departamentos-page .oc-card:hover{
      transform: translateY(-3px);
      box-shadow: 0 18px 40px rgba(15,23,42,.14);
    }
    .departamentos-page .oc-top{
      padding: 12px 14px;
      display:flex;
      justify-content:space-between;
      gap:10px;
      background: linear-gradient(180deg,#fff,#fbfdff);
    }
    .departamentos-page .oc-name{
      font-weight: 700;
      font-size: 14px;
      letter-spacing: -.01em;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .departamentos-page .oc-sub{
      display:flex;
      flex-wrap:wrap;
      gap:8px;
      margin-top: 8px;
    }
    .departamentos-page .oc-pill{
      font-size: 11px;
      color:#334155;
      background:#f8fafc;
      border:1px solid var(--border);
      border-radius:999px;
      padding: 6px 10px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
    }
    .departamentos-page .oc-score{
      font-weight: 800;
      font-size: 13px;
      background:#0f172a;
      color:#fff;
      border-radius:12px;
      padding: 8px 10px;
      height: fit-content;
      flex: 0 0 auto;
    }
    .departamentos-page .oc-progress{
      height: 10px;
      background:#e2e8f0;
      border-top:1px solid var(--border);
      border-bottom:1px solid var(--border);
    }
    .departamentos-page .oc-fill{
      height:100%;
      width:0%;
    }
    .departamentos-page .oc-bottom{
      padding: 12px 14px 14px;
      display:flex;
      justify-content:space-between;
      align-items:flex-end;
      gap: 10px;
    }
    .departamentos-page .oc-status{
      font-weight: 800;
      font-size: 12px;
    }
    .departamentos-page .oc-card[data-status="ok"] .oc-status{ color:#16a34a; }
    .departamentos-page .oc-card[data-status="warning"] .oc-status{ color:#f59e0b; }
    .departamentos-page .oc-card[data-status="danger"] .oc-status{ color:#ef4444; }
    .departamentos-page .oc-kpis{
      display:flex;
      gap:10px;
    }
    .departamentos-page .oc-kpi span{
      display:block;
      font-size:10px;
      color: var(--muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .departamentos-page .oc-kpi strong{
      display:block;
      font-size:13px;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    @media (max-width: 980px) {
      .departamentos-page .area-grid,
      .departamentos-page .kanban {
        grid-template-columns: 1fr;
      }
    }
    @keyframes spin {
      from { transform: rotate(0deg); }
      to   { transform: rotate(360deg); }
    }
/* ── modulos/kpis/kpis.html ──────────────────────────────────────── */
table {
            width: 100%;
            border-collapse: collapse;
        }
        th, td {
            border: 1px solid #ccc;
            padding: 8px;
            text-align: left;
        }
        th {
            background: #f4f6fb;
        }

/* ── modulos/empleados/empleados.html (CV accordion) ─────────────────────────── */
#empleados-module .cv-accordion {
  overflow: hidden;
}

#empleados-module .cv-accordion-title {
  list-style: none;
  cursor: pointer;
  padding: 0.85rem 1rem;
  position: relative;
  color: #0f172a;
}

#empleados-module .cv-accordion-title::-backendkit-details-marker {
  display: none;
}

#empleados-module .cv-accordion-title::after {
  content: "+";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #334155;
  font-weight: 700;
}

#empleados-module .cv-accordion[open] .cv-accordion-title::after {
  content: "−";
}

#empleados-module .cv-accordion-content {
  display: block;
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  overflow: hidden;
  padding: 0 1rem 1rem;
  transition: max-height 0.28s ease, opacity 0.22s ease, transform 0.22s ease;
}

#empleados-module .cv-accordion[open] .cv-accordion-content {
  max-height: 720px;
  opacity: 1;
  transform: translateY(0);
}

#empleados-module .cv-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

#empleados-module .cv-field-item {
  display: grid;
  gap: 6px;
}

#empleados-module .cv-field-item-full {
  grid-column: 1 / -1;
}

#empleados-module .cv-field-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #64748b;
}

#empleados-module .cv-field-value,
#empleados-module .cv-field-input {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1.5px solid var(--color-MAIN-300, #16a34a);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--color-MAIN-100, #f4f6fb);
  color: var(--color-MAIN-content, #0f172a);
  font-size: 0.98rem;
  line-height: 1.35;
}

#empleados-module .cv-field-input {
  width: 100%;
  outline: none;
}

#empleados-module .cv-field-input:focus {
  border-color: var(--color-MAIN-400, #059669);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-MAIN-200, #bbf7d0) 60%, #fff 40%);
}

#empleados-module .cv-field-textarea {
  min-height: 92px;
  resize: vertical;
  align-items: flex-start;
}

#empleados-module .cv-value-list {
  display: grid;
  gap: 8px;
}

#empleados-module .cv-value-item {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 12px;
  background: #eef2f7;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.35;
}

#empleados-module .cv-record-list {
  display: grid;
  gap: 12px;
}

#empleados-module .cv-record-card {
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #f8fafd;
  padding: 10px;
}

#empleados-module .cv-record-actions {
  display: flex;
  justify-content: flex-end;
}

#empleados-module .cv-record-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
}

#empleados-module .cv-record-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
  margin: 0;
}

#empleados-module .cv-readonly-checkbox {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: #0f172a;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  appearance: auto;
  opacity: 1;
}

@media (max-width: 900px) {
  #empleados-module .cv-field-grid {
    grid-template-columns: 1fr;
  }
}

/* Overrides institucionales para módulos migrados */
.departamentos-page .area-card,
.departamentos-page .list-item,
.departamentos-page .kanban-col,
.departamentos-page .emp-note,
.departamentos-page .dept-org-dialog,
.departamentos-page .cv-record-card,
#empleados-module .cv-record-card {
  border-color: var(--field-border, #cbd5e1);
  background: var(--content-bg, #ffffff);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--sidebar-bottom, #0f172a) 8%, transparent);
}

.departamentos-page .list-item:hover,
.departamentos-page .emp-note-tabs,
#empleados-module .cv-field-value,
#empleados-module .cv-field-input,
#empleados-module .cv-value-item {
  background: var(--surface-soft, #f8fafc);
}

.departamentos-page .dept-org-modal {
  background: color-mix(in srgb, var(--sidebar-bottom, #0f172a) 30%, transparent);
}

.departamentos-page .dept-org-title,
.departamentos-page .emp-note-tab,
.departamentos-page .oc-name,
.departamentos-page .oc-title,
#empleados-module .cv-field-value,
#empleados-module .cv-field-input {
  color: var(--body-text, #0f172a);
}

.departamentos-page .dept-org-close,
.departamentos-page .emp-note-tab.active,
.departamentos-page .poa-sub-btn,
#empleados-module .cv-field-input,
#empleados-module .cv-value-item {
  border-color: var(--field-border, #cbd5e1);
  background: var(--field-color, #ffffff);
  color: var(--field-text, #0f172a);
}

.departamentos-page .emp-note-tab.active {
  border-bottom-color: var(--button-bg, #0f172a);
}

.departamentos-page .save-status.is-pending,
.departamentos-page .emp-assigned-meta,
#empleados-module .cv-record-title,
#empleados-module .cv-field-label {
  color: color-mix(in srgb, var(--body-text, #0f172a) 58%, #ffffff 42%);
}

.departamentos-page .save-status.is-ok {
  color: color-mix(in srgb, var(--institutional-accent, #166534) 82%, #0b0b0b 18%);
}

.departamentos-page .save-status.is-error,
.departamentos-page .poa-sub-btn.warn {
  color: #b91c1c;
}

.departamentos-page .color-swatch,
#empleados-module .cv-readonly-checkbox {
  border-color: var(--field-border, #cbd5e1);
  accent-color: var(--button-bg, #0f172a);
}

.departamentos-page .oc-card {
  background: var(--content-bg, #ffffff);
  border-color: var(--field-border, #cbd5e1);
}

.departamentos-page .oc-top {
  background: linear-gradient(180deg, var(--content-bg, #ffffff), var(--surface-soft, #f8fafc));
}

.departamentos-page .oc-code {
  background: var(--button-bg, #0f172a);
  color: var(--button-text, #ffffff);
}

.departamentos-page .oc-meta,
.departamentos-page .cv-field-label,
#empleados-module .cv-record-title {
  color: color-mix(in srgb, var(--body-text, #0f172a) 56%, #ffffff 44%);
}
