/* Shared, compact controls for every BackOffice page. */
:root { --admin-sidebar-width: 238px; --paper: #f5f7f6; --admin-border: #e3e9e6; }
.admin-body { font-size: .84rem; line-height: 1.8; }
.admin-topbar { min-height: 70px; padding: .7rem 1.4rem; background: #ffffffed; border-color: var(--admin-border); }
.admin-topbar__heading h1 { font-size: 1.05rem; line-height: 1.7; }
.admin-topbar__heading .small { font-size: .66rem; }
.admin-topbar__actions { gap: .5rem; }
.admin-user { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #738078; font-size: .72rem; }
.admin-brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; }
.admin-brand:hover { color: #fff; }
.admin-brand img, .admin-login__brand img { object-fit: contain; flex: 0 0 auto; background: #fff; padding: 5px; border-radius: 10px; }
.admin-brand span { font-size: .9rem; font-weight: 600; }
.admin-brand small { display: block; margin-top: .15rem; font-weight: 400; font-size: .66rem; color: #b6c9c2; }
.admin-sidebar__brand { padding: 1rem 1.1rem; }
.admin-sidebar__nav.offcanvas-body { padding: .75rem; }
.admin-nav-link, .admin-nav-group { padding: .6rem .75rem; border-radius: .55rem; font-size: .8rem; gap: .6rem; }
.admin-nav-link:hover { transform: none; }
.admin-nav-link--child { font-size: .75rem; padding: .45rem .6rem; }
.admin-content { padding: 1.4rem; }
.admin-panel { border-color: var(--admin-border); border-radius: .8rem; box-shadow: 0 3px 14px #173c2f04; }
.admin-content .admin-panel.p-4 { padding: 1.15rem !important; }
.admin-content :is(h1.h3, h2.h3) { font-size: 1.2rem; }
.admin-content .h5 { font-size: .95rem; }
.admin-content .h6 { font-size: .84rem; }
.admin-content .btn, .admin-topbar .btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 36px; padding: .4rem .75rem; font-size: .78rem; line-height: 1.5; border-radius: .5rem; box-shadow: none; }
.admin-content .btn-sm { min-height: 32px; padding: .3rem .55rem; font-size: .73rem; }
.admin-content .btn-dark { --bs-btn-bg: #214f40; --bs-btn-border-color: #214f40; --bs-btn-hover-bg: #173d30; --bs-btn-hover-border-color: #173d30; }
.admin-content .btn-outline-dark { --bs-btn-color: #3d5d50; --bs-btn-border-color: #cbd8d1; --bs-btn-hover-bg: #edf4f0; --bs-btn-hover-color: #214f40; --bs-btn-hover-border-color: #a9c2b4; }
.admin-content .rounded-pill { border-radius: .5rem !important; }
.admin-body .admin-icon-button { width: 36px; height: 36px; flex: 0 0 auto; padding: 0; color: #4e695c; background: #f7faf8; border: 1px solid #dfe7e2; border-radius: .55rem; }
.admin-icon-button:hover { background: #eaf2ed; color: #214f40; border-color: #b9ccbf; }
.admin-icon-button--danger:hover { color: #a83c44; background: #fff0f1; border-color: #e9bfc4; }
.admin-body :is(button, a, input, select, textarea):focus-visible { outline: 2px solid #47836c; outline-offset: 3px; }
.admin-content :is(.form-control, .form-select) { min-height: 36px; font-size: .8rem; border-color: #dce5df; border-radius: .5rem; }
.admin-content textarea.form-control { min-height: 80px; }
.admin-content .form-label { font-size: .76rem; color: #52655a; margin-bottom: .35rem; }
.admin-content .table { font-size: .79rem; --bs-table-border-color: #eaf0ec; }
.admin-content .table > :not(caption) > * > * { padding: .7rem .6rem; }
.admin-content .table thead { color: #6c7d73; background: #f8faf9; }
.admin-content .table th { font-size: .72rem; font-weight: 600; }
.admin-content .table td .btn, .cms-row .btn { flex-shrink: 0; }
.admin-content .badge { font-size: .67rem; font-weight: 500; line-height: 1.5; }
.admin-content .d-flex > :is(div, form), .cms-row > div { min-width: 0; }
.admin-content .d-flex:has(> .btn) { gap: .5rem; }
.cms-row { padding: .8rem 0; gap: .7rem; }
.cms-row > .d-flex { flex-wrap: wrap; }
.cms-setting-form { grid-template-columns: minmax(120px, .9fr) repeat(3, minmax(0, 1fr)) auto; }
.cms-setting-form > * { min-width: 0; }
.dashboard-page { gap: 1.2rem; }
.dashboard-overview { padding: 1.2rem 1.3rem; border-radius: .8rem; }
.dashboard-overview h2 { font-size: 1.2rem; }
.dashboard-overview p { font-size: .78rem; }
.dashboard-metric { min-height: 118px; padding: 1rem; border-radius: .8rem; box-shadow: none; }
.dashboard-metric__icon { width: 36px; height: 36px; border-radius: .6rem; font-size: 1rem; }
.dashboard-metric__content strong { font-size: 1.65rem; }
.dashboard-panel { min-height: 240px; border-radius: .8rem; }
.dashboard-panel__header { min-height: 68px; padding: .85rem 1rem; gap: .65rem; }
.dashboard-panel__header h2 { font-size: .82rem; }
.dashboard-panel__body { padding-inline: 1rem; }
.dashboard-empty { min-height: 150px; }
.dashboard-trends:not(:has(.dashboard-chart)) { display: none; }
.dashboard-trends__heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .8rem; }
.dashboard-trends__heading h2 { margin: 0 0 .25rem; font-size: .95rem; }
.dashboard-trends__heading p { margin: 0; color: #7b8880; font-size: .7rem; }
.dashboard-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.dashboard-chart { min-width: 0; padding: 1rem; }
.dashboard-chart__header, .dashboard-chart__header > div { display: flex; align-items: center; gap: .55rem; }
.dashboard-chart__header { justify-content: space-between; }
.dashboard-chart__header > div { min-width: 0; color: #315d49; }
.dashboard-chart__header h3 { font-size: .83rem; margin: 0; color: #314b3f; }
.dashboard-chart__caption { font-size: .68rem; color: #7b8880; margin: .3rem 0 .8rem; }
.dashboard-chart__canvas { height: 210px; min-width: 0; position: relative; direction: ltr; }
.dashboard-chart__canvas > div { max-width: 100%; }
.dashboard-chart__placeholder { display: grid; place-items: center; height: 100%; border-radius: .5rem; background: #f6f9f7; color: #7b8880; font-size: .74rem; text-align: center; padding: 1rem; }
.dashboard-chart[aria-busy="true"] .dashboard-chart__placeholder { opacity: .65; }
.dashboard-chart__status { min-height: 1.8em; margin-top: .6rem; color: #7b8880; font-size: .67rem; }
.dashboard-chart__actions { display: flex; justify-content: flex-end; margin-top: .5rem; }
.dashboard-data-modal .modal-content { border: 1px solid var(--admin-border); border-radius: .85rem; }
.dashboard-data-modal .modal-header, .dashboard-data-modal .modal-footer { padding: .85rem 1rem; border-color: var(--admin-border); gap: .75rem; }
.dashboard-data-modal .modal-title { font-size: .95rem; }
.dashboard-data-modal .modal-body { padding: 1rem; }
.dashboard-data-modal .table-responsive { overflow: visible; }
.dashboard-data-modal .modal-body > p, .dashboard-data-modal .modal-footer { color: #718176; font-size: .75rem; }
.dashboard-data-modal .table { font-size: .8rem; --bs-table-border-color: #eaf0ec; margin: 0; }
.dashboard-data-modal thead th { color: #52685a; background: #f7faf8; font-weight: 600; }
.dashboard-data-modal .btn { display: inline-flex; align-items: center; gap: .4rem; border-radius: .5rem; font-size: .76rem; }
.admin-feedback { position: fixed; z-index: 1100; inset-inline-end: 1.25rem; bottom: 1.25rem; max-width: min(400px, calc(100vw - 2rem)); padding: .8rem 1rem; border: 1px solid #c3d9ca; border-radius: .65rem; background: #f1faf4; color: #265c3d; box-shadow: 0 4px 24px #172b2314; font-size: .8rem; }
.admin-feedback[data-error="true"] { border-color: #ebc3c3; color: #9a3434; background: #fff4f4; }
.admin-content[aria-busy="true"] { cursor: progress; }
.admin-content form[aria-busy="true"] { opacity: .65; }
.admin-login__message h1 { font-size: clamp(1.45rem, 2.5vw, 2rem); }
.admin-login__card { padding: 2rem; border-radius: 16px; box-shadow: 0 12px 36px #15372f0c; }
.admin-login__card h2 { font-size: 1.2rem; }
@media (max-width: 1199.98px) {
  .cms-setting-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cms-setting-form > div { grid-column: 1 / -1; }
}
@media (max-width: 767.98px) {
  .dashboard-chart-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-content { padding: 1rem; }
  .admin-topbar { padding: .6rem 1rem; min-height: 64px; }
  .admin-menu-toggle { width: 36px; height: 36px; border-radius: .55rem; font-size: 1.2rem; }
  .admin-content .d-flex:not(.input-group):not(.btn-group):not(.table .d-flex) { flex-wrap: wrap; }
  .admin-topbar__heading h1 { font-size: .9rem !important; }
  .admin-content .row.g-4 { --bs-gutter-y: 1rem; --bs-gutter-x: 1rem; }
}
@media (max-width: 575.98px) {
  .admin-topbar { padding-inline: .75rem; gap: .4rem; }
  .admin-topbar__heading, .admin-topbar__actions { gap: .4rem; }
  .admin-content { padding: .85rem; }
  .dashboard-overview { padding: 1rem; }
  .admin-content .row.dashboard-metrics > .col-6:not(.col-auto) { width: 50%; flex: 0 0 auto; }
  .dashboard-metric { grid-template-columns: minmax(0, 1fr); min-height: 132px; padding: .8rem; }
  .dashboard-metric__icon { position: absolute; inset-inline-end: .65rem; top: .65rem; width: 28px; height: 28px; font-size: .85rem; }
  .dashboard-metric__label { padding-inline-end: 1.8rem; font-size: .68rem; min-height: 28px; }
  .dashboard-metric__content small { font-size: .66rem; }
  .dashboard-metric__arrow { display: none; }
  .dashboard-chart-grid { gap: .8rem; }
  .dashboard-chart { padding: .85rem; }
  .dashboard-chart__canvas { height: 190px; }
  .cms-setting-form { grid-template-columns: minmax(0, 1fr); }
  .admin-login__card { padding: 1.5rem; }
  .admin-content .btn { min-height: 38px; }
}
