body {
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  background: #f5f6f8;
  color: #222;
}
header {
  background: #111;
  color: #fff;
  padding: 14px 20px;
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.brand {
  font-weight: 700;
}
nav a {
  color: #ddd;
  text-decoration: none;
  margin-right: 14px;
}
nav a.active,
nav a:hover {
  color: #fff;
  border-bottom: 2px solid #fff;
}
main {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}
.card {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px #0002;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.metric {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 4px #0002;
}
.metric b {
  display: block;
  font-size: 24px;
  margin-top: 8px;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
th,
td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}
th {
  background: #fafafa;
}
input,
select,
textarea,
button {
  padding: 9px;
  border: 1px solid #bbb;
  border-radius: 6px;
}
input,
select,
textarea {
  width: 100%;
  box-sizing: border-box;
}
button,
.btn {
  background: #111;
  color: #fff;
  border: 0;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 6px;
  display: inline-block;
}
.btn.secondary {
  background: #666;
}
.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.flash {
  background: #e8f3ff;
  border: 1px solid #acd3ff;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.actions {
  margin: 12px 0;
}
.public {
  max-width: 850px;
}
.paid {
  color: green;
  font-weight: 700;
}
.unpaid {
  color: #b00020;
  font-weight: 700;
}
.partial {
  color: #ad6500;
  font-weight: 700;
}
.small {
  font-size: 12px;
  color: #666;
}
.autocomplete {
  position: relative;
}
.suggestions {
  position: absolute;
  z-index: 10;
  background: white;
  border: 1px solid #bbb;
  width: 100%;
  max-height: 220px;
  overflow: auto;
}
.suggestions div {
  padding: 8px;
  cursor: pointer;
}
.suggestions div:hover {
  background: #eee;
}
.table-tools {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 12px;
  flex-wrap: wrap;
}
.table-tools label {
  display: flex;
  gap: 8px;
  align-items: center;
}
.table-tools select,
.table-tools input {
  width: auto;
}
.print-only {
  display: none;
}
.invoice-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}
.invoice-total {
  font-size: 22px;
  font-weight: 700;
}
.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.danger {
  background: #9b111e;
}
@media print {
  header,
  .actions,
  .no-print,
  .table-tools,
  button,
  .btn {
    display: none !important;
  }
  body {
    background: #fff;
  }
  main {
    max-width: none;
    margin: 0;
  }
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
  .print-only {
    display: block;
  }
}
.inline-form {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}
.inline-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}
.button,
button {
  display: inline-block;
}
.metric span {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: #666;
  margin-top: 4px;
}
.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #ddd;
  border: 1px solid #ddd;
}
.calendar-cell {
  background: #fff;
  min-height: 110px;
  padding: 6px;
  font-size: 13px;
}
.calendar-head {
  background: #222;
  color: #fff;
  text-align: center;
  font-weight: bold;
  min-height: auto;
}
.calendar-day {
  font-weight: bold;
  color: #555;
}
.calendar-event {
  display: block;
  margin: 4px 0;
  padding: 4px;
  border-radius: 5px;
  background: #eef;
  color: #124;
  text-decoration: none;
}
.muted {
  color: #777;
}
.mini-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.success {
  background: #16833a !important;
  color: #fff !important;
}
.narrow {
  max-width: 560px;
  margin: 2rem auto;
}
.inline-edit {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fafafa;
}
.inline-edit label {
  display: block;
  margin: 0.4rem 0;
}
.compact {
  padding: 0.75rem;
}
.grid.four {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.stat {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 4px #0002;
}
.stat b {
  display: block;
  font-size: 24px;
}
.stat span {
  font-size: 12px;
  color: #666;
}
.checkline {
  display: flex !important;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.checkline input {
  width: auto;
}
.calendar-event .small {
  display: block;
  color: #456;
  font-size: 11px;
  margin-top: 2px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #eef2f7;
  border: 1px solid #d8dee8;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  margin: 0.1rem;
}
.chip button {
  border: 0;
  background: transparent;
  font-weight: bold;
  cursor: pointer;
  padding: 0 0.15rem;
}
.compact {
  padding: 0.75rem;
}
.mini-actions select,
.mini-actions input {
  max-width: 220px;
}
.linklike {
  background: transparent;
  border: 0;
  color: #b00020;
  padding: 0 0.25rem;
  box-shadow: none;
  font-weight: bold;
  cursor: pointer;
}
.linklike:hover {
  text-decoration: underline;
}
.mini-actions select {
  max-width: 260px;
}
.chips {
  margin-top: 0.5rem;
}
body:not(.theme-manta-blue) main:has(.login-card) {
  max-width: 460px;
  margin: 8vh auto;
}
.login-card {
  max-width: 420px;
  margin: 8vh auto;
  padding: 26px;
}
.login-card h1 {
  margin-top: 0;
  text-align: center;
}
.login-card button {
  width: 100%;
  padding: 11px;
}
.login-card .small {
  text-align: center;
}
@supports not selector(:has(*)) {
  .login-card {
    max-width: 420px;
    margin: 8vh auto;
    padding: 26px;
  }
}
.install-main {
  max-width: 760px;
  margin: 5vh auto;
}
.install-card {
  max-width: 720px;
  margin: 0 auto;
}
.install-log {
  background: #111;
  color: #eee;
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
  white-space: pre-wrap;
}
.install-card h1 {
  margin-top: 0;
}
.install-card .card {
  box-shadow: none;
  border: 1px solid #e3e6ec;
}
.invoice-student-group td {
  background: #eef2f7 !important;
  color: #2b3a4a;
  font-weight: 700;
  border-top: 2px solid #d8dee8;
}
.invoice-student-group td:before {
  content: "👤 ";
  font-weight: 400;
}

.line-price-input,
.line-qty-input {
  width: 92px;
  min-width: 82px;
  padding: 6px 8px;
}
.line-code-input {
  min-width: 150px;
  padding: 6px 8px;
}
#lines input,
#lines select {
  font-size: 14px;
}

.deposit-box {
  border-left: 4px solid var(--accent, #2563eb);
  background: rgba(37, 99, 235, 0.08);
  padding: 14px 16px;
  border-radius: 12px;
  margin: 14px 0;
}
.deposit-box h3 {
  margin-top: 0;
}
.line-price-input,
.line-qty-input,
.line-code-input {
  min-width: 90px;
}

/* v0.7.8.3 layout polish */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand span {
  display: inline-block;
}
.topbar-logo {
  max-width: 250px;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.business-logo-preview {
  max-width: 250px;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}
.public-invoice-card {
  max-width: 850px;
  margin-left: auto;
  margin-right: auto;
}
.public-invoice-top {
  text-align: center;
  margin-bottom: 18px;
}
.public-invoice-logo {
  display: block;
  max-width: 250px;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto 12px;
}
.public-invoice-top h1 {
  margin: 0.25rem 0;
}
.business-address {
  margin: 0.25rem 0;
}
.public-invoice-meta {
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  padding: 14px 0;
  margin-bottom: 16px;
}
.payment-card {
  text-align: center;
}
.payment-options-grid {
  justify-items: center;
}
.payment-option {
  position: relative;
  text-align: center;
  width: 100%;
  max-width: 260px;
  box-sizing: border-box;
}
.payment-option h3 {
  text-align: center;
  margin-top: 0;
}


.preferred-payment-note {
  margin-top: -4px;
  margin-bottom: 14px;
}
.preferred-payment-label {
  display: inline-block;
  margin: 0 0 8px 0;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #166534;
  background: #dcfce7;
}
.preferred-payment-method {
  border-color: #16a34a;
}
.preferred-payment-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
  z-index: 5;
}
.payment-option img {
  display: block;
  max-width: 180px;
  max-height: 180px;
  width: auto;
  height: auto;
  margin: 0 auto 10px;
}
.secure-invoice-card {
  max-width: 620px;
  font-size: 0.95rem;
}
.secure-invoice-card h2 {
  font-size: 1.2rem;
  margin-top: 0;
}
.secure-invoice-card input[name="pin"] {
  max-width: 140px;
}
@media (max-width: 700px) {
  header {
    justify-content: center;
  }
  .brand {
    width: 100%;
    justify-content: center;
    text-align: center;
    flex-direction: column;
  }
  .topbar-logo {
    max-width: 220px;
    max-height: 80px;
  }
  .invoice-header {
    display: block;
  }
  .invoice-total {
    font-size: 16px;
    line-height: 1.6;
  }
  .public-invoice-card {
    overflow-x: auto;
  }
  .secure-invoice-card {
    font-size: 0.9rem;
  }
  .secure-invoice-card h2 {
    font-size: 1.05rem;
  }
}

/* v0.7.8.4 invoice/admin layout polish */
header {
  align-items: center;
  gap: 18px;
}
header nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
header nav a {
  margin-right: 0;
  padding: 7px 10px;
  border-radius: 8px;
}
header nav a.active,
header nav a:hover {
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.14);
}
.brand {
  flex: 0 0 auto;
}
.brand span {
  font-size: 1.05rem;
}
.app-footer {
  text-align: center;
  color: #666;
  font-size: 12px;
  padding: 18px 12px 28px;
}
.app-footer a {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}
.app-footer a:hover {
  text-decoration: underline;
}
.invoice-summary-stack {
  max-width: 360px;
  margin: 18px 0 0 auto;
  border-top: 2px solid #222;
}
.invoice-summary-stack div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0;
  border-bottom: 1px solid #e3e6ec;
}
.invoice-summary-stack span {
  color: #555;
}
.invoice-summary-stack strong {
  font-size: 1.05rem;
}
.invoice-summary-stack .balance {
  font-size: 1.15rem;
  border-bottom: 0;
}
.public-summary-stack {
  margin-left: auto;
  margin-right: 0;
}
.category-summary {
  margin: 16px 0 4px;
  padding: 12px 14px;
  background: #fafafa;
  border: 1px solid #e3e6ec;
  border-radius: 10px;
}
.category-summary h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.category-total-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 16px;
}
.category-total-grid div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.category-total-grid span {
  color: #555;
}
.invoice-lines-table th:last-child,
.invoice-lines-table td:last-child {
  text-align: right;
}
@media (max-width: 700px) {
  header {
    justify-content: flex-start;
  }
  .brand {
    width: auto;
    justify-content: flex-start;
    text-align: left;
    flex-direction: row;
  }
  header nav {
    width: 100%;
  }
  .invoice-summary-stack {
    max-width: none;
    margin-left: 0;
  }
  .public-summary-stack {
    margin-right: 0;
  }
  .category-total-grid {
    grid-template-columns: 1fr;
  }
}
@media print {
  .app-footer {
    display: none !important;
  }
  .invoice-summary-stack {
    break-inside: avoid;
  }
  .category-summary {
    break-inside: avoid;
  }
}

