@charset "UTF-8";
:root {
  --bg: #f7f6f9;
  --surface: #ffffff;
  --surface-2: #f5f3f7;
  --border: #e7eaf0;
  --border-strong: #d9dde6;
  --text: #121827;
  --text-muted: #667085;
  --accent: #f51f67;
  --accent-hover: #df0f55;
  --accent-weak: #ffe6ef;
  --accent-soft: #fff5f8;
  --ok: #1fb463;
  --ok-bg: #e8faef;
  --warn: #8a5a00;
  --warn-bg: #fff3d6;
  --err: #d92d20;
  --err-bg: #fef3f2;
  --info: #1d5bd8;
  --info-bg: #eaf1ff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(18, 24, 39, .06);
  --shadow-md: 0 14px 44px rgba(18, 24, 39, .12);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --appbar-h: 60px;
  --sidebar-w: 236px;
  --sidebar-w-collapsed: 66px;
  --sidebar-bg: #1b2333;
  --sidebar-bg-2: #161d2b;
  --sidebar-fg: #9aa6bd;
  --sidebar-fg-strong: #ffffff;
  --sidebar-active: #ff4f86;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1 {
  font-size: 23px;
  margin: 0 0 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 16px;
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 12px;
}

.num,
.money {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.muted {
  color: var(--text-muted);
}

.hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
.app {
  min-height: 100dvh;
}

.appbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--appbar-h);
  padding: 0 18px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.appbar__burger {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  color: var(--text);
  cursor: pointer;
  flex: 0 0 auto;
}
.appbar__burger svg {
  width: 18px;
  height: 18px;
}
.appbar__burger:hover {
  background: var(--surface-2);
}
.appbar__burger--mobile {
  display: none;
}

.applogo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.applogo:hover {
  text-decoration: none;
}
.applogo__img {
  display: block;
  width: auto;
  height: 40px;
}

.appbar__spacer {
  flex: 1;
}

.appshell {
  display: flex;
  align-items: flex-start;
  padding-top: var(--appbar-h);
  padding-left: var(--sidebar-w);
  transition: padding-left 0.18s ease;
}

.sidebar {
  position: fixed;
  top: var(--appbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.18s ease;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 12px;
  flex: 1;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--sidebar-fg);
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  position: relative;
}
.sidebar__link:hover {
  color: var(--sidebar-fg-strong);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}
.sidebar__link[aria-current=page] {
  color: #fff;
  background: rgba(245, 31, 103, 0.16);
}
.sidebar__link[aria-current=page]::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--sidebar-active);
}

.sidebar__ico {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.sidebar__foot {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px;
  background: var(--sidebar-bg-2);
}

.usercard {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  color: var(--sidebar-fg-strong);
}
.usercard:hover {
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}
.usercard__avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}
.usercard__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.usercard__name {
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.usercard__sub {
  font-size: 11px;
  color: var(--sidebar-fg);
}

.sidebar__logout button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--sidebar-fg);
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
}
.sidebar__logout button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar__logout svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.content {
  flex: 1;
  min-width: 0;
  max-width: 1180px;
  margin: 26px auto 72px;
  padding: 0 26px;
}
.content--wide {
  max-width: 1600px;
}

.sidebar__backdrop {
  display: none;
}

