﻿/* =========================
   PTAS LIGHT — Diseño tipo Ciutat (clean institucional)
   Paleta:
   - Fondo blanco/gris suave
   - Azul PTAS #2563eb
   - Azul suave #dbeafe
   - Dorado PTAS #f5c542
========================= */

:root{
  --bg:#f6f8fc;
  --panel:#ffffff;
  --panel2:#fbfdff;
  --line:#e6ebf3;

  --text:#0f172a;
  --muted:#64748b;

  --ptas-blue:#2563eb;
  --ptas-blue-dark:#1e3a8a;
  --ptas-blue-soft:#dbeafe;
  --ptas-gold:#f5c542;

  --ok:#16a34a;
  --warn:#f59e0b;
  --bad:#dc2626;

  --radius:18px;
  --radius2:22px;
  --shadow:0 14px 34px rgba(2, 6, 23, .10);
  --shadow2:0 10px 24px rgba(2, 6, 23, .08);
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background:
    radial-gradient(1200px 420px at 20% -10%, rgba(37,99,235,.10), transparent 60%),
    radial-gradient(900px 340px at 90% 10%, rgba(245,197,66,.10), transparent 55%),
    linear-gradient(180deg, #ffffff, var(--bg));
}

/* ===== Topbar (estilo Ciutat) ===== */
.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px;
  background:rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}

.brand{display:flex; align-items:center; gap:12px}
.logo{
  width:46px; height:46px;
  border-radius:16px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, var(--ptas-blue-dark), var(--ptas-blue));
  color:#fff;
  font-weight:900;
  letter-spacing:.2px;
  box-shadow: var(--shadow2);
}
.logo img{
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:inherit;
}
.title{font-weight:950; letter-spacing:.2px; font-size:15px}
.subtitle{font-size:12px; color:var(--muted); margin-top:2px}

.status{display:flex; align-items:center; gap:10px; font-size:13px}
.statusStack{flex-direction:column; align-items:flex-end}
.dot{width:10px; height:10px; border-radius:50%; background:#cbd5e1}
.dot.ok{background:var(--ok)}
.dot.bad{background:var(--bad)}

.wrap{max-width:1100px; margin:0 auto; padding:16px}

.ownerPanel{
  margin-bottom:14px;
}

.ownerGrid{
  display:grid;
  grid-template-columns:minmax(0, .9fr) minmax(0, 1.1fr);
  gap:14px;
}

.ownerPanel.ownerLogged{
  box-shadow:var(--shadow2);
}

.ownerPanel.ownerLogged .panelHead{
  margin-bottom:10px;
}

.ownerPanel.ownerLogged #ownerAuthCard{
  background:#fff;
}

.ownerPanel.ownerLogged #ownerSessionInfo{
  margin-bottom:0;
}

.ownerPanel.ownerSingle{
  max-width:620px;
  margin-left:auto;
  margin-right:auto;
}

.ownerPanel.ownerSingle .ownerGrid{
  grid-template-columns:1fr;
}

.ownerPanel #ownerBusinessSelect:disabled{
  color:var(--muted);
  background:#f8fafc;
}

@media (max-width: 900px){
  .ownerGrid{grid-template-columns:1fr}
}

/* ===== Tabs ===== */
.tabs{
  display:flex; gap:10px; margin:10px 0 14px;
  flex-wrap:wrap;
}
.tab{
  border:1px solid var(--line);
  background:rgba(255,255,255,.85);
  padding:10px 14px;
  border-radius:999px;
  cursor:pointer;
  font-weight:800;
  transition:.15s ease;
}
.tab:hover{transform:translateY(-1px)}
.tab.active{
  border-color:rgba(37,99,235,.35);
  box-shadow:0 10px 26px rgba(37,99,235,.14);
  background:rgba(37,99,235,.08);
}

/* ===== Panels / Cards ===== */
.panel{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius2);
  box-shadow: var(--shadow);
  padding:14px;
}

.panelHead{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; flex-wrap:wrap;
  border-bottom:1px dashed var(--line);
  padding-bottom:12px;
  margin-bottom:14px;
}
h2{margin:0; font-size:20px}
h3{margin:0 0 10px; font-size:16px}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}
@media (max-width: 900px){
  .grid2{grid-template-columns:1fr}
}

.card{
  border:1px solid var(--line);
  border-radius:20px;
  padding:14px;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  box-shadow: var(--shadow2);
}

/* ===== Rows ===== */
.row{display:flex; align-items:center}
.space{justify-content:space-between}
.gap{gap:10px}
.wrapRow{flex-wrap:wrap}

