/* ─────────── Panel admin ─────────── */

.admin-body {
  background: var(--bg);
  min-height: 100vh;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 14px) 18px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.admin-brand img {
  height: 36px;
}
.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.admin-user-email {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

#admin-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px 160px; /* espacio extra para el save-bar sticky */
}

@media (min-width: 1440px) {
  #admin-main {
    max-width: 1440px;
    padding: 28px 40px 180px;
  }
}

@media (min-width: 1800px) {
  #admin-main {
    max-width: 1640px;
    padding: 32px 56px 200px;
  }
}

.admin-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 14px;
}

/* Login */
.admin-login {
  max-width: 420px;
  margin: 40px auto;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow);
}
.admin-login h2 {
  font-family: var(--font-display);
  color: var(--ink);
  text-transform: none;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-align: center;
}
.admin-login .sub {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 22px;
}
.admin-login label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  margin-top: 14px;
}
.admin-login input[type="email"],
.admin-login input[type="password"],
.admin-input,
.admin-textarea,
.admin-login select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--ink);
  transition: border-color 0.15s;
}
.admin-login input:focus,
.admin-input:focus,
.admin-textarea:focus {
  outline: none;
  border-color: var(--red);
}
.admin-login .btn {
  width: 100%;
  margin-top: 18px;
}
.admin-login .btn-google {
  width: 100%;
  margin: 6px 0 0;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.admin-login .btn-google:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.1);
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.login-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.login-actions .btn {
  flex: 1;
  margin-top: 0;
}
.admin-error {
  background: #fff1f3;
  border: 1px solid #f4c7cf;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--red-dark);
  margin-top: 12px;
}

/* Dashboard */
.admin-dashboard h2 {
  font-family: var(--font-display);
  text-transform: none;
  letter-spacing: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
}
.admin-dashboard .sub {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 22px;
}
.admin-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.trip-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.trip-card .color-tag {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
}
.trip-card .trip-info {
  flex: 1;
  min-width: 0;
}
.trip-card .trip-info .ttl {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 2px;
}
.trip-card .trip-info .meta {
  font-size: 12px;
  color: var(--muted);
}
.trip-card .trip-info .slug {
  font-family: ui-monospace, Menlo, monospace;
  color: var(--teal);
  font-size: 12px;
}
.trip-card .trip-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.trip-card .trip-actions a,
.trip-card .trip-actions button {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.trip-card .trip-actions .view {
  background: #fff1f3;
  color: var(--red);
}
.trip-card .trip-actions .edit {
  background: var(--red);
  color: #fff;
}
.trip-card .trip-actions .delete {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state .ic {
  font-size: 54px;
  margin-bottom: 12px;
}
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  margin: 0 0 8px;
}

/* Editor */
.admin-editor h2 {
  font-family: var(--font-display);
  text-transform: none;
  letter-spacing: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
}
.editor-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}
.editor-topbar h2 {
  margin: 0;
}
.btn-back {
  flex-shrink: 0;
  padding: 8px 14px !important;
  font-size: 13px !important;
}

/* jsoneditor host */
.json-editor-host {
  height: 520px;
  min-height: 320px;
  max-height: 75vh;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  resize: vertical;
}
@media (min-width: 1440px) {
  .json-editor-host {
    height: 620px;
  }
}
.json-editor-host .jsoneditor {
  border: none;
  height: 100%;
}
.json-editor-host .jsoneditor-menu {
  background: #f4f0ea;
  border-bottom: 1px solid var(--line);
}
.json-editor-host textarea.json-fallback {
  width: 100%;
  height: 100%;
  min-height: 280px;
  border: none;
  padding: 12px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
  line-height: 1.55;
  resize: none;
  white-space: pre;
}
.editor-section {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 20px;
  margin-bottom: 16px;
}
.editor-section h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.form-grid .full {
  grid-column: 1 / -1;
}