/* v0.7.8.5 public invoice controls */
.payment-option {
  overflow: visible;
  position: relative;
}
.payment-option img {
  cursor: zoom-in;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
  transform-origin: center center;
}
.payment-option img:hover,
.payment-option img:focus {
  transform: scale(2.25);
  position: relative;
  z-index: 60;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
  background: #fff;
  border-radius: 10px;
  padding: 6px;
}
.payment-options-grid {
  overflow: visible;
}
.public-invoice-top h1:empty {
  display: none;
}
@media (max-width: 700px) {
  .payment-option img:hover,
  .payment-option img:focus {
    transform: scale(1.65);
  }
}
@media print {
  .payment-option img:hover,
  .payment-option img:focus {
    transform: none;
    box-shadow: none;
    padding: 0;
  }
}

/* v0.7.8.6 login, top bar, and dashboard layout polish */
.login-logo {
  display: block;
  max-width: 250px;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto 16px;
}
.login-card h1 {
  font-size: 1.55rem;
  line-height: 1.2;
  margin: 0.2rem 0 1.15rem;
  text-align: center;
}
header {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 18px;
}
.brand {
  flex: 0 0 auto;
  min-width: 0;
}
.brand .topbar-logo {
  display: block;
}
header nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}
header nav a {
  white-space: nowrap;
}
.inline-form {
  align-items: flex-end;
}
.inline-form label {
  justify-content: flex-end;
}
.inline-form select,
.inline-form input {
  min-height: 42px;
}
.inline-form button,
.inline-form .button {
  min-height: 42px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.metrics {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
  align-items: stretch;
}
.metrics .metric {
  min-height: 112px;
  box-sizing: border-box;
}
.grid.two {
  gap: 18px;
  margin-bottom: 18px;
}
@media (max-width: 900px) {
  header {
    flex-wrap: wrap;
  }
  .brand {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  header nav {
    width: 100%;
    justify-content: center;
  }
  .metrics {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }
}
@media (max-width: 700px) {
  header {
    justify-content: center;
  }
  .brand {
    width: 100%;
    justify-content: center;
    text-align: center;
    flex-direction: row;
  }
  header nav {
    width: 100%;
    justify-content: center;
  }
  .topbar-logo {
    max-width: 220px;
    max-height: 80px;
  }
  .inline-form {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .inline-form .button,
  .inline-form button {
    width: 100%;
  }
  .metrics {
    grid-template-columns: 1fr;
  }
  .metrics .metric {
    min-height: auto;
  }
}
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.client-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}
.client-summary-grid > div,
.client-address,
.client-notes {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 0.75rem;
}
.label {
  display: block;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: #486070;
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.client-simple-form textarea[name="address_block"] {
  min-height: 80px;
}
.column-picker {
  position: relative;
  display: inline-block;
}
.column-picker summary {
  cursor: pointer;
  padding: 0.45rem 0.7rem;
  border: 1px solid #b8d2df;
  border-radius: 8px;
  background: #fff;
}
.column-options {
  position: absolute;
  z-index: 50;
  right: 0;
  min-width: 220px;
  max-height: 320px;
  overflow: auto;
  background: #fff;
  border: 1px solid #b8d2df;
  border-radius: 12px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
  padding: 0.75rem;
}
.column-options label {
  display: block;
  margin: 0.25rem 0;
  white-space: nowrap;
}
.column-options input {
  width: auto;
}
.table-tools {
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

/* v0.7.8.8 dashboard and global table tools polish */
.dashboard-range-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.dashboard-range-form label {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin: 0;
  line-height: 1.2;
}
.dashboard-range-form select,
.dashboard-range-form input {
  height: 42px;
  box-sizing: border-box;
}
.dashboard-range-form button,
.dashboard-range-form .button {
  height: 42px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}
.table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin: 8px 0 12px;
  flex-wrap: wrap;
}
.table-tools-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-right: auto;
}
.table-tools-left label,
.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.table-search {
  margin-left: auto;
}
.table-search input {
  min-width: 220px;
}
.column-options {
  left: 0;
  right: auto;
}
@media (max-width: 700px) {
  .dashboard-range-form {
    display: grid;
    grid-template-columns: 1fr;
  }
  .dashboard-range-form button,
  .dashboard-range-form .button {
    width: 100%;
  }
  .table-tools {
    display: grid;
    grid-template-columns: 1fr;
  }
  .table-tools-left {
    width: 100%;
    justify-content: flex-start;
  }
  .table-search {
    width: 100%;
    margin-left: 0;
  }
  .table-search input {
    width: 100%;
    min-width: 0;
  }
}
.settings-jump {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.settings-jump a {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--border, #b9d6df);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-weight: 700;
}
.settings-embedded-section {
  scroll-margin-top: 100px;
}
.settings-embedded-section > h2 {
  margin-top: 28px;
}
.document-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}
.document-row-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  align-items: end;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.72);
}
.document-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.client-simple-form[hidden],
.client-read[hidden] {
  display: none !important;
}

