:root,
html,
html[data-theme="light"],
html[data-theme="dark"],
html[data-theme="auto"] {
  color-scheme: light !important;
  --primary: #047857;
  --secondary: #065f46;
  --accent: #34d399;
  --primary-fg: #fff;
  --body-fg: #263445;
  --body-bg: #f5f7fa;
  --body-quiet-color: #64748b;
  --body-medium-color: #475569;
  --body-loud-color: #172033;
  --header-color: #fff;
  --header-branding-color: #fff;
  --header-bg: #047857;
  --header-link-color: #fff;
  --breadcrumbs-fg: #d1fae5;
  --breadcrumbs-link-fg: #fff;
  --breadcrumbs-bg: #065f46;
  --link-fg: #047857;
  --link-hover-color: #065f46;
  --link-selected-fg: #065f46;
  --hairline-color: #e2e8f0;
  --border-color: #dbe3ec;
  --darkened-bg: #f1f5f9;
  --selected-bg: #e2e8f0;
  --selected-row: #ecfdf5;
  --error-fg: #b91c1c;
  --message-success-bg: #dcfce7;
  --message-warning-bg: #fef3c7;
  --message-error-bg: #fee2e2;
  --button-fg: #fff;
  --button-bg: #047857;
  --button-hover-bg: #065f46;
  --default-button-bg: #047857;
  --default-button-hover-bg: #065f46;
  --close-button-bg: #64748b;
  --close-button-hover-bg: #475569;
  --delete-button-bg: #b91c1c;
  --delete-button-hover-bg: #991b1b;
  --object-tools-fg: #fff;
  --object-tools-bg: #64748b;
  --object-tools-hover-bg: #475569;
}

body,
body.dashboard {
  min-height: 100vh;
  color: #263445;
  background: #f5f7fa;
  font-size: 14px;
}

#header {
  position: relative;
  z-index: 20;
  min-height: 72px;
  padding: 0 30px;
  background: #047857;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .12);
}

#branding h1 {
  display: flex;
  align-items: center;
  font-weight: 700;
}

#branding h1 a {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

#branding h1 img {
  display: block;
  height: 48px;
  width: auto;
}

#branding h1 span {
  padding: 5px 0 5px 14px;
  border-left: 1px solid rgba(255, 255, 255, .35);
  font-size: .84rem;
  font-weight: 600;
  opacity: .9;
}

#user-tools {
  font-size: .78rem;
}

#user-tools strong {
  color: #fff;
}

#user-tools a:focus,
#user-tools a:hover {
  color: #d1fae5;
}

#container > .main {
  min-height: calc(100vh - 72px);
  align-items: stretch;
}

#toggle-nav-sidebar {
  display: none;
}

#nav-sidebar {
  position: sticky;
  top: 0;
  left: auto;
  flex: 0 0 250px;
  width: 250px;
  height: calc(100vh - 72px);
  max-height: calc(100vh - 72px);
  margin-left: 0;
  padding: 16px 12px;
  box-sizing: border-box;
  align-self: flex-start;
  border-right: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 2px 0 12px rgba(15, 23, 42, .04);
  visibility: visible;
}

#nav-sidebar .module {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

#nav-sidebar .module caption {
  padding: 12px 10px 8px;
  background: transparent;
  color: #94a3b8;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .09em;
}

#nav-sidebar .module th,
#nav-sidebar .module td {
  padding: 0;
  border-radius: 7px;
}

#nav-sidebar .module th a,
#nav-sidebar .module td a {
  display: block;
  padding: 9px 10px;
  border-radius: 7px;
  color: #334155;
  font-size: .84rem;
  font-weight: 550;
  line-height: 1.4;
  text-decoration: none;
}

#nav-sidebar .module th {
  color: #334155;
  font-size: .84rem;
  font-weight: 550;
}

#nav-sidebar .module th a:hover,
#nav-sidebar .module td a:hover {
  background: #f1f5f9;
  color: #065f46;
}

#nav-sidebar .current-app .section:link,
#nav-sidebar .current-app .section:visited {
  color: #047857;
  font-weight: 700;
}

#nav-sidebar .current-model {
  border-radius: 6px;
  background: #ecfdf5;
}

#nav-sidebar .current-model th,
#nav-sidebar .current-model a {
  color: #047857;
  font-weight: 700;
}

#nav-filter {
  min-height: 38px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid #dbe3ec;
  border-radius: 7px;
  background: #f8fafc;
  color: #263445;
}

.main > #nav-sidebar,
.main.shifted > #nav-sidebar {
  margin-left: 0;
  visibility: visible;
}

.main > #nav-sidebar + .content,
.main.shifted > #nav-sidebar + .content {
  flex: 1 1 0;
  width: 0;
  max-width: none;
  min-width: 0;
}

