/* Descuentos a empleados (descuentos.php) */
.ds, .ds-modal {
  --ds-surface: #ffffff;
  --ds-fondo: #f6f7f9;
  --ds-borde: #e1e4e8;
  --ds-texto: #1f2328;
  --ds-texto-2: #57606a;
  --ds-muted: #8c959f;
  --ds-acento: #2a78d6;
  --ds-acento-suave: #eef5fd;
  --ds-bueno: #1a7f37;
  --ds-malo: #cf222e;
  --ds-aviso: #9a6700;
  color: var(--ds-texto);
}
.ds [hidden] { display: none !important; }
.demo, #demo-setting { display: none !important; }
.ds .ds-muted, .ds-modal .ds-muted { color: var(--ds-muted); }

.ds-head { margin-bottom: 10px; }
.ds-head .page-title { margin: 0 0 2px; }
.ds-head p { margin: 0; }
.ds-card { background: var(--ds-surface); border: 1px solid var(--ds-borde); border-radius: 6px; padding: 14px 16px; margin-bottom: 14px; }
.ds-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ds-card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }

/* sistema.css fuerza height:20px !important en .form-control; aquí se devuelve un alto legible */
.ds .form-control, .ds-modal .form-control { height: 32px !important; padding: 4px 10px; }
.ds textarea.form-control { height: auto !important; min-height: 54px; resize: vertical; }
.ds .input-sm, .ds-modal .input-sm { height: 30px !important; }

/* Pestañas */
.ds-tabs { display: flex; gap: 2px; list-style: none; margin: 0 0 12px; padding: 0; border-bottom: 1px solid var(--ds-borde); }
.ds-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; color: var(--ds-texto-2); font-weight: 600; margin-bottom: -1px; }
.ds-tabs button.activo { color: var(--ds-acento); border-bottom-color: var(--ds-acento); }

/* Avisos */
.ds-aviso { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 6px; border: 1px solid #d4a72c; background: #fff8c5; margin-bottom: 10px; }
.ds-aviso .fa { margin-top: 3px; }
.ds-aviso.error { border-color: #f5a3a8; background: #ffebe9; color: #82071e; }
.ds-aviso.ok { border-color: #8ddb9e; background: #dafbe1; color: #116329; }

/* KPIs */
.ds-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ds-kpi { background: var(--ds-surface); border: 1px solid var(--ds-borde); border-radius: 6px; padding: 10px 14px; }
.ds-kpi .et { font-size: 12px; color: var(--ds-texto-2); }
.ds-kpi .val { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ds-kpi .sub { font-size: 11px; color: var(--ds-muted); }
.ds-kpi.fuerte { border-color: var(--ds-acento); box-shadow: inset 3px 0 0 var(--ds-acento); }
.ds-kpi.alerta .val { color: var(--ds-aviso); }
.ds-kpi.ok .val { color: var(--ds-bueno); }

/* Formulario */
.ds-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px; align-items: start; }
.ds-campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ds-campo > label { font-size: 12px; font-weight: 600; color: var(--ds-texto-2); margin: 0; }
.ds-campo > label small { font-weight: 400; color: var(--ds-muted); }
.ds-ancho { grid-column: span 2; }
.ds-dinero { display: flex; align-items: center; gap: 4px; }
.ds-dinero span { color: var(--ds-muted); }
.ds-dinero input { text-align: right; }
.ds-pagos small { font-size: 11px; min-height: 14px; }
.ds-programar { grid-column: span 2; }
.ds-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; font-weight: 600; color: var(--ds-texto-2); }
.ds-form-acc { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.ds .select2-container .select2-selection--single { height: 32px; border-color: #ccc; }
.ds .select2-container .select2-selection--single .select2-selection__rendered { line-height: 30px; }
.ds .select2-container .select2-selection--single .select2-selection__arrow { height: 30px; }

/* Lista */
.ds-lista { padding: 0; }
.ds-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 14px; border-bottom: 1px solid var(--ds-borde); }
.ds-toolbar input[type="search"] { flex: 1 1 220px; max-width: 320px; }
.ds-toolbar select { width: auto; min-width: 170px; }
.ds-segmento { display: inline-flex; border: 1px solid var(--ds-borde); border-radius: 4px; overflow: hidden; }
.ds-segmento label { margin: 0; padding: 5px 10px; cursor: pointer; font-weight: 400; font-size: 12px; white-space: nowrap; position: relative; }
.ds-segmento label + label { border-left: 1px solid var(--ds-borde); }
.ds-segmento input { position: absolute; opacity: 0; pointer-events: none; }
.ds-segmento label.sel { background: var(--ds-acento-suave); color: var(--ds-acento); font-weight: 600; }
.ds-tabla-wrap { overflow: auto; max-height: 65vh; }
.ds-tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.ds-tabla th, .ds-tabla td { padding: 7px 10px; border-bottom: 1px solid var(--ds-borde); vertical-align: middle; }
.ds-tabla thead th { background: var(--ds-fondo); font-size: 12px; font-weight: 600; color: var(--ds-texto-2); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.ds-tabla tbody tr:hover td { background: #f8fafc; }
.ds-tabla td small { display: block; color: var(--ds-muted); font-size: 11px; }
.ds-tabla .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ds-tabla .col-acc { text-align: right; width: 1%; white-space: nowrap; }
.ds-sin-datos { text-align: center; padding: 22px !important; }
.ds-avance { height: 6px; background: #eceef1; border-radius: 3px; overflow: hidden; width: 120px; margin-bottom: 2px; }
.ds-avance > div { height: 100%; background: var(--ds-bueno); }
.ds-nota-ico { color: var(--ds-muted); cursor: help; }

.ds-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.ds-chip.ok { background: #dafbe1; color: #116329; }
.ds-chip.azul { background: var(--ds-acento-suave); color: var(--ds-acento); }
.ds-chip.aviso { background: #fff4d6; color: var(--ds-aviso); }
.ds-chip.malo { background: #ffe5e7; color: var(--ds-malo); }
.ds-chip.gris { background: #eef0f2; color: var(--ds-texto-2); }

/* Tipos */
.ds-tipos { max-width: 640px; }
.ds-alta { display: flex; gap: 8px; margin-bottom: 10px; }
.ds-alta .form-control { flex: 1; }
.ds-nombre-btn { background: none; border: 0; padding: 0; font-weight: 600; color: var(--ds-texto); cursor: text; text-align: left; }
.ds-nombre-btn:hover { text-decoration: underline dotted; }
.ds-nota { margin: 8px 0 0; font-size: 11px; }

/* Modal: alto fijo, encabezado y pie fijos, scroll solo en el cuerpo */
.ds-modal .modal-content { display: flex; flex-direction: column; max-height: 86vh; }
.ds-modal .modal-body { overflow-y: auto; flex: 1 1 auto; }
.ds-modal .modal-footer { display: flex; align-items: center; justify-content: space-between; }
.ds-programar-modal { background: var(--ds-fondo); border: 1px solid var(--ds-borde); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
.ds-programar-modal label { font-size: 12px; font-weight: 600; color: var(--ds-texto-2); margin: 0 0 4px; display: block; }
.ds-programar-modal > div { display: flex; gap: 6px; }
.ds-programar-modal input { max-width: 170px; }
.ds-modal .ds-tabla input[type="date"] { max-width: 160px; }

@media (max-width: 767px) {
  .ds-ancho, .ds-programar { grid-column: 1 / -1; }
  .ds-toolbar input[type="search"] { max-width: none; }
}
