:root{
  /* Tema "blanco perlado" + tipografía sutil */
  --bg:#fbfaf7;
  --card:#fffdfa;
  --text:#111827;
  --muted:#4b5563;
  /* Acento homogéneo con /home */
  --brand:#1fb6d1;
  --brand2:#38bdf8;
  --border:rgba(17,24,39,.10);
  --shadow:0 14px 34px rgba(17,24,39,.08);
  --r:18px;
}
*{box-sizing:border-box}
html,body{width:100%;max-width:100%;overflow-x:hidden}
body{
  margin:0;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:var(--bg);
  color:var(--text);
}
.wrap{max-width:980px;margin:0 auto;padding:18px}
.top{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.brand{display:flex;gap:12px;align-items:center}
.logo{width:54px;height:54px;animation:spin 18s linear infinite}
.title{font-weight:900;letter-spacing:2px;color:var(--text);font-size:18px}
.subtitle{color:var(--muted);font-size:12px;margin-top:2px}
.slugline{margin-top:6px;font-size:12px;color:rgba(15,23,42,.65)}
.slugline a{color:var(--brand);font-weight:900;text-decoration:none}
.slugline a:hover{text-decoration:underline}
.meta{display:flex;gap:10px;align-items:center}

.authbar{display:flex;align-items:center;gap:10px;justify-content:space-between;flex-wrap:wrap;width:100%}
.authbar .muted{min-width:0;white-space:normal;overflow-wrap:anywhere}

.authbox{background:rgba(0,0,0,.04);border:1px solid var(--border);border-radius:14px;padding:10px 12px;min-width:260px}
.authbox .actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;width:100%}
@media (max-width:760px){
  .authbox{min-width:0;width:100%}
}
.pill{padding:6px 10px;border:1px solid var(--border);border-radius:999px;background:#fff;font-size:12px;color:var(--muted)}
.card{background:var(--card);border-radius:var(--r);box-shadow:var(--shadow);padding:18px}
h1{margin:0 0 8px 0;font-size:22px}
h2{margin:0 0 8px 0;font-size:18px}
.muted{color:var(--muted)}
.form{display:grid;gap:10px;max-width:460px}
label{display:grid;gap:6px;font-size:13px;min-width:0;width:100%}
input,select,textarea{
  width:100%;max-width:100%;min-width:0;display:block;
  padding:10px 12px;border:1px solid var(--border);border-radius:12px;font-size:14px;background:#fff
}
.btn{
  height:44px;
  padding:0 16px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  cursor:pointer;
  font-weight:900;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.btn.primary{
  background:linear-gradient(135deg, var(--brand), var(--brand2));
  border:0;
  color:#fff;
  box-shadow:0 12px 30px rgba(31,182,209,.20)
}
.btn.primary:hover{transform:translateY(-1px)}
.btn.ghost{background:transparent}
.btn:disabled{opacity:.5;cursor:not-allowed}
.hint{margin-top:6px;font-size:12px;color:var(--muted)}
#pro-editing-state{
  margin:4px 0 8px;
  padding:8px 12px;
  border:1px solid rgba(31,182,209,.22);
  background:rgba(31,182,209,.08);
  border-radius:12px;
  font-weight:700;
  color:#0f766e;
}
.details{margin-top:12px}
.tabs{display:flex;gap:8px;margin-bottom:14px;flex-wrap:wrap}
.tab{padding:9px 12px;border-radius:999px;border:1px solid var(--border);background:#fff;cursor:pointer;font-weight:700;font-size:13px}
.tab.active{background:rgba(31,182,209,.14);border-color:rgba(31,182,209,.35);color:var(--text)}
.panel{margin-top:4px}
.grid{display:grid;grid-template-columns: 1.2fr .8fr auto;gap:10px;align-items:end;margin:12px 0}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:end;margin:12px 0}
.grid3{display:grid;grid-template-columns: 1fr 1fr auto;gap:10px;align-items:end;margin:8px 0 12px}

.block .label{font-size:13px;color:var(--muted);margin-bottom:6px}
.checks{display:flex;flex-wrap:wrap;gap:10px;padding:10px;border:1px solid var(--border);border-radius:12px}
.check{display:flex;gap:8px;align-items:center;font-size:13px}
.list{display:grid;gap:10px;margin-top:10px}
.item{
  border:1px solid var(--border);border-radius:14px;padding:12px;display:flex;justify-content:space-between;gap:12px;align-items:flex-start
}
.item .main{display:grid;gap:4px}
.item .name{font-weight:800}
.item .sub{color:var(--muted);font-size:12px}
.actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.actions > *{min-width:0}
.inline-actions{align-self:end;justify-content:flex-start}
.small{padding:8px 10px;border-radius:10px;font-size:12px}
.foot{margin-top:14px;font-size:12px}
@keyframes spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}
@media (max-width:760px){
  .grid{grid-template-columns:1fr}
  .inline-actions{width:100%}
  .inline-actions .btn{width:100%}
  /* On small screens, avoid "missing" submit buttons in 2-col grids */
  .grid3{grid-template-columns:1fr 1fr}
  .grid3 button{grid-column:1 / -1; width:100%}
  .grid3 .btn{width:100%}

  /* Biz form: stack inputs + full-width button on mobile */
  #biz-form{grid-template-columns:1fr}
  #biz-form button{justify-self:stretch; width:100%}
}