#content {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 30px clamp(22px, 3vw, 48px) 48px;
  box-sizing: border-box;
}

body.dashboard #content {
  width: 100%;
  max-width: 1600px;
}

#content-main {
  float: none;
  width: 100%;
}

.breadcrumbs {
  padding: 12px clamp(22px, 3vw, 48px);
  background: #065f46;
  font-size: .82rem;
}

.breadcrumbs a {
  color: #d1fae5;
}

.module,
.inline-group,
.selector,
.calendarbox,
.clockbox {
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .035);
  overflow: hidden;
}

.module h2,
.module caption,
.inline-group h2 {
  padding: 12px 16px;
  background: #f8fafc;
  color: #334155;
  font-size: .84rem;
  font-weight: 700;
}

#content h1 {
  margin: 0 0 20px;
  color: #263445;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -.025em;
}

#content h2 {
  color: #263445;
}

.object-tools {
  margin-top: -3px;
}

.object-tools a {
  min-height: 34px;
  padding: 8px 13px;
  border-radius: 7px;
  background: #047857;
  font-size: .8rem;
  font-weight: 650;
}

.object-tools a:hover {
  background: #065f46;
}

.object-tools a:focus,
.object-tools a:active {
  background: #065f46;
}

#changelist {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .035);
}

#changelist .changelist-form-container {
  min-width: 0;
}

#changelist .changelist-form-container,
#changelist .results {
  background: #fff;
}

#changelist .results {
  overflow-x: auto;
}

#changelist table {
  border-collapse: separate;
  border-spacing: 0;
}

#changelist table thead th {
  position: sticky;
  top: 0;
  padding: 11px 12px;
  background: #f8fafc;
  color: #475569;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .035em;
}

#changelist table tbody td,
#changelist table tbody th {
  padding: 11px 12px;
  border-bottom: 1px solid #eef2f6;
  vertical-align: middle;
}

#changelist table tbody tr:last-child td,
#changelist table tbody tr:last-child th {
  border-bottom: 0;
}

#changelist table tbody tr:hover {
  background: #f8fafc;
}

#changelist .actions {
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f6;
  background: #fff;
}

#changelist .actions select {
  min-height: 36px;
}

#changelist .actions button {
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 7px;
  font-weight: 650;
}

#changelist-search {
  margin: 0 0 16px;
}

#changelist-search input[type="text"] {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #172033;
}

#changelist-search input[type="submit"] {
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 7px;
  font-weight: 600;
}

#changelist-filter {
  min-width: 190px;
  padding-bottom: 14px;
  border-left: 1px solid #e2e8f0;
  background: #fff;
}

#changelist-filter h2 {
  padding: 13px 15px;
  background: #f8fafc;
  color: #334155;
  font-size: .8rem;
}

#changelist-filter h3 {
  padding: 12px 15px 5px;
  color: #64748b;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

#changelist-filter ul {
  padding: 0 10px;
}

#changelist-filter li {
  margin: 2px 0;
}

#changelist-filter li a {
  display: block;
  padding: 5px 7px;
  border-radius: 5px;
}

#changelist-filter li a:hover {
  background: #f1f5f9;
}

#changelist-filter li.selected a {
  color: #047857;
  background: #ecfdf5;
  font-weight: 650;
}

.paginator {
  padding: 13px 15px;
  border-top: 1px solid #eef2f6;
  background: #fff;
}

.submit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 13px 15px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .035);
}

.submit-row input,
.submit-row a {
  min-height: 36px;
  box-sizing: border-box;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: .82rem;
  font-weight: 650;
}

.submit-row .deletelink {
  margin-left: auto;
}

input,
textarea,
select,
.selector select {
  border-radius: 6px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #10b981;
}

.aligned label {
  color: #334155;
  font-weight: 600;
}

fieldset.module {
  margin-bottom: 18px;
}

fieldset.module .form-row {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
}

fieldset.module .form-row:last-child {
  border-bottom: 0;
}

.help,
p.help,
form p.help {
  color: #64748b;
  font-size: .78rem;
}

.errornote,
ul.errorlist {
  border-radius: 7px;
}

.messagelist {
  margin: 0 0 18px;
  padding: 0;
}

.messagelist li {
  margin: 0 0 8px;
  padding: 11px 14px 11px 42px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background-position: 14px 12px;
}

.messagelist li.error {
  border-color: #fecaca;
}

.backoffice-apps {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 16px;
}

.backoffice-app {
  box-shadow: 0 2px 8px rgba(15, 23, 42, .035);
}

.backoffice-app-heading {
  padding: 17px 20px;
}

.backoffice-models {
  gap: 8px;
  padding: 14px;
}

.backoffice-model {
  padding: 11px;
}

