#admin-status:not(:empty), #publish-status:not(:empty), #member-status:not(:empty) { margin-block: 8px; }
.admin-tabs { display: flex; gap: 8px; padding: 6px; margin-top: 24px; border: 1px solid #d5e0c8; border-radius: 14px; background: #eaf2df; }
.admin-tabs [role="tab"] { flex: 1; min-width: 0; padding: 12px 16px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #64755d; font: inherit; font-weight: 700; cursor: pointer; }
.admin-tabs [role="tab"]:hover { color: var(--green-dark); background: #f5f9ef; }
.admin-tabs [role="tab"][aria-selected="true"] { color: #345c35; background: var(--paper); border-color: #c8d9b6; box-shadow: 0 2px 0 #d4e1c7; }
.admin-tabs [role="tab"]:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
#admin-content > [role="tabpanel"] { margin-top: 16px; }
#admin-content > [role="tabpanel"][hidden] { display: none; }
.credit-balance { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; margin-block: 12px; }
.credit-balance strong { font-size: 1.5rem; }
.credit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.bfl-panel { padding: 28px; }
.bfl-panel > h2 { margin: 0 0 20px; }
.credit-card {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 16px 28px; padding: 20px 24px; border: 1px solid #c8d9b6;
  border-radius: 14px; background: #f1f7e9;
}
.credit-info h3 { margin: 0; font-size: 17px; }
.credit-balance { margin: 7px 0 0; gap: 6px 14px; }
.credit-balance span { color: var(--muted); }
.credit-balance strong { color: #345c35; font-size: 1.65rem; }
.credit-actions a { color: var(--green-dark); font-size: 15px; text-underline-offset: 3px; }
.usage-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px 20px; margin-top: 30px; }
.usage-heading h3 { margin: 0; font-size: 21px; }
.usage-heading p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.bfl-panel .button { min-height: 40px; padding: 6px 14px; font-size: 16px; }
.bfl-panel .admin-totals { margin: 16px 0 0; color: var(--muted); font-size: 15px; }
.bfl-panel .usage-note { margin: 12px 0 20px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.usage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.usage-card { min-width: 0; overflow: hidden; border: 1px solid #d9e3cc; border-radius: 12px; background: #fff; }
.usage-card h4 { margin: 0; padding: 15px 18px; font-size: 17px; }
.usage-card .admin-table { margin: 0; }
.usage-card table { table-layout: fixed; font-size: 14px; }
.usage-card th, .usage-card td { padding: 11px 14px; overflow-wrap: anywhere; }
.usage-card th { background: #f6f8f1; color: #607055; font-weight: 600; }
.usage-card tbody tr:last-child td { border-bottom: 0; }
.usage-card td[colspan] { padding: 22px 14px; text-align: center; color: var(--muted); }
.usage-card th:nth-child(2), .usage-card td:nth-child(2) { text-align: center; }
.usage-card th:last-child, .usage-card td:last-child:not([colspan]) { text-align: right; }
.usage-detail { grid-column: 1 / -1; }
.usage-charts { margin-bottom: 16px; }
.chart-card { padding: 18px; }
.chart-card h4 { padding: 0; }
.chart-card > p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.endpoint-chart { min-height: 215px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 24px; }
.endpoint-donut { width: 145px; height: 145px; flex: 0 0 145px; border-radius: 50%; display: grid; place-items: center; }
.endpoint-donut > div { width: 105px; height: 105px; display: grid; place-content: center; text-align: center; border-radius: 50%; background: white; }
.endpoint-donut strong { font-size: 30px; line-height: 1.15; }
.endpoint-donut span, .chart-empty { color: var(--muted); font-size: 14px; }
.endpoint-legend { display: grid; gap: 8px; font-size: 14px; min-width: 0; }
.endpoint-legend div { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.endpoint-legend i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.daily-chart { min-height: 215px; display: grid; align-items: center; }
.daily-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.daily-chart text { fill: #74846c; font: 11px sans-serif; }
.chart-empty { text-align: center; padding: 24px 8px; }
.admin-totals { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 10px; }
.admin-totals span { padding: 5px 10px; border-radius: 9px; background: var(--leaf); }
.admin-table { max-height: 290px; overflow: auto; margin-top: 10px; }
.admin-table table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: start; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.admin-table th { position: sticky; top: 0; background: var(--paper); }
.admin-table .button { min-height: 34px; padding: 4px 9px; font-size: 14px; }
#member-filter, #publish-sticker input {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  font: inherit;
  max-width: 100%;
}
#publish-sticker { display: grid; justify-items: start; gap: 6px; margin-block: 12px; }
.admin-password-form { display: grid; gap: 8px; max-width: 420px; margin-top: 20px; }
.admin-password-form label { font-weight: 700; margin-top: 8px; }
.admin-password-form input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; font: inherit; }
.admin-password-form input:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.admin-password-form #admin-password-hint { color: var(--muted); font-size: 14px; margin: 0; }
.admin-password-form .button { justify-self: start; margin-top: 12px; }
#print-price-form { max-width: 800px; margin-block: 18px 0; }
#print-price-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; margin-bottom: 16px; }
.print-price-option { margin: 0; min-width: 0; border: 1px solid var(--line); padding: 10px 14px; background: #fff; border-radius: 12px; }
.print-price-option legend { padding: 0 5px; font-weight: bold; color: var(--green-dark); }
.print-price-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.print-price-fields label { min-width: 0; font-size: 14px; }
.print-price-fields input { display: block; width: 100%; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 7px; font: inherit; }
.print-price-option p { display: flex; justify-content: space-between; gap: 8px; margin: 12px 0 0; padding-top: 8px; border-top: 1px solid var(--line); font-size: 14px; }
.print-price-option output { font-weight: 700; }
#print-price-status:not(:empty) { margin: 10px 0 0; }
.print-estimate { max-width: 800px; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 14px; }
.print-estimate summary { cursor: pointer; font-weight: 700; }
.print-estimate p { margin: 12px 0; }
.print-estimate select { margin-inline-start: 6px; padding: 5px 8px; font: inherit; }
.estimate-result { background: var(--leaf); padding: 10px 12px; border-radius: 8px; }
.estimate-result output { font-weight: 700; }
.estimate-result output[data-loss] { color: #943a2a; }
#admin-password-message { margin: 4px 0 0; color: var(--green-dark); }
#admin-password-message[data-error] { color: #a0372e; }
#order-detail { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
#order-contact { white-space: pre-line; overflow-wrap: anywhere; }
.order-art canvas { display: block; width: min(200px, 100%); height: auto; margin: 12px 0; border: 1px solid var(--line); background: white; }
#order-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
@media (max-width: 760px) {
  .admin-tabs { gap: 3px; }
  .admin-tabs [role="tab"] { padding: 10px 6px; font-size: 14px; }
  .bfl-panel { padding: 18px; }
  .credit-card { padding: 18px; }
  .usage-grid { grid-template-columns: minmax(0, 1fr); }
  .usage-detail { grid-column: auto; }
  .usage-card table { min-width: 390px; }
}
@media (max-width: 540px) {
  .admin-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