@media (min-width: 861px) {
  #nav-collapsed:checked ~ .appshell {
    padding-left: var(--sidebar-w-collapsed);
  }
  #nav-collapsed:checked ~ .appshell .sidebar {
    width: var(--sidebar-w-collapsed);
  }
  #nav-collapsed:checked ~ .appshell .sidebar .sidebar__label,
  #nav-collapsed:checked ~ .appshell .sidebar .usercard__meta {
    display: none;
  }
  #nav-collapsed:checked ~ .appshell .sidebar .sidebar__link,
  #nav-collapsed:checked ~ .appshell .sidebar .sidebar__logout button,
  #nav-collapsed:checked ~ .appshell .sidebar .usercard {
    justify-content: center;
    gap: 0;
  }
}
@media (max-width: 860px) {
  .appbar__burger--desktop {
    display: none;
  }
  .appbar__burger--mobile {
    display: inline-grid;
  }
  .applogo__img {
    height: 34px;
  }
  .appshell {
    display: block;
    padding-left: 0;
  }
  .sidebar {
    width: min(80vw, 280px);
    z-index: 45;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  #nav-open:checked ~ .appshell .sidebar {
    transform: none;
  }
  #nav-open:checked ~ .appshell .sidebar__backdrop {
    display: block;
    position: fixed;
    inset: var(--appbar-h) 0 0 0;
    z-index: 44;
    background: rgba(18, 24, 39, 0.45);
  }
  .content {
    margin: 18px auto 60px;
    padding: 0 16px;
  }
}
.wrap {
  max-width: 1180px;
  margin: 28px auto 72px;
  padding: 0 20px;
}

.linkbtn {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 4px;
}
.linkbtn:hover {
  text-decoration: underline;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(245, 31, 103, 0.18);
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn--outline {
  background: var(--surface);
  color: var(--accent);
  box-shadow: none;
}
.btn--outline:hover {
  background: var(--accent-soft);
}
.btn--subtle {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  box-shadow: none;
}
.btn--subtle:hover {
  background: var(--surface-2);
  color: var(--text);
  transform: none;
}
.btn--danger {
  background: var(--surface);
  color: var(--err);
  border-color: #f3c3bd;
  box-shadow: none;
}
.btn--danger:hover {
  background: var(--err-bg);
}
.btn--sm {
  height: 32px;
  padding: 0 13px;
  font-size: 12.5px;
  box-shadow: none;
}
.btn--ico {
  padding: 0;
  width: 32px;
  box-shadow: none;
}
.btn--ico.btn--sm {
  width: 32px;
}
.btn--ico svg {
  flex: 0 0 auto;
  display: block;
}
.btn--ico.has-badge {
  position: relative;
  overflow: visible;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ico-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  line-height: 15px;
  font-weight: 700;
  text-align: center;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.field {
  margin-bottom: 14px;
}

.field > label,
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
}

input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=search], select, textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

textarea {
  height: auto;
  min-height: 80px;
  padding: 9px 12px;
  resize: vertical;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}

.field--error input,
.field--error select {
  border-color: var(--err);
}

