/* Nexos Estudio · ajustes para celular y piezas compartidas */

/* Íconos del menú: solo en celular */
nav a .ic, nav a .tx-m { display: none; }
.topbar { display: none; }
.fab { display: none; }

/* Tira de días de la semana (agenda) */
.dias { display: grid; grid-template-columns: repeat(7, minmax(64px, 1fr)); gap: 8px; margin: 0 0 14px; }
.dia { background: #fff; border: 1px solid var(--linea); padding: 8px 4px; text-align: center; cursor: pointer; border-radius: 6px; user-select: none; }
.dia small { display: block; font-family: var(--mono); font-size: 10px; text-transform: uppercase; color: var(--gris); letter-spacing: .05em; }
.dia b { display: block; font-size: 20px; line-height: 1.2; }
.dia span { display: block; font-family: var(--mono); font-size: 10px; color: var(--gris); }
.dia.hoy b { color: var(--acento); }
.dia.sel { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.dia.sel small, .dia.sel span { color: #cfcac2; }
.dia.sel.hoy b { color: #fff; }
.dia.cerr { background: repeating-linear-gradient(45deg, #faf8f5, #faf8f5 6px, #f3efe9 6px, #f3efe9 12px); }
.dia.sel.cerr { background: var(--tinta); }

/* Selector Lista / Grilla */
.seg { display: inline-flex; border: 1px solid var(--tinta); }
.seg button { border: 0; background: #fff; padding: 7px 12px; font-weight: 600; font-size: 13px; cursor: pointer; }
.seg button.on { background: var(--tinta); color: #fff; }

/* Vista lista de la agenda */
.lista-ag { display: flex; flex-direction: column; gap: 10px; }
.ci { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--linea); border-left: 5px solid var(--gris); padding: 12px; border-radius: 6px; cursor: pointer; }
.ci:active { background: #faf6f2; }
.ci-h { text-align: center; font-family: var(--mono); line-height: 1.15; }
.ci-h b { display: block; font-size: 17px; }
.ci-h span { font-size: 12px; color: var(--gris); }
.ci-n { font-weight: 700; font-size: 15px; }
.ci-t { font-size: 14px; margin: 2px 0; }
.ci-a { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.ci.cancelada, .ci.no_asistio { opacity: .55; }
.ci.cancelada .ci-n, .ci.no_asistio .ci-n { text-decoration: line-through; }
.libre { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px dashed #d9d3c8; border-radius: 6px; color: var(--gris); font-size: 14px; cursor: pointer; background: rgba(255,255,255,.5); }
.libre b { font-family: var(--mono); color: var(--tinta); font-size: 13px; }
.libre:active { background: #fff; }

@media (max-width: 860px) {
  html { -webkit-text-size-adjust: 100%; }
  body { background-size: 14px 14px; }

  /* Barra superior */
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 25; background: var(--lateral); color: #fff;
    margin: -14px -12px 14px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .topbar .lg img, .topbar .lg .ini { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--acento); display: grid; place-items: center; font-weight: 800; color: #fff; }
  .topbar b { flex: 1; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar button { background: none; border: 1px solid #444; color: #fff; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; cursor: pointer; }

  /* Menú inferior tipo app */
  #app { grid-template-columns: 1fr; }
  aside { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; z-index: 30; padding: 0; flex-direction: row;
    border-top: 1px solid #2c282a; padding-bottom: env(safe-area-inset-bottom); }
  aside .cli { display: none; }
  nav { display: flex; width: 100%; overflow-x: auto; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav a { flex: 1 1 0; min-width: 60px; flex-direction: column; gap: 3px; padding: 8px 2px 7px; font-size: 10.5px; border-left: 0; border-top: 3px solid transparent;
    justify-content: center; text-align: center; white-space: nowrap; background: none !important; }
  nav a .n, nav a .pill, nav a .tx { display: none; }
  nav a .ic { display: block; width: 22px; height: 22px; margin: 0 auto; }
  nav a .tx-m { display: block; }
  nav a.activo { border-top-color: var(--acento); color: #fff; }
  nav a.activo .ic { color: var(--acento); }
  nav a.xs-no { display: none; }

  /* Menú de cuenta (botón ⋯ de la barra superior) */
  aside .pie { display: none; position: fixed; top: calc(62px + env(safe-area-inset-top)); right: 10px; width: 270px; background: var(--lateral);
    border: 1px solid #333; border-radius: 10px; padding: 14px; z-index: 40; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
  body.menu-abierto aside .pie { display: block; }

  /* Contenido */
  main { padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); max-width: none; }
  h1 { font-size: 22px; }
  .cab { margin-bottom: 14px; gap: 10px; }
  .cab > div:last-child:not(:first-child) { width: 100%; }
  .cab .btn { flex: 1; text-align: center; }
  .caja > h2 { padding: 12px 14px; flex-wrap: wrap; }
  .caja > h2 small { margin-left: 0; width: 100%; }
  .cuerpo { padding: 4px 14px 14px; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 12px; }

  /* Controles cómodos para el dedo (y sin zoom automático en iPhone) */
  input[type=text], input[type=email], input[type=password], input[type=url], input[type=tel], input[type=number], input[type=time], input[type=date], select, textarea { font-size: 16px !important; min-height: 44px; }
  .btn { min-height: 44px; padding: 10px 14px; }
  .btn.peq { min-height: 36px; padding: 6px 10px; }
  .check li { padding: 12px 0; }
  label { font-size: 13px; }

  /* Barra de guardar sobre el menú inferior */
  .barra { left: 0; bottom: calc(60px + env(safe-area-inset-bottom)); padding: 10px 12px; }
  .barra > span { font-size: 13px; }
  #toast { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); text-align: center; }

  /* Tablas: se ocultan columnas secundarias */
  .xs-no { display: none !important; }
  table.t th, table.t td { padding: 12px 10px; }

  /* Ventanas como hoja desde abajo */
  #modal { padding: 0 !important; place-items: end stretch !important; }
  #modal .m { max-width: none !important; width: 100%; max-height: 92vh !important; border: 0 !important; box-shadow: none !important; border-radius: 16px 16px 0 0; }
  #modal header { border-radius: 16px 16px 0 0; }
  #modal footer { flex-wrap: wrap; padding-bottom: calc(14px + env(safe-area-inset-bottom)) !important; }
  #modal footer .der { width: 100%; }
  #modal footer .der .btn { flex: 1; }

  /* Agenda */
  .ag-nav { width: 100%; }
  .ag-nav input[type=date] { order: 5; flex: 1 1 100%; min-width: 0; }
  .ag-nav .seg { margin-left: auto; }
  .ag-nav #ag-nueva { display: none; }
  .dias { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 6px; margin: 0 -12px 12px; padding: 0 12px; scrollbar-width: none; }
  .dias::-webkit-scrollbar { display: none; }
  .dia { flex: 0 0 calc((100% - 36px) / 7); min-width: 44px; padding: 7px 2px; scroll-snap-align: start; }
  .dia b { font-size: 17px; }
  .ag-wrap { max-height: calc(100vh - 290px); margin: 0 -12px; border-left: 0; border-right: 0; }
  .ag { grid-template-columns: 54px repeat(var(--nbox, 1), minmax(120px, 1fr)) !important; }
  .ag .hcol div { padding-right: 5px; }
  .ci { grid-template-columns: 54px 1fr; }
  .ci-a { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .fab { display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 58px; height: 58px;
    border-radius: 50%; border: 0; background: var(--acento); color: #fff; font-size: 30px; line-height: 1; box-shadow: 0 6px 18px rgba(0,0,0,.25); z-index: 26; cursor: pointer; }

  /* Mi clínica */
  .imgs { grid-template-columns: 110px 1fr; gap: 12px; }
  .colores { gap: 8px; }
  .color { flex: 1 1 140px; }
  .horario .d { grid-template-columns: 1fr auto; row-gap: 6px; }
  .horario .d .tramos { grid-column: 1 / -1; }
  .horario input[type=time] { width: 104px; }
  .redes .r { grid-template-columns: 1fr 44px; }
  .redes .r select { grid-column: 1 / -1; }
  .mapa { height: 200px; }
}
