/* Estilos basicos para la pagina de administracion del plugin KS Doble PDF A4 */
.ksdp-wrap h1 {
  margin-bottom: 10px;
}

.ksdp-form .ksdp-form-section {
  padding: 12px;
  margin-bottom: 12px;
}

.ksdp-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}

.ksdp-field label {
  font-weight: 600;
  margin-bottom: 4px;
}

.ksdp-field input[type="text"],
.ksdp-field input[type="date"],
.ksdp-field input[type="time"],
.ksdp-field textarea {
  max-width: 480px;
}

/* Iconos para date/time */
.ksdp-field input[type="date"],
.ksdp-field input[type="time"] {
  padding-right: 30px;
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  background-origin: content-box;
  background-clip: content-box;
}

.ksdp-field input[type="date"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

.ksdp-field input[type="date"]::-webkit-calendar-picker-indicator {
  color: transparent;
  opacity: 1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='14' height='14' rx='2' ry='2'/%3E%3Cline x1='13' y1='2' x2='13' y2='6'/%3E%3Cline x1='7' y1='2' x2='7' y2='6'/%3E%3Cline x1='3' y1='8' x2='17' y2='8'/%3E%3C/svg%3E") no-repeat center center;
  background-size: 16px;
  cursor: pointer;
}

.ksdp-field input[type="time"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpolyline points='12 7 12 12 15 13'/%3E%3C/svg%3E");
}

.ksdp-field input[type="time"]::-webkit-calendar-picker-indicator {
  color: transparent;
  opacity: 1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpolyline points='12 7 12 12 15 13'/%3E%3C/svg%3E") no-repeat center center;
  background-size: 16px;
  cursor: pointer;
}

/* Grid de 3 columnas para la parte superior del formulario */
.ksdp-grid-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.ksdp-col {
  min-width: 0;
}

.ksdp-form-section--no-title h2 {
  display: none;
}

/* Grid de 2 columnas para Orden de impresion */
.ksdp-grid-impresion {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 10px;
}

.ksdp-grid-impresion > .ksdp-col {
  padding: 12px;
}

.ksdp-col--empty {
  /* Mantiene espacio para futuras expansiones */
}

/* Bloques dinamicos de equipos */
.ksdp-devices-container {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.ksdp-device-card {
  padding: 12px;
}

.ksdp-device-header {
  font-weight: 700;
  margin-bottom: 8px;
}

.ksdp-device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.ksdp-field--full {
  grid-column: 1 / -1;
}

.ksdp-help-text {
  margin: 0 0 10px;
}

/* Prefijo monetario */
.ksdp-money-wrap {
  position: relative;
}

.ksdp-money-prefix {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
}

.ksdp-money-input {
  padding-left: 40px !important;
  max-width: 480px;
}

.ksdp-razon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.ksdp-razon-wrap input {
  flex: 1;
}

.ksdp-razon-wrap + .widefat,
.ksdp-razon-wrap + .regular-text,
.ksdp-razon-wrap + .ksdp-field input {
  margin-top: 6px;
}

.ksdp-save-client {
  width: 32px;
  height: 32px;
  cursor: pointer;
  margin-left: 6px;
}

.ksdp-hidden-field {
  display: none !important;
}

/* Boton alineado a la derecha */
.ksdp-submit-wrap {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.ksdp-submit-wrap--top {
  justify-content: flex-start;
  margin-bottom: 12px;
}

.ksdp-submit-wrap--stack {
  flex-direction: column;
  align-items: flex-start;
}

.ksdp-submit-wrap--in-grid {
  justify-content: flex-start;
  align-items: flex-start;
  margin-top: 0;
  gap: 8px;
}

/* --------- Resets y refuerzos de estilos contra temas externos --------- */
.ksdp-form,
.ksdp-wrap {
  box-sizing: border-box;
}

.ksdp-form *,
.ksdp-wrap * {
  box-sizing: inherit;
}