/* ===== KPIs (te faltaba estilo para .kpis/.kpi) ===== */
.kpis{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  margin-top:10px;
}
@media (max-width: 560px){
  .kpis{grid-template-columns:1fr}
}
.kpi{
  border:1px solid var(--line);
  border-radius:18px;
  padding:12px;
  background:
    radial-gradient(500px 160px at 20% 0%, rgba(37,99,235,.10), transparent 55%),
    linear-gradient(180deg, #fff, #fbfdff);
}
.kpiLabel{font-size:12px; color:var(--muted); font-weight:800}
.kpiValue{font-size:22px; font-weight:950; margin-top:4px}

/* ===== Inputs ===== */
.field{margin-top:12px}
label{font-weight:900; font-size:13px}
input, select{
  width:100%;
  margin-top:6px;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:14px;
  outline:none;
  font-size:14px;
  background:#fff;
}
textarea{
  width:100%;
  min-height:96px;
  margin-top:6px;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:14px;
  outline:none;
  font-size:14px;
  background:#fff;
  resize:vertical;
  font-family:inherit;
}
input:focus, select:focus{
  border-color:rgba(37,99,235,.55);
  box-shadow:0 0 0 4px rgba(37,99,235,.14);
}
textarea:focus{
  border-color:rgba(37,99,235,.55);
  box-shadow:0 0 0 4px rgba(37,99,235,.14);
}

.hint{font-size:12px; color:var(--muted); margin-top:6px}

.note{
  margin-top:12px;
  padding:10px 12px;
  border-radius:16px;
  border:1px solid rgba(37,99,235,.22);
  background:rgba(37,99,235,.08);
  color:#0b255e;
  font-size:13px;
}

/* ===== Buttons (estilo Ciutat, más “app”) ===== */
.btn{
  border:none;
  background: linear-gradient(135deg, var(--ptas-blue-dark), var(--ptas-blue));
  color:#fff;
  padding:11px 14px;
  border-radius:16px;
  cursor:pointer;
  font-weight:950;
  box-shadow:0 12px 26px rgba(37,99,235,.18);
  transition:.12s ease;
}
.btn:hover{filter:brightness(1.03)}
.btn:active{transform:translateY(1px)}
.btn:disabled{
  cursor:not-allowed;
  opacity:.6;
  filter:none;
  box-shadow:none;
}

.btn.soft{
  background:rgba(37,99,235,.10);
  color:var(--ptas-blue-dark);
  box-shadow:none;
  border:1px solid rgba(37,99,235,.22);
}
.btn.ghost{
  background:transparent;
  border:1px solid var(--line);
  color:var(--text);
  box-shadow:none;
}

/* Pills */
.pill{
  border:1px solid rgba(37,99,235,.22);
  background:rgba(37,99,235,.08);
  color:#0b255e;
  padding:9px 12px;
  border-radius:999px;
  cursor:pointer;
  font-weight:900;
  transition:.12s ease;
}
.pill:hover{transform:translateY(-1px)}
.pill.active{
  background: linear-gradient(135deg, var(--ptas-blue-dark), var(--ptas-blue));
  color:#fff;
  border-color:transparent;
}

/* Check */
.check{display:flex; align-items:center; gap:10px; margin-top:10px; font-weight:900; font-size:13px}
.check input{width:auto; margin:0}

/* ===== Lists ===== */
.list{display:flex; flex-direction:column; gap:10px; margin-top:10px}
.item{
  border:1px solid var(--line);
  border-radius:18px;
  padding:12px;
  background:#fff;
  box-shadow: 0 8px 18px rgba(2,6,23,.06);
}
.itemHead{display:flex; justify-content:space-between; gap:10px; align-items:flex-start}

/* ===== Badges ===== */
.badge{
  display:inline-flex; align-items:center; gap:8px;
  font-size:12px;
  font-weight:950;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#f8fafc;
  color:var(--text);
}
.badge.once{border-color:rgba(245,197,66,.55); background:rgba(245,197,66,.16)}
.badge.weekly{border-color:rgba(37,99,235,.35); background:rgba(37,99,235,.10)}

/* Estados reserva (BOOKED / DONE / CANCELLED) */
.badge.booked{
  background:rgba(37,99,235,.12);
  color:#1d4ed8;
  border:1px solid rgba(37,99,235,.28);
}
.badge.ok{
  background:rgba(22,163,74,.12);
  color:#166534;
  border:1px solid rgba(22,163,74,.28);
}
.badge.danger{
  background:rgba(220,38,38,.12);
  color:#991b1b;
  border:1px solid rgba(220,38,38,.28);
}

/* ===== Code preview ===== */
.code{
  margin:0;
  padding:12px;
  border-radius:16px;
  border:1px solid var(--line);
  background:#0b1220;
  color:#e5e7eb;
  overflow:auto;
  font-size:12px;
}

.small{font-size:12px}
.muted{color:var(--muted)}
.hidden{display:none}

.danger{
  background:rgba(220,38,38,.08);
  border:1px solid rgba(220,38,38,.22);
  color:#7f1d1d;
  padding:10px 12px;
  border-radius:16px;
  font-weight:900;
}

.logoPreview{
  min-height:160px;
  border:1px dashed rgba(37,99,235,.28);
  border-radius:20px;
  background:linear-gradient(180deg, rgba(37,99,235,.06), rgba(255,255,255,.9));
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.logoPreview img{
  width:100%;
  height:160px;
  object-fit:contain;
  background:#fff;
}
.logoPreviewText{
  color:var(--muted);
  font-weight:900;
}

.storageBox{
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(37,99,235,.22);
  background:rgba(37,99,235,.06);
  margin-top:10px;
}

.summaryList{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:14px;
}

.summaryItem{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  padding:10px 12px;
  border-radius:16px;
  border:1px solid var(--line);
  font-size:13px;
  background:#fff;
}
.summaryItem.ok{
  border-color:rgba(22,163,74,.24);
  background:rgba(22,163,74,.08);
}
.summaryItem.pending{
  border-color:rgba(245,158,11,.24);
  background:rgba(245,158,11,.08);
}

.paymentMethodsGrid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:14px;
  margin-top:14px;
}
@media (max-width: 900px){
  .paymentMethodsGrid{grid-template-columns:1fr}
}

.paymentCard{
  border:1px solid var(--line);
  border-radius:18px;
  padding:14px;
  background:#fff;
  box-shadow:0 8px 18px rgba(2,6,23,.06);
}

.paymentCard h4{
  margin:0;
  font-size:15px;
}

.accessGrid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:14px;
  margin-top:14px;
}

