/* Long settings forms (business editor): sections with an intro on the left, fields on the right. */
.page-wide { max-width: 1080px; }
.settings-form { display: grid; gap: 2.4rem; }

.form-section { display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: 1rem 2.5rem; align-items: start; }
.form-section-intro { position: sticky; top: 1.2rem; }
.form-section-intro h2 { margin-bottom: 0.35rem; }
.form-section-intro p { color: var(--ink-2); max-width: 36ch; }
.intro-tip { margin-top: 0.8rem; padding: 0.7rem 0.85rem; border-radius: var(--radius); background: var(--blue-soft); color: #153a96 !important; font-size: 0.92rem; }

/* Web address with its fixed prefix, locked for existing businesses */
.slug-box { display: flex; align-items: stretch; gap: 0.5rem; }
.slug-prefix {
  display: flex; align-items: center; padding: 0 0.7rem; border: 1.5px solid var(--line-strong); border-right: 0; border-radius: var(--radius) 0 0 var(--radius);
  background: #f1f4f6; color: var(--ink-2); font-weight: 600; white-space: nowrap; margin-right: -0.5rem;
}
.slug-box .input { border-radius: 0 var(--radius) var(--radius) 0; min-width: 0; }
.slug-box .input[readonly] { background: #f6f8fa; color: var(--ink-2); }
.slug-box .btn { align-self: center; }
.slug-warning { margin: 0.5rem 0 0; }

/* Role cards */
.role-editor { padding: 1.1rem 1.2rem; }
.role-editor-head { align-items: center; }
.role-editor-head .field label { display: grid; gap: 0.35rem; font-weight: 650; }
.role-editor details summary { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0; }
.role-editor details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 0.8rem; }
.perm-tools { display: flex; gap: 0.5rem; margin: 0 0 0.8rem; font-size: 0.92rem; color: var(--ink-3); }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem 1.6rem; }
.perm-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.perm-group legend { font-family: var(--font-display); font-weight: 650; color: var(--ink); padding: 0; margin-bottom: 0.3rem; }
.owner-pick {
  border: 1.5px solid var(--line-strong); border-radius: 999px; padding: 0.25rem 0.85rem 0.25rem 0.65rem; background: var(--surface); min-height: 40px;
  transition: border-color 0.12s, background 0.12s;
}
.owner-pick:has(input:checked) { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); }

/* Open / paused switch */
.status-switch { display: flex; gap: 1rem; align-items: flex-start; cursor: pointer; position: relative; }
.switch-input { position: absolute; opacity: 0; width: 52px; height: 30px; margin: 0; cursor: pointer; }
.switch-track { flex: none; width: 52px; height: 30px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background 0.2s ease; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.2s ease; }
.switch-input:checked + .switch-track { background: var(--green); }
.switch-input:checked + .switch-track .switch-thumb { transform: translateX(22px); }
.switch-input:focus-visible + .switch-track { outline: 3px solid var(--blue); outline-offset: 2px; }
.switch-input:checked ~ span .status-paused, .switch-input:not(:checked) ~ span .status-open { display: none; }
.status-switch strong { display: block; font-size: 1.05rem; }
.status-card.is-paused { border-color: var(--red); background: #fffafa; }

/* Save bar that stays in view while scrolling a long form */
.sticky-actions {
  position: sticky; bottom: 1rem; z-index: 9; display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap;
  padding: 0.7rem 0.8rem 0.7rem 1.2rem; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.dirty-note { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 650; color: var(--amber); }
.dirty-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tag); box-shadow: 0 0 0 3px var(--tag-soft); }

@media (max-width: 900px) {
  .form-section { grid-template-columns: 1fr; }
  .form-section-intro { position: static; }
  .form-section-intro p { max-width: none; }
  .slug-box { flex-wrap: wrap; }
  .slug-prefix { border-right: 1.5px solid var(--line-strong); border-radius: var(--radius); margin-right: 0; width: 100%; }
  .slug-box .input { border-radius: var(--radius); flex: 1; }
}

