/* Shared table rhythm and small control details from the existing Metrix kit.
   Widths, visibility, scroll containers and physical column resizing stay native. */
@layer lunora-components {
 body.lunora-admin-v3 #app table:is([data-la-table],table) {
  --admin-table-rule:#edf0f6;
  font-family:Inter,Arial,sans-serif!important;
  font-size:14px!important;
  line-height:20px!important;
  color:#54596a!important;
  background:#fff!important;
  border-collapse:separate!important;
  border-spacing:0!important;
 }
 body.lunora-admin-v3 #app table:is([data-la-table],table) :is(th,td) {
  box-sizing:border-box;
  height:48px!important;
  padding-top:10px!important;
  padding-bottom:10px!important;
  border-top:0!important;
  border-left:0!important;
  border-right:0!important;
  border-bottom:1px solid var(--admin-table-rule)!important;
  font:400 14px/20px Inter,Arial,sans-serif!important;
  letter-spacing:0!important;
  vertical-align:middle!important;
  background:#fff!important;
 }
 body.lunora-admin-v3 #app table:is([data-la-table],table):not([data-admin-physical-columns="1"]) :is(th,td) {
  padding-left:12px!important;
  padding-right:12px!important;
 }
 body.lunora-admin-v3 #app table:is([data-la-table],table) th {
  height:42px!important;
  color:#737784!important;
  font-size:12px!important;
  font-weight:500!important;
  text-transform:none!important;
  text-align:left;
  border-bottom-color:#e5e8f0!important;
 }
 body.lunora-admin-v3 #app #page-dashboard :is(.overview-section-table,.dl-revenue-table) :is(th,td) {
  height:48px!important; padding-top:10px!important; padding-bottom:10px!important;
  font:400 14px/20px Inter,Arial,sans-serif!important;
 }
 body.lunora-admin-v3 #app #page-dashboard :is(.overview-section-table,.dl-revenue-table):not([data-admin-physical-columns="1"]) :is(th,td) {padding-left:12px!important; padding-right:12px!important;}
 body.lunora-admin-v3 #app #page-dashboard :is(.overview-section-table,.dl-revenue-table) th {height:42px!important; font-size:12px!important; font-weight:500!important;}
 body.lunora-admin-v3 #app table tbody tr:last-child>td {border-bottom:0!important;}
 body.lunora-admin-v3 #app table tbody tr:is(:hover,:focus-within)>td {background:#f8f9fd!important;}
 body.lunora-admin-v3 #app table tbody tr:is(.selected,.is-selected,[aria-selected="true"])>td,
 body.lunora-admin-v3 #app table tbody tr:has(input[type="checkbox"]:checked)>td {background:#eef1ff!important;}
 body.lunora-admin-v3 #app table :is(.rpt-number,.col-amount,[data-col="paid_rub"],[data-col="ai_tokens"]) {font-variant-numeric:tabular-nums;}
 body.lunora-admin-v3 #app :is(.overview-section-table,.dl-revenue-table) :is(th,td):not(:first-child) {text-align:right; font-variant-numeric:tabular-nums;}
 body.lunora-admin-v3 #app .overview-data-row {
  min-height:48px!important;
  box-sizing:border-box;
  padding:10px 12px!important;
  border-bottom:1px solid #edf0f6!important;
  font:400 14px/20px Inter,Arial,sans-serif!important;
  color:#54596a!important;
 }
 body.lunora-admin-v3 #app .overview-data-row:last-child {border-bottom:0!important;}
 body.lunora-admin-v3 #app .overview-data-row strong {font:500 14px/20px Inter,Arial,sans-serif!important; font-variant-numeric:tabular-nums;}
 body.lunora-admin-v3 #app .overview-data-row[data-state="unavailable"] strong {color:#8b8d97!important;}

 /* Align all three header elements to one centerline, including wrapped labels. */
 body.lunora-admin-v3 #app .lmc-card>.lmc-header {align-items:center!important;}
 body.lunora-admin-v3 #app .lmc-card>.lmc-header>.lmc-grip {align-self:center!important; margin-top:0!important; margin-bottom:0!important;}
 body.lunora-admin-v3 #app .lmc-card>.lmc-header>.lmc-title-content {align-self:center!important;}

 /* Same labelled field as the period controls; the data API remains V11. */
 body.lunora-admin-v3 #app #overview-chart-grouping.overview-chart-grouping-select {
  display:block!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  min-width:0!important;
 }
 body.lunora-admin-v3 #app #overview-chart-grouping.overview-chart-grouping-select>label {
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  margin:0!important;
  color:#8b8d97!important;
  font:400 12px/18px Inter,Arial,sans-serif!important;
 }
 body.lunora-admin-v3 #app #overview-chart-grouping.overview-chart-grouping-select :is(select,.lac-select) {
  width:154px!important;
  max-width:100%!important;
 }
 body.lunora-admin-v3 #app #overview-chart-grouping.overview-chart-grouping-select :is(select,.lac-select-trigger) {
  min-height:40px!important;
  height:40px!important;
  font:400 14px/20px Inter,Arial,sans-serif!important;
 }
 @media(max-width:700px) {
  body.lunora-admin-v3 #app #overview-chart-grouping.overview-chart-grouping-select>label {justify-content:flex-end;}
  body.lunora-admin-v3 #app table:is([data-la-table],table) :is(th,td) {font-size:13px!important;}
  body.lunora-admin-v3 #app table:is([data-la-table],table) th {font-size:12px!important;}
  body.lunora-admin-v3 #app .overview-data-row {font-size:13px!important;}
 }
}

