/* servicios.css - reglas especificas de Servicios */

:root {
  --servicios-row-hover: #f1f5f9;
  --servicios-cell-hover: #e2e8f0;
  --servicios-edit-bg: #ffffff;
  --servicios-edit-text: #0f172a;
  --servicios-edit-border: #cbd5e1;
  --servicios-table-head-bg: rgba(248, 251, 255, 0.96);
  --servicios-table-row-bg: #ffffff;
  --servicios-table-row-alt-bg: #f8fbff;
  --servicios-table-row-hover-bg: #eef6ff;
  --servicios-table-row-border: #edf3fa;
  --servicios-table-wrap-border: #d8e4f2;
  --servicios-table-head-text: #64748b;
  --servicios-table-text: #0f172a;
}

.dark-mode {
  --servicios-row-hover: rgba(59, 130, 246, 0.12);
  --servicios-cell-hover: rgba(59, 130, 246, 0.2);
  --servicios-edit-bg: #0b1220;
  --servicios-edit-text: #e2e8f0;
  --servicios-edit-border: #334155;
  --servicios-table-head-bg: rgba(17, 24, 39, 0.96);
  --servicios-table-row-bg: #0f172a;
  --servicios-table-row-alt-bg: #111c2f;
  --servicios-table-row-hover-bg: #17243a;
  --servicios-table-row-border: #1f2d42;
  --servicios-table-wrap-border: #2a3a52;
  --servicios-table-head-text: #9fb0c5;
  --servicios-table-text: #dbe5f2;
}

body[data-theme="vampire"].dark-mode {
  --servicios-row-hover: #2a2d2e;
  --servicios-cell-hover: #303436;
  --servicios-edit-bg: #252526;
  --servicios-edit-text: #e6edf3;
  --servicios-edit-border: #3c3c3c;
  --servicios-table-head-bg: #252526;
  --servicios-table-row-bg: #1e1e1e;
  --servicios-table-row-alt-bg: #222222;
  --servicios-table-row-hover-bg: #2a2d2e;
  --servicios-table-row-border: #303030;
  --servicios-table-wrap-border: #3c3c3c;
  --servicios-table-head-text: #d4d4d4;
  --servicios-table-text: #e6edf3;
}

body[data-theme="princess"] {
  --servicios-row-hover: #ffe3f2;
  --servicios-cell-hover: #ffd2ea;
  --servicios-edit-bg: #fff7fc;
  --servicios-edit-text: #2d1230;
  --servicios-edit-border: rgba(214, 51, 154, 0.24);
  --servicios-table-head-bg: #ffe8f4;
  --servicios-table-row-bg: #fff7fc;
  --servicios-table-row-alt-bg: #fff0f8;
  --servicios-table-row-hover-bg: #ffe3f2;
  --servicios-table-row-border: rgba(214, 51, 154, 0.16);
  --servicios-table-wrap-border: rgba(214, 51, 154, 0.24);
  --servicios-table-head-text: #9d1b64;
  --servicios-table-text: #2d1230;
}

.servicios-container {
  font-family: var(--font-family-base);
  width: 98%;
  max-width: 100%;
  margin: 20px auto;
}

.servicios-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.servicios-controls .autofill-trap {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.servicios-controls .ui-control {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-white, #fff);
  color: var(--text-color, #0f172a);
  font-size: 12px;
  width: 260px;
}

.servicios-table-wrap {
  border: 1px solid var(--servicios-table-wrap-border);
  border-radius: 12px;
  margin-top: 12px;
  padding-top: 0;
  background: var(--servicios-table-row-bg);
  overflow: auto;
}

.servicios-table {
  width: 100%;
  min-width: 620px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.servicios-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 6px 9px;
  line-height: 1.12;
  background: var(--servicios-table-head-bg);
  color: var(--servicios-table-head-text);
  border-bottom: 1px solid var(--servicios-table-row-border);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.servicios-table tbody tr {
  height: 34px;
}

.servicios-table tbody td {
  padding: 5px 7px;
  line-height: 1.15;
  border-bottom: 1px solid var(--servicios-table-row-border);
  background: var(--servicios-table-row-bg);
  color: var(--servicios-table-text);
  font-size: 12px;
  vertical-align: middle;
}

.servicios-table tbody tr:nth-child(even) td {
  background: var(--servicios-table-row-alt-bg);
}

.servicios-table .serv-precio {
  font-weight: 700;
}

.servicio-btn-delete {
  box-shadow: none;
}

.servicio-btn-delete:hover {
  box-shadow: none;
}

.servicio-btn-delete:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.empty-row td {
  padding: 30px 12px;
  font-style: italic;
}

#modal-servicio .modal-content {
  max-width: 420px;
  width: 92%;
  padding: 20px;
  border-radius: 12px;
}

#modal-servicio label {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted, #6b7280);
}

#modal-servicio input[type="text"],
#modal-servicio input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e5e7eb);
  margin-top: 6px;
  background: var(--bg-white, #fff);
}

#modal-servicio .modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

/* Hover completo en la fila */
.servicios-table tbody tr:hover td {
  background-color: var(--servicios-table-row-hover-bg);
  transition: background-color 0.15s ease-in-out;
}

/* Cursor para indicar que puede editarse */
.servicios-table td.editable {
  cursor: pointer;
}

/* Hover mas fuerte al estar sobre una celda editable */
.servicios-table td.editable:hover {
  background-color: var(--servicios-cell-hover);
}

.servicios-table .comment-edit {
  width: 100%;
  padding: 2px 4px;
  border-radius: 6px;
  border: 1px solid var(--servicios-edit-border);
  background: var(--servicios-edit-bg);
  color: var(--servicios-edit-text);
}

.servicios-table .comment-edit:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
