:root {
    --navy: #0f2a47;
    --navy-dark: #0a1f36;
    --red: #e2231a;
    --red-dark: #c01912;
    --bg: #f2f5fa;
    --card: #ffffff;
    --border: #e8ecf2;
    --text: #1a2b3c;
    --text-muted: #6b7a8d;

    --tone-blue-bg: #e8f1fe;
    --tone-blue-fg: #2f80ed;
    --tone-green-bg: #e7f8ee;
    --tone-green-fg: #219653;
    --tone-red-bg: #fdeaea;
    --tone-red-fg: #eb5757;
    --tone-purple-bg: #f1eafb;
    --tone-purple-fg: #8e44ad;
    --tone-pink-bg: #fdeaf3;
    --tone-pink-fg: #eb5797;
    --tone-navy-bg: #dce6f1;
    --tone-navy-fg: #0f2a47;
    --tone-teal-bg: #e1f7f5;
    --tone-teal-fg: #17a398;
    --tone-orange-bg: #fff1e0;
    --tone-orange-fg: #f2994a;

    --header-height: 64px;
    --sidebar-width: 232px;
    --bottom-nav-height: 62px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
}

.icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.icon--dots {
    fill: currentColor;
    stroke: none;
}

.icon--rupee {
    font-style: normal;
    font-weight: 800;
    line-height: 1;
    stroke: none;
}

/* ---------------------------------------------------------------- */
/* App shell                                                        */
/* ---------------------------------------------------------------- */

.app-shell {
    min-height: 100vh;
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    z-index: 40;
}

.topbar__logo img {
    height: 32px;
    display: block;
}

.topbar__menu-btn {
    background: none;
    border: none;
    color: var(--text);
    padding: 6px;
    display: flex;
    border-radius: 8px;
}

.topbar__menu-btn:hover {
    background: var(--bg);
}

.topbar__search {
    flex: 1;
    max-width: 460px;
    display: none;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border-radius: 999px;
    padding: 9px 16px;
    color: var(--text-muted);
}

/* Below the 1024px breakpoint, .topbar__search has no room next to the
   logo/menu button -- .topbar__search-toggle (see admin/partials/header.php,
   dashboard.js) opens it as a dropdown panel instead, anchored under the
   fixed topbar rather than inline with it. */
.topbar__search.is-open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    max-width: none;
    margin-top: 8px;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 42, 71, 0.12);
    z-index: 45;
}

.topbar__search input {
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    width: 100%;
    color: var(--text);
}

.topbar__search-btn {
    display: flex;
    align-items: center;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    color: inherit;
    cursor: pointer;
}

.topbar__spacer {
    flex: 1;
}

.topbar__right {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.icon-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 6px;
    border-radius: 8px;
    display: flex;
}

.icon-btn:hover {
    background: var(--bg);
}

.icon-btn__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 999px;
}

.branch-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    flex-shrink: 0;
}

.branch-pill .icon {
    width: 16px;
    height: 16px;
    color: var(--red);
}

/* Rendered in the fixed-width header topbar on every screen size (see
   admin/partials/header.php) -- bound the label so a long branch name (or
   "N Branches") can't push other header controls off a narrow viewport. */
.branch-pill span[data-branch-label] {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

@media (max-width: 479px) {
    .branch-pill {
        padding: 7px 10px;
    }

    .branch-pill span[data-branch-label] {
        max-width: 48px;
    }
}

/* Branch filter dropdown (see admin/partials/branch_selector.php) */

.branch-selector {
    position: relative;
    display: inline-flex;
}

.branch-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    min-width: 220px;
    max-width: 280px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 42, 71, 0.12);
    padding: 10px;
}

.branch-menu__form {
    display: flex;
    flex-direction: column;
}

.branch-menu__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
}

.branch-menu__option:hover {
    background: var(--bg);
}

.branch-menu__option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.branch-menu__option--all {
    font-weight: 700;
}

.branch-menu__divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 6px 0;
}