/* Collapsible role permissions: show that the row opens */
.role-editor details summary { cursor: pointer; list-style: none; }
.role-editor details summary::-webkit-details-marker { display: none; }
.role-editor details summary::after {
  content: "Ver y cambiar"; margin-left: auto; white-space: nowrap; flex: none; color: var(--blue); font-weight: 600; font-size: 0.92rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f55d6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right center / 18px no-repeat;
  padding-right: 22px;
}
.role-editor details[open] summary::after { content: "Ocultar"; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f55d6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 15 6-6 6 6'/%3E%3C/svg%3E"); }
.role-editor details summary:hover::after { text-decoration: underline; }

/* Logo field: preview and button side by side */
.logo-field > div:last-child { flex: 1 1 260px; min-width: 0; }


/* ---- Business summary at the top of the editor ---- */
.store-hero {
  display: grid; gap: 1.2rem; margin-bottom: 2rem; padding: 1.4rem 1.5rem; border-radius: var(--radius-lg); color: #fff;
  background: linear-gradient(135deg, var(--ink) 0%, #26394d 100%); position: relative; overflow: hidden;
}
.store-hero::after { /* price-tag cut corner, the one decorative touch */
  content: ""; position: absolute; top: 0; right: 0; width: 84px; height: 84px; background: var(--tag);
  clip-path: polygon(0 0, 100% 0, 100% 100%); opacity: 0.95;
}
.store-hero-main { display: flex; gap: 1.1rem; align-items: center; padding-right: 3.5rem; }
.store-hero-mark .brand-logo, .store-hero-mark .brand-mark { width: 68px; height: 68px; border-radius: 16px; font-size: 1.9rem; display: grid; place-items: center; padding: 6px; }
.store-hero h1 { font-size: 1.7rem; overflow-wrap: anywhere; }
.hero-link { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; color: #b9c6d2; margin-top: 0.3rem; }
.hero-link .link-btn { color: var(--tag); display: inline-flex; align-items: center; gap: 0.3rem; text-decoration: none; }
.hero-link .link-btn:hover { text-decoration: underline; }
.store-hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin: 0; }
.store-hero-stats div { background: rgb(255 255 255 / 0.08); border-radius: var(--radius); padding: 0.7rem 0.9rem; }
.store-hero-stats dt { color: #b9c6d2; font-size: 0.88rem; }
.store-hero-stats dd { margin: 0; font-size: 1.6rem; font-weight: 700; line-height: 1.15; }

/* ---- Section identity ---- */
.section-icon {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; margin-bottom: 0.8rem;
  background: var(--tag-soft); color: var(--tag-ink);
}
.section-icon .icon { width: 22px; height: 22px; }

/* ---- Role cards: a color stripe per role, and a summary that says what the role does ---- */
.role-editor { border-left: 6px solid hsl(var(--hue, 210) 55% 52%); box-shadow: var(--shadow-sm); }
.role-editor-head { align-items: flex-end; }
.role-editor-head > .owner-pick, .role-editor-head > .btn, .role-editor-head > .badge { margin-bottom: 0.1rem; }
.role-editor-head > .badge { align-self: center; margin-top: 1.6rem; }
.role-editor-head .owner-pick { min-height: 46px; }
.role-editor-head > .btn { min-height: 46px; }
.perm-chips { display: flex; gap: 0.35rem; flex-wrap: wrap; min-width: 0; }
.perm-chips span { background: hsl(var(--hue, 210) 60% 94%); color: hsl(var(--hue, 210) 50% 26%); padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.perm-chips .more { background: #e8edf1; color: var(--ink-2); }
.role-editor details[open] .perm-chips { display: none; }

/* ---- Permissions as tiles you can see are on ---- */
.perm-group .check {
  border: 1.5px solid var(--line); border-radius: var(--radius); padding: 0.6rem 0.75rem; margin-bottom: 0.5rem; background: var(--surface);
  transition: border-color 0.12s, background 0.12s;
}
.perm-group .check:hover { border-color: var(--line-strong); }
.perm-group .check:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.perm-group .check:has(input:checked) .hint { color: var(--green-dark); }

@media (max-width: 900px) {
  .store-hero-stats { grid-template-columns: repeat(2, 1fr); }
  .store-hero-main { padding-right: 2.5rem; }
  .store-hero::after { width: 56px; height: 56px; }
}

/* ---- Business detail (console) ---- */
.store-hero-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.btn-ghost-light { background: rgb(255 255 255 / 0.1); border-color: rgb(255 255 255 / 0.28); color: #fff; }
.btn-ghost-light:hover { background: rgb(255 255 255 / 0.2); border-color: rgb(255 255 255 / 0.5); }
.show-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 1.1rem; align-items: start; }
.show-main, .show-side { display: grid; gap: 1.1rem; min-width: 0; }
.show-main > .card, .show-side > .card { margin: 0; }
.section-icon-sm { display: inline-grid; width: 34px; height: 34px; margin: 0 0.4rem 0 0; vertical-align: middle; border-radius: 10px; }
.section-icon-sm .icon { width: 18px; height: 18px; }
.card-head h2 { display: flex; align-items: center; }

/* Renewal card: the colored edge says at a glance how urgent it is */
.renewal-card { border-left: 6px solid var(--line-strong); }
.renewal-card.status-ok { border-left-color: var(--green); }
.renewal-card.status-soon { border-left-color: var(--tag); background: #fffdf3; }
.renewal-card.status-overdue { border-left-color: var(--red); background: #fffafa; }
.renewal-figures { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1rem; margin-bottom: 1.3rem; padding-bottom: 1.3rem; border-bottom: 1px dashed var(--line-strong); }
.figure-label { display: block; color: var(--ink-2); font-weight: 550; }
.figure-value { display: block; font-size: 1.5rem; line-height: 1.2; margin-top: 0.15rem; }
.renewal-form .inline-btn { display: inline; margin: 0; }
.renewal-date { display: block; font-weight: 650; }
.renewal-sub { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.15rem; }

.facts { display: grid; gap: 0.8rem; margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 650; text-align: right; }
.role-list { display: grid; gap: 0.7rem; }
.role-list li { border-left: 5px solid hsl(var(--hue, 210) 55% 52%); padding: 0.1rem 0 0.1rem 0.8rem; }
.role-list p { font-size: 0.92rem; }

@media (max-width: 1000px) { .show-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .renewal-figures { grid-template-columns: 1fr; } }

.renew-actions {
  display: flex; justify-content: space-between; align-items: center; gap: 0.8rem 1.2rem; flex-wrap: wrap;
  margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px dashed var(--line-strong);
}
.renew-actions strong { display: block; }

/* ---- Owner settings: form on the left, live ticket preview on the right ---- */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 2.2rem; align-items: start; }
.settings-sections { display: grid; gap: 2rem; min-width: 0; }
.settings-form.stacked .form-section { grid-template-columns: 1fr; gap: 0.9rem; }
.settings-form.stacked .form-section-intro { position: static; display: grid; grid-template-columns: auto 1fr; gap: 0 0.9rem; align-items: center; }
.settings-form.stacked .form-section-intro .section-icon { grid-row: span 2; margin: 0; }
.settings-form.stacked .form-section-intro p { max-width: none; }
.settings-aside { position: sticky; top: 1.2rem; }
.ticket-preview-wrap { display: grid; gap: 0.6rem; }
.ticket-preview-wrap .receipt { max-width: 100%; }
.ticket-preview-wrap .receipt-logo { max-height: 18mm; }
.tax-example { margin: 0.4rem 0 0; padding: 0.55rem 0.8rem; border-radius: var(--radius); background: var(--blue-soft); color: #153a96; font-weight: 600; font-size: 0.95rem; }

/* generic on/off texts for the switch */
.switch-input:checked ~ span .when-off, .switch-input:not(:checked) ~ span .when-on { display: none; }
.status-switch .hint { display: block; }

@media (max-width: 1060px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-aside { position: static; }
}

/* Two clearly worded choices side by side (instead of an on/off switch that reads backwards) */
.choice-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.choice {
  display: flex; gap: 0.8rem; align-items: flex-start; padding: 1.1rem 1.1rem 1.2rem; background: var(--surface); cursor: pointer;
  border: 2px solid var(--line); border-radius: var(--radius-lg); transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.choice:hover { border-color: var(--line-strong); }
.choice:has(input:checked) { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 3px rgb(14 122 90 / 0.12); }
.choice input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--green); flex: none; }
.choice-body { display: grid; gap: 0.35rem; min-width: 0; }
.choice-body strong { font-family: var(--font-display); font-size: 1.1rem; line-height: 1.25; }
.choice-tag { justify-self: start; background: var(--tag); color: var(--tag-ink); font-weight: 700; font-size: 0.8rem; padding: 0.05rem 0.6rem; border-radius: 999px; }
.choice-when { font-weight: 600; font-size: 0.92rem; color: var(--ink-2); padding-top: 0.5rem; border-top: 1px dashed var(--line-strong); margin-top: 0.2rem; }
.choice:has(input:checked) .choice-when { color: var(--green-dark); border-top-color: rgb(14 122 90 / 0.35); }
@media (max-width: 700px) { .choice-cards { grid-template-columns: 1fr; } }