/* v0.7.8.14 client and invoice display polish */
.client-detail-wrap {
  max-width: 980px;
  margin: 0 auto;
}
.client-detail-wrap > h1 {
  text-align: center;
}
.client-detail-card {
  margin-left: auto;
  margin-right: auto;
}
.invoice-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  max-width: 780px;
}
.invoice-actions .btn,
.invoice-actions button {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  font: inherit;
  white-space: nowrap;
}
.invoice-actions form {
  display: block;
  margin: 0;
  width: 100%;
}
.invoice-student-group td {
  text-align: left !important;
}
.invoice-student-group td:before {
  content: none !important;
}
.invoice-student-group a {
  float: right;
  font-weight: 600;
  font-size: 0.92rem;
}
.payment-options-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 14px;
}
.payment-options-grid .payment-option {
  flex: 0 1 260px;
  margin: 0;
}
@media (max-width: 850px) {
  .invoice-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
  }
}
@media (max-width: 520px) {
  .invoice-actions {
    grid-template-columns: 1fr;
  }
  .invoice-actions .btn,
  .invoice-actions button,
  .invoice-actions form {
    width: 100%;
  }
  .invoice-student-group a {
    float: none;
    display: block;
    margin-top: 4px;
  }
  .client-detail-wrap {
    max-width: 100%;
  }
}