.branch-menu__empty {
    padding: 8px 6px;
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.branch-menu__actions {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.profile {
    display: none;
    align-items: center;
    gap: 10px;
}

.profile__avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--tone-navy-bg);
    color: var(--tone-navy-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.profile__meta {
    line-height: 1.2;
}

.profile__name {
    font-size: 13px;
    font-weight: 700;
}

.profile__role {
    font-size: 12px;
    color: var(--text-muted);
}

.topbar__avatar-btn {
    display: flex;
    background: none;
    border: none;
    padding: 0;
}

/* ---------------------------------------------------------------- */
/* Sidebar                                                          */
/* ---------------------------------------------------------------- */

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 35, 0.5);
    z-index: 45;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.sidebar-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--navy);
    color: #cfd9e6;
    overflow-y: auto;
    z-index: 46;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    display: flex;
    flex-direction: column;
    padding: 14px 0;
}

.sidebar.is-open {
    transform: translateX(0);
}

.sidebar__nav {
    list-style: none;
    margin: 0;
    padding: 0 12px;
    flex: 1;
}

.sidebar__nav li + li {
    margin-top: 2px;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #cfd9e6;
}

.sidebar__link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.sidebar__link.is-active {
    background: var(--red);
    color: #fff;
    font-weight: 600;
}

.sidebar__link .icon {
    width: 18px;
    height: 18px;
}

.sidebar__chevron {
    margin-left: auto;
    width: 14px;
    height: 14px;
    opacity: 0.7;
    transition: transform 0.15s ease;
}