.step-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-weak);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.step-badge {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.check input {
  width: auto;
  height: auto;
  accent-color: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.grid--tight {
  gap: 12px;
}
.grid--sidebar {
  grid-template-columns: minmax(300px, 360px) 1fr;
  align-items: start;
}

@media (max-width: 760px) {
  .grid--sidebar {
    grid-template-columns: 1fr;
  }
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
}
.filters label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.filters select {
  width: auto;
}

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data th {
  text-align: left;
  padding: 11px 12px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
table.data td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tbody tr:hover td {
  background: var(--accent-soft);
}
table.data td.actions {
  white-space: nowrap;
  text-align: right;
}
table.data td.actions form {
  display: inline;
}
table.data td.actions .btn {
  margin-left: 4px;
}

tr.is-paid td {
  color: var(--text-muted);
}

tr.is-cancelled td {
  color: var(--text-muted);
  text-decoration: line-through;
}

tr.is-paid td.acts, tr.is-cancelled td.acts {
  color: var(--text);
  text-decoration: none;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text-muted);
}
.badge--issued {
  background: var(--accent-weak);
  color: var(--accent-hover);
}
.badge--paid {
  background: var(--ok-bg);
  color: var(--ok);
}
.badge--draft {
  background: var(--warn-bg);
  color: var(--warn);
}
.badge--cancelled {
  background: var(--surface-2);
  color: var(--text-muted);
}
.badge--partial {
  background: var(--info-bg);
  color: var(--info);
}

tr.is-voided td {
  color: var(--text-muted);
}

tr.is-voided td.amt {
  text-decoration: line-through;
}

.paybar {
  height: 8px;
  margin: 12px 0 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.paybar__fill {
  height: 100%;
  border-radius: inherit;
  background: var(--ok);
}

.listbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-bottom: 16px;
}
.listbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  white-space: nowrap;
}
.listbar select {
  width: auto;
}
.listbar__q {
  flex: 1 1 260px;
  min-width: 180px;
  height: 40px;
}

.card--flush {
  padding: 0;
}

table.data--list {
  border-collapse: separate;
  border-spacing: 0;
}
table.data--list thead tr:first-child th:first-child {
  border-top-left-radius: var(--radius);
}
table.data--list thead tr:first-child th:last-child {
  border-top-right-radius: var(--radius);
}

table.data--list thead th {
  padding: 0;
}
table.data--list thead th a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 12px;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}
table.data--list thead th a:hover {
  color: var(--text);
  text-decoration: none;
}
table.data--list thead th.num a {
  justify-content: flex-end;
}
table.data--list .sort-ind {
  font-size: 9px;
  line-height: 1;
  opacity: 0.35;
}
table.data--list .sort-ind[data-state=asc], table.data--list .sort-ind[data-state=desc] {
  opacity: 1;
  color: var(--accent);
}
table.data--list td.acts {
  white-space: nowrap;
  text-align: right;
}
table.data--list td.acts > .btn, table.data--list td.acts > .menu, table.data--list td.acts > .acts__inline {
  margin-left: 2px;
}
table.data--list .acts__inline {
  display: inline-flex;
  margin: 0;
}
table.data--list .acts__pay {
  color: var(--ok);
}
table.data--list .acts__pay:hover {
  background: var(--ok-bg);
  color: var(--ok);
}
table.data--list .rel-note {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
table.data--list th.acts-h {
  text-align: right;
}

.menu {
  position: relative;
  display: inline-block;
}
.menu > summary {
  list-style: none;
}
.menu > summary::-webkit-details-marker {
  display: none;
}
.menu[open] > summary {
  background: var(--surface-2);
  color: var(--text);
}

.menu__pop {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  min-width: 210px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  text-align: left;
}
.menu__pop hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}
.menu__pop form {
  display: block;
  margin: 0;
}

.menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu__item:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.menu__item--danger {
  color: var(--err);
}
.menu__item--danger:hover {
  background: var(--err-bg);
}

.menu__ico {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--text-muted);
}
.menu__item--danger .menu__ico {
  color: var(--err);
}

.listfoot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.pager {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pager__pp {
  margin: 0;
}
.pager__pp label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  white-space: nowrap;
}
.pager__pp select {
  width: auto;
  height: 34px;
}
.pager__nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.pager__nav a, .pager__nav span {
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pager__nav a {
  color: var(--text-muted);
}
.pager__nav a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.pager__nav [aria-current=page] {
  background: var(--accent);
  color: #fff;
}
.pager__nav .is-off {
  color: var(--border-strong);
}
.pager__nav .gap {
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .menu__pop {
    right: auto;
    left: 0;
  }
  table.data--list td.acts .menu__pop {
    right: 0;
    left: auto;
  }
  .listfoot {
    justify-content: center;
  }
  .pager {
    flex-direction: column;
    gap: 10px;
  }
  .listbar {
    gap: 8px;
  }
  .listbar label {
    flex: 1 1 100%;
    justify-content: space-between;
  }
  .listbar select, .listbar__q {
    flex: 1 1 100%;
    width: 100%;
  }
  .listbar > .btn {
    flex: 1 1 100%;
  }
  table.data--list td.acts {
    padding-top: 6px;
    padding-bottom: 6px;
  }
  table.data--list .rel-note {
    text-align: left;
  }
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  margin-bottom: 18px;
}

.card__title {
  margin: -4px 0 16px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

@media (max-width: 760px) {
  .stat-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .stat-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  min-width: 0;
}
.stat-tile--ico {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.stat-tile--ico > div:last-child {
  min-width: 0;
}
.stat-tile__ico {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.stat-tile__ico--warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.stat-tile__ico--ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.stat-tile__label {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.stat-tile__value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-tile__value--sm {
  font-size: 16px;
  white-space: normal;
  overflow: visible;
}
.stat-tile__value--err {
  color: var(--err);
}
.stat-tile__sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

@media (max-width: 760px) {
  .stat-tile {
    padding: 16px;
  }
  .stat-tile__value {
    font-size: 21px;
  }
}
.chart-wrap {
  position: relative;
  height: 170px;
}
.chart-wrap canvas {
  max-width: 100%;
}

.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--text-muted);
}
.empty p {
  margin-bottom: 16px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.plan-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.plan-card--featured {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.plan-card--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.plan-card__badge {
  position: absolute;
  top: -10px;
  right: 16px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.plan-card__price {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 2px 0 0;
}
.plan-card__suffix {
  margin-left: 4px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-muted);
}
.plan-card__foot {
  margin: 0 0 4px;
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
}
.plan-card .btn,
.plan-card > span.muted:last-child {
  margin-top: auto;
}
.plan-card > span.muted:last-child {
  padding-top: 14px;
}

.ticks {
  list-style: none;
  margin: 10px 0 16px;
  padding: 0;
  font-size: 13.5px;
}
.ticks li {
  padding: 4px 0 4px 22px;
  position: relative;
}
.ticks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--ok);
  font-weight: 700;
}
.ticks li.ticks__tag {
  margin-top: 12px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.plan-card--featured .ticks__tag {
  color: var(--accent);
}

.pay-methods {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}
.pay-methods label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
}
.pay-methods input {
  width: auto;
  height: auto;
  accent-color: var(--accent);
}

.planbadge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sidebar-fg);
  background: rgba(255, 255, 255, 0.05);
}
.planbadge:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}
.planbadge--plus, .planbadge--magor {
  color: #fff;
  background: rgba(245, 31, 103, 0.22);
}