/* Extra-tight phones */
@media (max-width:420px){
  .grid2{grid-template-columns:1fr}
  .grid3{grid-template-columns:1fr}
  .grid3 button{grid-column:1 / -1; width:100%}
  .applybox-top{flex-direction:column; align-items:flex-start}
  .apply-presets{width:100%; justify-content:flex-start}
  .apply-presets .btn{flex:1 1 auto}
  .row-between{align-items:flex-start}
  #btn-apply-work{width:100%}
}

/* ===== UX tweaks (services/pro list alignment) ===== */
.item .actions{min-width:220px}
.btn.small{min-width:92px; text-align:center}

/* ---- Horarios (jornada + pausas) ---- */
.subttl{
  margin:14px 0 8px;
  font-size:14px;
  color:var(--muted);
  font-weight:700;
  letter-spacing:.4px;
  text-transform:uppercase;
}
.row-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
  margin:8px 0 10px;
}
.row-actions.row-between{
  justify-content:space-between;
}
.chkline{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:14px;
  color:#111827;
}
.btn.secondary{
  background:transparent;
  color:var(--brand);
  border:1px solid rgba(139,60,246,.35);
}
.btn.secondary:hover{
  background:rgba(139,60,246,.08);
}

/* ---- Aplicar a días (opción B) ---- */
.applybox{
  margin:10px 0 14px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fafafa;
}
.applybox-top{
  display:flex;
  gap:12px;
  align-items:flex-start;
  justify-content:space-between;
  flex-wrap:wrap;
}
.apply-days{display:flex;flex-wrap:wrap;gap:8px}
.daychk{
  display:flex;
  align-items:center;
  gap:6px;
  padding:6px 8px;
  border:1px solid var(--border);
  border-radius:999px;
  background:#fff;
  font-size:13px;
}
.apply-presets{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.btn.tiny{padding:6px 10px;border-radius:999px;font-size:12px}

/* ---- Banner pro: cobertura de horarios ---- */
.notice{
  border:1px solid rgba(245,158,11,.35);
  background:rgba(245,158,11,.12);
  color:#7c2d12;
  padding:12px 14px;
  border-radius:14px;
  margin:8px 0 12px;
  font-size:13px;
  display:flex;
  gap:10px;
  align-items:flex-start;
}
.notice .strong{font-weight:800}
.notice .muted{color:rgba(124,45,18,.75)}
.notice .actions{margin-left:auto}

.sep{ border:0; border-top:1px solid rgba(0,0,0,.08); margin:16px 0; }/* ===============================
   TOPBAR (homogéneo con /home)
   =============================== */
.topbar{
  position:sticky; top:0; z-index:20;
  background:rgba(255,255,255,.82);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(15,23,42,.07);
}
.topbar-inner{
  max-width:1040px;
  margin:0 auto;
  padding:12px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.brand{display:flex;align-items:center;gap:10px;font-weight:900;letter-spacing:.04em}
.brand img{width:28px;height:28px}
.topbar-actions{display:flex;align-items:center;gap:10px}

/* Root override controls */
.bizoverride{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px;align-items:center}
.bizoverride-label{font-size:12px;opacity:.8}

/* Horarios - semana list */
.weekrow.selected{ outline: 2px solid rgba(0,0,0,.12); border-radius: 14px; }
#avail-week-grid .item{ cursor: pointer; }
#avail-week-grid .item .actions button{ cursor:pointer; }
#copy-details > summary{ list-style:none; cursor:pointer; }
#copy-details > summary::-webkit-details-marker{ display:none; }
#copy-details > summary{ padding:10px 12px; border:1px solid rgba(0,0,0,.08); border-radius:14px; }
#copy-details[open] > summary{ margin-bottom:10px; }

/* --- Responsive guardrails (mobile overflow fixes) ---
   IMPORTANT: keep desktop layout width/centering intact.
   Apply only on small screens, and avoid clipping scrollable/report areas.
*/
@media (max-width: 720px){
  html, body { overflow-x:hidden; }
  .grid2 > *, .grid3 > *, .grid > * { min-width:0; }
  input, select, textarea, button { max-width:100%; }
  pre, code { white-space:pre-wrap; word-break:break-word; }
  img, svg, canvas { max-width:100%; height:auto; }
  .tablewrap, .table-wrap, .hscroll { overflow-x:auto; -webkit-overflow-scrolling:touch; }
}

/* ---- Negocio (dirección + maps) ----
   Objetivo: inputs alineados en desktop; "aire" cuando apilan; Safari-friendly. */
#biz-form{
  grid-template-columns: 1fr 1fr;
  align-items: start;           /* 🔑 evita desalineo por baseline */
  gap: 24px;                    /* más aire */
  margin: 14px 0 18px;
}
#biz-form > label{
  display:flex;
  flex-direction:column;
}
#biz-form input{
  height: 44px;                 /* Safari: altura consistente */
}
#biz-form .biz-help{
  margin-top: 8px;
  min-height: 18px;             /* reserva el slot del help */
}
#biz-form button{
  grid-column: 1 / -1;
  justify-self: end;
  margin-top: 6px;
}
#biz-form #biz-msg{
  grid-column: 1 / -1;
  justify-self: start;
}