.sidebar__group-toggle {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.sidebar__group .sidebar__submenu {
    list-style: none;
    margin: 2px 0 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.18s ease;
}

.sidebar__group.is-open .sidebar__submenu {
    max-height: 500px;
}

.sidebar__group.is-open .sidebar__chevron {
    transform: rotate(180deg);
}

.sidebar__submenu li + li {
    margin-top: 2px;
}

.sidebar__link--sub {
    padding-left: 38px;
    font-size: 13.5px;
}

.sidebar__divider {
    margin: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-form {
    display: inline-flex;
    margin: 0;
}

.sidebar__footer {
    margin-top: 20px;
    padding: 18px 20px 22px;
    text-align: center;
    color: rgba(207, 217, 230, 0.55);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__footer .icon {
    width: 34px;
    height: 34px;
    margin-bottom: 8px;
    stroke: rgba(207, 217, 230, 0.55);
}

.sidebar__footer p {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

/* ---------------------------------------------------------------- */
/* Main content                                                     */
/* ---------------------------------------------------------------- */

.main {
    padding-top: var(--header-height);
    padding-bottom: calc(var(--bottom-nav-height) + 20px);
    min-height: 100vh;
}

.content {
    padding: 20px 16px 32px;
    max-width: 1400px;
    margin: 0 auto;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.page-head h1 {
    font-size: 22px;
    margin: 0 0 4px;
}

.page-head p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.page-head__date {
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.page-head__date .icon {
    width: 16px;
    height: 16px;
    color: var(--red);
}

.branch-pill--inline {
    display: inline-flex;
    margin-top: 8px;
}

/* Stat cards */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    background: var(--card);
    border-radius: 14px;
    border: 1px solid var(--border);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-card__icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card__icon .icon {
    width: 22px;
    height: 22px;
}

.stat-card__value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card__label {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 2px 0 4px;
}

.stat-card__trend {
    font-size: 12px;
    font-weight: 700;
    color: var(--tone-green-fg);
}

.tone-blue { background: var(--tone-blue-bg); color: var(--tone-blue-fg); }
.tone-green { background: var(--tone-green-bg); color: var(--tone-green-fg); }
.tone-red { background: var(--tone-red-bg); color: var(--tone-red-fg); }
.tone-purple { background: var(--tone-purple-bg); color: var(--tone-purple-fg); }
.tone-pink { background: var(--tone-pink-bg); color: var(--tone-pink-fg); }
.tone-navy { background: var(--tone-navy-bg); color: var(--tone-navy-fg); }
.tone-teal { background: var(--tone-teal-bg); color: var(--tone-teal-fg); }
.tone-orange { background: var(--tone-orange-bg); color: var(--tone-orange-fg); }

/* Panels */

.panels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
}

.panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.panel__head h2 {
    font-size: 15px;
    margin: 0;
}

.panel__link {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--red);
}

.panel__select {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 10px;
    background: var(--card);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.badge {
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge--checked-in { background: var(--tone-green-bg); color: var(--tone-green-fg); }
.badge--waiting { background: var(--tone-orange-bg); color: var(--tone-orange-fg); }
.badge--consultation { background: var(--tone-blue-bg); color: var(--tone-blue-fg); }
.badge--scheduled { background: var(--tone-purple-bg); color: var(--tone-purple-fg); }
.badge--low-stock { background: var(--tone-orange-bg); color: var(--tone-orange-fg); }
.badge--out-of-stock { background: var(--tone-red-bg); color: var(--tone-red-fg); }
.badge--expiring-soon { background: var(--tone-blue-bg); color: var(--tone-blue-fg); }
.badge--pending { background: var(--tone-navy-bg); color: var(--tone-navy-fg); }
.badge--declined { background: var(--tone-red-bg); color: var(--tone-red-fg); }

/* Chart */

.chart-wrap {
    width: 100%;
}

.chart-wrap svg {
    width: 100%;
    height: auto;
    display: block;
}

.chart-day-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

/* The fixed topbar would otherwise cover the top of either widget right
   after a date-range jump (see admin/partials/date_range_select.php's
   '#patient-status-widget'/'#patient-type-widget' anchor) -- this reserves
   that much space above the target when the browser scrolls it into view,
   the same way '.main' already offsets its own top padding. */
#patient-status-widget,
#patient-type-widget {
    scroll-margin-top: calc(var(--header-height) + 16px);
}

/* Shared "per-clinic + optional Combined summary" card grid used by both
   the Patients-by-Status donut widget and the Patients-by-Type stacked-bar
   widget (see Home::patientBreakdownWidgets() / admin/partials/
   patient_status_widget.php / patient_type_widget.php). One card per
   clinic for a super_admin, or a single card for everyone else. */

.widget-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.widget-card + .widget-card {
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.widget-card__title {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* The one extra "sum of every selected clinic" card a super_admin sees
   above the per-clinic breakdown when more than one branch is selected
   (see Home::patientBreakdownWidgets()) -- spans the full card grid and
   gets a tinted background so it reads as the headline total, not just
   another clinic in the list. */
.widget-card--summary {
    grid-column: 1 / -1;
    background: var(--bg);
    border-radius: 12px;
    padding: 16px;
    margin: -4px -4px 4px;
}

.widget-card--summary.widget-card + .widget-card {
    border-top: none;
    padding-top: 0;
}

.widget-card__badge {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tone-blue-fg);
    background: var(--tone-blue-bg);
    padding: 2px 8px;
    border-radius: 999px;
}

/* Shared legend list (swatch + label + count), reused by both widgets. */

.widget-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.widget-legend__row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    padding: 4px 6px;
    margin: 0 -6px;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

.widget-legend__row:hover {
    background: var(--bg);
}

.widget-legend__swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.widget-legend__label {
    flex: 1;
    min-width: 0;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.widget-legend__count {
    font-weight: 700;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .widget-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .widget-card + .widget-card {
        padding-top: 0;
        border-top: none;
    }
}

/* Patients-by-status donut chart itself -- the one part of that widget NOT
   shared with patient_type_widget.php (which draws a bar instead). */

.status-donut {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.status-donut__chart {
    flex-shrink: 0;
}

.status-donut__total {
    font-size: 28px;
    font-weight: 700;
    fill: var(--text);
}

/* Patients-by-type stacked bar -- the one part of that widget NOT shared
   with patient_status_widget.php (which draws a donut instead). A single
   horizontal bar split into New/Follow-up segments, each sized by its
   share of the card's total and clickable through to the filtered list,
   same no-charting-library approach as the SVG donut/line charts. */

.type-bar {
    display: flex;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg);
    margin-bottom: 14px;
}

.type-bar__segment {
    display: block;
    height: 100%;
    transition: opacity 0.15s;
}

.type-bar__segment:hover {
    opacity: 0.85;
}

/* Stock alert list */

.stock-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.stock-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stock-row__icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--tone-orange-bg);
    color: var(--tone-orange-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stock-row__icon .icon {
    width: 17px;
    height: 17px;
}

.stock-row__info {
    flex: 1;
    min-width: 0;
}

.stock-row__name {
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stock-row__left {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Branch overview (scoped to the current branch filter selection) */

.panel--branches {
    margin-bottom: 14px;
}

.panel__hint {
    font-size: 12.5px;
    color: var(--text-muted);
}

.panel__empty {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
}

.branch-overview-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.branch-overview-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.branch-overview-row__icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--tone-red-bg);
    color: var(--tone-red-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.branch-overview-row__icon .icon {
    width: 17px;
    height: 17px;
}

.branch-overview-row__info {
    flex: 1;
    min-width: 0;
}

.branch-overview-row__name {
    font-size: 13.5px;
    font-weight: 700;
}

.branch-overview-row__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

.branch-overview-row__meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.branch-overview-row__meta .icon {
    width: 13px;
    height: 13px;
}

@media (min-width: 768px) {
    .branch-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .branch-overview-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Quick actions */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.quick-action {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.quick-action:hover {
    border-color: var(--red);
}

.quick-action__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--tone-blue-bg);
    color: var(--tone-blue-fg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-action__label {
    font-size: 12.5px;
    font-weight: 700;
}

/* ---------------------------------------------------------------- */
/* Mobile bottom nav                                                 */
/* ---------------------------------------------------------------- */

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--bottom-nav-height);
    background: var(--card);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    z-index: 40;
}

.bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 6px 0;
}

.bottom-nav__item.is-active {
    color: var(--red);
}

.bottom-nav__fab-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.bottom-nav__fab {
    position: absolute;
    top: -22px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(226, 35, 26, 0.4);
    border: none;
}

.bottom-nav__fab .icon {
    width: 24px;
    height: 24px;
    stroke-width: 2.2;
}

/* ---------------------------------------------------------------- */
/* Breakpoints                                                       */
/* ---------------------------------------------------------------- */

/* Tablet and up: sidebar becomes off-canvas via hamburger, no bottom nav */
@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }

    .main {
        padding-bottom: 24px;
    }

    .content {
        padding: 28px 28px 40px;
    }

    .stats-grid {
        gap: 16px;
    }

    .profile {
        display: flex;
    }
}

/* Desktop: static sidebar, full header, multi-column layout */
@media (min-width: 1024px) {
    .topbar__menu-btn {
        display: none;
    }

    .topbar__search {
        display: flex;
        position: static;
        max-width: 460px;
        margin-top: 0;
        box-shadow: none;
    }

    .topbar__search-toggle {
        display: none;
    }

    .sidebar {
        transform: translateX(0);
        position: fixed;
    }

    .sidebar-overlay {
        display: none;
    }

    .main {
        margin-left: var(--sidebar-width);
    }

    .page-head__date {
        display: inline-flex;
    }

    .branch-pill--inline {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .panels {
        grid-template-columns: 1.7fr 1.3fr 1.3fr;
        align-items: start;
    }

    /* Patients-by-Status and Patients-by-Type sit together as a full-width
       stacked pair at the top of the dashboard (in that DOM order -- see
       dashboard/index.php), each spanning every column so their own
       per-clinic card grids have the full width to lay out in, rather than
       being squeezed into a single 1.3fr column like the smaller
       single-chart panels below them. */
    .panels .panel--status-donut,
    .panels .panel--type-bar {
        grid-column: 1 / -1;
    }

    .quick-actions {
        grid-template-columns: repeat(4, 1fr);
        grid-column: 1;
    }
}

@media (min-width: 1280px) {
    .content {
        padding: 32px 40px 48px;
    }
}