/* v0.7.8.16 public invoice centering and eLearning display cleanup */
body.public {
  max-width: none;
  width: 100%;
}
body.public main.public {
  max-width: 900px;
  margin: 24px auto;
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}
body.public .public-invoice-card {
  margin-left: auto;
  margin-right: auto;
}
body.public .invoice-lines-table th:nth-child(2),
body.public .invoice-lines-table td:nth-child(2) {
  text-align: left;
}
@media (max-width: 700px) {
  body.public main.public {
    max-width: 100%;
    margin: 12px auto;
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* v0.7.8.17 public invoice date/logo/mobile line-item polish */
.public-invoice-logo {
  max-width: 275px;
  max-height: 110px;
}
body.public .invoice-lines-table {
  table-layout: auto;
}
body.public .public-invoice-card {
  box-sizing: border-box;
  width: 100%;
}
@media (max-width: 700px) {
  body.public .public-invoice-logo {
    max-width: min(275px, 88vw);
    max-height: 110px;
  }
  body.public .public-invoice-card {
    padding: 14px;
    overflow: visible;
  }
  body.public .invoice-lines-table,
  body.public .invoice-lines-table tbody,
  body.public .invoice-lines-table tr,
  body.public .invoice-lines-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  body.public .invoice-lines-table {
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
  }
  body.public .invoice-lines-table tr:first-child {
    display: none;
  }
  body.public .invoice-lines-table tr:not(.invoice-student-group) {
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid #e3e6ec;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }
  body.public .invoice-lines-table td {
    border: 0;
    padding: 6px 0;
    text-align: left !important;
    overflow-wrap: anywhere;
    word-break: normal;
  }
  body.public
    .invoice-lines-table
    tr:not(.invoice-student-group)
    td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #607083;
    font-weight: 700;
    margin-bottom: 2px;
  }
  body.public .invoice-lines-table td[data-label="eLearning"]:empty {
    display: none;
  }
  body.public .invoice-student-group {
    margin: 14px 0 8px !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  body.public .invoice-student-group td {
    display: block !important;
    border-radius: 10px;
    padding: 10px 12px !important;
    background: #eef2f7 !important;
  }
  body.public .invoice-student-group a {
    float: none;
    display: block;
    margin-top: 4px;
  }
  body.public code {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
/* v0.7.8.18 email test UI */
.invoice-test-email {
  max-width: 780px;
  margin-left: 0;
  margin-right: auto;
}
.invoice-test-email .row {
  align-items: end;
}
.invoice-test-email input[type="email"] {
  max-width: 420px;
}
@media (max-width: 850px) {
  .invoice-test-email {
    max-width: 100%;
  }
  .invoice-test-email input[type="email"] {
    max-width: 100%;
  }
}

/* v0.7.8.20 shared invoice line rendering and mobile card display */
.invoice-lines-table {
  width: 100%;
}
.invoice-lines-table td[data-label="eLearning"]:empty {
  display: none;
}
@media (max-width: 700px) {
  .invoice-lines-table,
  .invoice-lines-table tbody,
  .invoice-lines-table tr,
  .invoice-lines-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .invoice-lines-table {
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
  }
  .invoice-lines-table tr:first-child {
    display: none;
  }
  .invoice-lines-table tr:not(.invoice-student-group) {
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid #e3e6ec;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }
  .invoice-lines-table td {
    border: 0;
    padding: 6px 0;
    text-align: left !important;
    overflow-wrap: anywhere;
    word-break: normal;
  }
  .invoice-lines-table tr:not(.invoice-student-group) td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #607083;
    font-weight: 700;
    margin-bottom: 2px;
  }
  .invoice-lines-table td[data-label="eLearning"]:empty,
  .invoice-line-row.invoice-single-unit-line td[data-label="Qty"],
  .invoice-line-row.invoice-single-unit-line td[data-label="Unit"] {
    display: none !important;
  }
  .invoice-student-group {
    margin: 14px 0 8px !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  .invoice-student-group td {
    display: block !important;
    border-radius: 10px;
    padding: 10px 12px !important;
    background: #eef2f7 !important;
  }
  .invoice-student-group a {
    float: none;
    display: block;
    margin-top: 4px;
  }
  .invoice-lines-table code {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* v0.7.8.32 compact invoice test email action */
.invoice-actions-expanded {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  max-width: 980px;
  position: relative;
}
.invoice-action-dropdown {
  position: relative;
  display: block;
  width: 100%;
}
.invoice-action-dropdown summary {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #111827;
  color: #fff;
  padding: 0.6rem 0.9rem;
  list-style: none;
}
.invoice-action-dropdown summary::-webkit-details-marker {
  display: none;
}
.invoice-action-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: min(340px, 88vw);
  margin: 0;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.18);
}
.invoice-action-popover label,
.invoice-action-popover input,
.invoice-action-popover button {
  width: 100%;
}
.invoice-action-popover input {
  margin-top: 0.35rem;
}
.invoice-action-popover button {
  margin-top: 0.75rem;
}
.invoice-action-popover .small {
  margin-bottom: 0;
}
@media (max-width: 520px) {
  .invoice-actions-expanded {
    grid-template-columns: 1fr;
  }
  .invoice-action-popover {
    position: static;
    width: 100%;
    margin-top: 8px;
  }
}

/* v0.7.9 invoice delete action */
.invoice-action-dropdown summary.danger,
.invoice-action-popover button.danger {
  background: #9b111e;
  color: #fff;
}
.danger-dropdown .invoice-action-popover {
  border-color: rgba(155, 17, 30, 0.35);
}