.backoffice-model:focus-within {
  border-color: #10b981;
  outline: 3px solid rgba(16, 185, 129, .13);
}

.backoffice-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 22px;
  padding: 24px 28px;
  border: 1px solid #d1fae5;
  border-radius: 14px;
  background: linear-gradient(115deg, #ecfdf5 0%, #fff 72%);
}

.backoffice-welcome h1 {
  margin: 0 0 8px;
  color: #172033;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -.025em;
}

.backoffice-welcome p:last-child {
  margin: 0;
  color: #64748b;
  font-size: .96rem;
}

.backoffice-eyebrow {
  margin: 0 0 8px;
  color: #047857;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
}

.backoffice-apps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 410px), 1fr));
  align-items: start;
  gap: 20px;
}

.backoffice-app {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .045);
}

.backoffice-app-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px;
  border-bottom: 1px solid #eef2f6;
}

.backoffice-app-heading .backoffice-eyebrow {
  margin-bottom: 4px;
}

.backoffice-app-heading h2 {
  margin: 0;
  color: #172033;
  font-size: 1.15rem;
}

.backoffice-count {
  color: #64748b;
  font-size: .78rem;
}

.backoffice-models {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.backoffice-model {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
  padding: 13px;
  border: 1px solid #eef2f6;
  border-radius: 9px;
  transition: border-color .15s, background-color .15s, transform .15s;
}

.backoffice-model:hover {
  transform: translateY(-1px);
  border-color: #a7f3d0;
  background: #f8fdfb;
}

.backoffice-model-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 9px;
  background: #ecfdf5;
  color: #047857;
  font-size: .9rem;
  font-weight: 700;
}

.backoffice-model-info {
  flex: 1;
  min-width: 0;
}

.backoffice-model h3 {
  overflow: hidden;
  margin: 0 0 5px;
  color: #172033;
  font-size: .9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backoffice-model h3 a {
  color: inherit;
}

.backoffice-model-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  font-size: .73rem;
}

.backoffice-model-actions a {
  color: #047857;
}

.backoffice-model-actions a:hover {
  color: #065f46;
  text-decoration: underline;
}

.backoffice-arrow {
  color: #94a3b8;
}

.backoffice-empty {
  padding: 24px;
}

.backoffice-empty h2 {
  margin-top: 0;
}

.admin-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.admin-status-trialing,
.admin-status-active,
.admin-status-succeeded,
.admin-status-paid {
  background: #dcfce7;
  color: #166534;
}

.admin-status-pending,
.admin-status-open,
.admin-status-past_due {
  background: #fef3c7;
  color: #92400e;
}

.admin-status-suspended,
.admin-status-expired,
.admin-status-failed,
.admin-status-void {
  background: #fee2e2;
  color: #991b1b;
}

.admin-status-cancelled,
.admin-status-refunded,
.admin-status-muted {
  background: #f1f5f9;
  color: #475569;
}

@media (max-width: 767px) {
  #header {
    position: relative;
    min-height: 64px;
    padding: 0 16px;
  }

  #container > .main {
    flex-direction: column;
  }

  #toggle-nav-sidebar {
    display: none;
  }

  #branding h1 img {
    height: 42px;
  }

  #user-tools {
    padding: 12px 0;
  }

  #content {
    padding: 20px 16px 30px;
  }

  .breadcrumbs {
    padding-right: 16px;
    padding-left: 16px;
  }

  #nav-sidebar {
    position: static;
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    max-height: 34vh;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
    overflow: auto;
  }

  #nav-sidebar .module {
    display: table;
    width: 100%;
    overflow: hidden;
    border: 0;
    box-shadow: none;
  }

  #nav-sidebar .module caption {
    padding: 8px 9px 5px;
  }

  #nav-sidebar .module th a,
  #nav-sidebar .module td a {
    padding: 7px 9px;
  }

  .main > #nav-sidebar + .content,
  .main.shifted > #nav-sidebar + .content {
    width: 100%;
  }

  #changelist {
    overflow: visible;
  }

  #changelist-filter {
    box-sizing: border-box;
    width: 100%;
    border-top: 1px solid #e2e8f0;
    border-left: 0;
  }

  .object-tools {
    margin-bottom: 14px;
  }

  .backoffice-welcome {
    margin-top: 0;
    padding: 20px;
  }

  .backoffice-models {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  #header {
    align-items: flex-start;
    flex-direction: column;
    padding: 10px 14px;
  }

  #user-tools {
    align-self: stretch;
    padding: 4px 0 2px;
    text-align: left;
  }

  #content h1 {
    font-size: 1.4rem;
  }

  .backoffice-welcome {
    padding: 18px;
  }

  .backoffice-app-heading {
    padding: 15px;
  }

  .backoffice-models {
    padding: 11px;
  }
}
