input,
select,
textarea {
  font-size: 16px;
}

* {
  touch-action: manipulation;
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display',
    system-ui, Arial, sans-serif;
  background: #f4f6f8;
}

/* ==========================================
   DOSAGE READINGS LIST
========================================== */

.operations-dosage-readings-page .operations-services-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}

/* CARD BASE */
.operations-service-card {
  display: flex;
  justify-content: space-between;
  align-items: center;

  background: #ffffff;
  border-radius: 12px;
  padding: 14px 16px;

  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.15s ease;
}

.operations-service-card:active {
  transform: scale(0.98);
}

/* WARNING CARD */
.operations-service-card.card-warning {
  border: 1px solid #ffc107;
  background: #fff8e1;
}

/* LEFT */
.dosage-card-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.service-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #1c1c1e;
}

.service-card-sub {
  font-size: 13px;
  color: #6c757d;
}

/* RIGHT */
.dosage-card-right {
  display: flex;
  align-items: center;
}

/* BADGES */
.badge-success {
  background: #e6f7ec;
  color: #28a745;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 20px;
}

.badge-warning {
  background: #fff3cd;
  color: #856404;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 20px;
}

/* EMPTY */
.operations-empty {
  text-align: center;
  padding: 20px;
  color: #6c757d;
  font-size: 14px;
}

/* ==========================================
   DOSAGE CONFIGS LIST (SCREEN 2)
========================================== */

/* Disabled card */
.operations-service-card.card-disabled {
  opacity: 0.5;
}

/* Title spacing tweak for configs */
.operations-dosage-configs-page .service-card-title {
  font-size: 15px;
}

/* Sub rows tighter */
.operations-dosage-configs-page .service-card-sub {
  font-size: 12px;
}

/* Switch alignment */
.operations-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.operations-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.operations-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #ccc;
  transition: 0.2s;
  border-radius: 20px;
}

.operations-switch-slider:before {
  position: absolute;
  content: '';
  height: 16px;
  width: 16px;
  left: 3px;
  top: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

.operations-switch input:checked + .operations-switch-slider {
  background-color: #28a745;
}

.operations-switch input:checked + .operations-switch-slider:before {
  transform: translateX(18px);
}

/* ==========================================
   DOSAGE CONFIG FORM (SCREEN 3)
========================================== */

/* Form spacing */
.operations-dosage-config-form-page .operations-form-section {
  padding: 14px;
}

/* Inputs side by side (target range) */
.operations-dosage-config-form-page input[type='number'] {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 14px;
}

/* Group spacing */
.operations-dosage-config-form-page .services-form-group {
  margin-bottom: 16px;
}

/* Switch row */
.services-switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 14px;
}

/* Label */
.operations-dosage-config-form-page label {
  font-weight: 600;
  font-size: 14px;
  color: #1c1c1e;
}

/* Select */
.operations-dosage-config-form-page select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 14px;
  background: #fff;
}

/* Divider (optional si luego lo usas) */
.operations-divider {
  margin: 16px 0;
  border: none;
  border-top: 1px solid #eee;
}

/* Improve tap feel (mobile) */
.global-btn-save,
.global-btn-delete {
  min-width: 90px;
}

/* Delete button spacing */
#btnDeleteConfig {
  margin-left: 8px;
}

/* ===============================
   DOSAGE RANGE BAR
=============================== */

.dosage-range-bar {
  display: flex;
  height: 12px;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 8px;
  background: #eee;
}

.range-segment {
  height: 100%;
}

.range-low {
  width: 25%;
  background: #e74c3c;
}

.range-ok {
  width: 50%;
  background: #2ecc71;
}

.range-high {
  width: 25%;
  background: #e74c3c;
}

.dosage-range-labels {
  position: relative;
  height: 16px;
  margin-top: 4px;
  font-size: 12px;
  color: #666;
}

.dosage-range-labels span {
  position: absolute;
  transform: translateX(-50%);
}

/* 🔵 alineados al inicio y fin del rango verde */
#rangeMin {
  left: 25%;
}

#rangeMax {
  left: 75%;
}

.dosage-range-note {
  font-size: 11px;
  color: #999;
  margin-top: 6px;
}
