/**
 * ============================================================================
 * MUAADH SHELL — Layout primitives
 * ============================================================================
 *
 * Shell-related rules extracted from muaadh-core.css in Phase 3 Wave 2
 * (2026-05-13).
 *
 * Owns:
 *   - Section 2: LAYOUT GRID (.muaadh-shell-layout, .muaadh-shell-main,
 *                .muaadh-shell-content, .muaadh-shell-overlay)
 *   - Section 3: SIDEBAR STYLES
 *   - Section 4: TOPBAR STYLES
 *   - Section 5: FOOTER STYLES
 *
 * Loaded on every page via shell layouts. Order matters: this file MUST
 * load AFTER muaadh-tokens.css + muaadh-chassis.css (it consumes both)
 * and BEFORE muaadh-core.css (the remaining core uses some shell tokens).
 * ============================================================================
 */

/* ===== 2. LAYOUT GRID ===== */
.muaadh-shell-layout {
    display: flex;
    min-height: 100vh;
}
.muaadh-shell-sidebar {
    position: fixed;
    top: var(--m-topbar-h);
    inset-inline-start: 0;
    bottom: 0;
    width: 280px;
    background: var(--theme-sidebar-bg);
    color: var(--theme-sidebar-text);
    z-index: 10090;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease;
    overflow-x: clip;
    overflow-y: auto;
    /* Closed = slid off the inline-start edge. transform: translateX
       does NOT mirror with dir="rtl" (it's a physical axis), so the
       :dir(rtl) override flips the slide direction. The .open state
       (translateX(0)) is direction-neutral. */
    transform: translateX(-100%);
    border-inline-end: var(--chassis-border-thin) solid var(--theme-sidebar-border);
}
.muaadh-shell-sidebar:dir(rtl) {
    transform: translateX(100%);
}
.muaadh-shell-sidebar.open {
    transform: translateX(0);
}
/* Sidebar is overlay-only on EVERY breakpoint (rebuild 2026-04-30).
   The hamburger in the topbar is the single trigger; clicking the overlay
   or a link closes it. No desktop "always-open" mode — gives the main
   content full width on every page (front and admin). The pre-rebuild
   `@media (min-width: 768px)` block that pushed admin .muaadh-shell-main by 280px
   was deleted along with the desktop-pinned sidebar. */
