@import url("/theme.css");

html, body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  box-sizing: border-box;
}

body {
  font-family: var(--app-font-family);
  background-color: var(--app-page-bg);
}

.container {
  max-width: var(--container-max-width);
  width: 95%;
  margin: 30px auto;
  padding: var(--container-padding);
  background-color: var(--app-card-bg);
  border-radius: var(--app-radius-md);
  box-shadow: var(--app-shadow-md);
  box-sizing: border-box;
  overflow-x: hidden;
}

.app-shell {
  margin: 3vh auto 0 auto;
  min-height: 70vh;
  background: var(--color-fondo, var(--app-card-bg));
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow-sm);
  padding: 36px 18px 30px 18px;
}

.app-shell-tall {
  min-height: 80vh;
  padding: 40px 18px 36px 18px;
}

.page-heading {
  margin: 0 0 14px 0;
  text-align: center;
  color: var(--app-text-color);
  font-size: 1.35rem;
}

.status-error {
  text-align: center;
  color: #b30000;
  font-weight: 700;
}

.status-info {
  text-align: center;
  color: var(--color-primario, #d87b95);
  font-weight: 700;
}

.btn-primary {
  background: var(--color-primario, #d87b95) !important;
  color: var(--color-fondo, #fff) !important;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}

.btn,
.btn-ver,
.btn-confirmar {
  background: var(--color-primario, #d87b95) !important;
  color: var(--color-fondo, #fff) !important;
  border: none;
  border-radius: 10px;
  padding: 14px 16px;
  font-weight: bold;
  font-size: 1.08em;
  line-height: 1.15;
  cursor: pointer;
  transition: filter .15s;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

.btn:hover,
.btn-ver:hover,
.btn-confirmar:hover {
  filter: brightness(0.97);
}

.btn-small {
  display: inline-block;
  width: auto;
  padding: 10px 18px;
  font-size: 1em;
  margin-bottom: 12px;
}

.btn-back {
  width: 100% !important;
  display: block !important;
  text-align: center;
  margin-bottom: 20px !important;
}

.btn-ver {
  opacity: 0.5;
}

.btn-ver.enabled {
  opacity: 1;
}

.grupos-lista {
  width: 100%;
  margin: 0 0 22px 0;
}

.grupo {
  background: var(--color-fondo, #fff);
  border: 2px solid var(--color-secundario, #f6ece6);
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  padding: 14px 18px;
  min-height: 45px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: box-shadow .15s, border-color .2s;
  word-break: break-word;
}

.grupo:hover {
  border-color: var(--color-primario, #d87b95);
  box-shadow: 0 3px 16px rgba(0,0,0,0.09);
  background: var(--color-secundario, #f6ece6);
}

.grupo-parent {
  user-select: none;
}

.grupo-children {
  margin: -6px 0 12px 0;
  padding: 8px 0 2px 12px;
  display: none;
  border-left: 3px solid color-mix(in srgb, var(--color-primario, #d87b95) 40%, transparent 60%);
  background: color-mix(in srgb, var(--color-secundario, #f6ece6) 25%, #ffffff 75%);
  border-radius: 0 8px 8px 0;
}

.grupo-children.open {
  display: block;
}

.grupo-child {
  min-height: 40px;
  margin-bottom: 8px;
  padding: 10px 14px;
  border-width: 1.5px;
}

.grupo-parent .arrow {
  font-size: 1.5em;
  line-height: 1;
  display: inline-block;
  transition: transform .2s ease;
}

.grupo-parent.open .arrow {
  transform: rotate(180deg);
}

.nombre-grupo {
  font-weight: bold;
  color: var(--color-primario, #d87b95);
}

.lista-scrollable-grid {
  max-height: calc(80vh - 260px);
  min-height: 150px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  background: transparent;
  border-radius: 12px;
  padding: 0 0 4px 0;
  margin-bottom: 0;
}

.tratamiento {
  background: var(--color-fondo, #fff);
  padding: 10px 15px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid var(--color-secundario, #f6ece6);
  user-select: none;
  transition: border-color 0.2s, background 0.2s;
  min-height: 70px;
  word-break: break-word;
}

.tratamiento.selected {
  border-color: var(--color-primario, #d87b95);
  background-color: var(--color-secundario, #f6ece6);
}

.duracion {
  font-size: 13px;
  color: #888;
}

.resumen-total {
  margin-top: 20px;
  padding: 15px;
  background-color: var(--color-secundario, #f6ece6);
  border-radius: 8px;
  text-align: center;
}

.semana-nav {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:15px;
  font-size:1.08em;
  background: var(--color-secundario, #f6ece6);
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: bold;
}

.btn-nav {
  cursor:pointer;
  font-size:2.1em;
  user-select:none;
  color:var(--color-primario, #d87b95);
  border:none;
  background:transparent;
  padding:2px 16px;
}

.btn-nav.disabled {
  color: #ccc;
  pointer-events: none;
}

.dias-scroll {
  max-height: calc(80vh - 250px);
  min-height: 180px;
  overflow-y: auto;
  margin-bottom: 0;
  padding: 0;
}

.dia {
  padding: 11px;
  margin: 8px 0 3px 0;
  background:var(--color-secundario, #f6ece6);
  border-radius:6px;
  text-align:center;
  font-weight:bold;
}

.dia.hoy {
  border:2px solid var(--color-primario, #d87b95);
}

.hora {
  display: inline-block;
  min-width: 80px;
  text-align: center;
  padding: 8px 0;
  margin: 4px;
  background: #fff;
  border-radius: 7px;
  border: 1.7px solid var(--color-primario, #d87b95);
  color: var(--color-primario, #d87b95);
  cursor: pointer;
  font-weight: 500;
  font-size: 1em;
  transition: background .18s, color .18s;
}

.hora:hover {
  background: var(--color-primario, #d87b95);
  color: #fff;
}

.sin-huecos {
  text-align:center;
  color:#999;
  padding:8px;
}

.panel-card {
  background-color: var(--color-fondo, #fff);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.panel-card h4 {
  margin-top: 0;
  color: var(--color-primario, #d87b95);
}

.panel-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.panel-item span:first-child {
  font-weight: bold;
}

.switch-modos {
  text-align: center;
  margin: 25px 0 15px 0;
}

.btn-switch {
  color: var(--color-primario, #d87b95);
  background: none;
  border: none;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  margin: 0 5px;
  text-decoration: underline;
  padding: 0;
}

.field-label {
  display: block;
}

.field-control {
  width: 100%;
  padding: 8px;
  box-sizing: border-box;
  border: 1px solid var(--color-secundario, #f6ece6);
  border-radius: 4px;
  margin-top: 2px;
}

.field-stack {
  margin-bottom: 14px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.tab-btn {
  flex: 1 1 0;
  min-width: 0;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--color-primario, #d87b95);
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  min-height: 44px;
  font-size: 0.95em;
}

.tab-btn.active {
  background: var(--color-primario, #d87b95);
  color: #fff;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.btn-action {
  background: var(--color-primario, #d87b95);
  color: #fff;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.admin-shell {
  max-width: 720px;
  margin: 8vh auto 0 auto;
  min-height: 36vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 14px rgba(0, 0, 0, 0.08);
  padding: 30px 22px 26px 22px;
}

.admin-shell-lg {
  max-width: 900px;
}

.admin-shell-xl {
  max-width: 1200px;
}

.admin-shell-sm {
  max-width: 520px;
  min-height: 46vh;
}

.admin-shell-md {
  max-width: 820px;
}

.admin-title {
  text-align: center;
  color: #2f4f6f;
  margin: 0 0 12px 0;
}

.admin-btn {
  background: #2f4f6f;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.98em;
  cursor: pointer;
}

.admin-form-field {
  margin-bottom: 14px;
}

.admin-form-label {
  font-weight: 600;
  color: #2c2c2c;
  display: block;
  margin-bottom: 6px;
}

.admin-form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  font-size: 1em;
  box-sizing: border-box;
}

.admin-form-input:focus {
  outline: none;
  border-color: #2f4f6f;
  box-shadow: 0 0 0 2px rgba(47, 79, 111, 0.2);
}

.admin-message {
  text-align: center;
  margin-bottom: 12px;
  color: #2f4f6f;
  font-weight: bold;
}

.admin-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  color: #2f4f6f;
  text-decoration: none;
  font-weight: bold;
}

.error-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.error-card {
  width: 100%;
  max-width: 620px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  padding: 24px;
  text-align: center;
}

.error-title {
  margin: 0 0 12px 0;
  color: #1f3b5b;
  font-size: 28px;
  font-weight: 700;
}

.error-text {
  margin: 0 0 8px 0;
  line-height: 1.5;
  font-size: 16px;
}

.error-meta {
  margin-top: 12px;
  color: #6b7280;
  font-size: 13px;
}

input[type=text] {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.input-group-pass {
  position: relative;
  margin-bottom: 18px;
}

.input-group-pass input[type="password"],
.input-group-pass input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px 38px 12px 12px;
  font-size: 1.08em;
  margin-top: 5px;
  margin-bottom: 0;
  display: block;
  background: #fff;
  transition: border-color .15s;
}

.input-group-pass input:focus {
  border-color: #d87b95;
  outline: none;
}

.toggle-password {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  padding: 0;
  z-index: 2;
  color: #d87b95;
  opacity: 0.7;
  transition: opacity .15s;
}

.toggle-password:hover,
.toggle-password:focus {
  opacity: 1;
  color: #b05577;
}

.centro {
  background-color: #f2efee;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s ease;
}

.centro:hover {
  background-color: #e2dedc;
}

.nombre-centro {
  font-weight: bold;
  font-size: 15px;
}

.detalles {
  font-size: 13px;
  color: #555;
}

header {
  background: var(--color-primario, #d87b95);
  color: var(--color-fondo, #fff);
  min-height: var(--header-min-height);
  font-weight: bold;
  font-size: 1.2em;
  margin-bottom: 0;
  padding: 0;
}

.header-flex {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--header-min-height);
  width: 100%;
  padding: 0 12px;
  gap: 10px;
  box-sizing: border-box;
  flex-wrap: nowrap;
}

.header-col {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--header-min-height);
  min-width: 0;
}

.header-col-left {
  justify-content: flex-start;
  min-width: 0;
}

.header-title {
  justify-content: center;
  font-size: var(--header-title-size);
  font-weight: var(--header-title-weight);
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.header-col-right {
  justify-content: flex-end;
  min-width: 0;
  padding-right: 4px;
  box-sizing: border-box;
}

.logo-header {
  display: flex;
  align-items: center;
  margin-right: 0;
}

.cliente-btn {
  color: var(--color-fondo, #fff);
  background: rgba(255,255,255,0.15);
  border: 1.3px solid transparent;
  font-weight: bold;
  font-size: 0.95em;
  cursor: pointer;
  border-radius: 7px;
  padding: 6px 10px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border 0.18s;
  opacity: 0.9;
}
.cliente-btn:hover {
  background: var(--color-primario, #d87b95);
  color: #fff;
  border: 1.3px solid #fff;
  opacity: 1;
}
.cliente-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cliente-menu-icon svg {
  width: 24px;
  height: 24px;
}
.cliente-menu {
  position: absolute;
  top: 60px;
  right: 10px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  min-width: 180px;
  display: none;
  z-index: 1000;
}

@media (max-width: 900px) {
  .container {
    width: 94%;
    padding: 18px;
  }
  .app-shell,
  .app-shell-tall {
    padding: 24px 16px;
  }
  .lista-scrollable-grid {
    grid-template-columns: 1fr;
  }
  .tab-btn {
    flex: 1 1 100%;
  }
}

@media (max-width: 600px) {
  header {
    min-height: auto;
  }
  .header-flex {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    gap: 8px;
  }
  .header-col {
    min-height: var(--header-min-height);
    justify-content: center;
  }
  .header-col-left,
  .header-col-right {
    justify-content: flex-start;
    flex: 0 0 auto;
    max-width: 36vw;
  }
  .header-col-right { justify-content: flex-end; }
  .header-title {
    font-size: clamp(14px, 4.2vw, 18px);
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }
  .cliente-btn {
    max-width: 36vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cliente-btn span {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
  }
  .cliente-btn .cliente-menu-icon {
    overflow: visible;
    max-width: none;
  }
  .cliente-menu {
    right: 8px;
    min-width: 160px;
  }
  .container {
    width: 96%;
    margin: 16px auto;
    padding: 14px;
    overflow-x: hidden;
  }
  .app-shell,
  .app-shell-tall {
    min-height: auto;
    margin-top: 2vh;
    padding: 18px 12px 20px 12px;
  }
}
.cliente-menu a,
.cliente-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: #444;
  font-size: 0.95em;
}
.cliente-menu a:hover,
.cliente-menu button:hover {
  background: #f5f5f5;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: none;
  z-index: 999;
}
.modal {
  background: #fff;
  border-radius: 10px;
  max-width: 400px;
  margin: 12vh auto 0 auto;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.modal h4 { margin-top: 0; }
.modal .btn {
  margin-top: 10px;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  padding-right: 10px;
}

.lang-btn {
  display: flex;
  align-items: center;
  padding: 5px 10px;
  background: rgba(255,255,255,0.15);
  border-radius: 7px;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  font-size: 1em;
  border: 1.3px solid transparent;
  transition: background 0.15s, color 0.15s, border 0.18s;
  gap: 4px;
  opacity: 0.8;
}

.lang-btn span {
  display: none;
}

.lang-btn:hover,
.lang-btn.active {
  background: var(--color-primario, #d87b95);
  color: #fff;
  border: 1.3px solid #fff;
  opacity: 1;
}

.lang-btn.active {
  font-weight: bolder;
  box-shadow: 0 0 4px rgba(0,0,0,0.05);
}

@media (min-width:600px) {
  .lang-btn span { display: inline; }
}

.tratamientos-lista {
  margin-top: 10px;
  margin-bottom: 6px;
  padding-left: 0;
  list-style: none;
  width: 100%;
}

.tratamiento-item {
  background: var(--color-secundario);
  border-radius: 7px;
  padding: 10px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1em;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  width: 100%;
  gap: 8px;
  flex-wrap: wrap;
}

.trat-nombre {
  font-weight: bold;
  color: var(--color-primario);
  text-align: left;
  word-break: break-word;
  flex: 1 1 160px;
  min-width: 0;
  white-space: normal;
}

.trat-duracion {
  color: #555;
  font-size: 0.98em;
  margin-left: 16px;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .tratamiento-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 10px;
  }
  .trat-duracion {
    margin-left: 0;
    margin-top: 2px;
  }
}

footer.pie-saraworld {
  width: 100%;
  text-align: center;
  margin: 32px 0 10px 0;
  padding-top: 12px;
  font-size: 0.78em;
  color: #aaa;
  border-top: 1px solid #ececec;
  letter-spacing: 0.01em;
}

footer.pie-saraworld a {
  color: #aaa;
  text-decoration: none;
  transition: color .15s;
}

footer.pie-saraworld a:hover {
  color: #d87b95;
  text-decoration: underline;
}
