/* css/modules/rrhh.css */

.rrhh-wrapper { padding: 0 4px; }

.rrhh-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rrhh-title  { font-size: 1rem; font-weight: 700; color: #0f172a; margin: 0; display: flex; align-items: center; gap: 8px; }
.rrhh-btn-add { display: flex; align-items: center; gap: 6px; background: #10b981; color: white; border: none; border-radius: 7px; padding: 7px 14px; font-size: 0.75rem; font-weight: 700; cursor: pointer; font-family: inherit; transition: background 0.2s; }
.rrhh-btn-add:hover { background: #059669; }

/* Filtros */
.rrhh-filters { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.rrhh-filter-group { display: flex; gap: 4px; background: #f1f5f9; border-radius: 8px; padding: 3px; }
.rrhh-filter-btn { background: none; border: none; border-radius: 6px; padding: 5px 12px; font-size: 0.72rem; font-weight: 600; color: #64748b; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.rrhh-filter-btn.active { background: white; color: #0f172a; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

/* Grid de cards */
#rrhh-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }

/* Card */
.rrhh-card { background: white; border-radius: 10px; border: 1px solid #e2e8f0; padding: 14px 16px; cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column; gap: 10px; }
.rrhh-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-1px); }
.rrhh-card.card-urgente { border-color: #fca5a5; background: #fff8f8; }
.rrhh-card.card-proximo { border-color: #fcd34d; background: #fffdf0; }
.rrhh-card.card-vencido { border-color: #e2e8f0; background: #f8fafc; opacity: 0.8; }

.rrhh-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.rrhh-card-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rrhh-nombre { font-size: 0.88rem; font-weight: 700; color: #0f172a; }

/* Badges */
.rrhh-badge { font-size: 0.62rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.badge-honorarios  { background: #ede9fe; color: #7c3aed; }
.badge-plazo       { background: #dbeafe; color: #1d4ed8; }
.badge-indefinido  { background: #dcfce7; color: #16a34a; }
.badge-local       { background: #f1f5f9; color: #475569; }
.badge-activo      { background: #dcfce7; color: #16a34a; }
.badge-indefinido-ok { background: #dcfce7; color: #16a34a; }
.badge-proximo     { background: #fef9c3; color: #a16207; }
.badge-urgente     { background: #fee2e2; color: #dc2626; }
.badge-vencido     { background: #f1f5f9; color: #94a3b8; }
.badge-sin-contrato { background: #fef3c7; color: #d97706; }

/* Body */
.rrhh-card-body { display: flex; gap: 16px; flex-wrap: wrap; }
.rrhh-stat { display: flex; align-items: center; gap: 5px; font-size: 0.75rem; color: #475569; font-weight: 600; }
.rrhh-stat i { color: #94a3b8; }
.rrhh-dias { font-size: 0.72rem; color: #64748b; }
.rrhh-dias.card-urgente { color: #dc2626; font-weight: 700; }
.rrhh-dias.card-proximo { color: #a16207; font-weight: 700; }
.rrhh-max-renov { color: #dc2626; font-weight: 700; font-size: 0.68rem; }

/* Footer */
.rrhh-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid #f1f5f9; }
.rrhh-rut { font-size: 0.68rem; color: #94a3b8; }
.rrhh-actions { display: flex; gap: 4px; }
.rrhh-btn-sm { background: none; border: 1px solid #e2e8f0; border-radius: 5px; padding: 4px 8px; cursor: pointer; color: #64748b; font-size: 0.75rem; transition: all 0.15s; }
.rrhh-btn-sm:hover { background: #f8fafc; color: #0f172a; border-color: #cbd5e0; }

/* Estados */
.rrhh-loading { padding: 40px; text-align: center; color: #94a3b8; font-size: 0.8rem; }
.rrhh-error   { padding: 20px; color: #dc2626; font-size: 0.8rem; }
.rrhh-empty   { padding: 60px 20px; text-align: center; color: #94a3b8; }
.rrhh-empty i { font-size: 2.5rem; display: block; margin-bottom: 8px; }
.rrhh-empty p { font-size: 0.85rem; margin: 0; }
.rrhh-empty-inline { color: #94a3b8; font-size: 0.75rem; margin: 6px 0; }

/* ─── TABS ─── */
.rrhh-tabs { display: flex; gap: 4px; background: #f1f5f9; border-radius: 8px; padding: 3px; margin-bottom: 16px; width: fit-content; }
.rrhh-tab { background: none; border: none; border-radius: 6px; padding: 6px 16px; font-size: 0.75rem; font-weight: 600; color: #64748b; cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 6px; transition: all 0.15s; }
.rrhh-tab.active { background: white; color: #0f172a; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

/* ─── CALENDARIO visual ─── */
.cal-nav   { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cal-label { font-size: 0.85rem; font-weight: 700; color: #0f172a; flex: 1; text-align: center; }

.cal-scroll { overflow-x: auto; background: white; border-radius: 10px; border: 1px solid #e2e8f0; box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.cal-grid   { display: flex; min-width: 700px; }

/* Columna de horas */
.cal-horas-col   { width: 48px; flex-shrink: 0; border-right: 1px solid #e2e8f0; display: flex; flex-direction: column; }
.cal-horas-spacer { min-height: 44px; border-bottom: 1px solid #1e293b; background: #0f172a; }
.cal-horas-body  { position: relative; flex: 1; }
.cal-hora-line   { position: absolute; left: 0; right: 0; border-top: 1px solid #f1f5f9; }
.cal-hora-label  { font-size: 0.58rem; color: #94a3b8; position: absolute; top: -8px; right: 4px; font-weight: 600; }

/* Días */
.cal-dias-row { display: flex; flex: 1; }
.cal-dia-col  { flex: 1; border-right: 1px solid #e2e8f0; display: flex; flex-direction: column; }
.cal-dia-col:last-child { border-right: none; }
.cal-dia-col.cal-dia-hoy > .cal-dia-header { background: #1e3a5f; }

.cal-dia-header { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; background: #0f172a; border-bottom: 1px solid #1e293b; min-height: 44px; }
.cal-dia-nombre { font-size: 0.65rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; }
.cal-header-hoy .cal-dia-nombre { color: #93c5fd; }
.cal-dia-num    { font-size: 1.1rem; font-weight: 800; color: white; }
.cal-header-hoy .cal-dia-num { color: #60a5fa; }
.cal-btn-add    { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25); color: white; border-radius: 50%; width: 20px; height: 20px; font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; transition: background 0.15s; }
.cal-btn-add:hover { background: rgba(255,255,255,0.3); }

/* Cuerpo del día con bloques */
.cal-dia-body { position: relative; background: #fafafa; }
.cal-dia-body::after { content:''; position:absolute; inset:0; background: repeating-linear-gradient(to bottom, transparent, transparent calc(52px - 1px), #f0f0f0 52px); pointer-events:none; }

/* Bloques de trabajadores */
.cal-bloque { position: absolute; border-radius: 5px; padding: 4px 6px; cursor: pointer; box-sizing: border-box; overflow: hidden; transition: filter 0.15s; z-index: 1; display: flex; flex-direction: column; gap: 1px; }
.cal-bloque:hover { filter: brightness(0.9); }
.cal-bloque-nombre { font-size: 0.68rem; font-weight: 700; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-bloque-time   { font-size: 0.6rem; color: rgba(255,255,255,0.85); }
.cal-bloque-horas  { font-size: 0.62rem; font-weight: 700; color: rgba(255,255,255,0.9); }

/* Leyenda */
.cal-leyenda { display: flex; gap: 14px; margin-top: 10px; font-size: 0.7rem; color: #64748b; flex-wrap: wrap; align-items: center; }
.cal-leyenda span { display: flex; align-items: center; gap: 5px; }
.cal-leyenda-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ─── MODAL ─── */
.rrhh-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 99999; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.rrhh-modal-box { background: white; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); width: 560px; max-width: 96vw; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }

.rrhh-modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #e2e8f0; flex-shrink: 0; }
.rrhh-modal-nombre { font-size: 0.95rem; font-weight: 700; color: #0f172a; }
.rrhh-modal-sub    { font-size: 0.72rem; color: #64748b; margin-top: 2px; }
.rrhh-modal-close  { background: none; border: none; cursor: pointer; color: #94a3b8; font-size: 1.1rem; padding: 2px; border-radius: 4px; }
.rrhh-modal-close:hover { color: #0f172a; background: #f1f5f9; }

.rrhh-modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 16px; }

.rrhh-modal-contact { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.75rem; color: #475569; }
.rrhh-modal-contact span { display: flex; align-items: center; gap: 5px; }

.rrhh-modal-section { display: flex; flex-direction: column; gap: 8px; }
.rrhh-modal-section-title { font-size: 0.72rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.4px; display: flex; align-items: center; justify-content: space-between; }

.rrhh-contratos-grid { display: flex; flex-direction: column; gap: 4px; }
.rrhh-contrato-row { display: grid; grid-template-columns: 80px 160px 70px 80px 1fr 80px; gap: 8px; align-items: center; font-size: 0.72rem; padding: 5px 0; border-bottom: 1px solid #f8fafc; color: #475569; }
.rrhh-dias-txt { font-weight: 600; }

.rrhh-docs-grid { display: flex; flex-direction: column; gap: 4px; }
.rrhh-doc-row { display: grid; grid-template-columns: 90px 60px 1fr 80px 32px; gap: 8px; align-items: center; font-size: 0.72rem; padding: 5px 0; border-bottom: 1px solid #f8fafc; color: #475569; }

.rrhh-modal-footer { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid #e2e8f0; flex-shrink: 0; justify-content: flex-end; flex-wrap: wrap; }

/* Botones footer modal */
.rrhh-btn-sec    { background: #f8fafc; border: 1px solid #e2e8f0; color: #475569; border-radius: 6px; padding: 6px 12px; font-size: 0.73rem; font-weight: 600; cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 5px; }
.rrhh-btn-warn   { background: #fef3c7; border: 1px solid #fcd34d; color: #a16207; border-radius: 6px; padding: 6px 12px; font-size: 0.73rem; font-weight: 600; cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 5px; }
.rrhh-btn-danger { background: #fee2e2; border: 1px solid #fca5a5; color: #dc2626; border-radius: 6px; padding: 6px 12px; font-size: 0.73rem; font-weight: 600; cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 5px; }
.rrhh-btn-sec:hover    { background: #f1f5f9; }
.rrhh-btn-warn:hover   { background: #fde68a; }
.rrhh-btn-danger:hover { background: #fecaca; }

/* Formularios */
.rrhh-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rrhh-label { display: flex; flex-direction: column; gap: 4px; font-size: 0.7rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.3px; }
.rrhh-input { padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 0.78rem; font-family: inherit; color: #0f172a; outline: none; transition: border-color 0.2s; background: white; }
.rrhh-input:focus { border-color: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,0.12); }
.rrhh-upload-hint { font-size: 0.65rem; color: #94a3b8; margin: 0; }