.muaadh-shell-main {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    margin-left: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.muaadh-shell-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10100;
    background: var(--theme-header-bg);
    /* Notion-style: clean at top of page, subtle border + shadow appear
       only after the user starts scrolling. The transparent border keeps
       the layout height stable so toggling --scrolled doesn't shift content.
       Toggle is JS-bound: see resources/js/modules/shell.js. */
    border-bottom: var(--chassis-border-thin) solid transparent;
    box-shadow: none;
    transition:
        border-bottom-color var(--chassis-duration-normal) ease,
        box-shadow var(--chassis-duration-normal) ease;
    height: var(--m-topbar-h);
    display: flex;
    align-items: center;
    padding: 0 var(--space-6);
    gap: var(--space-4);
    /* No width:100% — left:0 + right:0 handles width.
       width:100% would shift when Bootstrap adds body padding-right for modals. */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
/* Notion-style scroll affordance — JS toggles this class when window.scrollY > 8 */
.muaadh-shell-topbar--scrolled {
    border-bottom-color: var(--theme-border-light);
    box-shadow: var(--chassis-shadow-header);
}
.muaadh-shell-content {
    flex: 1;
    /* Inline / bottom = space-4 (visual padding around content), top has a
     * compensation calc so the first child clears the position:fixed topbar.
     * NEVER replace the calc with a `padding:` shorthand — that would clobber
     * the topbar offset and the breadcrumb would slide UNDER the topbar
     * (owner-flagged 2026-05-07 from Home_d.png + breadcrumb screenshots).
     * Phase G' merged the former responsive override (padding-inline +
     * padding-bottom = space-4 at line ~7400) into this canonical block. */
    padding: var(--space-4);
    padding-top: calc(var(--space-6) + var(--m-topbar-h));
    background: var(--theme-bg-body);
    /* `clip` prevents horizontal overflow without creating a scroll
     * container — `hidden` would force overflow-y to auto per CSS spec,
     * causing a duplicate scrollbar AND clipping absolutely-positioned
     * descendants like the search-hub suggestions dropdown. */
    overflow-x: clip;
}
.muaadh-shell-footer {
    background: var(--theme-footer-bg);
    color: var(--theme-footer-text);
    padding: var(--chassis-footer-padding) 0 0;
}
/* ===== 3. SIDEBAR STYLES ===== */
/* Sidebar Nav */
.muaadh-shell-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: clip;
    padding: var(--space-2) 0;
    scrollbar-width: thin;
    scrollbar-color: var(--theme-sidebar-border) transparent;
}
.muaadh-shell-sidebar__nav::-webkit-scrollbar {
    width: 12px;
}
.muaadh-shell-sidebar__nav::-webkit-scrollbar-thumb {
    background: var(--theme-sidebar-border);
    border-radius: var(--chassis-radius-sm);
}
/* Sidebar Section */
.muaadh-shell-sidebar__section {
    margin-bottom: var(--space-1);
}
.muaadh-shell-sidebar__section-title {
    padding: var(--space-3) var(--space-5) 6px;
    font-size: var(--text-xs);
    font-weight: var(--theme-font-bold);
    text-transform: uppercase;
    letter-spacing: var(--theme-letter-spacing-wide);
    color: var(--theme-sidebar-section-text);
    white-space: nowrap;
    overflow: hidden;
}
/* Sidebar Items */
.muaadh-shell-sidebar__item {
    display: block;
}
.muaadh-shell-sidebar__link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 11px var(--space-5);
    color: var(--theme-sidebar-text);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: var(--theme-font-medium);
    white-space: nowrap;
    transition: all var(--chassis-duration-fast) ease;
    border-left: var(--chassis-border-thick) solid transparent;
    position: relative;
}
.muaadh-shell-sidebar__link:hover {
    color: var(--theme-sidebar-text-hover);
    background: var(--theme-sidebar-hover-bg);
    text-decoration: none;
}
.muaadh-shell-sidebar__link.active {
    color: var(--theme-sidebar-text-hover);
    background: var(--theme-sidebar-active-bg);
    border-left-color: var(--theme-primary);
}
.muaadh-shell-sidebar__icon {
    width: var(--size-control-xxs);
    height: var(--size-control-xxs);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.muaadh-shell-sidebar__icon svg {
    width: var(--size-control-xxs);
    height: var(--size-control-xxs);
}
.muaadh-shell-sidebar__icon svg path,
.muaadh-shell-sidebar__icon svg circle,
.muaadh-shell-sidebar__icon svg rect {
    stroke: currentColor;
}
.muaadh-shell-sidebar__icon svg [fill]:not([fill="none"]) {
    fill: currentColor;
}
.muaadh-shell-sidebar__icon i {
    font-size: var(--text-base);
    width: var(--size-control-xxs);
    text-align: center;
}
.muaadh-shell-sidebar__label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Submenu Toggle */
.muaadh-shell-sidebar__toggle {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 11px var(--space-5);
    color: var(--theme-sidebar-text);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: var(--theme-font-medium);
    white-space: nowrap;
    transition: all var(--chassis-duration-fast) ease;
    border-left: var(--chassis-border-thick) solid transparent;
    width: 100%;
    background: none;
    border-top: none;
    border-right: none;
    border-bottom: none;
    cursor: pointer;
    text-align: left;
}
.muaadh-shell-sidebar__toggle:hover {
    color: var(--theme-sidebar-text-hover);
    background: var(--theme-sidebar-hover-bg);
}
.muaadh-shell-sidebar__toggle.active {
    color: var(--theme-sidebar-text-hover);
    background: var(--theme-sidebar-hover-bg);
}
.muaadh-shell-sidebar__arrow {
    margin-left: auto;
    font-size: var(--text-xs);
    transition: transform var(--chassis-duration-quick) ease;
}
.muaadh-shell-sidebar__toggle[aria-expanded="true"] .muaadh-shell-sidebar__arrow {
    transform: rotate(180deg);
}
/* Submenu */
.muaadh-shell-sidebar__submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
}
.muaadh-shell-sidebar__submenu.muaadh-state--show {
    max-height: 600px;
}
.muaadh-shell-sidebar__submenu a {
    display: block;
    padding: 7px var(--space-5) 7px 56px;
    color: var(--theme-sidebar-text);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: all var(--chassis-duration-fast) ease;
}
.muaadh-shell-sidebar__submenu a:hover {
    color: var(--theme-sidebar-text-hover);
    text-decoration: none;
}
.muaadh-shell-sidebar__submenu a.active {
    color: var(--theme-primary);
    font-weight: var(--theme-font-semibold);
}
/* Sidebar Version */
.muaadh-shell-sidebar__version {
    color: var(--theme-sidebar-section-text);
    font-size: var(--text-xs);
}
/* Sidebar Badge */
.muaadh-shell-sidebar__badge {
    background: var(--theme-danger);
    color: var(--theme-text-on-danger);
    font-size: var(--text-xs);
    font-weight: var(--theme-font-bold);
    padding: 2px 6px;
    border-radius: var(--radius-xl);
    min-width: 18px;
    text-align: center;
    line-height: 1.3;
}
/* Sidebar Profile Card — replaces the deleted topbar avatar/name block.
   Sits at the top of each role's account section so identity is visible
   the moment the user opens the sidebar. */