.tpl-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
}
.tpl-opt input {
  width: auto;
  height: auto;
  accent-color: var(--accent);
}
.tpl-opt--locked {
  opacity: 0.55;
  cursor: default;
}

.tpl-name {
  font-weight: 600;
}

.tpl-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-weak);
  color: var(--accent-hover);
}
.tpl-badge--custom {
  background: var(--sidebar-bg);
  color: #fff;
}

.tpl-prev {
  margin-left: auto;
  font-size: 12px;
}

.qr-box {
  text-align: center;
}
.qr-box img {
  width: 240px;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.qr-box dl {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 4px 14px;
  margin: 16px auto 0;
  text-align: left;
  font-size: 13.5px;
}
.qr-box dt {
  color: var(--text-muted);
}
.qr-box dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 13.5px;
  font-weight: 500;
}
.flash--ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.flash--error {
  background: var(--err-bg);
  color: var(--err);
}
.flash--warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.flash__x {
  margin-left: auto;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  opacity: 0.6;
}
.flash__x:hover {
  opacity: 1;
}

.modal {
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  width: calc(100% - 32px);
  max-width: 440px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
}
.modal::backdrop {
  background: rgba(18, 24, 39, 0.45);
}
.modal[open] {
  display: flex;
  flex-direction: column;
}
.modal form {
  display: contents;
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.modal__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.modal__close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.modal__close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.modal__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal textarea {
  min-height: 120px;
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

@media (max-width: 720px) {
  .modal {
    max-width: none;
  }
}
.client-picker {
  position: relative;
}
.client-picker.is-enhanced .client-select {
  display: none;
}
.client-picker:not(.is-enhanced) .client-search {
  display: none;
}

.client-results {
  list-style: none;
  margin: 4px 0 0;
  padding: 4px;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 240px;
  overflow-y: auto;
}
.client-results li {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
}
.client-results li:hover {
  background: var(--accent-weak);
}

.items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-row {
  display: grid;
  grid-template-columns: 1fr 84px 128px 132px 36px;
  gap: 8px;
  align-items: start;
}
.item-row__label {
  display: none;
}
.item-row .remove-item {
  padding: 0;
  width: 36px;
  height: 40px;
  font-size: 18px;
}

.total-line {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px solid var(--border-strong);
  text-align: right;
  font-size: 17px;
  font-weight: 800;
}
.total-line .num {
  font-size: 20px;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
}

.tab {
  padding: 9px 16px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tab:hover {
  color: var(--text);
}
.tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.login-card {
  width: 100%;
  max-width: 400px;
  margin: 7vh auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 32px;
}
.login-card .applogo {
  display: flex;
  justify-content: center;
  margin: 0 auto 20px;
}
.login-card .applogo__img {
  height: 66px;
}
.login-card h1 {
  text-align: center;
  margin-bottom: 8px;
}
.login-card .muted {
  text-align: center;
  margin-bottom: 20px;
}

.help {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 760px) {
  .help {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}
.help-toc {
  position: sticky;
  top: calc(var(--appbar-h) + 20px);
  font-size: 12.5px;
  line-height: 1.4;
}
.help-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.help-toc li {
  margin: 3px 0;
}
.help-toc a {
  display: block;
  padding: 3px 0;
  color: var(--text-muted);
}
.help-toc a:hover {
  color: var(--accent);
  text-decoration: none;
}
@media (max-width: 760px) {
  .help-toc {
    position: static;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    background: var(--surface);
  }
  .help-toc ol {
    columns: 2;
    column-gap: 20px;
  }
}
@media (max-width: 720px) {
  .help-toc ol {
    columns: 1;
  }
}

.help-body section:first-child h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.help-body h2 {
  font-size: 17px;
  margin: 34px 0 10px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.help-body h3 {
  font-size: 14px;
  margin: 18px 0 6px;
  font-weight: 700;
}
.help-body h2, .help-body h3 {
  scroll-margin-top: calc(var(--appbar-h) + 16px);
}
.help-body ul, .help-body ol {
  margin: 0 0 12px;
  padding-left: 22px;
}
.help-body li {
  margin: 4px 0;
}
.help-body code {
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.help-body .callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 10px 14px;
  border-radius: 8px;
  margin: 12px 0;
}
.help-body .table-wrap {
  margin: 8px 0 16px;
}

.sidebar__foot .sidebar__link {
  margin-bottom: 8px;
}

.admin-dl {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 3px 16px;
  margin: 0;
  font-size: 13.5px;
}
.admin-dl dt {
  color: var(--text-muted);
}
.admin-dl dd {
  margin: 0;
}
.admin-dl code {
  font-size: 12px;
}
@media (max-width: 720px) {
  .admin-dl {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .admin-dl dt {
    margin-top: 12px;
    font-weight: 700;
  }
  .admin-dl dd {
    padding-bottom: 6px;
    border-bottom: 1px solid var(--surface-2);
  }
  .admin-dl dd:last-child {
    border-bottom: 0;
  }
}

.stack > * + * {
  margin-top: 12px;
}

details > summary {
  cursor: pointer;
}
details > summary::-webkit-details-marker {
  display: none;
}
details > summary::marker {
  content: "";
}

.row-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.nowrap {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .wrap {
    padding: 0 16px;
  }
  .appbar {
    padding: 0 12px;
    gap: 8px;
  }
}
@media (max-width: 720px) {
  table.data,
  table.data tbody,
  table.data tr,
  table.data td {
    display: block;
    width: 100%;
  }
  table.data thead {
    position: absolute;
    left: -9999px;
  }
  table.data tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
    padding: 6px 4px;
  }
  table.data td {
    border: 0;
    border-bottom: 1px solid var(--surface-2);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 12px;
    text-align: right;
  }
  table.data tr td:last-child {
    border-bottom: 0;
  }
  table.data td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-muted);
    text-align: left;
  }
  table.data td.actions {
    text-align: right;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  table.data td.actions::before {
    content: "";
  }
  table.data td.actions .btn {
    margin: 2px 0 2px 4px;
  }
  table.data--list td.acts {
    justify-content: flex-end;
  }
  table.data--list td.acts::before {
    content: "";
  }
  .item-row {
    grid-template-columns: 1fr;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    background: var(--surface-2);
  }
  .item-row__label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
  }
  .item-row .btn {
    justify-self: end;
  }
  .wrap {
    margin-top: 16px;
  }
  h1 {
    font-size: 21px;
  }
}