@media (min-width: 1440px) {
  .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
  }
}
.form-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}
.form-field input[type="color"] {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  cursor: pointer;
  padding: 4px;
}
.admin-textarea {
  min-height: 260px;
  max-height: 420px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
  white-space: pre;
  overflow: auto;
}
.prompt-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.prompt-bar .btn {
  flex: 1;
  min-width: 180px;
}
.validator-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  font-size: 13px;
}
.validator-panel.ok {
  background: #e6f7f1;
  border: 1px solid #9ddcc6;
  color: #1b6b52;
}
.validator-panel.err {
  background: #fff1f3;
  border: 1px solid #f4c7cf;
  color: var(--red-dark);
}
.validator-panel.warn {
  background: #fff7e6;
  border: 1px solid #f0d68c;
  color: #8b6a14;
}
.validator-panel ul {
  margin: 6px 0 0;
  padding-left: 22px;
}
.validator-panel li {
  margin-bottom: 3px;
}
.save-bar {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  margin: 20px -18px 0;
  padding: 14px 18px calc(14px + var(--safe-bot));
  display: flex;
  gap: 10px;
}
.save-bar .btn {
  flex: 1;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  z-index: 200;
  animation: toastIn 0.25s ease;
}
.toast.ok { background: #1e7a55; }
.toast.err { background: var(--red-dark); }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 520px) {
  .form-grid { grid-template-columns: 1fr; }
  .trip-card { flex-wrap: wrap; }
  .trip-card .trip-actions { width: 100%; }
  .trip-card .trip-actions a,
  .trip-card .trip-actions button { flex: 1; text-align: center; }
}

/* ─────────── Visual editor (days / activities) ─────────── */

.empty-hint {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 24px;
  margin: 0;
}

/* Override styles.css (.day-card is also used by the main PWA) */
#admin-main .day-card {
  display: block;
  align-items: initial;
  gap: 0;
  padding: 0;
  cursor: default;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}
#admin-main .day-card .day-head,
#admin-main .day-card .day-body {
  width: 100%;
  box-sizing: border-box;
}
.day-card:hover {
  border-color: #f4c7cf;
}

.day-card .day-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  background: linear-gradient(90deg, #fdf9f4, #fff);
}
.day-num {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--teal), #218e88);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 16px;
  flex-shrink: 0;
}
.day-head-info {
  flex: 1;
  min-width: 0;
}
.day-title-input {
  width: 100%;
  border: none;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  padding: 2px 6px;
  border-radius: 6px;
  background: transparent;
}
.day-title-input:focus {
  outline: none;
  background: #fff7e6;
}
.day-head-meta {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.day-head-meta input {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--muted);
  background: #fff;
  font-family: ui-monospace, Menlo, monospace;
  min-width: 0;
}
.day-head-meta input:focus {
  outline: none;
  border-color: var(--red);
  color: var(--ink);
}
.day-date-input { width: 108px; }
.day-city-input { width: 110px; }
.day-tz-input { width: 130px; }

.day-head-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.day-head-stats .stat {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 10px;
  background: #f4f0ea;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.day-head-stats .stat.ok {
  background: #e6f7f1;
  color: #1b6b52;
}
.day-head-stats .stat.warn {
  background: #fff7e6;
  color: #8b6a14;
}
.day-toggle {
  font-size: 16px;
  color: var(--muted);
  margin-left: 4px;
  transition: transform 0.2s;
}
.day-card:not(.collapsed) .day-toggle {
  transform: rotate(180deg);
}

.day-body {
  padding: 0 14px 14px 14px;
  border-top: 1px solid var(--line);
}
.day-card.collapsed .day-body {
  display: none;
}

.day-summary-field {
  margin: 12px 0;
}
.day-summary-field label,
.act-row-text label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.7px;
  color: var(--muted);
  margin-bottom: 4px;
}
.day-summary-field textarea,
.act-row-text textarea,
.act-row-text input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--ink);
  resize: vertical;
  background: #fff;
}
.day-summary-field textarea:focus,
.act-row-text textarea:focus,
.act-row-text input:focus {
  outline: none;
  border-color: var(--red);
}