.muaadh-shell-sidebar__profile {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 14px var(--space-5);
    margin-bottom: var(--space-1);
    background: var(--theme-sidebar-hover-bg);
    border-bottom: var(--chassis-border-thin) solid var(--theme-sidebar-border);
}
.muaadh-shell-sidebar__profile-info {
    min-width: 0;
    flex: 1;
}
.muaadh-shell-sidebar__profile-name {
    font-size: var(--text-sm);
    font-weight: var(--theme-font-semibold);
    color: var(--theme-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.muaadh-shell-sidebar__profile-role {
    font-size: var(--text-xs);
    color: var(--theme-text-muted);
    text-transform: uppercase;
    letter-spacing: var(--theme-letter-spacing-wide);
    margin-top: 2px;
}
/* Danger variant for Logout etc. — flagged red so the user can find it
   at a glance without scanning every label. */
.muaadh-shell-sidebar__link--danger {
    color: var(--theme-danger);
}
.muaadh-shell-sidebar__link--danger:hover {
    background: var(--theme-danger-light);
    color: var(--theme-danger);
}
/* Logout is a POST form (CSRF-protected — GET logout is forgeable by
   any cross-site image/link). The <button> needs default chrome reset
   so it visually matches the surrounding sidebar <a> links. */
.muaadh-shell-sidebar__logout-form {
    margin: 0;
    padding: 0;
}
.muaadh-shell-sidebar__logout-form button.muaadh-shell-sidebar__link {
    background: transparent;
    border: none;
    font: inherit;
    cursor: pointer;
    width: 100%;
    text-align: start;
}
.muaadh-shell-sidebar__version-row {
    text-align: center;
    padding: var(--space-4) 0;
}
/* Sidebar Overlay */
.muaadh-shell-overlay {
    display: none;
    position: fixed;
    top: var(--m-topbar-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--theme-overlay-bg);
    z-index: 10080;
    opacity: 0;
    transition: opacity var(--chassis-duration-quick) ease;
}
.muaadh-shell-overlay.active {
    display: block;
    opacity: 1;
}
/* ===== 4. TOPBAR STYLES ===== */
.muaadh-shell-topbar__toggle {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: var(--theme-text-primary);
    padding: var(--space-2);
    cursor: pointer;
    border-radius: var(--chassis-radius);
    font-size: var(--text-xl);
    line-height: 1;
}
.muaadh-shell-topbar__toggle:hover {
    background: var(--theme-bg-gray);
}
.muaadh-shell-topbar__logo {
    display: flex;
    min-width: 0;
    flex-shrink: 1;
    overflow: hidden;
    /* Anchor the logo to the far end of the topbar — opposite the
       hamburger. `margin-inline-start: auto` is RTL-aware: in LTR it
       pushes right, in RTL it pushes left, in both cases away from
       the hamburger that sits at the start. */
    margin-inline-start: auto;
}
.muaadh-shell-topbar__logo img {
    max-height: 32px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}
/* ============================================================
   TOPBAR NAVIGATION — single architectural block
   ============================================================
   One CSS contract for every topbar item, regardless of whether
   the markup is an <a> (Home, Categories, Cart, Favorites, ...)
   or a <button> (Language dropdown trigger, Currency dropdown
   trigger). The `all: unset` reset on `.muaadh-shell-topbar__nav-link` is
   the key: it neutralizes the entire user-agent style sheet for
   that element — colors, fonts, padding, appearance, system
   button chrome — so both element types start from the SAME
   blank slate before our visual rules paint them. After unset
   we re-declare every property we want explicitly. Anything not
   declared here is `unset`, so nothing leaks in from elsewhere.

   Layout: buttons cluster next to the hamburger; the logo sits
   at the opposite end via `margin-inline-start: auto` on
   `.muaadh-shell-topbar__logo`. The nav itself has `flex: 1` to absorb
   the gap. `flex-wrap: nowrap` is required because the parent
   `.muaadh-shell-topbar` has a fixed height — any wrapping would push
   items below the bar and overlap page content. Secondary
   items hide below 550px so the row always fits.
   ============================================================ */
.muaadh-shell-topbar__nav {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--space-1);
    min-width: 0;
}
.muaadh-shell-topbar__nav-link {
    /* Reset every UA default in one stroke. After this line the
       element has no color, no font, no padding, no appearance,
       no border, no margin — equivalent to an "unstyled span". */
    all: unset;

    /* Re-declare every property explicitly. Color is sourced from
       --text-link so <button> nav-links match what <a> nav-links
       receive from `.muaadh-theme-scope a:not(...)` two thousand lines up
       (both end at --theme-link → --theme-primary, the brand green).
       Without this alignment the dropdown triggers (Language, Currency)
       would render in --theme-text-secondary while sibling anchors
       carry the link color, producing the "buttons look different"
       symptom the user spotted. */
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--chassis-radius);
    color: var(--text-link);
    font-size: var(--text-sm);
    font-weight: var(--theme-font-medium);
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--chassis-duration-fast) ease, color var(--chassis-duration-fast) ease;
}
.muaadh-shell-topbar__nav-link:hover,
.muaadh-shell-topbar__nav-link:focus-visible {
    background: var(--theme-bg-gray);
    color: var(--text-link-hover);
    outline: none;
}
/* Active page link — highlighted via background + color. Width/height
   apply to icons only; mistakenly chained here previously (trailing comma
   followed by the SVG rule), which collapsed the active <a> to 18×18 and
   stacked its icon+label on top of each other. */
