/* Shared Trustidy-inspired administration shell for the two Stripe screens. */
:root {
  --dashboard-ink: #1e293b;
  --dashboard-muted: #64748b;
  --dashboard-border: #e5eaf0;
  --dashboard-soft: #f8fafc;
  --dashboard-brand: #0f766e;
  --dashboard-brand-dark: #0a625c;
  --dashboard-nav: #111c2d;
}

html { scroll-behavior: smooth; }
body { background: #fff; color: var(--dashboard-ink); }
body.sidebar-lock { overflow: hidden; }
.admin-shell.shell { max-width: none; min-height: 100dvh; margin: 0; padding: 0; background: #fff; }
.admin-shell .skip-link { position: fixed; z-index: 100; inset-block-start: 8px; inset-inline-start: 16px; transform: translateY(-170%); padding: 10px 14px; background: #fff; color: var(--dashboard-brand); border: 1px solid var(--dashboard-border); }
.admin-shell .skip-link:focus { transform: translateY(0); }

.dashboard-sidebar { position: fixed; z-index: 50; inset-block: 0; inset-inline-start: 0; width: 252px; display: flex; flex-direction: column; background: var(--dashboard-nav); color: #d4deeb; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; min-height: 88px; padding: 18px 20px; border-bottom: 1px solid #ffffff12; }
.sidebar-brand-mark { width: 38px; height: 38px; flex: none; display: grid; place-items: center; background: var(--dashboard-brand); color: #fff; border-radius: 4px; font-size: 23px; font-weight: 700; }
.sidebar-brand strong, .sidebar-brand small, .sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-brand strong { color: #fff; font-size: 16px; letter-spacing: -.02em; }
.sidebar-brand small { color: #9fb0c3; font-size: 11px; margin-top: 3px; }
.sidebar-close { display: none; margin-inline-start: auto; width: 38px; height: 38px; border: 0; color: #d4deeb; background: transparent; font-size: 26px; }
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 12px 24px; display: flex; flex-direction: column; gap: 22px; }
.sidebar-nav-group { display: grid; gap: 4px; }
.sidebar-nav-heading { margin: 0; padding: 8px 12px; color: #8d9fb5; text-transform: uppercase; letter-spacing: .09em; font-size: 10px; font-weight: 700; }
.sidebar-link { position: relative; min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 4px; color: #bccadc; text-decoration: none; font-size: 13px; font-weight: 600; transition: color .15s, background .15s; }
.sidebar-link:hover { color: #fff; background: #ffffff0a; }
.sidebar-link.is-active { color: #fff; background: var(--dashboard-brand); }
.sidebar-link.is-active::before { position: absolute; inset-block: 9px; inset-inline-start: 0; width: 3px; border-radius: 99px; background: #5eead4; content: ""; }
.sidebar-link-icon { width: 19px; display: inline-grid; place-items: center; color: #a8b7c8; font-size: 21px; line-height: 1; }
.sidebar-link.is-active .sidebar-link-icon { color: #fff; }
.sidebar-footer { display: flex; align-items: center; gap: 11px; margin: 0 16px; padding: 17px 4px; border-top: 1px solid #ffffff16; font-size: 12px; }
.sidebar-footer strong { color: #e2e8f0; font-weight: 600; }
.sidebar-footer small { color: #94a3b8; margin-top: 3px; }
.sidebar-avatar { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border: 1px solid #3d4d62; border-radius: 4px; color: #e2e8f0; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 40; background: #0f172a80; }
.workspace { min-width: 0; min-height: 100dvh; margin-inline-start: 252px; display: flex; flex-direction: column; }
.admin-shell:not(.is-authenticated) .dashboard-sidebar { display: none; }
.admin-shell:not(.is-authenticated) .workspace { margin-inline-start: 0; }

.admin-shell .topbar { height: 72px; min-height: 72px; margin: 0; padding: 0 28px; background: #fff; border-bottom: 1px solid #e8edf2; display: flex; align-items: center; gap: 18px; }
.topbar-leading { min-width: 0; display: flex; align-items: center; gap: 12px; }
.admin-shell .breadcrumb { display: flex; align-items: center; gap: 11px; min-width: 0; color: #94a3b8; font-size: 12px; }
.admin-shell .breadcrumb strong { color: #475569; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-brand { display: none; align-items: center; gap: 10px; color: #172236; font-size: 15px; }
.topbar-brand .brand-icon { width: 32px; height: 32px; border-radius: 4px; background: var(--dashboard-brand); font-size: 20px; }
.admin-shell:not(.is-authenticated) .topbar-brand { display: flex; }
.admin-shell:not(.is-authenticated) .breadcrumb { display: none; }
.sidebar-toggle { display: none; width: 40px; height: 40px; flex: none; place-items: center; padding: 0; border: 0; background: transparent; color: #475569; font-size: 22px; }
.admin-shell .topbar-actions { margin-inline-start: auto; gap: 8px; flex-wrap: nowrap; }
.admin-shell .topbar-actions .ghost { min-height: 40px; padding: 8px 12px; border-color: #e2e8f0; border-radius: 4px; background: #fff; color: #475569; font-size: 12px; font-weight: 650; }
.admin-shell .topbar-actions .ghost:hover { background: var(--dashboard-soft); }

.admin-shell main { width: min(100%, 1540px); min-width: 0; flex: 1; margin: 0 auto; padding: 28px 28px 44px; }
.admin-shell .page-heading { margin: 0 0 22px; padding: 0 0 23px; border-bottom: 1px solid #edf0f4; align-items: flex-start; }
.admin-shell .page-heading h1 { margin: 5px 0 7px; color: #172236; font-size: clamp(24px, 2.2vw, 31px); font-weight: 680; letter-spacing: -.035em; }
.admin-shell .page-heading p { max-width: 70ch; color: var(--dashboard-muted); font-size: 13px; line-height: 1.7; }
.admin-shell .eyebrow { color: var(--dashboard-brand); font-size: 11px; letter-spacing: .08em; }
.admin-shell .mode-badge { max-width: 100%; padding: 8px 12px; border-radius: 4px; font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
.admin-shell .mode-badge.test, .admin-shell .pill.test { background: #eff6ff; color: #2563a8; }
.admin-shell .mode-badge.live, .admin-shell .pill.live { background: #fff3e4; color: #a65313; }
.overview-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.overview-card { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 18px 20px; border: 1px solid var(--dashboard-border); border-radius: 4px; background: #fff; }
.overview-card .overview-icon { width: 43px; height: 43px; flex: none; display: grid; place-items: center; border: 1px solid #e2e8f0; border-radius: 4px; background: #f8fafc; color: #7b8da1; font-size: 23px; }
.overview-card small, .overview-card strong { display: block; }
.overview-card small { color: var(--dashboard-muted); font-size: 12px; font-weight: 600; }
.overview-card strong { margin-top: 4px; color: #172236; font-size: 25px; line-height: 1; font-weight: 680; font-variant-numeric: tabular-nums; }

.admin-shell .card { border: 1px solid var(--dashboard-border); border-radius: 4px; box-shadow: none; background: #fff; }
.admin-shell .create-card, .admin-shell .accounts-card, .admin-shell .history-card, .admin-shell .subscription-account-card, .admin-shell .subscription-pricing-card, .admin-shell .subscription-title-card, .admin-shell .subscription-review-card, .admin-shell .subscription-result-card, .admin-shell .subscription-history-card { padding: 23px; }
.admin-shell .columns { grid-template-columns: minmax(0, 1.42fr) minmax(310px, 1fr); gap: 18px; }
.admin-shell .section-heading { margin-bottom: 22px; }
.admin-shell .section-heading h2, .admin-shell .history-heading h2, .admin-shell .subscription-account-card h2, .admin-shell .subscription-pricing-card h2, .admin-shell .subscription-title-card h2, .admin-shell .subscription-review-card h2 { color: #172236; font-size: 17px; font-weight: 680; }
.admin-shell .section-heading p, .admin-shell .history-heading p, .admin-shell .subscription-section-top p, .admin-shell .title-intro { color: var(--dashboard-muted); line-height: 1.6; }
.admin-shell .section-icon, .admin-shell .section-icon.purple { width: 38px; height: 38px; border: 1px solid #d8ece9; border-radius: 4px; background: #effaf7; color: var(--dashboard-brand); }
.admin-shell .step-label { color: var(--dashboard-brand); }
.admin-shell .step-label span { background: #e7f5f2; color: var(--dashboard-brand); }
.admin-shell label { color: #475569; font-size: 12px; }
.admin-shell input, .admin-shell select, .admin-shell textarea { min-height: 46px; border-color: #cdd6df; border-radius: 4px; color: var(--dashboard-ink); font-size: 14px; box-shadow: none; }
.admin-shell select { appearance: none; -webkit-appearance: none; padding-inline-end: 44px; background: #fff url('/select-chevron.svg') no-repeat right 15px center / 16px 16px; }
[dir="rtl"] .admin-shell select { background-position: left 15px center; }
.admin-shell textarea { min-height: 86px; }
.admin-shell input:focus, .admin-shell select:focus, .admin-shell textarea:focus { border-color: var(--dashboard-brand); box-shadow: 0 0 0 3px #0f766e18; }
.admin-shell button:focus-visible, .admin-shell a:focus-visible, .admin-shell summary:focus-visible { outline: 2px solid #14b8a6; outline-offset: 3px; }
.admin-shell button:disabled { cursor: not-allowed; }
.admin-shell .primary, .admin-shell .secondary, .admin-shell .ghost { border-radius: 4px; box-shadow: none; }
.admin-shell .primary { min-height: 44px; background: var(--dashboard-brand); border-color: var(--dashboard-brand); color: #fff; font-size: 13px; }
.admin-shell .primary:hover { background: var(--dashboard-brand-dark); border-color: var(--dashboard-brand-dark); }
.admin-shell .secondary { min-height: 44px; border-color: #cbd5e1; color: #334155; font-size: 13px; }
.admin-shell .secondary:hover, .admin-shell .ghost:hover { background: var(--dashboard-soft); }
.admin-shell .field-help { color: #718096; line-height: 1.55; }
.admin-shell .review-grid > div, .admin-shell .summary-title, .admin-shell .title-preview { border-radius: 4px; background: var(--dashboard-soft); border-color: var(--dashboard-border); }
.admin-shell .result, .admin-shell .subscription-result-card { border: 1px solid #b7e2d2; border-radius: 4px; background: #f0faf5; }
.admin-shell .result-head, .admin-shell .subscription-result-name { color: #146c4a; }
.admin-shell .security-note { border: 1px solid #e7edf2; border-radius: 4px; background: #f8fafc; }
.admin-shell .account-card, .admin-shell .history-row { border-color: var(--dashboard-border); border-radius: 4px; }
.admin-shell .account-actions button, .admin-shell .row-actions button, .admin-shell .row-actions a, .admin-shell .subscription-row-actions button, .admin-shell .subscription-row-actions a { border-color: #d7e0e9; border-radius: 4px; }
.admin-shell .pill { border-radius: 4px; }
.admin-shell .pill.active { background: #e8f7ee; color: #147449; }
.admin-shell .pill.default { background: #e8f5f2; color: var(--dashboard-brand); }
.admin-shell .history-card { margin-top: 18px; }
.admin-shell .history-column-headings { background: var(--dashboard-soft); padding: 11px 15px; border: 1px solid var(--dashboard-border); border-bottom: 0; color: var(--dashboard-muted); }
.admin-shell .history-column-headings + .history-list .history-row:first-child { border-start-start-radius: 0; border-start-end-radius: 0; }
.admin-shell .empty { background: var(--dashboard-soft); border-radius: 4px; }
.admin-shell .history-heading { align-items: end; }
.admin-shell .history-controls { align-items: end; gap: 10px; }
.admin-shell .history-filter { width: 220px; max-width: 100%; min-width: 0; }
.admin-shell .history-filter label { display: block; margin: 0 0 7px; }
.admin-shell .history-filter select { width: 100%; min-width: 0; min-height: 40px; padding-block: 8px; }
.admin-shell .history-controls .ghost { min-height: 40px; margin: 0; }

.admin-shell .subscription-account-card { margin-top: 0; }
.admin-shell .subscription-pricing-card, .admin-shell .subscription-title-card, .admin-shell .subscription-review-card, .admin-shell .subscription-result-card, .admin-shell .subscription-history-card { margin-top: 18px; }
.admin-shell .currency-tabs { gap: 0; margin: 22px 0 14px; border-bottom: 1px solid var(--dashboard-border); }
.admin-shell .currency-tabs button { margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: #64748b; }
.admin-shell .currency-tabs button:hover { background: var(--dashboard-soft); color: #334155; }
.admin-shell .currency-tabs button.selected { background: #e8f5f2; border-color: var(--dashboard-brand); color: var(--dashboard-brand); }
.admin-shell .pricing-table { border-spacing: 0 5px; }
.admin-shell .pricing-table thead th, .admin-shell .subscription-history-table th { background: var(--dashboard-soft); color: var(--dashboard-muted); }
.admin-shell .pricing-table tbody th { border-radius: 4px; background: var(--dashboard-soft); color: #334155; }
.admin-shell .price-choice { border-color: #dce4ec; border-radius: 4px; padding: 14px 6px; font-size: 15px; }
.admin-shell .price-choice:hover { border-color: #79b9b0; background: #f1faf8; }
.admin-shell .pricing-table td.selected .price-choice { border: 2px solid var(--dashboard-brand); background: #e8f5f2; color: var(--dashboard-brand-dark); box-shadow: 0 0 0 2px #ccebe5; }
.admin-shell .title-template-settings summary { color: var(--dashboard-brand); }
.admin-shell .subscription-history-table td { border-color: var(--dashboard-border); }
.admin-shell .subscription-history-table tbody tr:hover { background: #f9fbfc; }
.admin-shell .subscription-filters select { min-height: 40px; }
.admin-shell footer { margin: 0; padding: 20px 28px; border-top: 1px solid #edf0f4; color: #94a3b8; font-size: 11px; }

.admin-shell:not(.is-authenticated) main { display: grid; place-items: center; }
.admin-shell .login-card { width: min(100%, 440px); max-width: 440px; margin: 50px auto; padding: 34px; border-top: 3px solid var(--dashboard-brand); }
.admin-shell .login-card .eyebrow { margin-bottom: 8px; }
.admin-shell .login-card h1 { color: #172236; }
.admin-shell .login-card p { line-height: 1.6; }
.admin-shell .login-card .primary { margin-top: 20px; }
.admin-shell .login-card .remember-option { display: flex; align-items: center; gap: 9px; margin-top: 18px; font-size: 13px; font-weight: 600; color: #40506a; cursor: pointer; }
.admin-shell .login-card .remember-option input { width: 17px; height: 17px; margin: 0; accent-color: var(--dashboard-brand); flex: none; }

@media (max-width: 1180px) {
  .admin-shell .columns { grid-template-columns: 1fr; }
  .admin-shell .history-column-headings { display: none; }
}
@media (max-width: 979px) {
  .dashboard-sidebar { max-width: calc(100vw - 40px); transform: translateX(-100%); transition: transform .18s ease; }
  [dir="rtl"] .dashboard-sidebar { transform: translateX(100%); }
  .admin-shell.sidebar-open .dashboard-sidebar { transform: translateX(0); }
  .admin-shell .workspace { margin-inline-start: 0; }
  .admin-shell .sidebar-toggle { display: grid; }
  .admin-shell:not(.is-authenticated) .sidebar-toggle { display: none; }
  .admin-shell .sidebar-close { display: grid; place-items: center; }
  .admin-shell .topbar-brand { display: flex; }
  .admin-shell .breadcrumb { display: none; }
  .admin-shell .topbar { padding: 0 20px; }
  .admin-shell main { padding: 26px 20px 38px; }
}
@media (max-width: 850px) {
  .admin-shell .history-heading { flex-direction: column; align-items: stretch; }
  .admin-shell .history-controls { justify-content: flex-start; }
}
@media (max-width: 700px) {
  .overview-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-card:last-child { grid-column: span 2; }
  .admin-shell .page-heading { display: block; }
  .admin-shell .mode-badge { display: inline-block; margin-top: 16px; }
}
@media (max-width: 540px) {
  .admin-shell .topbar { height: 64px; min-height: 64px; flex-wrap: nowrap; align-items: center; padding: 0 14px; }
  .admin-shell .topbar-leading { gap: 4px; }
  .admin-shell .topbar-brand { gap: 7px; font-size: 12px; }
  .admin-shell .topbar-brand .brand-icon { width: 28px; height: 28px; font-size: 18px; }
  .admin-shell .topbar-actions { gap: 5px; }
  .admin-shell .topbar-actions .ghost { min-height: 36px; padding: 6px 8px; font-size: 11px; }
  .admin-shell main { padding: 21px 14px 30px; }
  .admin-shell .page-heading h1 { font-size: 23px; }
  .overview-strip { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
  .overview-card { gap: 8px; padding: 12px; }
  .overview-card .overview-icon { width: 33px; height: 33px; font-size: 18px; }
  .overview-card strong { font-size: 21px; }
  .overview-card small { font-size: 11px; }
  .admin-shell .create-card, .admin-shell .accounts-card, .admin-shell .history-card, .admin-shell .subscription-account-card, .admin-shell .subscription-pricing-card, .admin-shell .subscription-title-card, .admin-shell .subscription-review-card, .admin-shell .subscription-result-card, .admin-shell .subscription-history-card { padding: 17px; }
  .admin-shell .login-card { padding: 25px; }
  .admin-shell .history-controls { display: grid; grid-template-columns: minmax(0, 1fr); }
  .admin-shell .history-filter, .admin-shell .history-controls .ghost { width: 100%; }
  .admin-shell footer { padding: 18px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dashboard-sidebar, .sidebar-link { transition: none; }
}
