/* filepath: public/css/admin.css */
/* ═══════════════════════════════════════
   Admin Pages — BEM CSS
   ═══════════════════════════════════════ */

/* ── Shared: Toggle Switch ── */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle--on { background: #6366f1; }
.toggle--off { background: #cbd5e1; }
.toggle__knob {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle__knob--on { left: 22px; }
.toggle__knob--off { left: 2px; }

/* ── Shared: Section Header (inside card, no padding) ── */
.section-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-header__icon { color: #6366f1; }
.section-header__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}
.section-header__subtitle {
  font-size: .78rem;
  color: #94a3b8;
  margin: 0;
}
.section-header__right { margin-left: auto; }

/* ── Shared: Empty State ── */
.empty-state {
  padding: 32px 20px;
  text-align: center;
  color: #94a3b8;
}
.empty-state--lg { padding: 48px 20px; }
.empty-state__icon {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
  opacity: .4;
}
.empty-state__icon--lg { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state__icon--sm { font-size: 1.5rem; margin-bottom: 8px; }
.empty-state__text { margin: 0; }
.empty-state__text--bold { font-weight: 500; }
.empty-state__text--mb { margin-bottom: 20px; }

/* ── Shared: Info Table (key-value rows) ── */
.info-table {
  width: 100%;
  font-size: .85rem;
  border-collapse: collapse;
}
.info-table--lg { font-size: .88rem; }
.info-table__row { border-bottom: 1px solid #f1f5f9; }
.info-table__label {
  padding: 8px 0;
  color: #64748b;
  width: 45%;
}
.info-table__label--narrow { width: 35%; }
.info-table__value {
  padding: 8px 0;
  font-weight: 600;
}
.info-table__value--normal { font-weight: 500; }
.info-table__value--prewrap { white-space: pre-wrap; }

/* ── Shared: Flex Utilities ── */
.flex-row { display: flex; align-items: center; }
.flex-row--between { justify-content: space-between; }
.flex-row--gap-6 { gap: 6px; }
.flex-row--gap-8 { gap: 8px; }
.flex-row--gap-10 { gap: 10px; }
.flex-row--gap-12 { gap: 12px; }
.flex-row--wrap { flex-wrap: wrap; }
.flex-col { display: flex; flex-direction: column; }
.flex-col--gap-8 { gap: 8px; }
.flex-col--gap-12 { gap: 12px; }
.flex-col--gap-14 { gap: 14px; }
.flex-col--gap-16 { gap: 16px; }
.flex-col--gap-20 { gap: 20px; }
.flex-1 { flex: 1; min-width: 0; }

/* ── Shared: Spacing ── */
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-4 { margin-top: 4px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mr-4 { margin-right: 4px; }
.mr-6 { margin-right: 6px; }
.mr-8 { margin-right: 8px; }
.ml-4 { margin-left: 4px; }
.ml-8 { margin-left: 8px; }

/* ── Shared: Text Helpers ── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #94a3b8; }
.text-muted-dark { color: #64748b; }
.text-dark { color: #1e293b; }
.text-primary { color: #6366f1; }
.text-success { color: #059669; }
.text-danger { color: #ef4444; }
.text-capitalize { text-transform: capitalize; }
.text-mono { font-family: monospace; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-xs { font-size: .75rem; }
.font-sm { font-size: .82rem; }
.font-md { font-size: .85rem; }
.font-base { font-size: .88rem; }

/* ── Shared: Padding/Overflow ── */
.p-0 { padding: 0; }
.overflow-hidden { overflow: hidden; }

/* ── Shared: Cursor ── */
.cursor-pointer { cursor: pointer; }

/* ── Shared: Icon Margin (small gap before/after icon) ── */
.icon-mr { margin-right: 6px; }

/* ═══════════════════════════════════════
   Billing Page
   ═══════════════════════════════════════ */

.billing__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.billing__section-label {
  font-size: .75rem;
  color: #94a3b8;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.billing__plan-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.billing__plan-badge {
  font-size: 1rem;
  padding: 6px 16px;
}
.billing__plan-desc {
  font-size: .85rem;
  color: #64748b;
}

.billing__usage-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
  line-height: 1;
}
.billing__usage-total {
  font-size: 1rem;
  font-weight: 400;
  color: #94a3b8;
}

.billing__progress-track {
  background: #f1f5f9;
  border-radius: 8px;
  height: 12px;
  margin: 12px 0 6px;
  overflow: hidden;
}
.billing__progress-fill {
  height: 100%;
  border-radius: 8px;
  transition: width .5s;
}
.billing__usage-pct {
  font-size: .8rem;
  color: #64748b;
}

.billing__quota-warn {
  margin-top: 10px;
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: .82rem;
  color: #dc2626;
}

.billing__usage-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
  font-size: .82rem;
  color: #64748b;
}
.billing__usage-footer-row {
  display: flex;
  justify-content: space-between;
}
.billing__usage-footer-row + .billing__usage-footer-row { margin-top: 6px; }
.billing__usage-footer-val {
  font-weight: 600;
  color: #1e293b;
}

.billing__actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.billing__btn-text { font-size: .8rem; }
.billing__btn-cancel {
  font-size: .8rem;
  color: #ef4444;
  border-color: #fecaca;
}

.billing__current-badge {
  display: block;
  font-size: .7rem;
  color: #6366f1;
  margin-top: 2px;
}

.billing__feature-check { color: #22c55e; font-size: 1rem; }
.billing__feature-cross { color: #e2e8f0; font-size: 1rem; }

/* API Keys */
.billing__api-code {
  font-size: .8rem;
  background: #f8fafc;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}
.billing__revoke-btn {
  color: #ef4444;
  border-color: #fecaca;
  font-size: .75rem;
}

.billing__loading {
  padding: 24px;
  text-align: center;
  color: #94a3b8;
}

/* Plan Modal */
.billing__plan-option {
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all .15s;
}
.billing__plan-option--selected {
  border: 2px solid #6366f1;
  background: #f5f3ff;
}
.billing__plan-option--unselected {
  border: 2px solid #e2e8f0;
  background: #fff;
}
.billing__plan-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #1e293b;
}
.billing__plan-meta {
  font-size: .83rem;
  color: #64748b;
  margin-top: 2px;
}
.billing__plan-quota {
  font-size: .83rem;
  color: #64748b;
  margin-top: 4px;
}
.billing__plan-price {
  font-size: 1.4rem;
  font-weight: 800;
  color: #6366f1;
}
.billing__plan-per-month {
  font-size: .75rem;
  color: #94a3b8;
}
.billing__ssl-note {
  font-size: .78rem;
  color: #94a3b8;
  margin: 4px 0 0;
  text-align: center;
}

/* Cancel Modal */
.billing__cancel-body {
  text-align: center;
  padding: 8px 0;
}
.billing__cancel-icon {
  font-size: 2.5rem;
  color: #f59e0b;
  margin-bottom: 12px;
  display: block;
}
.billing__cancel-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 8px;
}
.billing__cancel-desc {
  color: #64748b;
  font-size: .88rem;
}
.billing__btn-confirm-cancel {
  background: #ef4444;
  border-color: #ef4444;
}

/* New API Key Modal */
.billing__api-created-msg {
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: .82rem;
  color: #166534;
}
.billing__api-key-display {
  display: flex;
  align-items: center;
  gap: 8px;
}
.billing__api-key-code {
  flex: 1;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: .85rem;
  word-break: break-all;
}

/* Billing Info form grid */
.billing__form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.billing__form-full { grid-column: 1 / -1; }

.billing__no-info {
  color: #94a3b8;
  font-size: .88rem;
  margin: 0;
}

/* Invoice */
.billing__invoice-no {
  font-weight: 600;
  font-family: monospace;
  font-size: .85rem;
}

/* ═══════════════════════════════════════
   Approval Flows Page
   ═══════════════════════════════════════ */

.approval__toggle-card { margin-bottom: 16px; }

.approval__toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.approval__toggle-label {
  font-weight: 700;
  font-size: .95rem;
  color: #1e293b;
}
.approval__toggle-desc {
  font-size: .82rem;
  color: #94a3b8;
  margin-top: 4px;
}
.approval__toggle-status {
  font-size: .85rem;
  font-weight: 600;
}
.approval__toggle-status--enabled { color: #059669; }
.approval__toggle-status--disabled { color: #94a3b8; }

/* Empty state */
.approval__empty {
  text-align: center;
  padding: 40px 20px;
}
.approval__empty-icon {
  font-size: 2.5rem;
  color: #e2e8f0;
  margin-bottom: 14px;
  display: block;
}
.approval__empty-title {
  font-weight: 600;
  color: #64748b;
  margin-bottom: 6px;
}
.approval__empty-desc {
  font-size: .83rem;
  color: #94a3b8;
  margin-bottom: 20px;
}

/* Flow summary card */
.approval__flow-card {
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
  border: 1.5px solid #e2e8f0;
}
.approval__flow-card:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 20px rgba(99,102,241,.1);
}

.approval__flow-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.approval__flow-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #eef2ff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.approval__flow-icon { color: #6366f1; font-size: 1.1rem; }
.approval__flow-name {
  font-weight: 700;
  font-size: 1rem;
  color: #1e293b;
}
.approval__flow-level-count {
  font-size: .78rem;
  color: #94a3b8;
  margin-top: 2px;
}

/* Level preview list */
.approval__level-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.approval__level-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 8px;
}

.approval__level-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .75rem;
  flex-shrink: 0;
}
.approval__level-name {
  font-weight: 600;
  font-size: .87rem;
  color: #1e293b;
}
.approval__level-approver {
  font-size: .76rem;
  color: #94a3b8;
  margin-left: 8px;
}

.approval__level-badge {
  font-size: .72rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
}
.approval__level-badge--amount {
  background: #eff6ff;
  color: #3b82f6;
}
.approval__level-badge--all {
  background: #f0fdf4;
  color: #059669;
}

.approval__arrow-hidden {
  font-size: .65rem;
  color: #cbd5e1;
  position: absolute;
  margin-left: -999px;
}

/* Configure modal */
.approval__cfg-levels-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.approval__cfg-levels-label {
  margin-bottom: 0;
  font-weight: 700;
}

.approval__cfg-empty {
  text-align: center;
  padding: 24px 0;
  color: #94a3b8;
  background: #f8fafc;
  border-radius: 10px;
  border: 1.5px dashed #e2e8f0;
}
.approval__cfg-empty-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
  display: block;
  opacity: .4;
}
.approval__cfg-empty-text { font-size: .85rem; }

/* Editable level row */
.approval__cfg-level {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color .15s;
}
.approval__cfg-level:hover {
  border-color: var(--level-color, #6366f1);
}

.approval__cfg-level-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .8rem;
  flex-shrink: 0;
}
.approval__cfg-level-name {
  font-weight: 700;
  font-size: .88rem;
  color: #1e293b;
}
.approval__cfg-level-meta {
  font-size: .75rem;
  color: #64748b;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.approval__cfg-level-badge {
  font-size: .72rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.approval__cfg-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #cbd5e1;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color .15s;
}
.approval__cfg-remove-btn:hover { color: #ef4444; }

/* Level edit modal */
.approval__hint {
  font-size: .75rem;
  color: #94a3b8;
  margin-top: 4px;
}
.approval__auto-info {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: .82rem;
  color: #64748b;
}

/* ═══════════════════════════════════════
   Departments Page
   ═══════════════════════════════════════ */

.dept__tree-card { margin-bottom: 20px; }
.dept__tree-empty {
  padding: 32px;
  text-align: center;
  color: #94a3b8;
}
.dept__tree-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
}

.dept__root-row { background: #f8fafc; }
.dept__root-name { font-weight: 700; }
.dept__root-icon { margin-right: 8px; color: #6366f1; }

.dept__no-parent {
  color: #94a3b8;
  font-size: .8rem;
}

.dept__child-name { padding-left: 32px; }
.dept__child-icon { margin-right: 8px; color: #94a3b8; }

.dept__action-gap { margin-right: 6px; }

/* User assignment */
.dept__user-name {
  font-weight: 600;
  font-size: .88rem;
}
.dept__user-role {
  font-size: .75rem;
  color: #94a3b8;
}
.dept__user-email {
  font-size: .85rem;
  color: #64748b;
}
.dept__user-dept { font-size: .85rem; }
.dept__assign-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.dept__assign-select {
  flex: 1;
  padding: 6px 8px;
  font-size: .82rem;
}
.dept__spinner { color: #6366f1; }

/* Department Modal (custom, not using shared Modal) */
.dept__modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dept__modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.5);
}
.dept__modal-box {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.dept__modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.dept__modal-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.dept__modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 18px;
}
.dept__form-group { margin-bottom: 14px; }
.dept__form-group--last { margin-bottom: 20px; }
.dept__form-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ═══════════════════════════════════════
   Users Page
   ═══════════════════════════════════════ */

.users__card {
  padding: 0;
  overflow: hidden;
}

.users__dept-cell {
  font-size: .85rem;
  color: #4a5568;
}
.users__dept-empty { color: #a0aec0; }

.users__device-list {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.users__device-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 600;
}
.users__device-badge--ios { background: #000; color: #fff; }
.users__device-badge--android { background: #3ddc84; color: #000; }
.users__device-badge--web { background: #6366f1; color: #fff; }
.users__no-device {
  color: #cbd5e1;
  font-size: .8rem;
}

.users__date-cell {
  font-size: .8rem;
  color: #64748b;
}
.users__action-row {
  display: flex;
  gap: 6px;
}
.users__btn-sm {
  padding: 4px 10px;
  font-size: .75rem;
}

/* Pagination */
.users__pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  font-size: .82rem;
  color: #64748b;
}
.users__pagination-btns {
  display: flex;
  gap: 4px;
}
.users__pagination-btn {
  padding: 4px 12px;
  font-size: .78rem;
}
.users__page-num {
  padding: 4px 10px;
  font-size: .78rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}
.users__page-num--active {
  background: #6366f1;
  color: #fff;
  font-weight: 700;
}
.users__page-num--inactive {
  background: transparent;
  color: #64748b;
  font-weight: 400;
}

/* Modal forms */
.users__form-grid { display: grid; gap: 14px; }
.users__device-section { margin-top: 4px; }
.users__device-label { margin-bottom: 8px; }
.users__device-icon { margin-right: 6px; color: #6366f1; }
.users__device-list-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.users__device-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: .82rem;
}
.users__device-platform-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}
.users__device-platform-icon--ios { color: #333; }
.users__device-platform-icon--android { color: #3ddc84; }
.users__device-platform-icon--web { color: #6366f1; }
.users__device-info-name {
  font-weight: 600;
  color: #1e293b;
}
.users__device-info-meta {
  color: #94a3b8;
  font-size: .75rem;
}

/* ═══════════════════════════════════════
   Tenant Settings Page
   ═══════════════════════════════════════ */

.settings__layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: flex-start;
}
.settings__tab-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px;
  position: sticky;
  top: 16px;
}
.settings__tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  text-align: left;
  width: 100%;
  transition: background .15s, color .15s;
}
.settings__tab--active {
  background: color-mix(in srgb, var(--color-primary, #00b14f) 12%, #fff);
  color: var(--color-primary, #00b14f);
}
.settings__tab--inactive {
  background: transparent;
  color: #475569;
}
.settings__tab--inactive:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.settings__tab-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}
.settings__tab-label { flex: 1; }

.settings__card {
  max-width: 720px;
  min-width: 0;
}

.settings__toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}
.settings__toggle-content {
  flex: 1;
  margin-right: 16px;
}
.settings__toggle-label {
  font-weight: 600;
  font-size: .88rem;
  color: #1e293b;
}
.settings__toggle-desc {
  font-size: .78rem;
  color: #94a3b8;
  margin-top: 2px;
}

.settings__select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: .88rem;
  background: #fff;
  color: #1e293b;
  cursor: pointer;
  outline: none;
}

.settings__notify-section { margin-bottom: 8px; }
.settings__notify-section--email { margin-top: 24px; margin-bottom: 8px; }
.settings__notify-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.settings__notify-icon { color: #6366f1; }
.settings__notify-title {
  font-weight: 700;
  font-size: .92rem;
  color: #1e293b;
}
.settings__notify-desc {
  font-size: .78rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

.settings__save-section { margin-top: 20px; }

/* ── Branding tab ── */
.branding__logo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.branding__logo-preview {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  border: 1.5px dashed #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.branding__logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.branding__logo-placeholder {
  font-size: 32px;
  color: #cbd5e1;
}
.branding__logo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.branding__color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.branding__color-input {
  width: 48px;
  height: 38px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 2px;
  cursor: pointer;
  background: #fff;
}
.branding__preview {
  margin-top: 24px;
  padding: 16px;
  border: 1.5px dashed #e2e8f0;
  border-radius: 12px;
  background: #fafbfc;
}
.branding__preview-label {
  font-size: .75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  font-weight: 600;
}
.branding__preview-body {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.branding__preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--preview-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
}
.branding__preview-btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.branding__preview-btn:hover { background: var(--preview-primary-dark); }
.branding__preview-link {
  color: var(--preview-primary);
  font-weight: 600;
  font-size: .88rem;
  text-decoration: underline;
  cursor: default;
}
.branding__preview-badge {
  background: color-mix(in srgb, var(--preview-primary) 12%, #fff);
  color: var(--preview-primary);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}

/* ── Public URL row ── */
.public-url__row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.public-url__input {
  flex: 1;
  min-width: 220px;
  font-family: monospace;
  font-size: .8rem;
  background: #f8fafc;
}

/* ── Public WR page (anonymous) ── */
.public-wr {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 8%, #f8fafc) 0%, #fff 100%);
  padding: 24px 16px;
  position: relative;
}
.public-wr--loading {
  align-items: center;
  font-size: 36px;
  color: var(--color-primary);
}
.public-wr__lang {
  position: absolute;
  top: 16px;
  right: 16px;
}
.public-wr__card {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  padding: 32px 28px;
  margin: 24px 0;
}
.public-wr__header {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 24px;
}
.public-wr__logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 12px;
}
.public-wr__logo-icon {
  font-size: 48px;
  color: var(--color-primary);
  margin-bottom: 12px;
}
.public-wr__brand-name {
  font-size: 22px;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 4px;
}
.public-wr__title {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}
.public-wr__intro {
  margin-top: 12px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--color-primary) 6%, #fff);
  border-left: 3px solid var(--color-primary);
  border-radius: 6px;
  font-size: 13px;
  color: #475569;
  text-align: left;
  white-space: pre-wrap;
}
.public-wr__form .form-group { margin-bottom: 16px; }
.public-wr__form .required { color: #e53e3e; font-weight: 700; }
.public-wr__contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.public-wr__hint {
  font-size: 12px;
  color: #94a3b8;
  margin: -8px 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.public-wr__upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.public-wr__upload-counter {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 10px;
  border-radius: 999px;
}
.public-wr__upload-zone {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.public-wr__upload-zone:hover {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 4%, #fff);
}
.public-wr__upload-zone:active { transform: scale(0.99); }
.public-wr__upload-input { display: none; }
.public-wr__upload-icon {
  font-size: 28px;
  color: var(--color-primary);
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--color-primary) 10%, #fff);
  border-radius: 12px;
}
.public-wr__upload-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.public-wr__upload-text strong {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}
.public-wr__upload-text span {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}
.public-wr__photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.public-wr__photo-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.public-wr__photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.public-wr__photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.public-wr__photo-remove:hover { background: #ef4444; }
.public-wr__submit {
  width: 100%;
  margin-top: 8px;
  height: 48px;
  font-size: 15px;
  font-weight: 600;
}
.public-wr__footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: #94a3b8;
}
.public-wr__card--success,
.public-wr__card--error {
  text-align: center;
}
.public-wr__success-icon {
  font-size: 56px;
  color: var(--color-primary);
  margin: 16px 0;
}
.public-wr__error-icon {
  font-size: 56px;
  color: #ef4444;
  margin: 16px 0;
}
.public-wr__request-no {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  padding: 14px 20px;
  background: color-mix(in srgb, var(--color-primary) 8%, #fff);
  border-radius: 12px;
  margin: 16px 0 24px;
  display: inline-block;
  letter-spacing: 1px;
  font-family: monospace;
}

/* ═══════════════════════════════════════
   Responsive Overrides
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
  .billing__grid { grid-template-columns: 1fr; }
  .billing__form-grid { grid-template-columns: 1fr; }
  .settings__card { max-width: 100%; }
  .settings__layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .settings__tab-bar {
    flex-direction: row;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    position: static;
    padding: 6px;
    border-radius: 999px;
    background: #f1f5f9;
    border: none;
  }
  .settings__tab {
    width: auto;
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 999px;
  }
  .settings__tab-label { flex: 0 0 auto; }
  .branding__logo-row { gap: 12px; }
  .branding__preview-body { flex-direction: column; align-items: flex-start; }
  .public-wr__card { padding: 24px 18px; margin: 0; }
  .public-wr__contact-row { grid-template-columns: 1fr; gap: 0; }
  .public-wr__brand-name { font-size: 20px; }
  .public-wr__logo { width: 56px; height: 56px; }
}

@media (max-width: 480px) {
  .public-wr { padding: 12px 8px; }
  .public-wr__card { padding: 20px 14px; border-radius: 12px; }
  .public-url__row { flex-direction: column; }
  .public-url__row .btn { width: 100%; justify-content: center; }
}