.activities-list {
  margin-top: 8px;
}
.act-card {
  background: #fdfaf6;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.act-row-main {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  align-items: center;
}
.act-row-main input {
  border: 1.5px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
}
.act-row-main input:focus {
  outline: none;
  border-color: var(--red);
}
.act-time { width: 66px; font-family: ui-monospace, Menlo, monospace; }
.act-duration { width: 58px; text-align: right; }
.act-emoji { width: 48px; text-align: center; font-size: 16px; }
.act-title { flex: 1; font-weight: 600; font-family: var(--font-display); font-size: 14px; }

.act-row-map,
.act-row-wiki {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.act-row-map input,
.act-row-wiki input {
  flex: 1;
  border: 1.5px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 12px;
  font-family: ui-monospace, Menlo, monospace;
  color: var(--ink);
  background: #fff;
}
.act-row-map input:focus,
.act-row-wiki input:focus {
  outline: none;
  border-color: var(--red);
}
.act-chip {
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 14px;
  background: #f4f0ea;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.act-chip.ok {
  background: #e6f7f1;
  color: #1b6b52;
}
.act-chip.warn {
  background: #fff7e6;
  color: #8b6a14;
}
a.act-chip:hover { opacity: 0.85; }

.act-row-text {
  margin-top: 8px;
}

/* ─────────── Adjuntos (editor admin) ─────────── */
.act-attachments {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.act-attachments label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.7px;
  color: var(--muted);
  margin-bottom: 8px;
}
.att-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.att-empty {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  padding: 6px 0;
}
.att-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.att-item .att-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.att-item .att-info {
  flex: 1;
  min-width: 0;
}
.att-item .att-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.att-item .att-name-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-body);
}
.att-item .att-name-input:hover {
  border-color: var(--line);
  background: #fff7e6;
}
.att-item .att-name-input:focus {
  outline: none;
  border-color: var(--red);
  background: #fff;
}
.att-item .att-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.att-item .att-view {
  padding: 6px 12px;
  background: var(--red);
  color: #fff;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
}
.att-item .att-del {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f4f0ea;
  color: var(--muted);
  font-size: 16px;
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.att-item .att-del:hover {
  background: #fff1f3;
  color: var(--red-dark);
}
.att-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.att-actions button {
  flex: 1;
  min-width: 140px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px dashed #f4c7cf;
  background: #fff;
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.att-actions button:hover {
  background: #fff1f3;
  border-style: solid;
}

/* ─────────── Clientes (admin) ─────────── */

.client-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.client-avatar.big {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.client-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.client-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
.client-preview-card:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}
.client-info {
  min-width: 0;
  flex: 1;
}
.client-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.more-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  font-style: italic;
}

/* ─────────── Tabs activo/expirado ─────────── */

.trip-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin: 14px 0 14px;
}
.trip-tab {
  background: transparent;
  border: 0;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.trip-tab:hover { color: var(--ink); }
.trip-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* Chip "expirado" */
.chip-expired {
  display: inline-block;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-left: 8px;
}
.trip-card.expired {
  opacity: 0.82;
  background: #fafbfc;
}
.trip-card.expired .ttl {
  color: var(--muted);
}

/* ── Superadmin nav ── */
.sadmin-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0;
  flex-wrap: wrap;
}
.sadmin-tab {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  border-radius: 6px 6px 0 0;
}
.sadmin-tab:hover { color: var(--ink); background: var(--bg); }
.sadmin-tab.active { color: var(--brand); border-bottom-color: var(--brand); background: none; }

.sadmin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.sadmin-header h2 { margin: 0 0 4px; }
.sadmin-header .sub { margin: 0; }

/* ── Subscriptions stats ── */
.subs-stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.subs-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 24px;
  text-align: center;
  min-width: 100px;
}
.subs-stat-n {
  display: block;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}