.accessCard{
  border:1px solid var(--line);
  border-radius:18px;
  padding:14px;
  background:#fff;
  box-shadow:0 8px 18px rgba(2,6,23,.06);
}

.accessUrl{
  margin:6px 0 10px;
  font-size:15px;
  font-weight:950;
  line-height:1.35;
  word-break:break-all;
}

.clientAccessLayout{
  display:grid;
  grid-template-columns:220px 1fr;
  gap:16px;
  align-items:center;
  margin-top:14px;
}

.qrBox{
  width:220px;
  aspect-ratio:1;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
  display:grid;
  place-items:center;
  padding:14px;
  box-shadow:0 8px 18px rgba(2,6,23,.06);
}

.qrBox img{
  width:100%;
  height:100%;
  object-fit:contain;
}

.clientAccessBody{
  min-width:0;
}

.accessList{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:10px;
}

.accessItem{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:16px;
  background:linear-gradient(180deg, #fff, #fbfdff);
}

.accessBody{
  min-width:0;
  flex:1;
}

.accessMeta{
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
}

.foot{
  padding:18px 16px;
  text-align:center;
  border-top:1px solid var(--line);
  background:rgba(255,255,255,.75);
}

/* Pequeño detalle “dorado PTAS” opcional para resaltar algo */
.goldLine{
  height:4px;
  width:120px;
  border-radius:999px;
  background: linear-gradient(90deg, transparent, rgba(245,197,66,.9), transparent);
  margin:10px 0 0;
}

@media (max-width: 900px){
  .topbar{
    align-items:flex-start;
    flex-wrap:wrap;
  }

  .statusStack{
    width:100%;
    align-items:flex-start;
  }

  .accessGrid{
    grid-template-columns:1fr;
  }

  .clientAccessLayout{
    grid-template-columns:1fr;
  }

  .qrBox{
    width:min(100%, 260px);
  }
}

@media (max-width: 640px){
  .wrap{
    padding:12px;
  }

  .topbar{
    padding:12px;
  }

  .panel{
    padding:12px;
  }

  .tabs{
    gap:8px;
  }

  .tab{
    flex:1 1 calc(50% - 8px);
    text-align:center;
  }

  .panelHead{
    align-items:flex-start;
  }

  .panelHead > .row,
  .accessItem,
  .itemHead{
    flex-direction:column;
    align-items:stretch;
  }

  .accessItem .btn,
  .panelHead > .row .btn,
  .panelHead > .row input,
  .panelHead > .row select{
    width:100%;
  }

  .row.space{
    flex-wrap:wrap;
  }
}