/* Payment result has its own colour. Billing health remains data-state/title. */
.lunora-admin-v3 .v8-header-billing {max-width:460px; gap:8px;}
.lunora-admin-v3 .v8-billing-text {min-width:0; flex:0 1 auto;}
.lunora-admin-v3 .v8-billing-status {
 display:inline-flex;
 align-items:center;
 gap:6px;
 flex:0 0 auto;
 max-width:100%;
 box-sizing:border-box;
 padding:4px 8px;
 border-radius:6px;
 background:#f1f3f8;
 color:#686d79;
 font:500 11px/16px Inter,Arial,sans-serif;
 white-space:nowrap;
}
.lunora-admin-v3 .v8-header-billing .v8-billing-status>.v8-billing-dot {
 width:6px; height:6px; background:currentColor;
}
.lunora-admin-v3 .v8-header-billing[data-payment-freshness="fresh"][data-payment-status="completed"] .v8-billing-status {background:#e7f5ee; color:#1c7655;}
.lunora-admin-v3 .v8-header-billing[data-payment-freshness="fresh"]:is([data-payment-status="declined"],[data-payment-status="cancelled"]) .v8-billing-status {background:#fff0f1; color:#bc3b4a;}
.lunora-admin-v3 .v8-header-billing[data-payment-freshness="fresh"]:is([data-payment-status="pending"],[data-payment-status="authorized"],[data-payment-status="refunded"],[data-payment-status="partially_refunded"]) .v8-billing-status,
.lunora-admin-v3 .v8-header-billing:is([data-payment-freshness="stale"],[data-payment-freshness="problem"]) .v8-billing-status {background:#fff3e3; color:#9a631d;}
@media(max-width:1000px) {.lunora-admin-v3 .v8-header-billing {max-width:390px;}}
@media(max-width:700px) {
 .lunora-admin-v3 .v8-header-billing {max-width:none;}
 .lunora-admin-v3 .v8-billing-status {padding:2px 6px; font-size:10px; line-height:16px; gap:4px;}
}

/* The users toolbar includes dialog and icon-only actions that deliberately
   bypass the generic button adapter. They still share the same field rhythm. */
@layer lunora-components {
 body.lunora-admin-v3 #app #page-users :is(#users-filters-toggle,#v9-users-reset,.users-table-toolbar .users-icon-btn),
 body.lunora-admin-v3 #app #page-users #users-filters-card .v3-users-quick .lac-select-trigger {
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-sizing:border-box!important;
  height:var(--la-field-height,40px)!important;
  min-height:var(--la-field-height,40px)!important;
  padding:9px 12px!important;
  border:1px solid var(--la-control-border,#cfd3d4)!important;
  border-radius:var(--la-field-radius,8px)!important;
  background:#fff!important;
  color:var(--la-control-text,#5e6366)!important;
  font:400 14px/20px Inter,Arial,sans-serif!important;
  letter-spacing:0!important;
  gap:8px!important;
  box-shadow:none!important;
 }
 body.lunora-admin-v3 #app #page-users .users-table-toolbar .users-icon-btn[onclick*="autoFitUsersColumns"] {
  width:40px!important;
  min-width:40px!important;
  padding:0!important;
  flex:0 0 40px!important;
 }
 body.lunora-admin-v3 #app #page-users :is(#users-filters-toggle,.users-table-toolbar .users-icon-btn) :is(.v13-icon,svg:not(.v13-icon-source)) {
  width:20px!important;
  height:20px!important;
  min-width:20px!important;
  min-height:20px!important;
  max-width:20px!important;
  max-height:20px!important;
  flex:0 0 20px!important;
  color:inherit!important;
 }
 body.lunora-admin-v3 #app #page-users :is(#users-filters-toggle,#v9-users-reset,.users-table-toolbar .users-icon-btn):hover:not(:disabled),
 body.lunora-admin-v3 #app #page-users #users-filters-card .v3-users-quick .lac-select-trigger:hover:not(:disabled) {
  background:#f7f8fc!important;
  border-color:#aeb6bc!important;
 }
 body.lunora-admin-v3 #app #page-users :is(#users-filters-toggle,#v9-users-reset,.users-table-toolbar .users-icon-btn):focus-visible,
 body.lunora-admin-v3 #app #page-users #users-filters-card .v3-users-quick .lac-select-trigger:focus-visible {
  border-color:var(--la-primary,#5570f1)!important;
  outline:2px solid #5570f133!important;
  outline-offset:1px!important;
 }
 body.lunora-admin-v3 #app #page-users #users-filters-toggle[aria-expanded="true"] {
  border-color:var(--la-primary,#5570f1)!important;
  background:#f4f5ff!important;
 }
 body.lunora-admin-v3 #app #page-users :is(#users-filters-toggle,#v9-users-reset,.users-table-toolbar .users-icon-btn):disabled {
  opacity:.6!important;
  cursor:not-allowed!important;
 }
 /* Only the outer search frame is40px; its inner text line fits its padding. */
 body.lunora-admin-v3 #app #page-users #users-filters-card .v3-users-quick .la-search>#user-search {
  height:20px!important;
  min-height:20px!important;
  max-height:20px!important;
  padding:0!important;
 }
 @media(max-width:600px) {
  body.lunora-admin-v3 #app #page-users .users-columns-pop {
   box-sizing:border-box!important;
   width:min(300px,calc(100vw - 64px))!important;
   min-width:0!important;
   max-width:calc(100vw - 64px)!important;
  }
 }
}