@media (max-width:760px){
  /* Cuando se apila (grid pasa a 1 columna), damos más aire vertical */
  #biz-form{
    gap: 16px;
  }
  #biz-form button{
    justify-self: stretch;
    width: 100%;
  }
}

/* Step95 suspended visual in /select */
.bizcard-suspended{
  border:2px solid #e11d48 !important;
  box-shadow:0 0 0 3px rgba(225,29,72,.08) !important;
  background:#fff1f2 !important;
}

.tag.bad{
  background:#e11d48 !important;
  color:#fff !important;
  font-weight:800;
}

/* ===== Guide box / onboarding ===== */
.guide-box{
  margin-top:12px;
  margin-bottom:16px;
  padding:18px 20px;
  border-radius:18px;
  border:1px solid #d8e7ff;
  background:linear-gradient(180deg,#f7fbff 0%,#eef6ff 100%);
  box-shadow:0 10px 28px rgba(37,99,235,.06);
}
.guide-title{
  font-size:18px;
  font-weight:800;
  color:#172554;
  margin-bottom:10px;
}
.guide-link-row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  gap:6px;
  margin-bottom:12px;
}
.guide-link-label{
  font-size:12px;
  font-weight:700;
  color:#47607d;
  text-transform:none;
}
.guide-link, .guide-link a{
  color:#1d4ed8;
  font-weight:700;
  word-break:break-all;
  text-decoration:none;
}
.guide-link a:hover{ text-decoration:underline; }
.guide-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:14px;
}
.guide-copy{
  display:grid;
  gap:10px;
  color:#334155;
}
.guide-message{
  font-size:15px;
  line-height:1.55;
}
.guide-next{
  font-size:14px;
  font-weight:800;
  color:#1d4ed8;
}
.guide-note{
  font-size:13px;
  line-height:1.55;
  color:#516174;
  padding-top:2px;
}
.guide-success{
  margin-top:14px;
  background:#eaf8ef;
  border:1px solid #b9e5c7;
  border-radius:14px;
  padding:12px 14px;
  color:#1f5133;
  font-weight:800;
}
@media (max-width:720px){
  .guide-box{padding:16px;}
  .guide-title{font-size:17px;}
  .guide-message{font-size:14px;}
  .guide-next,.guide-note{font-size:13px;}
  .guide-actions .btn{width:100%;}
}

.brand .logo{width:24px;height:24px;border-radius:8px;display:block}
.brand.brand-wordmark{display:flex;align-items:center;gap:10px}

/* ---- Panel responsive polish ---- */
.hours-days-list{max-width:100%;overflow:hidden}
.hours-day-card{max-width:100%}
.hours-day-grid{
  display:grid;
  grid-template-columns:minmax(180px,1.4fr) minmax(120px,1fr) minmax(120px,1fr);
  gap:12px;
  align-items:center;
}
.hours-day-label{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  font-weight:900;
  min-width:0;
}
.hours-day-time{min-width:0;width:100%}
.appointments-filters{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(170px,1fr)) !important;
  gap:14px;
  margin-bottom:16px;
}
.appointments-toolbar{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:16px;
}
@media (max-width: 820px){
  .hours-day-grid{
    grid-template-columns:1fr;
    gap:10px;
  }
  .appointments-filters{
    grid-template-columns:1fr !important;
  }
  .appointments-toolbar{
    flex-direction:column;
    align-items:stretch;
  }
}

