body.admin-view {
    --adm-bg: #f2f5fc;
    --adm-card: #fff;
    --adm-ink: #101a35;
    --adm-muted: #52617b;
    --adm-border: #dbe3f1;
    --adm-soft: #eef3fe;
    --adm-blue: #1150ed;
    background: var(--adm-bg);
}
body.admin-view.dark-mode {
    --adm-bg: #101827;
    --adm-card: #172338;
    --adm-ink: #edf3ff;
    --adm-muted: #aabbd8;
    --adm-border: #324463;
    --adm-soft: #233553;
    --adm-blue: #87adff;
}
body.admin-view > header, body.admin-view #desktopSidebar, body.admin-view #desktopRightSidebar { display: none !important; }
body.admin-view #siteLayout { max-width: none; padding: 0; }
.adm-shell { min-height: 100dvh; color: var(--adm-ink); display: grid; grid-template-columns: 214px minmax(0,1fr); grid-template-rows: auto 1fr; }
.adm-shell [hidden] { display: none !important; }
.adm-shell :focus-visible { outline: 2px solid var(--adm-blue); outline-offset: 3px; }
.adm-top { grid-column: 1/-1; background: var(--adm-card); border-bottom: 1px solid var(--adm-border); position: sticky; top: 0; z-index: 45; min-height: 72px; padding: 12px 24px; display: flex; align-items: center; gap: 20px; }
.adm-brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.adm-brand strong { display: block; font-size: 1.35rem; color: var(--adm-blue); line-height: 1.3; overflow-wrap: anywhere; }
.adm-brand small, .adm-account small, .adm-person small { display: block; color: var(--adm-muted); }
.adm-logo { width: 44px; height: 38px; border-radius: 12px 12px 12px 4px; background: #1150ed; color: #fff; display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.adm-logo img { width: 100%; height: 100%; object-fit: contain; }
.adm-global-search { flex: 1; margin-inline: auto; max-width: 580px; display: flex; padding: 0 11px; gap: 8px; align-items: center; border: 1px solid var(--adm-border); background: var(--adm-bg); border-radius: 12px; }
.adm-global-search span { font-size: 1.35rem; color: var(--adm-blue); }
.adm-global-search input { flex: 1; min-width: 0; padding: 9px 0; background: transparent; }
.adm-global-search button { padding: 0 6px; font-size: 1.25rem; }
.adm-top-reports { font-size: 1.45rem; position: relative; }
.adm-top-reports i { position: absolute; top: 4px; right: -2px; width: 8px; height: 8px; background: #e5334f; border-radius: 50%; }
.adm-report-callout { display: none; }
.adm-account { position: relative; flex-shrink: 0; }
.adm-account summary { list-style: none; display: flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 700; }
.adm-account summary::-webkit-details-marker { display: none; }
.adm-account img, .adm-person img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--adm-soft); }
.adm-account > div { position: absolute; right: 0; min-width: 154px; padding: 8px; display: grid; background: var(--adm-card); border: 1px solid var(--adm-border); border-radius: 12px; box-shadow: 0 6px 24px #20355a22; }
.adm-account button { text-align: start; padding: 8px; }
.adm-sidebar { min-width: 0; padding: 20px 12px; border-right: 1px solid var(--adm-border); background: var(--adm-card); }
.adm-sidebar nav { position: sticky; top: 92px; max-height: calc(100dvh - 104px); overflow: auto; display: grid; gap: 4px; }
.adm-sidebar a, .adm-bottom a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; font-size: .94rem; font-weight: 650; min-height: 43px; overflow-wrap: anywhere; }
.adm-sidebar a span, .adm-bottom a span { font: 1.25rem system-ui,sans-serif; width: 23px; text-align: center; flex-shrink: 0; }
.adm-sidebar a:hover, .adm-bottom a:hover { background: var(--adm-soft); color: var(--adm-blue); }
.adm-sidebar [aria-current="page"], .adm-bottom [aria-current="page"] { color: #fff !important; background: #1150ed !important; }
.adm-nav-caption { margin: 13px 10px 4px; color: var(--adm-muted); font-size: .76rem; font-weight: 700; line-height: 1.6; }
.adm-main { width: 100%; max-width: 1600px; margin-inline: auto; padding: 19px clamp(14px,2.2vw,32px) 32px; min-width: 0; }
#adminPageContent { display: grid; gap: 13px; }
.adm-page-head h1 { font-size: clamp(1.55rem,3vw,2.12rem); font-weight: 800; line-height: 1.5; }
.adm-page-head p, .adm-muted { color: var(--adm-muted); font-size: .88rem; }
.adm-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.adm-card { background: var(--adm-card); border: 1px solid var(--adm-border); border-radius: 14px; min-width: 0; box-shadow: 0 2px 3px #263f7310; }
.adm-card-header { padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.adm-card-header h2 { font-size: 1.02rem; font-weight: 750; }
.adm-metric { min-height: 104px; padding: 14px; display: flex; align-items: flex-start; gap: 12px; }
a.adm-metric:hover { border-color: var(--adm-blue); }
.adm-metric-icon { border-radius: 10px; background: var(--adm-soft); color: var(--adm-blue); width: 38px; height: 38px; display: grid; place-items: center; flex-shrink: 0; font-size: 1.35rem; font-family: system-ui,sans-serif; }
.adm-metric-icon.danger, .adm-badge.danger { background: #ffe8ea; color: #991b25; }
.adm-metric strong { display: block; font-size: clamp(1.35rem,2.6vw,2rem); font-weight: 800; line-height: 1.15; }
.adm-metric small { display: block; font-weight: 650; line-height: 1.45; overflow-wrap: anywhere; }
.adm-overview-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 12px; }
.adm-two { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.adm-chart { padding: 0 12px 7px; }
.adm-chart svg { width: 100%; height: auto; }
.adm-chart text { fill: var(--adm-muted); font-size: 13px; }
.adm-breakdown { padding: 8px 16px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 15px; }
.adm-donut { width: 126px; aspect-ratio: 1; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; }
.adm-donut span { width: 67%; height: 67%; border-radius: 50%; background: var(--adm-card); align-content: center; text-align: center; display: grid; }
.adm-donut b { font-size: 1.45rem; line-height: 1.2; }
.adm-breakdown ul { flex: 1 1 155px; display: grid; gap: 7px; font-size: .86rem; }
.adm-breakdown li { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; gap: 8px; align-items: center; }
.adm-breakdown i { width: 9px; height: 9px; border-radius: 50%; }
.adm-table-wrap { overflow-x: auto; scrollbar-width: thin; }
.adm-table-wrap::-webkit-scrollbar { display: block; height: 7px; }
.adm-table-wrap table { border-collapse: collapse; width: 100%; font-size: .89rem; }
.adm-table-wrap thead { background: var(--adm-bg); }
.adm-table-wrap th, .adm-table-wrap td { padding: 9px 15px; text-align: start; overflow-wrap: anywhere; }
.adm-table-wrap tbody tr { border-top: 1px solid var(--adm-border); }
.adm-table-wrap th { color: var(--adm-muted); font-weight: 650; }
.adm-person { display: flex; gap: 8px; align-items: center; line-height: 1.3; }
.adm-badge { display: inline-block; font-size: .81rem; font-weight: 650; background: var(--adm-soft); border-radius: 99px; color: var(--adm-blue); padding: 4px 9px; white-space: nowrap; }
.adm-badge.warn { background: #fff0cf; color: #854800; }
.adm-button { display: inline-block; border: 1px solid var(--adm-border); background: var(--adm-card); border-radius: 8px; color: var(--adm-ink); padding: 7px 11px; min-height: 36px; font-weight: 650; font-size: .84rem; cursor: pointer; }
.adm-button:hover { border-color: var(--adm-blue); }
.adm-button.is-primary { background: #1150ed; border-color: #1150ed; color: #fff; }
.adm-button.is-danger { color: #a32d3c; background: #fff2f4; }
.adm-link { color: var(--adm-blue); font-weight: 650; background: none; }
.adm-link:hover { text-decoration: underline; }
.adm-actions, .adm-context, .adm-filters, .adm-more { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adm-more, .adm-filters, .adm-empty, .adm-form { padding: 12px 16px; }
.adm-empty { color: var(--adm-muted); }
.adm-form { display: grid; justify-items: start; gap: 13px; width: 100%; }
.adm-form.adm-actions { display: flex; }
.adm-fields { width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.adm-field { display: grid; gap: 5px; width: 100%; min-width: 0; font-size: .9rem; font-weight: 650; }
.adm-shell :is(select,textarea,.adm-field input,input[type="file"]) { max-width: 100%; background: var(--adm-card); color: var(--adm-ink); border: 1px solid var(--adm-border); border-radius: 8px; padding: 7px 9px; font: inherit; }
.adm-check { display: flex; align-items: center; gap: 9px; }
.adm-check input { accent-color: #1150ed; width: 17px; height: 17px; }
.adm-media { display: grid; grid-template-columns: repeat(auto-fill,minmax(145px,1fr)); gap: 10px; padding: 12px 16px; }
.adm-media article { display: grid; justify-items: start; gap: 6px; min-width: 0; border: 1px solid var(--adm-border); padding: 8px; border-radius: 10px; }
.adm-media a { min-width: 0; width: 100%; }
.adm-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--adm-bg); border-radius: 7px; }
.adm-media small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-brand-field { min-width: 0; display: grid; gap: 7px; }
.adm-brand-field img { width: 118px; height: 54px; object-fit: contain; background: var(--adm-bg); border-radius: 8px; }
.adm-bottom, .adm-menu-toggle, .adm-shade { display: none; }

@media (max-width: 1120px) {
    .adm-shell { grid-template-columns: 187px minmax(0,1fr); }
    .adm-metric { padding: 11px; gap: 8px; }
}
@media (max-width: 920px) {
    .adm-shell { grid-template-columns: 1fr; }
    .adm-top { gap: 10px; min-height: 64px; padding: 9px 14px; }
    .adm-menu-toggle { display: inline-grid; place-items: center; }
    .adm-sidebar { display: none; position: fixed; z-index: 49; inset: 64px auto 0 0; width: min(285px,84vw); overflow: auto; padding-bottom: 78px; }
    .adm-sidebar nav { position: static; max-height: none; }
    .adm-shell.drawer-open .adm-sidebar { display: block; }
    .adm-shade { display: block; position: fixed; inset: 64px 0 0; background: #111d36a0; z-index: 48; }
    .adm-main { padding-bottom: 86px; }
    .adm-bottom { display: flex; position: fixed; inset: auto 0 0; justify-content: space-evenly; z-index: 44; padding: 5px 4px max(5px,env(safe-area-inset-bottom)); background: var(--adm-card); border-top: 1px solid var(--adm-border); }
    .adm-bottom a { padding: 4px 7px; gap: 0; min-width: 44px; flex-direction: column; font-size: clamp(.65rem,2vw,.84rem); text-align: center; }
    .adm-bottom button { font-size: .75rem; }
}
@media (max-width: 670px) {
    .adm-top { flex-wrap: wrap; }
    .adm-global-search { order: 4; flex: 1 0 100%; max-width: none; }
    .adm-brand { flex: 1; }
    .adm-brand small, .adm-account summary span, .adm-top-reports { display: none; }
    .adm-sidebar, .adm-shade { top: 101px; }
    .adm-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
    .adm-metric { min-height: 82px; }
    .adm-metric-icon { width: 30px; height: 30px; }
    .adm-report-callout { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px; background: #fff0f1; border: 1px solid #f4c8ce; color: #8d1a2a; border-radius: 12px; }
    .adm-report-callout p { font-size: .84rem; }
    .adm-overview-grid, .adm-two, .adm-fields { grid-template-columns: minmax(0,1fr); }
    .adm-table-wrap table,.adm-table-wrap tbody,.adm-table-wrap tr,.adm-table-wrap td { display: block; width: 100%; }
    .adm-table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .adm-table-wrap tr { padding: 7px 0; }
    .adm-table-wrap td { display: grid; grid-template-columns: minmax(80px,29%) minmax(0,1fr); gap: 9px; padding: 4px 12px; }
    .adm-table-wrap td::before { content: attr(data-label); color: var(--adm-muted); font-size: .8rem; }
    .adm-table-wrap td > .adm-badge { justify-self: start; }
}