.muaadh-shell-topbar__nav-link--active {
    background: var(--theme-bg-gray);
    color: var(--text-link-hover);
    font-weight: var(--theme-font-bold);
}

/* Icons inherit the link's text color via `currentColor`. Both
   <a> and <button> nav-links route their color through the same
   property, so icon tone matches automatically. */
.muaadh-shell-topbar__nav-link svg,
.muaadh-shell-topbar__nav-link i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: inherit;
    fill: currentColor;
    stroke: currentColor;
}
/* Icon wrap — for icons that need a positioned badge (cart, favorites). */
.muaadh-shell-topbar__nav-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}
.muaadh-cart-count {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 var(--space-1);
    border-radius: var(--radius-xl);
    background: var(--theme-danger);
    color: var(--theme-text-on-danger);
    font-size: var(--text-xs);
    font-weight: var(--theme-font-bold);
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Dropdown Menu */
.muaadh-shell-menu {
    position: relative;
}
.muaadh-shell-dropdown__menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    /* Cap height so a long menu can't extend below viewport bottom.
       Trigger is in the topbar so subtract topbar + own offset + bottom gap. */
    max-height: calc(var(--m-safe-dvh) - var(--m-floating-gap) * 2);
    overflow-y: auto;
    background: var(--theme-card-bg);
    border: var(--chassis-border-thin) solid var(--theme-border-light);
    border-radius: var(--chassis-radius-lg);
    box-shadow: var(--chassis-shadow-lg);
    z-index: 10110;
    padding: var(--space-1) 0;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity var(--chassis-duration-fast) ease, transform var(--chassis-duration-fast) ease;
}
.muaadh-shell-dropdown__menu.muaadh-state--show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}
.muaadh-shell-dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--space-2-5);
    padding: var(--space-2) var(--space-4);
    color: var(--theme-text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: all 0.1s ease;
}
.muaadh-shell-dropdown__item:hover {
    background: var(--theme-bg-gray);
    color: var(--theme-text-primary);
    text-decoration: none;
}
.muaadh-shell-dropdown__item i {
    width: 18px;
    text-align: center;
    font-size: var(--text-sm);
}
/* Active state for language/currency selectors so the user sees their
   current selection at a glance. */
