/* Density and theme share one last-layer stylesheet across all admin views. */
.topbar { min-height:80px; padding-block:12px; margin-bottom:12px; }
.topbar h1 { font-size:26px; margin:2px 0; }
.topbar p { font-size:12px; margin:0; }
.panel { padding:14px; border-radius:16px; }
.panel-head, .table-panel > .panel-head, #deviceTablePanel > .panel-head { padding:0; margin:0 0 10px; min-height:0; gap:8px; }
.panel-head h2 { font-size:16px; margin:3px 0; }
.panel-head p { margin:3px 0; font-size:12px; }
.panel-head .eyebrow { font-size:9px; }
.section-toolbar { gap:8px; margin-bottom:8px; }
.section-toolbar select, .section-toolbar input, .section-toolbar > button { min-height:40px; font-size:12px; }
.section-toolbar .search-box { min-height:40px; }
[data-page="devices"] > .section-toolbar { display:grid; grid-template-columns:minmax(0,1fr) minmax(150px,210px) auto; }
[data-page="devices"] .section-toolbar .search-box { min-width:0; }
[data-page="devices"] .section-toolbar #deviceSort { min-width:0; width:100%; }
.device-quick-filters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:12px 0; }
.advanced-filters { padding:10px 12px; margin-bottom:8px; }
.advanced-filters > summary { min-height:24px; font-size:12px; }
#deviceFilterCount { font-size:11px; color:var(--muted); }
.country-summary { padding:10px; margin-top:12px; margin-bottom:0; box-shadow:none; }
.country-chips { gap:6px; }
.country-chip { padding:6px 9px; min-height:32px; }
.device-list-tools { padding-bottom:8px; gap:6px; font-size:11px; }
.device-list-tools > span { font-size:10px; }
#deviceTablePanel .panel-head .eyebrow { display:none; }
#deviceTablePanel .panel-head > div:first-child { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 12px; }
#metrics.metrics { grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin-bottom:12px; }
#metrics .metric-primary, #metrics .metric-secondary, #metrics .metric:last-child { grid-column:auto; min-height:70px; padding:10px 12px; gap:10px; border-radius:13px; }
#metrics .metric b, #metrics .metric-primary b, #metrics .metric-secondary b { font-size:23px; line-height:1.15; margin-top:3px; }
#metrics .metric small { min-height:0; font-size:11px; }
#metrics .metric .metric-icon { width:28px; height:28px; min-width:28px; font-size:17px; }
.overview-grid { grid-template-columns:repeat(3,minmax(0,1fr)); align-items:start; gap:12px; }
.overview-grid > .span-2 { grid-column:1 / -1; }
.activity-summary { gap:8px; }
.activity-item { padding:10px; }
.activity-item b { font-size:20px; }
.activity-item small { font-size:11px; }
.bars { min-height:0; gap:8px; }
.bar-row { font-size:12px; }
[data-page="releases"] .two-column { display:flex; flex-direction:column; gap:10px; }
[data-page="releases"] .two-column > * { width:100%; min-width:0; }
.release-upload-panel.sticky-card { position:static; align-self:stretch; padding:10px 14px; }
.release-upload-panel > summary { display:list-item; min-height:24px; font-size:14px; }
.release-upload-content { padding-top:10px; }
.release-flow { padding:10px 12px; margin-bottom:8px; }
.release-flow p { margin:4px 0 0; font-size:12px; }
.release-flow summary { cursor:pointer; font-size:12px; font-weight:700; }
[data-page="releases"] > .section-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
[data-page="releases"] .release-filter-label { margin:0; min-width:0; }
#releaseResultCount { font-size:12px; color:var(--muted); }
@media(max-width:1100px) {
  .channel-card-table .release-row { gap:4px 12px; padding:12px; }
  .channel-card-table .release-row td { padding:5px 0; }
  .channel-card-table .release-row td::before { font-size:10px; margin-bottom:4px; }
  .channel-card-table .release-row .card-actions { padding-top:6px; }
}
.trial-table { min-width:0; width:100%; table-layout:fixed; }
.trial-table th, .trial-table td { padding:9px 8px; font-size:12px; overflow-wrap:anywhere; }
.trial-table th:first-child { width:20%; }
.trial-table th:last-child { width:25%; }
.trial-row .row-actions { display:flex; flex-wrap:wrap; gap:5px; min-width:0; justify-content:flex-end; }
.trial-row .row-actions button { min-height:36px; padding:6px 9px; font-size:11px; }
.trial-table time { display:flex; flex-wrap:wrap; gap:0 4px; font-variant-numeric:tabular-nums; }
.trial-table time span { white-space:nowrap; }
.trial-table .status { font-size:9px; padding:5px 7px; }
.notification-item { width:100%; text-align:left; padding:12px; gap:5px; }
.notification-item.read { opacity:1; border-left:3px solid var(--line); }
.notification-item:not(.read) { border-left:3px solid var(--blue); }
.live-preview-dialog { width:min(1600px,96vw); max-height:96dvh; padding:16px; }
.live-preview-dialog img { width:auto; height:auto; max-width:100%; max-height:calc(96dvh - 170px); object-fit:contain; margin:8px auto; }
.live-preview-dialog h2 { padding-right:42px; font-size:17px; overflow-wrap:anywhere; }
.light-theme { --muted:#516176; --blue:#1764ba; --green:#087450; --amber:#865800; --red:#ae243b; --purple:#6440a3; }
.light-theme .country-summary, .light-theme .issue-card, .light-theme .trial-row, .light-theme .country-control-row,
.light-theme .release-row, .light-theme .license-row, .light-theme .stored-apk-card, .light-theme .stored-apk-picker,
.light-theme .info-box, .light-theme .upload-limit-hint, .light-theme .bulk-bar, .light-theme .table-state,
.light-theme .advanced-filters, .light-theme .release-flow, .light-theme .telemetry-row,
.light-theme .live-preview-dialog, .light-theme .notification-item, .light-theme .upload-error-code,
.light-theme .promo-card, .light-theme .telegram-post-card, .light-theme .command-result,
.light-theme .danger-zone, .light-theme .dashboard-status, .light-theme .server-card { background:#fff; color:#182638; border-color:#ccd6e2; box-shadow:none; }
.light-theme :is(.panel,.modal,.live-preview-dialog,.country-summary,.issue-card,.advanced-filters) :is(small,p,dt,.muted,.hint,.tool-help) { color:#516176; }
.light-theme :is(.panel,.modal,.country-summary,.issue-card,.advanced-filters) :is(h2,h3,b,strong) { color:#182638; }
.light-theme :is(.eyebrow,summary,.text-button,.country-summary-icon,.country-chip i) { color:#1764ba; }
.light-theme :is(input,select,textarea) { color:#182638; background:#fff; border-color:#b9c7d8; }
.light-theme :is(input,textarea)::placeholder { color:#66758a; opacity:1; }
.light-theme button:disabled { opacity:.65; }
.light-theme label, .light-theme .bar, .light-theme .pagination, .light-theme th,
.light-theme .device-list-tools, .light-theme .device-field-label { color:#516176; }
.light-theme .bar b, .light-theme .current-mod b { color:#182638; }
.light-theme #metrics .metric small { color:#516176; }
.light-theme #metrics .metric b { color:#075f43; }
.light-theme #metrics .metric-icon { background:#e2edf7; color:#1764ba; }
.light-theme .nav-item i { color:#516176; background:#e4eaf2; }
.light-theme .responsive-table-panel > .panel-head,
.light-theme [data-page="country-control"] .responsive-table-panel > .info-box { background:#fff; color:#516176; }
@media(max-width:600px) {
  .country-control-table .country-control-row { grid-template-columns:1fr 1fr; gap:4px 12px; padding:12px; }
  .country-control-table .country-control-row td { padding:6px 0; }
}
.light-theme .warning-copy, .light-theme .bonus-scope-note { background:#fff6df; color:#795000; }
.light-theme .collision-alert, .light-theme .validation-card.validation-bad { background:#fbe9ed; color:#9e253a; }
.light-theme .validation-card { background:#e5f5ed; color:#075f43; }
.light-theme .warning-copy *, .light-theme .bonus-scope-note *, .light-theme .collision-alert * { color:inherit; }
.light-theme .notification-item span { color:#30445c; }
#deviceTablePanel .device-list-tools { margin:0; padding:4px 2px 8px; }
#deviceTablePanel .device-list-tools label { margin:0; min-height:36px; }
.light-theme .status { color:#394b62; background:#e7edf4; }
.light-theme .status.green, .light-theme .status.good, .light-theme .status.ok { color:#075f43; background:#d9f2e8; }
.light-theme .status.blue { color:#14559b; background:#e0edfc; }
.light-theme .status.amber { color:#795000; background:#fff0c5; }
.light-theme .status.purple { color:#633d96; background:#eee5fa; }
.light-theme .status.bad { color:#a01f36; background:#fbe3e8; }
.light-theme .device-version.current { color:#075f43; background:#d9f2e8; }
.light-theme .device-version.outdated { color:#795000; background:#fff0c5; }
.light-theme .issue-card code, .light-theme .issue-card pre { color:#30445c; background:#eef3f8; }
.light-theme .live-preview-dialog a { color:#14559b; }
@media(max-width:1100px) {
  #metrics.metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .trial-table, .trial-table tbody { display:block; }
  .trial-table thead { display:none; }
  .trial-table tbody { display:grid; gap:8px; }
  .trial-row { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px 12px; padding:12px; border:1px solid var(--line-soft); border-radius:12px; }
  .trial-row td { display:block; min-width:0; border:0; padding:4px 0; text-align:left; }
  .trial-row td::before { display:block; content:attr(data-label); font-size:9px; color:var(--muted); margin-bottom:3px; }
  .trial-row .card-primary, .trial-row .card-actions { grid-column:1 / -1; }
  .trial-row .row-actions { display:flex; flex-wrap:wrap; }
  .trial-row .row-actions button { min-height:44px; width:auto; flex:1; }
}
@media(max-width:780px) {
  .topbar { min-height:60px; padding:8px 12px; margin-bottom:8px; }
  .topbar h1 { font-size:20px; }
  .panel { padding:12px; }
  #deviceTablePanel > .panel-head { padding:10px; margin-bottom:8px; }
  [data-page="devices"] > .section-toolbar { grid-template-columns:minmax(0,1fr) minmax(125px,.65fr); gap:6px; }
  [data-page="devices"] .section-toolbar .search-box { grid-column:auto; }
  [data-page="devices"] .section-toolbar .page-size-note { display:none; }
  .device-quick-filters { grid-template-columns:1fr 1fr; }
  .device-quick-filters #deviceCountryFilter { grid-column:auto; }
  #metrics .metric-primary, #metrics .metric-secondary { min-height:65px; padding:9px; gap:6px; }
  #metrics .metric .metric-icon { display:none; }
  #metrics .metric b { font-size:21px; }
  .overview-grid { grid-template-columns:1fr 1fr; }
  .activity-summary { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .activity-item { padding:8px; }
  .activity-item b { font-size:17px; }
  .activity-item small { font-size:10px; }
  .device-list-tools > span { display:none; }
  .trial-row { grid-template-columns:1fr 1fr; }
  .light-theme #deviceTablePanel > .panel-head { background:#fff; }
}
@media(max-width:460px) {
  .topbar { display:flex; align-items:center; gap:8px; }
  .topbar > div:nth-child(2) { flex:1; }
  .topbar .eyebrow, #globalSearchButton, #lastRefresh { display:none; }
  .top-actions { display:flex; gap:4px; width:auto; }
  .top-actions button { width:32px; min-width:32px; padding:0; }
  #metrics.metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .overview-grid { grid-template-columns:1fr; }
  .activity-summary { grid-template-columns:1fr 1fr; }
  .device-list-tools label { min-height:36px; }
  .filter-grid { grid-template-columns:1fr 1fr; }
}