/* system-v7-overrides */
.hours-day-label span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
@media (max-width:820px){.hours-day-label span{overflow:visible;text-overflow:clip;}}


/* Fix negocio card alignment */
.biz-name,
.business-name,
.location-name,
.place-name,
.card-business-name,
.map-title,
.map-business-name,
#businessName {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  margin: 0 auto 10px auto !important;
  color: #5f6673 !important;
  text-shadow: none !important;
}

.biz-address,
.business-address,
.location-address,
.place-address,
.card-business-address,
.map-address,
#businessAddress {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  margin: 0 auto 10px auto !important;
  color: #6b7280 !important;
  text-shadow: none !important;
}

.biz-maps,
.business-maps,
.location-maps,
.place-maps,
.card-business-maps,
.map-link,
#businessMaps {
  display: block !important;
  width: fit-content !important;
  max-width: 100% !important;
  text-align: center !important;
  margin: 0 auto !important;
  color: #6b7280 !important;
  text-shadow: none !important;
}

.business-info,
.biz-info,
.location-info,
.place-info,
.card-business-info,
.map-overlay,
.map-content,
.map-info,
.map-labels {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: 100% !important;
}

.business-info > *,
.biz-info > *,
.location-info > *,
.place-info > *,
.card-business-info > *,
.map-overlay > *,
.map-content > *,
.map-info > *,
.map-labels > * {
  align-self: center !important;
  text-align: center !important;
}



/* Specific business frame fix */
.business-card .business-info,
.business-frame .business-info,
.location-card .location-info,
.map-card .map-info,
.map-preview .map-overlay,
.map-preview .map-content,
.store-card .store-info {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: calc(100% - 32px) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

.business-card .business-name,
.business-frame .business-name,
.location-card .location-name,
.map-card .map-title,
.map-preview .map-title,
.store-card .store-name {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  margin: 0 0 10px 0 !important;
  color: #5f6673 !important;
  text-shadow: none !important;
}

.business-card .business-address,
.business-frame .business-address,
.location-card .location-address,
.map-card .map-address,
.map-preview .map-address,
.store-card .store-address {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  margin: 0 0 10px 0 !important;
  color: #6b7280 !important;
  text-shadow: none !important;
}

.business-card .map-link,
.business-frame .map-link,
.location-card .map-link,
.map-card .map-link,
.map-preview .map-link,
.store-card .map-link {
  display: inline-block !important;
  margin: 0 auto !important;
  color: #6b7280 !important;
  text-shadow: none !important;
  float: none !important;
}


/* panel phone-shell hardening */
body.page-panel,
body.page-panel *{
  box-sizing:border-box;
}

body.page-panel{
  overflow-x:hidden;
}

body.page-panel .hours-days-list,
body.page-panel #hours-days{
  max-width:100%;
  overflow:visible !important;
}

body.page-panel .hours-day-card{
  max-width:100%;
  overflow:visible !important;
}

body.page-panel .hours-day-grid{
  display:grid;
  grid-template-columns:1fr !important;
  gap:10px !important;
  align-items:center;
}

body.page-panel .hours-day-label{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  min-width:0;
  overflow:visible !important;
}

body.page-panel .hours-day-label span{
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  line-height:1.25;
}

body.page-panel .hours-day-time{
  min-width:0;
  width:100%;
  max-width:100%;
}

body.page-panel .appointments-filters{
  grid-template-columns:1fr !important;
}



/* Admin session card mirrored from /app */
.admin-session-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:18px 20px;
  border:2px solid rgba(79,131,209,.18);
  border-radius:18px;
  background:rgba(255,255,255,.94);
}
.admin-session-main{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
  flex:1 1 auto;
}
.admin-session-avatar{
  width:48px;
  height:48px;
  border-radius:999px;
  flex:0 0 48px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#d9ece8;
  color:#245b52;
  font-weight:800;
  font-size:20px;
}
.admin-session-meta{
  min-width:0;
  flex:1 1 auto;
}
.admin-session-name{
  font-size:16px;
  line-height:1.2;
  font-weight:800;
  color:#222;
  margin:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.admin-session-email{
  font-size:14px;
  line-height:1.25;
  color:#555;
  margin-top:2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.admin-session-logout{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:46px;
  padding:0 20px;
  border-radius:999px;
  border:0;
  background:#111 !important;
  color:#fff !important;
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
  box-shadow:0 10px 22px rgba(15,23,42,.18);
  flex:0 0 auto;
}
.admin-session-logout:hover{background:#000 !important;transform:translateY(-1px)}
.admin-session-logout::before{content:'●';color:#22c55e;font-size:12px;line-height:1}
.admin-session-logout:focus-visible{outline:3px solid rgba(34,197,94,.18);outline-offset:2px}