/* Currency dropdown row layout: sign on the left, code+name flowing */
.muaadh-shell-dropdown__item-sign {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    font-weight: var(--theme-font-bold);
    color: var(--theme-text-primary);
}
.muaadh-shell-dropdown__item-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* ===== 5. FOOTER STYLES ===== */
.muaadh-shell-footer__grid {
    display: grid;
    /* auto-fit re-wraps as the container narrows: 4 cols → 2 cols → 1
     * col without any media query. Each cell asks for at least 220px,
     * so a 4-up layout fits ~880px wide and the grid drops to 2-up
     * automatically below that. */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: var(--space-10);
}
.muaadh-shell-footer__logo img {
    max-height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
    margin-bottom: var(--space-4);
}
.muaadh-shell-footer__desc {
    color: var(--theme-footer-text-muted);
    font-size: var(--text-sm);
    line-height: 1.6;
    margin-bottom: var(--space-4);
}
.muaadh-shell-footer__contact-item {
    display: flex;
    align-items: center;
    gap: var(--space-2-5);
    color: var(--theme-footer-link);
    text-decoration: none;
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
    transition: color var(--chassis-duration-fast) ease;
}
.muaadh-shell-footer__contact-item:hover {
    color: var(--theme-footer-link-hover);
    text-decoration: none;
}
.muaadh-shell-footer__contact-item i {
    width: 16px;
    text-align: center;
    color: var(--theme-primary);
}
.muaadh-shell-footer__title {
    color: var(--theme-footer-text);
    font-size: var(--text-base);
    font-weight: var(--theme-font-semibold);
    margin-bottom: var(--space-4);
}
.muaadh-shell-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.muaadh-shell-footer__links li {
    margin-bottom: var(--space-2);
}
.muaadh-shell-footer__links a {
    color: var(--theme-footer-link);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: color var(--chassis-duration-fast) ease;
}
.muaadh-shell-footer__links a:hover {
    color: var(--theme-footer-link-hover);
}
.muaadh-shell-footer__newsletter {
    margin-bottom: var(--space-5);
}
.muaadh-shell-footer__newsletter-text {
    color: var(--theme-footer-text-muted);
    font-size: var(--text-sm);
    margin-bottom: var(--space-3);
}
.muaadh-shell-footer__newsletter-form {
    display: flex;
    gap: 0;
}
.muaadh-shell-footer__newsletter-form input {
    flex: 1;
    height: 42px;
    padding: 0 14px;
    border: var(--chassis-border-thin) solid var(--theme-footer-border);
    border-radius: var(--chassis-radius) 0 0 var(--chassis-radius);
    background: rgba(var(--theme-card-bg-rgb), 0.08);
    color: var(--theme-footer-text);
    font-size: var(--text-sm);
}
.muaadh-shell-footer__newsletter-form input::placeholder {
    color: var(--theme-footer-text-muted);
}
.muaadh-shell-footer__newsletter-form button {
    height: 42px;
    padding: 0 var(--space-4);
    background: var(--theme-primary);
    color: var(--theme-text-on-primary);
    border: none;
    border-radius: 0 var(--chassis-radius) var(--chassis-radius) 0;
    cursor: pointer;
    transition: background var(--chassis-duration-fast) ease;
}
.muaadh-shell-footer__newsletter-form button:hover {
    background: var(--theme-primary-hover);
}
.muaadh-shell-footer__bottom {
    margin-top: var(--space-10);
    padding: var(--space-5) 0;
    border-top: var(--chassis-border-thin) solid var(--theme-footer-border);
    text-align: center;
}
.muaadh-shell-footer__copyright {
    color: var(--theme-footer-text-muted);
    font-size: var(--text-sm);
    margin: 0;
}
/* Bootstrap .fixed-top z-index override: ensure our topbar stays at 10100 not 1030 */
.muaadh-shell-topbar.fixed-top {
    z-index: 10100;
}