.subs-stat-l {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Subscriptions table ── */
.subs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.subs-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.subs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.subs-table tr:last-child td { border-bottom: none; }
.subs-table tr:hover td { background: #f8fafc; }

/* ── Stripe settings ── */
.stripe-cfg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.stripe-cfg-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 22px 20px;
}
.stripe-cfg-card h3 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.stripe-cfg-code {
  display: block;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  word-break: break-all;
  color: #0369a1;
}
.field-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}

/* ── Team admin rows ── */
.team-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.team-admin-row:last-child { border-bottom: none; }

/* ── GA4 Analytics ── */
.ga4-connect-prompt {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
}
.ga4-connect-prompt h3 { color: var(--ink); margin-bottom: 8px; }
.ga4-kpi-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.ga4-kpi {
  flex: 1;
  min-width: 120px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  text-align: center;
}
.ga4-kpi-n {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 4px;
}
.ga4-kpi-l {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ga4-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.ga4-card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.ga4-card-header h3 { margin: 0; font-size: 14px; font-weight: 700; }
.ga4-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  padding: 12px 16px 8px;
}
.ga4-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 3px;
}
.ga4-bar {
  width: 100%;
  min-height: 2px;
  background: var(--brand, #0ea5e9);
  border-radius: 3px 3px 0 0;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.ga4-bar:hover { opacity: 1; }
.ga4-bar-label { font-size: 9px; color: var(--muted); white-space: nowrap; }
.ga4-source-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.ga4-source-row:last-child { border-bottom: none; }
.ga4-source-bar-wrap {
  flex: 1;
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
}
.ga4-source-bar {
  height: 100%;
  border-radius: 3px;
  opacity: 0.8;
}

/* ── Stripe setup guide ── */
.stripe-setup-guide {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 24px;
}
.stripe-setup-guide h3 { margin: 0 0 16px; font-size: 15px; color: #065f46; }
.stripe-steps { display: flex; flex-direction: column; gap: 12px; }
.stripe-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--ink);
}
.stripe-step p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.stripe-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #d1fae5;
  color: #065f46;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stripe-step.done .stripe-step-num { background: #10b981; color: #fff; }
.stripe-step.done strong { color: #065f46; }

/* ── Revenue KPIs ── */
.rev-kpi-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.rev-kpi {
  flex: 1;
  min-width: 130px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}
.rev-kpi-main {
  border-color: #0ea5e9;
  background: linear-gradient(135deg, #f0f9ff, #fff);
}
.rev-kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.rev-kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 3px;
}
.rev-kpi-sub { font-size: 11px; color: var(--muted); }

/* ── Simulator ── */
.rev-simulator {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 28px;
}
.rev-sim-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}
.rev-sim-header h3 { margin: 0; font-size: 15px; }
.rev-sim-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #fef9c3;
  color: #a16207;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid #fde68a;
}
.rev-sim-body {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
}
@media (max-width: 860px) {
  .rev-sim-body { grid-template-columns: 1fr; }
}
.rev-sim-controls {
  padding: 20px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.rev-slider-group { display: flex; flex-direction: column; gap: 6px; }
.rev-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.rev-slider-header label { font-size: 13px; font-weight: 600; color: var(--ink); }
.rev-slider-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  min-width: 40px;
  text-align: right;
}
.rev-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  outline: none;
}
.rev-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--track, #0ea5e9);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.rev-slider-minmax {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}
.rev-sim-result {
  padding: 20px;
}
.rev-sim-result-mrr { margin-bottom: 16px; }
.rev-sim-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 2px;
}
.rev-sim-mrr {
  font-size: 38px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.rev-sim-result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 4px;
}
.rev-sim-big {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ── 12-month chart ── */
.rev-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 80px;
}
.rev-chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  height: 100%;
  justify-content: flex-end;
}
.rev-chart-bar {
  width: 100%;
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  opacity: 0.8;
  transition: height 0.3s ease;
}
.rev-chart-label { font-size: 8px; color: var(--muted); }
.rev-chart-val { font-size: 8px; color: var(--ink); font-weight: 600; }