/* ============================================================================
 * APPENDED (Phase 13 Wave 14 — 2026-05-13): rules pulled from muaadh-core.css
 * ============================================================================ */

.muaadh-shell,
.muaadh-shell-fluid {
    width: 100%;
    padding-right: var(--m-gutter);
    padding-left: var(--m-gutter);
    margin-right: auto;
    margin-left: auto;
}

.muaadh-shell-content .account-info-box {
    background: var(--theme-card-bg);
    border: var(--chassis-border-thin) solid var(--theme-card-border);
    border-radius: var(--chassis-radius-card);
    padding: var(--space-5);
    height: 100%;
}

.muaadh-shell-content .account-info-box h5,
.muaadh-shell-content .account-info-box h6 {
    color: var(--theme-text-primary);
}

/* ===== Page frame (admin + user dashboards) =====
   Canonical content wrapper for every operator/merchant/courier/user
   dashboard page. Replaces five fragmented legacy wrappers:
     .muaadh-merchant-outlet
     .muaadh-dashboard-outlet
     .muaadh-dashboard-user-content-wrapper
     .muaadh-dashboard-user-panel-review
     inner <div class="muaadh-shell"> wrappers in operator pages
   Direct children = the x-muaadh-pagehead + the page's panels/tables.
   Gives every page the SAME max-width, padding, and rhythm. */
.muaadh-pageframe {
    width: 100%;
    max-width: 1440px;
    margin-inline: auto;
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* Panels inside the pageframe rely on the pageframe's gap for vertical
   rhythm. Resetting margin-bottom here prevents the legacy panel margin
   (var(--space-4)) from stacking with the flex gap. Storefront pages
   (outside .muaadh-pageframe) still use the panel's own margin. */
.muaadh-pageframe > .muaadh-panel,
.muaadh-pageframe > .muaadh-tile-grid,
.muaadh-pageframe > .muaadh-notice {
    margin-bottom: 0;
}

/* ===== Page header (admin panels) =====
   Canonical page-header used by every operator/merchant/courier outlet.
   Replaces .muaadh-trail (+ legacy .heading / .links / .muaadh-breadcrumb-menu
   / .ud-page-name-box) — see x-muaadh-pagehead component. */
.muaadh-pagehead {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    background-color: var(--theme-card-bg);
    border: var(--chassis-border-thin) solid var(--theme-border);
    border-radius: var(--chassis-radius-card);
    padding: var(--space-4) var(--space-5);
    box-shadow: var(--chassis-shadow-card-elevated);
}

.muaadh-pagehead__main {
    flex: 1 1 auto;
    min-width: 0;
}

.muaadh-pagehead__crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 0 0 var(--space-2);
}

.muaadh-pagehead__crumbs a,
.muaadh-pagehead__crumbs span {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--chassis-duration-quick) ease;
}

.muaadh-pagehead__crumbs a:hover {
    color: var(--theme-primary);
}

.muaadh-pagehead__crumbs > * + *::before {
    content: "›";
    color: var(--text-muted);
    margin-inline-end: var(--space-2);
}

.muaadh-pagehead__title {
    font-size: var(--text-2xl);
    font-weight: var(--theme-font-bold);
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.muaadh-pagehead__lede {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: var(--space-2) 0 0;
    line-height: 1.5;
}

.muaadh-pagehead__actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

/* Centered variant — title + lede stack and center horizontally.
   Used by the public home page where the hero is the focal point. */
.muaadh-pagehead--centered {
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.muaadh-pagehead--centered .muaadh-pagehead__main {
    flex: 0 0 auto;
}

.muaadh-shell-content .muaadh-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 48px;
    z-index: 10;
    display: none;
    border-radius: var(--chassis-radius-card);
}

.muaadh-shell-content .muaadh-loader--submit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    display: none;
}

.muaadh-shell-content .process.select1 {
    padding: 0.375rem var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--theme-font-semibold);
    border-radius: var(--chassis-radius-sm);
    border: none;
    cursor: pointer;
}

.muaadh-shell-content .process.select1.drop-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.muaadh-shell-content .process.select1.drop-danger {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.muaadh-shell-layout--admin .muaadh-sync-progress-bar-wrap {
    background: var(--theme-border);
    border-radius: var(--chassis-radius-sm);
    height: 8px;
    overflow: hidden;
}

.muaadh-shell-layout--admin .muaadh-sync-progress-bar {
    background: var(--theme-primary);
    height: 100%;
    width: var(--sync-progress);
    transition: width var(--chassis-duration-normal);
}

.muaadh-shell-layout--admin .muaadh-empty-state-tile {
    background: var(--theme-bg-body);
    border-radius: var(--chassis-radius);
    text-align: center;
    color: var(--theme-text-muted);
}

.muaadh-shell-layout--admin .purchase-shipment-tile {
    background: var(--theme-card-bg);
    border: var(--chassis-border-thin) solid var(--theme-border);
    border-radius: var(--chassis-radius);
    padding: var(--space-3);
}

.muaadh-shell-layout--admin .purchase-shipment-progress {
    height: 6px;
    width: 80px;
    background: var(--theme-bg-light);
    border-radius: var(--chassis-radius-xs);
    overflow: hidden;
}

.muaadh-shell-layout--admin .purchase-shipment-progress-fill {
    height: 100%;
    width: var(--shipment-progress);
    background: var(--theme-primary);
    border-radius: var(--chassis-radius-xs);
}

.muaadh-shell-layout--admin .muaadh-shell-content {
    background-color: var(--theme-bg-gray);
    /* Preserve padding-top: calc(24px + 64px) = 88px from base .muaadh-shell-content rule
       so the page header clears the fixed 64px topbar. The shorthand
       `padding: var(--space-5)` was overwriting it, pushing the breadcrumb
       under the topbar. */
    padding-inline: var(--space-5);
    padding-bottom: var(--space-5);
}

.muaadh-shell-layout--admin .muaadh-panel {
    background-color: var(--theme-card-bg);
    border: var(--chassis-border-thin) solid var(--theme-border);
    border-radius: var(--chassis-radius-card);
    box-shadow: var(--chassis-shadow-card-elevated);
    transition: box-shadow var(--chassis-duration-quick) ease;
}

.muaadh-shell-layout--admin .muaadh-panel:hover {
    box-shadow: var(--chassis-shadow-card-elevated-hover);
}

.muaadh-shell-layout--admin .muaadh-panel__header {
    padding: var(--space-4) var(--space-5);
    background-color: var(--theme-bg-gray);
    border-bottom: var(--chassis-border-thin) solid var(--theme-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.muaadh-shell-layout--admin .muaadh-panel__header .name,
.muaadh-shell-layout--admin .muaadh-panel__header h4,
.muaadh-shell-layout--admin .muaadh-panel__header h5 {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--theme-font-semibold);
    color: var(--text-body);
}

.muaadh-shell-layout--admin .muaadh-panel__body {
    padding: var(--space-5);
}

.muaadh-shell-layout--admin .muaadh-panel__body > p:first-child {
    margin-top: 0;
}

.muaadh-shell-layout--admin .muaadh-panel__body > p:last-child {
    margin-bottom: 0;
}

.muaadh-shell-layout--admin .muaadh-panel__body.muaadh-text-align-center h5 {
    margin: 0 0 var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--theme-font-medium);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: var(--theme-letter-spacing-tight);
}

.muaadh-shell-layout--admin .muaadh-panel__body.muaadh-text-align-center h3 {
    margin: 0;
    font-size: var(--text-3xl);
    font-weight: var(--theme-font-bold);
    color: var(--text-body);
    line-height: 1.2;
}

.muaadh-shell-layout--admin .muaadh-switch {
    border-bottom: var(--chassis-border-thin) solid var(--theme-border);
    gap: var(--space-2);
    padding: 0 var(--space-1);
}

.muaadh-shell-layout--admin .muaadh-switch__route {
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    color: var(--text-secondary);
    font-weight: var(--theme-font-medium);
    background: transparent;
    list-style: none;
}

.muaadh-shell-layout--admin .muaadh-switch__route:hover {
    background-color: var(--theme-bg-light);
    color: var(--action-primary);
}

.muaadh-shell-layout--admin .muaadh-switch__route.active {
    background-color: var(--theme-card-bg);
    color: var(--action-primary);
    border-bottom-color: var(--action-primary);
    border-bottom-width: var(--chassis-border-normal);
    box-shadow: 0 -1px 0 var(--theme-border), 1px 0 0 var(--theme-border), -1px 0 0 var(--theme-border);
}

.muaadh-shell-layout--admin .muaadh-switch__pane {
    padding: var(--space-4) 0 0;
}

.muaadh-shell-layout--admin .muaadh-input {
    background-color: var(--theme-card-bg);
    border: var(--chassis-border-thin) solid var(--theme-border);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    min-height: 42px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    width: 100%;
}

.muaadh-shell-layout--admin .muaadh-input:focus {
    border-color: var(--action-primary);
    box-shadow: var(--focus-ring);
    outline: none;
}

.muaadh-shell-layout--admin .muaadh-roster {
    width: 100%;
    border-collapse: collapse;
}

.muaadh-shell-layout--admin .muaadh-roster th,
.muaadh-shell-layout--admin .muaadh-roster td {
    padding: var(--space-3) var(--space-4);
    border-bottom: var(--chassis-border-thin) solid var(--theme-border-light);
    text-align: start;
}

.muaadh-shell-layout--admin .muaadh-roster thead th {
    background-color: var(--theme-bg-light);
    font-weight: var(--theme-font-semibold);
    color: var(--text-body);
    text-transform: uppercase;
    letter-spacing: var(--theme-letter-spacing-tight);
    font-size: var(--text-xs);
}

.muaadh-shell-layout--admin .muaadh-roster--hover tbody tr:hover {
    background-color: var(--theme-bg-light);
}

/* ============================================================================
 * APPENDED (Phase 13 Wave 14): rules pulled from muaadh-operator.css
 * ============================================================================ */

.muaadh-pageframe .muaadh-user-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.muaadh-pageframe .muaadh-roster {
    margin-bottom: 0;
}


/* ============================================================================
 * APPENDED (Phase 13 Wave 14): rules pulled from muaadh-frontend.css
 * ============================================================================ */

.muaadh-shell--narrow { max-width: var(--shell-max-narrow); }

.muaadh-shell--wide   { max-width: var(--shell-max-wide); }


/* ============================================================================
 * APPENDED (Phase 13 Wave 20 — footer to shell): rules pulled from muaadh-core.css
 * ============================================================================ */

.muaadh-footer h4,
.muaadh-footer h5 {
    color: var(--theme-footer-text);
    font-size: var(--text-lg);
    font-weight: var(--theme-font-semibold);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: var(--chassis-border-normal) solid var(--theme-footer-link-hover);
    display: inline-block;
}

.muaadh-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.muaadh-footer a {
    color: var(--theme-footer-link);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: var(--chassis-duration-quick) ease;
}

.muaadh-footer a:hover {
    color: var(--theme-footer-link-hover);
}

