/*
 * LAMEA Design Foundation — Phase 1
 * ---------------------------------
 * Global visual foundation for Super Admin, Company Admin and School Admin.
 *
 * Goals:
 * - one semantic token system instead of page-specific palettes;
 * - premium operational surfaces without excessive glass/gradients;
 * - fast GPU-friendly motion only;
 * - RTL/LTR through logical properties;
 * - preserve existing Bootstrap / legacy class contracts while pages migrate.
 */

:root {
    /* Typography */
    --lm-ui-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --lm-ui-font-size-xs: .75rem;
    --lm-ui-font-size-sm: .8125rem;
    --lm-ui-font-size-md: .9375rem;
    --lm-ui-font-size-lg: 1.0625rem;
    --lm-ui-font-size-xl: clamp(1.4rem, 2vw, 1.9rem);
    --lm-ui-font-size-display: clamp(1.75rem, 3vw, 2.65rem);

    /* Canvas / surfaces */
    --lm-ui-canvas: #f3f5f8;
    --lm-ui-canvas-deep: #ebeff4;
    --lm-ui-surface: #ffffff;
    --lm-ui-surface-soft: #f8f9fb;
    --lm-ui-surface-muted: #f0f2f6;
    --lm-ui-surface-inverse: #171a21;
    --lm-ui-surface-inverse-soft: #20242d;

    /* Text */
    --lm-ui-ink: #171a21;
    --lm-ui-ink-soft: #3b414d;
    --lm-ui-muted: #737c8c;
    --lm-ui-faint: #a0a8b5;
    --lm-ui-on-dark: #f8f9fb;
    --lm-ui-on-dark-muted: #b8bfca;

    /* Brand / operational signal */
    --lm-ui-primary: #5a50e6;
    --lm-ui-primary-strong: #4439cc;
    --lm-ui-primary-soft: #eeedff;
    --lm-ui-primary-rgb: 90, 80, 230;

    /* States */
    --lm-ui-success: #118a67;
    --lm-ui-success-soft: #e9f8f2;
    --lm-ui-warning: #b36d05;
    --lm-ui-warning-soft: #fff4de;
    --lm-ui-danger: #c6425b;
    --lm-ui-danger-soft: #fff0f3;
    --lm-ui-info: #247aa6;
    --lm-ui-info-soft: #eaf6fb;
    --lm-ui-live: #6b46d9;
    --lm-ui-live-soft: #f0ecff;

    /* Lines */
    --lm-ui-line: #e2e6ec;
    --lm-ui-line-strong: #d4d9e2;
    --lm-ui-line-dark: rgba(255, 255, 255, .12);

    /* Radius */
    --lm-ui-radius-xs: .5rem;
    --lm-ui-radius-sm: .75rem;
    --lm-ui-radius-md: 1rem;
    --lm-ui-radius-lg: 1.375rem;
    --lm-ui-radius-xl: 1.75rem;
    --lm-ui-radius-pill: 999px;

    /* Elevation */
    --lm-ui-shadow-xs: 0 1px 2px rgba(17, 24, 39, .04);
    --lm-ui-shadow-sm: 0 8px 24px rgba(22, 28, 45, .055);
    --lm-ui-shadow-md: 0 18px 42px rgba(22, 28, 45, .075);
    --lm-ui-shadow-focus: 0 0 0 .23rem rgba(var(--lm-ui-primary-rgb), .13);

    /* Layout */
    --lm-ui-content-gap: clamp(1rem, 1.8vw, 1.5rem);
    --lm-ui-control-height: 2.875rem;
    --lm-ui-touch-target: 2.75rem;

    /* Motion */
    --lm-ui-motion-fast: 150ms;
    --lm-ui-motion-normal: 220ms;
    --lm-ui-motion-slow: 360ms;
    --lm-ui-ease: cubic-bezier(.2, .8, .2, 1);

    /* Bootstrap bridge — keeps existing components inside the same identity. */
    --bs-body-font-family: var(--lm-ui-font-family);
    --bs-body-bg: var(--lm-ui-canvas);
    --bs-body-color: var(--lm-ui-ink);
    --bs-primary: var(--lm-ui-primary);
    --bs-primary-rgb: var(--lm-ui-primary-rgb);
    --bs-border-color: var(--lm-ui-line);
    --bs-border-radius: var(--lm-ui-radius-sm);
    --bs-border-radius-lg: var(--lm-ui-radius-md);
}

html {
    background: var(--lm-ui-canvas);
    color-scheme: light;
    font-family: var(--lm-ui-font-family);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.lm-app-shell {
    min-height: 100vh;
    margin: 0;
    color: var(--lm-ui-ink);
    background: var(--lm-ui-canvas);
    font-family: var(--lm-ui-font-family);
    font-size: var(--lm-ui-font-size-md);
    line-height: 1.55;
}

body.lm-app-shell button,
body.lm-app-shell input,
body.lm-app-shell select,
body.lm-app-shell textarea {
    font: inherit;
}

::selection {
    color: var(--lm-ui-ink);
    background: rgba(var(--lm-ui-primary-rgb), .18);
}

/* --------------------------------------------------------------------------
   Application canvas
   -------------------------------------------------------------------------- */

.lm-app-shell .layout-page,
.lm-app-shell .content-wrapper {
    background: transparent;
}

.lm-app-shell .content-wrapper {
    min-width: 0;
}

.lm-app-shell .container-p-y {
    padding-block: clamp(1rem, 2vw, 1.75rem) !important;
}

.lm-app-shell .lm-primary-content {
    min-width: 0;
}

.lm-app-shell .lm-primary-content > :first-child {
    margin-block-start: 0;
}

.lm-app-shell .lm-primary-content > :last-child {
    margin-block-end: 0;
}

/* Existing detached navbar receives only a foundation skin here.
   Its composition is rebuilt later with navbar-partial.blade.php. */
.lm-app-shell .layout-navbar {
    color: var(--lm-ui-ink);
    background: var(--lm-ui-surface) !important;
    border: 1px solid rgba(30, 36, 48, .08);
    box-shadow: var(--lm-ui-shadow-sm);
}

.lm-app-shell .layout-navbar.navbar-detached {
    border-radius: var(--lm-ui-radius-lg);
}

/* Existing menu behavior remains untouched. Only visual states are normalized. */
.lm-app-shell .menu-vertical .menu-link {
    min-height: 2.75rem;
    border-radius: var(--lm-ui-radius-sm);
    transition:
        background-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        transform var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

.lm-app-shell .menu-vertical .menu-link:hover {
    background: var(--lm-ui-surface-muted);
    transform: translateY(-1px);
}

.lm-app-shell .menu-vertical .menu-item.active > .menu-link {
    color: var(--lm-ui-primary) !important;
    background: var(--lm-ui-primary-soft) !important;
    box-shadow: inset 0 0 0 1px rgba(var(--lm-ui-primary-rgb), .08);
}

.lm-app-shell .menu-vertical .menu-item.active > .menu-link i,
.lm-app-shell .menu-vertical .menu-item.active > .menu-link .menu-icon {
    color: currentColor !important;
}

/* --------------------------------------------------------------------------
   Type hierarchy
   -------------------------------------------------------------------------- */

.lm-app-shell h1,
.lm-app-shell h2,
.lm-app-shell h3,
.lm-app-shell h4,
.lm-app-shell h5,
.lm-app-shell h6 {
    color: var(--lm-ui-ink);
    font-family: var(--lm-ui-font-family);
    font-weight: 700;
    letter-spacing: -.015em;
}

[dir="rtl"] .lm-app-shell h1,
[dir="rtl"] .lm-app-shell h2,
[dir="rtl"] .lm-app-shell h3,
[dir="rtl"] .lm-app-shell h4,
[dir="rtl"] .lm-app-shell h5,
[dir="rtl"] .lm-app-shell h6 {
    letter-spacing: 0;
}

.lm-app-shell a {
    text-underline-offset: .18em;
}

.lm-app-shell .text-muted {
    color: var(--lm-ui-muted) !important;
}

/* --------------------------------------------------------------------------
   Focus / accessibility
   -------------------------------------------------------------------------- */

.lm-app-shell :where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--lm-ui-primary);
    outline-offset: 2px;
}

.lm-app-shell :where(.btn, .form-control, .form-select):focus-visible {
    outline: 0;
}

/* --------------------------------------------------------------------------
   Controls
   -------------------------------------------------------------------------- */

.lm-app-shell .form-label,
.lm-app-shell label:not(.form-check-label) {
    color: var(--lm-ui-ink-soft);
    font-size: var(--lm-ui-font-size-sm);
    font-weight: 650;
}

.lm-app-shell .form-control,
.lm-app-shell .form-select,
.lm-app-shell .input-group-text {
    min-height: var(--lm-ui-control-height);
    color: var(--lm-ui-ink);
    background-color: var(--lm-ui-surface);
    border-color: var(--lm-ui-line-strong);
    border-radius: var(--lm-ui-radius-sm);
    box-shadow: var(--lm-ui-shadow-xs);
    transition:
        border-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        box-shadow var(--lm-ui-motion-fast) var(--lm-ui-ease),
        background-color var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

.lm-app-shell .form-control::placeholder {
    color: var(--lm-ui-faint);
}

.lm-app-shell .form-control:hover:not(:disabled):not([readonly]),
.lm-app-shell .form-select:hover:not(:disabled) {
    border-color: #c7cdd7;
}

.lm-app-shell .form-control:focus,
.lm-app-shell .form-select:focus {
    color: var(--lm-ui-ink);
    background-color: var(--lm-ui-surface);
    border-color: rgba(var(--lm-ui-primary-rgb), .62);
    box-shadow: var(--lm-ui-shadow-focus);
}

.lm-app-shell .form-control:disabled,
.lm-app-shell .form-select:disabled,
.lm-app-shell .form-control[readonly] {
    color: var(--lm-ui-muted);
    background-color: var(--lm-ui-surface-muted);
    opacity: 1;
}

.lm-app-shell .form-text {
    color: var(--lm-ui-muted);
    font-size: var(--lm-ui-font-size-xs);
}

.lm-app-shell .form-check-input:checked {
    background-color: var(--lm-ui-primary);
    border-color: var(--lm-ui-primary);
}

.lm-app-shell input[type="email"],
.lm-app-shell input[type="url"],
.lm-app-shell input[type="tel"],
.lm-app-shell input[inputmode="email"],
.lm-app-shell input[inputmode="numeric"] {
    direction: ltr;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.lm-app-shell .btn {
    min-height: var(--lm-ui-touch-target);
    border-radius: var(--lm-ui-radius-sm);
    font-weight: 650;
    box-shadow: none;
    transition:
        transform var(--lm-ui-motion-fast) var(--lm-ui-ease),
        box-shadow var(--lm-ui-motion-fast) var(--lm-ui-ease),
        background-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        border-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        color var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

.lm-app-shell .btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.lm-app-shell .btn:active:not(:disabled) {
    transform: translateY(0);
}

.lm-app-shell .btn-primary {
    color: #fff;
    background: var(--lm-ui-primary);
    border-color: var(--lm-ui-primary);
    box-shadow: 0 7px 18px rgba(var(--lm-ui-primary-rgb), .18);
}

.lm-app-shell .btn-primary:hover,
.lm-app-shell .btn-primary:focus {
    color: #fff;
    background: var(--lm-ui-primary-strong);
    border-color: var(--lm-ui-primary-strong);
}

.lm-app-shell .btn-outline-primary {
    color: var(--lm-ui-primary);
    background: var(--lm-ui-surface);
    border-color: rgba(var(--lm-ui-primary-rgb), .28);
}

.lm-app-shell .btn-outline-primary:hover {
    color: var(--lm-ui-primary-strong);
    background: var(--lm-ui-primary-soft);
    border-color: rgba(var(--lm-ui-primary-rgb), .38);
}

.lm-app-shell .btn-light,
.lm-app-shell .btn-outline-secondary {
    color: var(--lm-ui-ink-soft);
    background: var(--lm-ui-surface);
    border-color: var(--lm-ui-line);
}

/* --------------------------------------------------------------------------
   Surfaces / cards
   -------------------------------------------------------------------------- */

.lm-app-shell .card,
.lm-app-shell .lux-card {
    color: var(--lm-ui-ink);
    background: var(--lm-ui-surface);
    border: 1px solid var(--lm-ui-line);
    border-radius: var(--lm-ui-radius-lg);
    box-shadow: var(--lm-ui-shadow-sm);
}

.lm-app-shell .card-header,
.lm-app-shell .card-footer {
    background: transparent;
    border-color: var(--lm-ui-line);
}

.lm-app-shell .card-header:first-child {
    border-start-start-radius: calc(var(--lm-ui-radius-lg) - 1px);
    border-start-end-radius: calc(var(--lm-ui-radius-lg) - 1px);
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.lm-app-shell .table-responsive {
    border-radius: inherit;
    scrollbar-width: thin;
    scrollbar-color: #c8ced8 transparent;
}

.lm-app-shell .table {
    --bs-table-color: var(--lm-ui-ink-soft);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--lm-ui-line);
    margin-block-end: 0;
}

.lm-app-shell .table > :not(caption) > * > * {
    padding: .9rem 1rem;
    vertical-align: middle;
}

.lm-app-shell .table thead th {
    color: var(--lm-ui-muted);
    background: var(--lm-ui-surface-soft);
    border-block-end-width: 1px;
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
    white-space: nowrap;
}

[dir="rtl"] .lm-app-shell .table thead th {
    letter-spacing: 0;
}

.lm-app-shell .table tbody tr {
    transition: background-color var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

.lm-app-shell .table tbody tr:hover {
    background: #fafbfc;
}

/* --------------------------------------------------------------------------
   Badges / alerts / status
   -------------------------------------------------------------------------- */

.lm-app-shell .badge {
    border-radius: var(--lm-ui-radius-pill);
    font-weight: 700;
    letter-spacing: 0;
}

.lm-app-shell .alert {
    border: 1px solid var(--lm-ui-line);
    border-radius: var(--lm-ui-radius-md);
    box-shadow: none;
}

.lm-app-shell .alert-success {
    color: #0d654d;
    background: var(--lm-ui-success-soft);
    border-color: #ccecdf;
}

.lm-app-shell .alert-warning {
    color: #875000;
    background: var(--lm-ui-warning-soft);
    border-color: #f0deb7;
}

.lm-app-shell .alert-danger {
    color: #9f3348;
    background: var(--lm-ui-danger-soft);
    border-color: #f0d1d8;
}

.lm-app-shell .alert-info {
    color: #1b6286;
    background: var(--lm-ui-info-soft);
    border-color: #cbe5ef;
}

/* --------------------------------------------------------------------------
   Dropdowns / modals / pagination
   -------------------------------------------------------------------------- */

.lm-app-shell .dropdown-menu {
    padding: .45rem;
    background: var(--lm-ui-surface);
    border: 1px solid var(--lm-ui-line);
    border-radius: var(--lm-ui-radius-md);
    box-shadow: var(--lm-ui-shadow-md);
}

.lm-app-shell .dropdown-item {
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    border-radius: .65rem;
    color: var(--lm-ui-ink-soft);
    font-weight: 550;
}

.lm-app-shell .dropdown-item:hover,
.lm-app-shell .dropdown-item:focus {
    color: var(--lm-ui-ink);
    background: var(--lm-ui-surface-muted);
}

.lm-app-shell .modal-content {
    border: 1px solid var(--lm-ui-line);
    border-radius: var(--lm-ui-radius-xl);
    box-shadow: 0 28px 70px rgba(19, 25, 39, .16);
}

.lm-app-shell .modal-header,
.lm-app-shell .modal-footer {
    border-color: var(--lm-ui-line);
}

.lm-app-shell .page-link {
    min-width: 2.45rem;
    min-height: 2.45rem;
    display: inline-grid;
    place-items: center;
    margin-inline: .12rem;
    color: var(--lm-ui-ink-soft);
    background: var(--lm-ui-surface);
    border: 1px solid var(--lm-ui-line);
    border-radius: .7rem !important;
}

.lm-app-shell .page-item.active .page-link {
    color: #fff;
    background: var(--lm-ui-primary);
    border-color: var(--lm-ui-primary);
}

/* --------------------------------------------------------------------------
   Legacy compatibility layer
   These classes are intentionally retained until each page is migrated.
   They now consume the same LAMEA tokens instead of owning separate palettes.
   -------------------------------------------------------------------------- */

.lm-app-shell .lux-page {
    color: var(--lm-ui-ink);
}

.lm-app-shell .lux-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-block-end: var(--lm-ui-content-gap);
    padding: clamp(1.25rem, 2.6vw, 2rem);
    color: var(--lm-ui-on-dark);
    background: var(--lm-ui-surface-inverse);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--lm-ui-radius-xl);
    box-shadow: 0 22px 46px rgba(18, 21, 28, .13);
}

.lm-app-shell .lux-hero::before {
    content: "";
    position: absolute;
    inset-block: 1rem;
    inset-inline-start: 0;
    width: .22rem;
    border-radius: 0 var(--lm-ui-radius-pill) var(--lm-ui-radius-pill) 0;
    background: #776ef2;
}

[dir="rtl"] .lm-app-shell .lux-hero::before {
    border-radius: var(--lm-ui-radius-pill) 0 0 var(--lm-ui-radius-pill);
}

.lm-app-shell .lux-hero-copy,
.lm-app-shell .lux-hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.lm-app-shell .lux-hero-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.lm-app-shell .lux-hero-icon {
    display: grid;
    place-items: center;
    width: 3.75rem;
    height: 3.75rem;
    flex: 0 0 auto;
    color: #d9d5ff;
    background: var(--lm-ui-surface-inverse-soft);
    border: 1px solid var(--lm-ui-line-dark);
    border-radius: var(--lm-ui-radius-md);
    font-size: 1.35rem;
}

.lm-app-shell .lux-eyebrow {
    display: block;
    margin-block-end: .3rem;
    color: var(--lm-ui-on-dark-muted);
    font-size: var(--lm-ui-font-size-xs);
    font-weight: 750;
    letter-spacing: .07em;
    text-transform: uppercase;
}

[dir="rtl"] .lm-app-shell .lux-eyebrow {
    letter-spacing: 0;
}

.lm-app-shell .lux-hero h1,
.lm-app-shell .lux-hero h2,
.lm-app-shell .lux-hero h3 {
    margin: 0;
    color: var(--lm-ui-on-dark);
}

.lm-app-shell .lux-hero h1 {
    font-size: var(--lm-ui-font-size-display);
    font-weight: 750;
}

.lm-app-shell .lux-hero p {
    max-width: 52rem;
    margin: .45rem 0 0;
    color: var(--lm-ui-on-dark-muted);
    line-height: 1.7;
}

.lm-app-shell .lux-hero .btn-primary,
.lm-app-shell .lux-hero .btn-outline-primary {
    color: var(--lm-ui-ink);
    background: #fff;
    border-color: #fff;
    box-shadow: none;
}

.lm-app-shell .lux-hero .btn-primary:hover,
.lm-app-shell .lux-hero .btn-outline-primary:hover {
    color: var(--lm-ui-primary-strong);
    background: #f4f2ff;
    border-color: #f4f2ff;
}

.lm-app-shell .lux-card {
    padding: 1.25rem;
}

.lm-app-shell .lux-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-block-end: 1px solid var(--lm-ui-line);
}

.lm-app-shell .lux-card-header h2,
.lm-app-shell .lux-card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 720;
}

.lm-app-shell .lux-card-header p {
    margin: .25rem 0 0;
    color: var(--lm-ui-muted);
    font-size: var(--lm-ui-font-size-sm);
}

.lm-app-shell .lux-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: .85rem;
    margin-block-end: var(--lm-ui-content-gap);
}

.lm-app-shell .lux-stat-card {
    --tone: var(--lm-ui-primary);
    display: flex;
    align-items: center;
    gap: .85rem;
    min-height: 6.25rem;
    padding: 1rem;
    background: var(--lm-ui-surface);
    border: 1px solid var(--lm-ui-line);
    border-radius: var(--lm-ui-radius-md);
    box-shadow: var(--lm-ui-shadow-xs);
}

.lm-app-shell .lux-stat-card > span {
    display: grid;
    place-items: center;
    width: 2.65rem;
    height: 2.65rem;
    flex: 0 0 auto;
    color: var(--tone);
    background: color-mix(in srgb, var(--tone) 10%, white);
    border-radius: .8rem;
}

.lm-app-shell .lux-stat-card small {
    display: block;
    color: var(--lm-ui-muted);
    font-size: var(--lm-ui-font-size-xs);
    font-weight: 650;
}

.lm-app-shell .lux-stat-card strong {
    display: block;
    margin-block-start: .15rem;
    color: var(--lm-ui-ink);
    font-size: 1.35rem;
    line-height: 1.15;
}

.lm-app-shell .tone-primary { --tone: var(--lm-ui-primary); }
.lm-app-shell .tone-success { --tone: var(--lm-ui-success); }
.lm-app-shell .tone-warning { --tone: var(--lm-ui-warning); }
.lm-app-shell .tone-danger  { --tone: var(--lm-ui-danger); }
.lm-app-shell .tone-info    { --tone: var(--lm-ui-info); }

.lm-app-shell .lux-table {
    min-width: 760px;
}

.lm-app-shell .lux-linked-item {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-height: 4.75rem;
    padding: .85rem;
    color: var(--lm-ui-ink-soft);
    background: var(--lm-ui-surface-soft);
    border: 1px solid var(--lm-ui-line);
    border-radius: var(--lm-ui-radius-md);
    text-decoration: none;
    transition:
        transform var(--lm-ui-motion-fast) var(--lm-ui-ease),
        border-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        background-color var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

.lm-app-shell .lux-linked-item:hover {
    color: var(--lm-ui-ink);
    background: var(--lm-ui-surface);
    border-color: #cbd1da;
    transform: translateY(-1px);
}

.lm-app-shell .lux-linked-item > span {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    color: var(--lm-ui-primary);
    background: var(--lm-ui-primary-soft);
    border-radius: .75rem;
}

.lm-app-shell .lux-linked-item > div {
    min-width: 0;
    flex: 1;
}

.lm-app-shell .lux-linked-item strong,
.lm-app-shell .lux-linked-item small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lux-linked-item small {
    color: var(--lm-ui-muted);
    font-size: var(--lm-ui-font-size-xs);
}

.lm-app-shell .lux-details-list {
    margin: 0;
}

.lm-app-shell .lux-details-list > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-block: .75rem;
    border-block-end: 1px solid var(--lm-ui-line);
}

.lm-app-shell .lux-details-list > div:last-child {
    border: 0;
}

.lm-app-shell .lux-details-list dt {
    color: var(--lm-ui-muted);
    font-weight: 600;
}

.lm-app-shell .lux-details-list dd {
    margin: 0;
    color: var(--lm-ui-ink);
    font-weight: 680;
    text-align: end;
}

.lm-app-shell .lux-alert {
    border-radius: var(--lm-ui-radius-md);
    box-shadow: none;
}

/* --------------------------------------------------------------------------
   New common primitives available to upcoming page rebuilds
   -------------------------------------------------------------------------- */

.lm-app-shell .lm-surface {
    background: var(--lm-ui-surface);
    border: 1px solid var(--lm-ui-line);
    border-radius: var(--lm-ui-radius-lg);
    box-shadow: var(--lm-ui-shadow-sm);
}

.lm-app-shell .lm-section-kicker {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--lm-ui-primary);
    font-size: var(--lm-ui-font-size-xs);
    font-weight: 750;
    letter-spacing: .055em;
    text-transform: uppercase;
}

[dir="rtl"] .lm-app-shell .lm-section-kicker {
    letter-spacing: 0;
}

.lm-app-shell .lm-status-dot {
    --status-color: var(--lm-ui-muted);
    width: .55rem;
    height: .55rem;
    display: inline-block;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--status-color);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--status-color) 13%, transparent);
}

.lm-app-shell .lm-status-dot.is-live,
.lm-app-shell .is-live .lm-status-dot {
    --status-color: var(--lm-ui-live);
}

.lm-app-shell .lm-status-dot.is-success,
.lm-app-shell .is-success .lm-status-dot,
.lm-app-shell .is-online .lm-status-dot {
    --status-color: var(--lm-ui-success);
}

.lm-app-shell .lm-status-dot.is-warning,
.lm-app-shell .is-warning .lm-status-dot,
.lm-app-shell .is-waiting .lm-status-dot {
    --status-color: var(--lm-ui-warning);
}

.lm-app-shell .lm-status-dot.is-danger,
.lm-app-shell .is-danger .lm-status-dot,
.lm-app-shell .is-offline .lm-status-dot {
    --status-color: var(--lm-ui-danger);
}

.lm-app-shell .lm-empty {
    display: grid;
    place-items: center;
    min-height: 13rem;
    padding: 2rem;
    text-align: center;
    color: var(--lm-ui-muted);
    background: var(--lm-ui-surface-soft);
    border: 1px dashed var(--lm-ui-line-strong);
    border-radius: var(--lm-ui-radius-lg);
}

.lm-app-shell .lm-empty > :last-child {
    margin-block-end: 0;
}

/* --------------------------------------------------------------------------
   Direction / responsive behavior
   -------------------------------------------------------------------------- */

[dir="rtl"] .lm-app-shell {
    text-align: start;
}

[dir="rtl"] .lm-app-shell .lux-page,
[dir="rtl"] .lm-app-shell .lux-table {
    text-align: start;
}

@media (max-width: 991.98px) {
    .lm-app-shell .lux-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .lm-app-shell .lux-hero-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .lm-app-shell .lux-hero-actions .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 575.98px) {
    .lm-app-shell .container-xxl {
        padding-inline: .85rem !important;
    }

    .lm-app-shell .layout-navbar.navbar-detached {
        border-radius: var(--lm-ui-radius-md);
    }

    .lm-app-shell .lux-hero {
        padding: 1.1rem;
        border-radius: var(--lm-ui-radius-lg);
    }

    .lm-app-shell .lux-hero-copy {
        align-items: flex-start;
    }

    .lm-app-shell .lux-hero-icon {
        width: 3.1rem;
        height: 3.1rem;
    }

    .lm-app-shell .lux-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .65rem;
    }

    .lm-app-shell .lux-stat-card {
        min-height: 5.6rem;
        padding: .75rem;
    }

    .lm-app-shell .lux-stat-card > span {
        width: 2.25rem;
        height: 2.25rem;
    }

    .lm-app-shell .lux-stat-card strong {
        font-size: 1.05rem;
    }

    .lm-app-shell .lux-card {
        padding: 1rem;
        border-radius: var(--lm-ui-radius-md);
    }

    .lm-app-shell .lux-card-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 1rem;
    }

    .lm-app-shell .btn {
        min-height: 2.85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lm-app-shell *,
    .lm-app-shell *::before,
    .lm-app-shell *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

@media print {
    body.lm-app-shell {
        background: #fff !important;
    }

    .lm-app-shell .layout-navbar,
    .lm-app-shell .layout-menu,
    .lm-app-shell .lux-hero-actions,
    .lm-app-shell form,
    .lm-app-shell .btn,
    .lm-app-shell footer {
        display: none !important;
    }

    .lm-app-shell .layout-page,
    .lm-app-shell .content-wrapper {
        padding: 0 !important;
        margin: 0 !important;
    }

    .lm-app-shell .lux-card,
    .lm-app-shell .card,
    .lm-app-shell .lm-surface {
        box-shadow: none !important;
        break-inside: avoid;
    }
}

/* ========================================================================== 
   LAMEA Application Shell — Phase 2
   Operational command bar + footer
   ========================================================================== */

.lm-app-shell .lm-command-bar {
    --lm-command-height: 4.65rem;
    position: relative;
    min-height: var(--lm-command-height);
    padding-block: .55rem !important;
    padding-inline: .7rem !important;
    color: var(--lm-ui-ink);
    background:
        linear-gradient(var(--lm-ui-surface), var(--lm-ui-surface)) padding-box,
        linear-gradient(110deg, rgba(var(--lm-ui-primary-rgb), .16), rgba(36, 122, 166, .08), rgba(17, 138, 103, .06)) border-box !important;
    border: 1px solid transparent !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .8) inset,
        var(--lm-ui-shadow-sm) !important;
    isolation: isolate;
}

.lm-app-shell .lm-command-bar::after {
    content: "";
    position: absolute;
    inset-inline: 1.4rem;
    inset-block-end: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--lm-ui-primary-rgb), .18), transparent);
    pointer-events: none;
}

.lm-app-shell .lm-command-bar-inner,
.lm-app-shell .lm-command-content {
    width: 100%;
    min-width: 0;
}

.lm-app-shell .lm-command-content {
    display: flex;
    gap: .75rem;
}

.lm-app-shell .lm-command-context {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    gap: .65rem;
}

.lm-app-shell .lm-command-actions {
    flex: 0 0 auto;
    gap: .45rem;
}

.lm-app-shell .lm-command-brand {
    min-width: 0;
    margin-inline-end: 1rem !important;
}

.lm-app-shell .lm-command-brand-link {
    min-width: 0;
    color: var(--lm-ui-ink);
}

.lm-app-shell .lm-command-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid rgba(var(--lm-ui-primary-rgb), .13);
    border-radius: .85rem;
    background: var(--lm-ui-primary-soft);
    overflow: hidden;
}

.lm-app-shell .lm-command-brand-image {
    width: 100%;
    height: 100%;
    padding: .3rem;
    object-fit: contain;
}

.lm-app-shell .lm-command-brand-fallback {
    display: none;
    align-items: center;
    justify-content: center;
}

.lm-app-shell .lm-command-brand-fallback.is-visible {
    display: inline-flex;
}

.lm-app-shell .lm-command-brand-name {
    max-width: 12rem;
    overflow: hidden;
    color: var(--lm-ui-ink);
    font-size: .94rem;
    font-weight: 800 !important;
    letter-spacing: -.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-command-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0 !important;
    color: var(--lm-ui-ink-soft) !important;
    border: 1px solid var(--lm-ui-line);
    border-radius: .9rem;
    background: var(--lm-ui-surface-soft);
    transition:
        color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        border-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        background-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        transform var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

.lm-app-shell .lm-command-icon-button:hover {
    color: var(--lm-ui-primary) !important;
    border-color: rgba(var(--lm-ui-primary-rgb), .22);
    background: var(--lm-ui-primary-soft);
    transform: translateY(-1px);
}

/* Super Admin context is shown as a real workspace selector rather than a banner. */
.lm-app-shell .lm-workspace-context {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: .75rem;
}

.lm-app-shell .lm-workspace-copy {
    display: grid;
    min-width: 0;
    gap: .08rem;
}

.lm-app-shell .lm-workspace-eyebrow {
    color: var(--lm-ui-muted);
    font-size: .66rem;
    font-weight: 650;
    letter-spacing: .035em;
    line-height: 1.1;
}

.lm-app-shell .lm-workspace-title {
    overflow: hidden;
    color: var(--lm-ui-ink);
    font-size: .84rem;
    font-weight: 800;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-workspace-switch {
    display: inline-flex;
    align-items: center;
    gap: .18rem;
    padding: .22rem;
    border: 1px solid var(--lm-ui-line);
    border-radius: .95rem;
    background: var(--lm-ui-surface-soft);
}

.lm-app-shell .lm-workspace-option {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    gap: .42rem;
    padding-inline: .72rem;
    color: var(--lm-ui-muted);
    border-radius: .72rem;
    text-decoration: none;
    font-size: .74rem;
    font-weight: 750;
    transition:
        color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        background-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        box-shadow var(--lm-ui-motion-fast) var(--lm-ui-ease),
        transform var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

.lm-app-shell .lm-workspace-option:hover {
    color: var(--lm-ui-ink-soft);
    background: var(--lm-ui-surface);
}

.lm-app-shell .lm-workspace-option.is-active {
    color: var(--lm-ui-primary);
    background: var(--lm-ui-surface);
    box-shadow: 0 2px 8px rgba(24, 30, 45, .07), inset 0 0 0 1px rgba(var(--lm-ui-primary-rgb), .07);
}

.lm-app-shell .lm-workspace-option.is-active i {
    color: var(--lm-ui-primary);
}

/* School / branch context */
.lm-app-shell .lm-school-context {
    min-width: 0;
}

.lm-app-shell .lm-school-context-trigger {
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: min(19rem, 26vw);
    min-height: 2.7rem;
    gap: .6rem;
    padding: .34rem .72rem .34rem .38rem;
    color: var(--lm-ui-ink);
    border: 1px solid var(--lm-ui-line);
    border-radius: .95rem;
    background: var(--lm-ui-surface-soft);
    text-align: start;
    box-shadow: none;
    transition:
        border-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        background-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        transform var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

[dir="rtl"] .lm-app-shell .lm-school-context-trigger {
    padding: .34rem .38rem .34rem .72rem;
}

.lm-app-shell .lm-school-context-trigger:hover,
.lm-app-shell .lm-school-context-trigger[aria-expanded="true"] {
    border-color: rgba(var(--lm-ui-primary-rgb), .24);
    background: var(--lm-ui-surface);
    transform: translateY(-1px);
}

.lm-app-shell .lm-school-context-trigger::after {
    margin-inline-start: .2rem;
    color: var(--lm-ui-muted);
}

.lm-app-shell .lm-school-context-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    color: var(--lm-ui-primary);
    border-radius: .7rem;
    background: var(--lm-ui-primary-soft);
}

.lm-app-shell .lm-school-context-copy {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    gap: .05rem;
}

.lm-app-shell .lm-school-context-copy small,
.lm-app-shell .lm-school-context-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-school-context-copy small {
    color: var(--lm-ui-muted);
    font-size: .62rem;
    font-weight: 650;
    line-height: 1.15;
}

.lm-app-shell .lm-school-context-copy strong {
    color: var(--lm-ui-ink);
    font-size: .76rem;
    font-weight: 800;
    line-height: 1.3;
}

.lm-app-shell .lm-context-menu,
.lm-app-shell .lm-account-menu {
    margin-top: .58rem !important;
    padding: .48rem;
    border: 1px solid rgba(31, 38, 52, .09) !important;
    border-radius: 1.15rem !important;
    background: var(--lm-ui-surface) !important;
    box-shadow: 0 22px 56px rgba(25, 31, 45, .13) !important;
}

.lm-app-shell .lm-context-menu {
    width: min(21rem, calc(100vw - 1.5rem));
}

.lm-app-shell .lm-context-menu-header {
    display: grid;
    gap: .08rem;
    padding: .55rem .62rem .62rem;
}

.lm-app-shell .lm-context-menu-header > span {
    color: var(--lm-ui-ink);
    font-size: .79rem;
    font-weight: 800;
}

.lm-app-shell .lm-context-menu-header > small {
    overflow: hidden;
    color: var(--lm-ui-muted);
    font-size: .68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-context-menu-option {
    display: flex;
    align-items: center;
    width: 100%;
    gap: .65rem;
    padding: .55rem .6rem;
    color: var(--lm-ui-ink-soft);
    border: 0;
    border-radius: .82rem;
    background: transparent;
    text-align: start;
    transition:
        color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        background-color var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

.lm-app-shell .lm-context-menu-option:hover {
    color: var(--lm-ui-ink);
    background: var(--lm-ui-surface-soft);
}

.lm-app-shell .lm-context-menu-option.is-active {
    color: var(--lm-ui-primary);
    background: var(--lm-ui-primary-soft);
}

.lm-app-shell .lm-context-menu-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: .68rem;
    background: var(--lm-ui-surface-muted);
}

.lm-app-shell .lm-context-menu-option.is-active .lm-context-menu-option-icon {
    background: rgba(var(--lm-ui-primary-rgb), .1);
}

.lm-app-shell .lm-context-menu-option-copy {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    gap: .05rem;
}

.lm-app-shell .lm-context-menu-option-copy strong,
.lm-app-shell .lm-context-menu-option-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-context-menu-option-copy strong {
    color: currentColor;
    font-size: .75rem;
    font-weight: 780;
}

.lm-app-shell .lm-context-menu-option-copy small {
    color: var(--lm-ui-muted);
    font-size: .64rem;
}

.lm-app-shell .lm-context-menu-check {
    flex: 0 0 auto;
    font-size: 1rem;
}

.lm-app-shell .lm-context-menu-separator,
.lm-app-shell .lm-account-separator {
    height: 1px;
    margin: .38rem .28rem;
    background: var(--lm-ui-line);
}

.lm-app-shell .lm-context-menu-link {
    display: flex;
    align-items: center;
    min-height: 2.55rem;
    gap: .55rem;
    padding-inline: .68rem;
    color: var(--lm-ui-ink-soft);
    border-radius: .78rem;
    font-size: .72rem;
    font-weight: 750;
    text-decoration: none;
}

.lm-app-shell .lm-context-menu-link:hover {
    color: var(--lm-ui-primary);
    background: var(--lm-ui-primary-soft);
}

.lm-app-shell .lm-context-menu-link .lm-directional-icon {
    margin-inline-start: auto;
}

/* Language switch is deliberately typographic; no country flags. */
.lm-app-shell .lm-language-switch {
    display: inline-flex;
    align-items: center;
    min-height: 2.7rem;
    gap: .42rem;
    padding-inline: .48rem .62rem;
    color: var(--lm-ui-ink-soft);
    border: 1px solid var(--lm-ui-line);
    border-radius: .92rem;
    background: var(--lm-ui-surface-soft);
    text-decoration: none;
    transition:
        color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        border-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        background-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        transform var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

.lm-app-shell .lm-language-switch:hover {
    color: var(--lm-ui-primary);
    border-color: rgba(var(--lm-ui-primary-rgb), .24);
    background: var(--lm-ui-primary-soft);
    transform: translateY(-1px);
}

.lm-app-shell .lm-language-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.8rem;
    height: 1.75rem;
    padding-inline: .3rem;
    color: var(--lm-ui-primary);
    border-radius: .58rem;
    background: var(--lm-ui-primary-soft);
    font-size: .65rem;
    font-weight: 850;
    letter-spacing: .04em;
}

.lm-app-shell .lm-language-label {
    font-size: .71rem;
    font-weight: 750;
    white-space: nowrap;
}

.lm-app-shell .lm-language-switch > i {
    color: var(--lm-ui-muted);
    font-size: .96rem;
}

/* Account control */
.lm-app-shell .lm-user-trigger {
    display: flex;
    align-items: center;
    min-height: 2.8rem;
    gap: .55rem;
    padding: .28rem .42rem .28rem .32rem !important;
    color: var(--lm-ui-ink) !important;
    border: 1px solid var(--lm-ui-line);
    border-radius: 1rem;
    background: var(--lm-ui-surface);
    transition:
        border-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        box-shadow var(--lm-ui-motion-fast) var(--lm-ui-ease),
        transform var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

[dir="rtl"] .lm-app-shell .lm-user-trigger {
    padding: .28rem .32rem .28rem .42rem !important;
}

.lm-app-shell .lm-user-trigger:hover,
.lm-app-shell .lm-user-trigger[aria-expanded="true"] {
    border-color: rgba(var(--lm-ui-primary-rgb), .22);
    box-shadow: 0 7px 20px rgba(25, 31, 45, .06);
    transform: translateY(-1px);
}

.lm-app-shell .lm-user-avatar-wrap,
.lm-app-shell .lm-account-avatar-wrap {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

.lm-app-shell .lm-user-avatar-wrap {
    width: 2.15rem;
    height: 2.15rem;
}

.lm-app-shell .lm-user-avatar,
.lm-app-shell .lm-account-avatar {
    width: 100%;
    height: 100%;
    border: 1px solid rgba(var(--lm-ui-primary-rgb), .12);
    border-radius: .75rem;
    object-fit: cover;
    background: var(--lm-ui-surface-muted);
}

.lm-app-shell .lm-user-presence {
    position: absolute;
    inset-inline-end: -.08rem;
    inset-block-end: -.08rem;
    width: .55rem;
    height: .55rem;
    border: 2px solid var(--lm-ui-surface);
    border-radius: 50%;
    background: var(--lm-ui-success);
}

.lm-app-shell .lm-user-trigger-copy {
    display: grid;
    min-width: 0;
    max-width: 10.5rem;
    gap: .02rem;
    text-align: start;
}

.lm-app-shell .lm-user-trigger-copy strong,
.lm-app-shell .lm-user-trigger-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-user-trigger-copy strong {
    color: var(--lm-ui-ink);
    font-size: .74rem;
    font-weight: 820;
    line-height: 1.25;
}

.lm-app-shell .lm-user-trigger-copy small {
    color: var(--lm-ui-muted);
    font-size: .62rem;
    font-weight: 600;
    line-height: 1.25;
}

.lm-app-shell .lm-user-trigger-chevron {
    color: var(--lm-ui-muted);
    transition: transform var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

.lm-app-shell .lm-user-trigger[aria-expanded="true"] .lm-user-trigger-chevron {
    transform: rotate(180deg);
}

.lm-app-shell .lm-account-menu {
    width: min(21rem, calc(100vw - 1.5rem));
}

.lm-app-shell .lm-account-summary {
    display: flex;
    align-items: center;
    gap: .72rem;
    padding: .58rem .62rem .62rem;
}

.lm-app-shell .lm-account-avatar-wrap {
    width: 2.6rem;
    height: 2.6rem;
}

.lm-app-shell .lm-account-summary-copy {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    gap: .05rem;
}

.lm-app-shell .lm-account-summary-copy strong,
.lm-app-shell .lm-account-summary-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-account-summary-copy strong {
    color: var(--lm-ui-ink);
    font-size: .8rem;
    font-weight: 820;
}

.lm-app-shell .lm-account-summary-copy small {
    color: var(--lm-ui-muted);
    font-size: .67rem;
}

.lm-app-shell .lm-account-status {
    flex: 0 0 auto;
    width: .58rem;
    height: .58rem;
    border-radius: 50%;
    background: var(--lm-ui-success);
    box-shadow: 0 0 0 .22rem var(--lm-ui-success-soft);
}

.lm-app-shell .lm-account-action {
    display: flex;
    align-items: center;
    min-height: 3.4rem;
    gap: .65rem;
    padding: .48rem .55rem;
    color: var(--lm-ui-ink-soft);
    border-radius: .82rem;
    text-decoration: none;
    transition:
        color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        background-color var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

.lm-app-shell .lm-account-action:hover {
    color: var(--lm-ui-primary);
    background: var(--lm-ui-primary-soft);
}

.lm-app-shell .lm-account-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    color: currentColor;
    border-radius: .68rem;
    background: var(--lm-ui-surface-muted);
}

.lm-app-shell .lm-account-action > span:not(.lm-account-action-icon) {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    gap: .05rem;
}

.lm-app-shell .lm-account-action strong,
.lm-app-shell .lm-account-action small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-account-action strong {
    color: currentColor;
    font-size: .74rem;
    font-weight: 790;
}

.lm-app-shell .lm-account-action small {
    color: var(--lm-ui-muted);
    font-size: .62rem;
}

.lm-app-shell .lm-account-action .lm-directional-icon {
    margin-inline-start: auto;
    color: var(--lm-ui-faint);
}

.lm-app-shell .lm-account-logout-form {
    margin: 0;
}

.lm-app-shell .lm-account-logout {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 2.8rem;
    gap: .62rem;
    padding: .45rem .55rem;
    color: var(--lm-ui-danger);
    border: 0;
    border-radius: .82rem;
    background: transparent;
    font-size: .74rem;
    font-weight: 800;
    text-align: start;
    transition: background-color var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

.lm-app-shell .lm-account-logout:hover {
    background: var(--lm-ui-danger-soft);
}

.lm-app-shell .lm-account-logout .lm-account-action-icon {
    background: var(--lm-ui-danger-soft);
}

[dir="rtl"] .lm-app-shell .lm-directional-icon {
    transform: scaleX(-1);
}

/* --------------------------------------------------------------------------
   Footer — quiet closing rail, not another navigation panel
   -------------------------------------------------------------------------- */

.lm-app-shell .lm-footer {
    padding-block: .25rem 1rem;
    background: transparent !important;
}

.lm-app-shell .lm-footer-shell {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 4.1rem;
    gap: 1rem;
    padding: .72rem .85rem;
    border-top: 1px solid var(--lm-ui-line);
}

.lm-app-shell .lm-footer-identity {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: .65rem;
}

.lm-app-shell .lm-footer-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.15rem;
    height: 2.15rem;
    color: var(--lm-ui-primary);
    border: 1px solid rgba(var(--lm-ui-primary-rgb), .12);
    border-radius: .76rem;
    background: var(--lm-ui-primary-soft);
}

.lm-app-shell .lm-footer-copy {
    display: grid;
    min-width: 0;
    gap: .05rem;
}

.lm-app-shell .lm-footer-copy strong {
    overflow: hidden;
    color: var(--lm-ui-ink-soft);
    font-size: .72rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-footer-copy span {
    color: var(--lm-ui-muted);
    font-size: .63rem;
}

.lm-app-shell .lm-footer-nav {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .15rem;
    margin-inline-start: auto;
}

.lm-app-shell .lm-footer-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    gap: .36rem;
    padding-inline: .58rem;
    color: var(--lm-ui-muted);
    border-radius: .68rem;
    font-size: .68rem;
    font-weight: 720;
    text-decoration: none;
    transition:
        color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        background-color var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

.lm-app-shell .lm-footer-link:hover {
    color: var(--lm-ui-primary);
    background: var(--lm-ui-primary-soft);
}

.lm-app-shell .lm-footer-session {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: .4rem;
    min-height: 2.15rem;
    padding-inline: .62rem;
    color: var(--lm-ui-muted);
    border: 1px solid var(--lm-ui-line);
    border-radius: var(--lm-ui-radius-pill);
    background: var(--lm-ui-surface-soft);
    font-size: .64rem;
    font-weight: 680;
}

.lm-app-shell .lm-footer-session-dot {
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: var(--lm-ui-success);
    box-shadow: 0 0 0 .18rem var(--lm-ui-success-soft);
}

/* --------------------------------------------------------------------------
   Command bar responsiveness
   -------------------------------------------------------------------------- */

@media (max-width: 1199.98px) {
    .lm-app-shell .lm-command-bar {
        --lm-command-height: 4.25rem;
    }

    .lm-app-shell .lm-workspace-copy {
        display: none;
    }

    .lm-app-shell .lm-workspace-option {
        padding-inline: .58rem;
    }

    .lm-app-shell .lm-user-trigger-copy {
        max-width: 7.5rem;
    }
}

@media (max-width: 991.98px) {
    .lm-app-shell .lm-command-content {
        gap: .4rem;
    }

    .lm-app-shell .lm-workspace-option span,
    .lm-app-shell .lm-language-label,
    .lm-app-shell .lm-user-trigger-copy,
    .lm-app-shell .lm-user-trigger-chevron {
        display: none;
    }

    .lm-app-shell .lm-workspace-option {
        width: 2.25rem;
        padding: 0;
        justify-content: center;
    }

    .lm-app-shell .lm-language-switch {
        padding-inline: .38rem;
    }

    .lm-app-shell .lm-language-switch > i {
        display: none;
    }

    .lm-app-shell .lm-user-trigger {
        padding: .25rem !important;
    }

    .lm-app-shell .lm-footer-shell {
        flex-wrap: wrap;
    }

    .lm-app-shell .lm-footer-nav {
        order: 3;
        width: 100%;
        margin-inline-start: 0;
    }
}

@media (max-width: 767.98px) {
    .lm-app-shell .lm-command-bar {
        margin-inline: .75rem !important;
        padding-inline: .45rem !important;
        border-radius: 1.05rem !important;
    }

    .lm-app-shell .lm-command-context,
    .lm-app-shell .lm-school-context {
        display: none;
    }

    .lm-app-shell .lm-command-actions {
        margin-inline-start: auto;
    }

    .lm-app-shell .lm-language-switch {
        min-height: 2.55rem;
    }

    .lm-app-shell .lm-user-avatar-wrap {
        width: 2rem;
        height: 2rem;
    }

    .lm-app-shell .lm-footer-shell {
        align-items: flex-start;
        padding-inline: .15rem;
    }

    .lm-app-shell .lm-footer-session {
        margin-inline-start: auto;
    }

    .lm-app-shell .lm-footer-nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .35rem;
    }

    .lm-app-shell .lm-footer-link {
        justify-content: center;
        padding-inline: .3rem;
        background: var(--lm-ui-surface-soft);
    }
}

@media (max-width: 479.98px) {
    .lm-app-shell .lm-language-switch {
        gap: 0;
    }

    .lm-app-shell .lm-footer-copy span {
        max-width: 11rem;
    }

    .lm-app-shell .lm-footer-session {
        max-width: 8.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .lm-app-shell .lm-footer-link span {
        display: none;
    }

    .lm-app-shell .lm-footer-link {
        min-height: 2.55rem;
        font-size: 1rem;
    }
}

/* ========================================================================== 
   LAMEA Identity — Phase 3 / Radical Application Shell
   --------------------------------------------------------------------------
   The shell deliberately stops looking like a classic admin template:
   - detached dark command rail instead of a white sidebar;
   - navbar becomes two independent command islands, not a full-width bar;
   - workspace switching lives in the rail, removing duplicated controls;
   - existing menu / dropdown / route / permission contracts remain intact.
   ========================================================================== */

:root {
    --lm-shell-rail: #11131b;
    --lm-shell-rail-raised: #181b25;
    --lm-shell-rail-soft: #202430;
    --lm-shell-rail-line: rgba(255, 255, 255, .08);
    --lm-shell-rail-text: #f7f7fa;
    --lm-shell-rail-muted: #9299aa;
    --lm-shell-accent: #6a5df6;
    --lm-shell-accent-soft: #eeecff;
    --lm-shell-accent-rgb: 106, 93, 246;
    --lm-shell-float-shadow: 0 24px 65px rgba(24, 29, 45, .12);
}

body.lm-app-shell {
    background:
        radial-gradient(circle at 78% -10%, rgba(var(--lm-shell-accent-rgb), .07), transparent 30rem),
        linear-gradient(180deg, #f6f7fa 0, #f1f3f7 100%);
}

/* ---------- desktop shell geometry ---------- */

@media (min-width: 1200px) {
    html.layout-menu-fixed:not(.layout-menu-collapsed) .lm-shell-stage,
    html.layout-menu-fixed-offcanvas:not(.layout-menu-collapsed) .lm-shell-stage {
        padding-inline-start: calc(var(--bs-menu-width) + 1rem) !important;
    }

    html.layout-menu-fixed.layout-menu-collapsed .lm-shell-stage {
        padding-inline-start: calc(var(--bs-menu-collapsed-width) + .8rem) !important;
    }

    .lm-app-shell .lm-command-rail {
        inset-block: 1rem !important;
        inset-inline-start: 1rem !important;
        width: calc(var(--bs-menu-width) - .15rem);
        min-height: 0 !important;
        max-height: calc(100dvh - 2rem) !important;
        border-radius: 1.8rem !important;
    }
}

.lm-app-shell .lm-shell-stage {
    min-width: 0;
}

.lm-app-shell .lm-shell-content {
    position: relative;
    isolation: isolate;
}

.lm-app-shell .lm-shell-content::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    pointer-events: none;
    background-image: radial-gradient(rgba(43, 48, 62, .045) .65px, transparent .65px);
    background-size: 18px 18px;
    -webkit-mask-image: linear-gradient(to bottom, #000 0, transparent 17rem);
    mask-image: linear-gradient(to bottom, #000 0, transparent 17rem);
}

/* ---------- command rail ---------- */

.lm-app-shell .lm-command-rail {
    z-index: 1100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--lm-shell-rail-text);
    border: 1px solid rgba(255, 255, 255, .065) !important;
    background:
        radial-gradient(circle at 14% 4%, rgba(var(--lm-shell-accent-rgb), .18), transparent 10rem),
        var(--lm-shell-rail) !important;
    box-shadow: 0 26px 70px rgba(15, 18, 28, .22) !important;
}

.lm-app-shell .lm-command-rail::before {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    width: 1px;
    content: "";
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,.14) 18%, rgba(255,255,255,.05) 80%, transparent);
    pointer-events: none;
}

.lm-app-shell .lm-rail-head {
    position: relative;
    flex: 0 0 auto;
    padding: 1rem .95rem .7rem;
}

.lm-app-shell .lm-rail-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: .78rem;
    padding: .5rem .48rem .78rem;
    color: inherit;
    text-decoration: none;
}

.lm-app-shell .lm-rail-brand-mark {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.8rem;
    height: 2.8rem;
    color: #fff;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: .95rem .95rem .95rem .35rem;
    background: rgba(255,255,255,.075);
    box-shadow: inset 0 1px rgba(255,255,255,.08);
}

.lm-app-shell .lm-rail-brand-image {
    display: block;
    max-width: 1.85rem;
    max-height: 1.85rem;
    object-fit: contain;
}

.lm-app-shell .lm-rail-brand-fallback {
    display: none;
    align-items: center;
    justify-content: center;
}

.lm-app-shell .lm-rail-brand-fallback.is-visible {
    display: inline-flex;
}

.lm-app-shell .lm-rail-brand-signal {
    position: absolute;
    inset-inline-end: -.13rem;
    inset-block-end: -.13rem;
    width: .7rem;
    height: .7rem;
    border: .14rem solid var(--lm-shell-rail);
    border-radius: 50%;
    background: #6de3bd;
    box-shadow: 0 0 0 .18rem rgba(109,227,189,.1);
}

.lm-app-shell .lm-rail-brand-copy {
    display: grid;
    min-width: 0;
    gap: .06rem;
}

.lm-app-shell .lm-rail-brand-copy strong {
    overflow: hidden;
    color: #fff;
    font-size: .96rem;
    font-weight: 850;
    letter-spacing: -.015em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-rail-brand-copy small {
    overflow: hidden;
    color: var(--lm-shell-rail-muted);
    font-size: .62rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[dir="rtl"] .lm-app-shell .lm-rail-brand-copy strong {
    letter-spacing: 0;
}

/* Workspace is a mode gate, not another pair of Bootstrap buttons. */
.lm-app-shell .lm-rail-mode {
    position: relative;
    margin-top: .2rem;
    padding: .72rem;
    border: 1px solid var(--lm-shell-rail-line);
    border-radius: 1.15rem;
    background: rgba(255,255,255,.035);
}

.lm-app-shell .lm-rail-mode-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .52rem;
    padding-inline: .15rem;
    color: #737b8f;
    font-size: .57rem;
    font-weight: 760;
    letter-spacing: .06em;
    text-transform: uppercase;
}

[dir="rtl"] .lm-app-shell .lm-rail-mode-caption {
    letter-spacing: 0;
}

.lm-app-shell .lm-rail-mode-grid {
    display: grid;
    gap: .34rem;
}

.lm-app-shell .lm-rail-mode-option {
    display: grid;
    grid-template-columns: 2.15rem minmax(0, 1fr);
    align-items: center;
    gap: .55rem;
    min-height: 3.05rem;
    padding: .38rem .48rem;
    color: #aab0bf;
    border: 1px solid transparent;
    border-radius: .88rem;
    text-decoration: none;
    transition:
        color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        background-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        transform var(--lm-ui-motion-fast) var(--lm-ui-ease),
        border-color var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

.lm-app-shell .lm-rail-mode-option:hover {
    color: #fff;
    background: rgba(255,255,255,.055);
    transform: translateX(.12rem);
}

[dir="rtl"] .lm-app-shell .lm-rail-mode-option:hover {
    transform: translateX(-.12rem);
}

.lm-app-shell .lm-rail-mode-option.is-active {
    color: #171824;
    border-color: rgba(255,255,255,.55);
    background: #fff;
    box-shadow: 0 .6rem 1.5rem rgba(0,0,0,.14);
}

.lm-app-shell .lm-rail-mode-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.05rem;
    height: 2.05rem;
    border-radius: .68rem;
    background: rgba(255,255,255,.07);
    font-size: 1rem;
}

.lm-app-shell .lm-rail-mode-option.is-active .lm-rail-mode-icon {
    color: var(--lm-shell-accent);
    background: var(--lm-shell-accent-soft);
}

.lm-app-shell .lm-rail-mode-option > span:last-child {
    display: grid;
    min-width: 0;
    gap: .03rem;
}

.lm-app-shell .lm-rail-mode-option strong {
    font-size: .7rem;
    font-weight: 820;
}

.lm-app-shell .lm-rail-mode-option small {
    overflow: hidden;
    color: #737b8f;
    font-size: .55rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-rail-mode-option:not(.is-active) small {
    color: #777f92;
}

/* Scrollable navigation zone */
.lm-app-shell .lm-command-rail .menu-inner-shadow {
    display: none;
}

.lm-app-shell .lm-command-rail .lm-rail-nav {
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    margin: 0;
    padding: .18rem .8rem .85rem !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.16) transparent;
}

.lm-app-shell .lm-command-rail .lm-rail-nav::-webkit-scrollbar {
    width: 5px;
}

.lm-app-shell .lm-command-rail .lm-rail-nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255,255,255,.14);
}

.lm-app-shell .lm-rail-section-label {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: .95rem .45rem .35rem !important;
    padding: 0 !important;
    color: #646c7e !important;
    font-size: .55rem !important;
    font-weight: 820 !important;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.lm-app-shell .lm-rail-section-label::after {
    flex: 1 1 auto;
    height: 1px;
    content: "";
    background: var(--lm-shell-rail-line);
}

[dir="rtl"] .lm-app-shell .lm-rail-section-label {
    letter-spacing: 0;
}

.lm-app-shell .lm-command-rail .menu-item {
    width: 100%;
    margin: .18rem 0 !important;
}

.lm-app-shell .lm-command-rail .lm-rail-link {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 3rem;
    gap: .62rem;
    margin: 0 !important;
    padding: .42rem .55rem !important;
    color: #abb1bf !important;
    border: 1px solid transparent;
    border-radius: 1rem !important;
    background: transparent !important;
    box-shadow: none !important;
    transition:
        color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        background-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        transform var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

.lm-app-shell .lm-command-rail .lm-rail-link:hover {
    color: #fff !important;
    background: rgba(255,255,255,.055) !important;
    transform: translateX(.14rem);
}

[dir="rtl"] .lm-app-shell .lm-command-rail .lm-rail-link:hover {
    transform: translateX(-.14rem);
}

.lm-app-shell .lm-rail-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.05rem;
    height: 2.05rem;
    color: #8e96a9;
    border-radius: .7rem;
    background: rgba(255,255,255,.045);
    font-size: 1rem;
    transition:
        color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        background-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        transform var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

.lm-app-shell .lm-command-rail .lm-rail-link > div {
    min-width: 0;
    overflow: hidden;
    font-size: .72rem;
    font-weight: 720;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-rail-link-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin-inline-start: auto;
    color: #5f6676;
    transition: transform var(--lm-ui-motion-normal) var(--lm-ui-ease);
}

.lm-app-shell .lm-command-rail .menu-item.open > .lm-rail-link .lm-rail-link-arrow {
    transform: rotate(90deg);
}

[dir="rtl"] .lm-app-shell .lm-command-rail .menu-item.open > .lm-rail-link .lm-rail-link-arrow {
    transform: rotate(-90deg);
}

.lm-app-shell .lm-command-rail .menu-item.active > .lm-rail-link {
    color: #171824 !important;
    border-color: rgba(255,255,255,.55);
    background: #fff !important;
    box-shadow: 0 .75rem 1.65rem rgba(0,0,0,.16) !important;
    transform: none;
}

.lm-app-shell .lm-command-rail .menu-item.active > .lm-rail-link::before {
    position: absolute;
    inset-inline-start: -.18rem;
    width: .22rem;
    height: 1.25rem;
    content: "";
    border-radius: 999px;
    background: var(--lm-shell-accent);
    box-shadow: 0 0 .75rem rgba(var(--lm-shell-accent-rgb), .48);
}

.lm-app-shell .lm-command-rail .menu-item.active > .lm-rail-link .lm-rail-link-icon {
    color: var(--lm-shell-accent) !important;
    background: var(--lm-shell-accent-soft);
}

.lm-app-shell .lm-command-rail .menu-item.active > .lm-rail-link .lm-rail-link-arrow {
    color: #8c90a0;
}

.lm-app-shell .lm-rail-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 1.3rem;
    min-height: 1.3rem;
    margin-inline-start: auto;
    padding-inline: .32rem;
    color: #fff;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 999px;
    background: rgba(255,255,255,.1);
    font-size: .55rem;
    font-weight: 800;
}

.lm-app-shell .lm-command-rail .menu-item.active > .lm-rail-link .lm-rail-badge {
    color: var(--lm-shell-accent);
    border-color: rgba(var(--lm-shell-accent-rgb), .12);
    background: var(--lm-shell-accent-soft);
}

/* Nested navigation reads like a route line instead of nested cards. */
.lm-app-shell .lm-command-rail .lm-rail-subnav {
    position: relative;
    margin: .25rem 0 .45rem !important;
    padding: 0 0 0 2.9rem !important;
    background: transparent !important;
}

[dir="rtl"] .lm-app-shell .lm-command-rail .lm-rail-subnav {
    padding: 0 2.9rem 0 0 !important;
}

.lm-app-shell .lm-command-rail .lm-rail-subnav::before {
    position: absolute;
    inset-block: .25rem .4rem;
    inset-inline-start: 1.57rem;
    width: 1px;
    content: "";
    background: var(--lm-shell-rail-line);
}

.lm-app-shell .lm-command-rail .lm-rail-sublink {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 2.25rem;
    gap: .4rem;
    padding: .32rem .3rem !important;
    color: #7f8799 !important;
    border-radius: .55rem !important;
    background: transparent !important;
    font-size: .65rem;
    font-weight: 650;
}

.lm-app-shell .lm-command-rail .lm-rail-sublink:hover,
.lm-app-shell .lm-command-rail .menu-item.active > .lm-rail-sublink {
    color: #fff !important;
    background: transparent !important;
}

.lm-app-shell .lm-rail-subnode {
    position: absolute;
    inset-inline-start: -1.38rem;
    width: .42rem;
    height: .42rem;
    border: 1px solid #4e5564;
    border-radius: 50%;
    background: var(--lm-shell-rail);
}

.lm-app-shell .lm-command-rail .menu-item.active > .lm-rail-sublink .lm-rail-subnode {
    border-color: #afa7ff;
    background: #8e82ff;
    box-shadow: 0 0 0 .2rem rgba(var(--lm-shell-accent-rgb), .12);
}

.lm-app-shell .lm-rail-subicon {
    flex: 0 0 auto;
    font-size: .8rem;
}

.lm-app-shell .lm-rail-foot {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: .45rem;
    padding: .75rem 1.2rem 1rem;
}

.lm-app-shell .lm-rail-foot-line {
    flex: 1 1 auto;
    height: 1px;
    background: var(--lm-shell-rail-line);
}

.lm-app-shell .lm-rail-foot-dot {
    width: .35rem;
    height: .35rem;
    border-radius: 50%;
    background: #596173;
}

/* ---------- navbar becomes floating command islands ---------- */

.lm-app-shell .lm-command-bar,
.lm-app-shell .layout-navbar.lm-command-bar,
.lm-app-shell .layout-navbar.lm-command-bar.navbar-detached {
    z-index: 1080;
    display: flex;
    align-items: center;
    width: auto !important;
    max-width: none !important;
    min-height: 4.9rem;
    block-size: auto !important;
    margin: 0 !important;
    padding: .9rem clamp(.9rem, 2vw, 1.4rem) .2rem !important;
    overflow: visible;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

.lm-app-shell .lm-command-mobile-toggle {
    flex: 0 0 auto;
    margin-inline-end: .55rem;
}

.lm-app-shell .lm-command-deck {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1 1 auto;
    min-width: 0;
    gap: .75rem;
}

.lm-app-shell .lm-command-island {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 3.55rem;
    padding: .38rem .48rem;
    border: 1px solid rgba(31, 37, 52, .075);
    background: rgba(255,255,255,.94);
    box-shadow: 0 .7rem 2rem rgba(33, 39, 58, .065);
}

.lm-app-shell .lm-command-island-context {
    max-width: min(31rem, 58%);
    gap: .66rem;
    padding-inline: .48rem .72rem;
    border-radius: 1.1rem 1.1rem 1.1rem .42rem;
}

[dir="rtl"] .lm-app-shell .lm-command-island-context {
    border-radius: 1.1rem 1.1rem .42rem 1.1rem;
}

.lm-app-shell .lm-command-island-actions {
    flex: 0 0 auto;
    gap: .34rem;
    margin-inline-start: auto;
    border-radius: 1.1rem .42rem 1.1rem 1.1rem;
}

[dir="rtl"] .lm-app-shell .lm-command-island-actions {
    border-radius: .42rem 1.1rem 1.1rem 1.1rem;
}

.lm-app-shell .lm-command-beacon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.62rem;
    height: 2.62rem;
    color: #fff;
    border-radius: .82rem .82rem .82rem .3rem;
    background: var(--lm-shell-rail);
    font-size: 1rem;
    box-shadow: inset 0 1px rgba(255,255,255,.08);
}

[dir="rtl"] .lm-app-shell .lm-command-beacon {
    border-radius: .82rem .82rem .3rem .82rem;
}

.lm-app-shell .lm-command-beacon-pulse {
    position: absolute;
    inset-inline-end: -.08rem;
    inset-block-end: -.08rem;
    width: .58rem;
    height: .58rem;
    border: .12rem solid #fff;
    border-radius: 50%;
    background: #6de3bd;
}

.lm-app-shell .lm-command-context-copy {
    display: grid;
    min-width: 0;
    gap: .02rem;
}

.lm-app-shell .lm-command-context-copy small {
    overflow: hidden;
    color: #9097a6;
    font-size: .57rem;
    font-weight: 720;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-command-context-copy strong {
    overflow: hidden;
    color: #1e2230;
    font-size: .78rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-command-context-separator {
    flex: 0 0 auto;
    width: 1px;
    height: 1.65rem;
    margin-inline: .1rem;
    background: #e4e7ed;
}

.lm-app-shell .lm-command-context-jump {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 2.3rem;
    gap: .28rem;
    padding-inline: .62rem;
    color: var(--lm-shell-accent);
    border-radius: .7rem;
    background: var(--lm-shell-accent-soft);
    font-size: .62rem;
    font-weight: 790;
    text-decoration: none;
}

.lm-app-shell .lm-command-context-jump:hover {
    color: #4f43d7;
    background: #e5e2ff;
}

.lm-app-shell .lm-command-orb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.62rem;
    height: 2.62rem;
    padding: 0 !important;
    color: #555d6e !important;
    border: 1px solid #e5e8ee;
    border-radius: .86rem;
    background: #f8f9fb;
    text-decoration: none;
    transition:
        color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        background-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        transform var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

.lm-app-shell .lm-command-orb:hover {
    color: var(--lm-shell-accent) !important;
    background: var(--lm-shell-accent-soft);
    transform: translateY(-1px);
}

.lm-app-shell .lm-language-orb {
    font-size: .62rem;
    font-weight: 850;
    letter-spacing: .02em;
}

.lm-app-shell .lm-school-context-trigger {
    min-height: 2.62rem;
    max-width: 15rem;
    border-color: #e5e8ee;
    background: #f8f9fb;
}

.lm-app-shell .lm-school-context-chevron {
    flex: 0 0 auto;
    color: #9aa0ad;
}

/* Recompose the existing user trigger for the action island. */
.lm-app-shell .lm-command-island-actions .lm-user-trigger {
    min-height: 2.62rem;
    margin: 0;
    padding: .2rem .32rem .2rem .23rem !important;
    border: 0 !important;
    background: transparent !important;
}

[dir="rtl"] .lm-app-shell .lm-command-island-actions .lm-user-trigger {
    padding: .2rem .23rem .2rem .32rem !important;
}

.lm-app-shell .lm-command-island-actions .lm-user-avatar-wrap {
    width: 2.18rem;
    height: 2.18rem;
    border: 0;
    box-shadow: none;
}

.lm-app-shell .lm-command-island-actions .lm-user-trigger-copy {
    max-width: 8.5rem;
}

/* ---------- page spacing under the new deck ---------- */

.lm-app-shell .lm-primary-content.container-p-y {
    padding-block-start: .95rem !important;
}

.lm-app-shell .lm-footer {
    padding-inline: clamp(.9rem, 2vw, 1.4rem);
}

/* ---------- collapsed rail compatibility ---------- */

@media (min-width: 1200px) {
    html.layout-menu-collapsed .lm-command-rail {
        width: calc(var(--bs-menu-collapsed-width) - .1rem);
    }

    html.layout-menu-collapsed .lm-command-rail .lm-rail-brand-copy,
    html.layout-menu-collapsed .lm-command-rail .lm-rail-mode,
    html.layout-menu-collapsed .lm-command-rail .lm-rail-section-label,
    html.layout-menu-collapsed .lm-command-rail .lm-rail-link > div,
    html.layout-menu-collapsed .lm-command-rail .lm-rail-link-arrow,
    html.layout-menu-collapsed .lm-command-rail .lm-rail-badge,
    html.layout-menu-collapsed .lm-command-rail .lm-rail-subnav,
    html.layout-menu-collapsed .lm-command-rail .lm-rail-foot {
        display: none !important;
    }

    html.layout-menu-collapsed .lm-command-rail .lm-rail-head {
        padding-inline: .5rem;
    }

    html.layout-menu-collapsed .lm-command-rail .lm-rail-brand,
    html.layout-menu-collapsed .lm-command-rail .lm-rail-link {
        justify-content: center;
        padding-inline: .25rem !important;
    }
}

/* ---------- tablet / mobile ---------- */

@media (max-width: 1199.98px) {
    .lm-app-shell .lm-command-rail {
        inset-block: 0 !important;
        inset-inline-start: 0 !important;
        width: var(--bs-menu-width);
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 1.8rem 1.8rem 0 !important;
    }

    [dir="rtl"] .lm-app-shell .lm-command-rail {
        border-radius: 1.8rem 0 0 1.8rem !important;
    }

    .lm-app-shell .lm-command-bar {
        padding-inline: .8rem !important;
    }

    .lm-app-shell .lm-command-mobile-toggle {
        display: flex;
    }
}

@media (max-width: 991.98px) {
    .lm-app-shell .lm-command-context-jump,
    .lm-app-shell .lm-command-context-separator,
    .lm-app-shell .lm-user-trigger-copy,
    .lm-app-shell .lm-user-trigger-chevron {
        display: none;
    }

    .lm-app-shell .lm-command-island-context {
        max-width: 52%;
    }
}

@media (max-width: 767.98px) {
    .lm-app-shell .lm-command-bar,
    .lm-app-shell .layout-navbar.lm-command-bar.navbar-detached {
        min-height: 4.25rem;
        padding: .62rem .65rem .12rem !important;
    }

    .lm-app-shell .lm-command-deck {
        gap: .4rem;
    }

    .lm-app-shell .lm-command-island {
        min-height: 3.1rem;
        padding: .28rem;
    }

    .lm-app-shell .lm-command-island-context {
        max-width: none;
        flex: 1 1 auto;
        border-radius: .95rem .95rem .95rem .35rem;
    }

    [dir="rtl"] .lm-app-shell .lm-command-island-context {
        border-radius: .95rem .95rem .35rem .95rem;
    }

    .lm-app-shell .lm-command-island-actions {
        border-radius: .95rem .35rem .95rem .95rem;
    }

    [dir="rtl"] .lm-app-shell .lm-command-island-actions {
        border-radius: .35rem .95rem .95rem .95rem;
    }

    .lm-app-shell .lm-command-beacon,
    .lm-app-shell .lm-command-orb {
        width: 2.42rem;
        height: 2.42rem;
    }

    .lm-app-shell .lm-command-context-copy small {
        display: none;
    }

    .lm-app-shell .lm-command-context-copy strong {
        max-width: 9rem;
        font-size: .68rem;
    }

    .lm-app-shell .lm-school-context {
        display: none;
    }
}

@media (max-width: 479.98px) {
    .lm-app-shell .lm-command-context-copy strong {
        max-width: 6.3rem;
    }

    .lm-app-shell .lm-command-island-actions {
        gap: .12rem;
    }

    .lm-app-shell .lm-language-orb {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lm-app-shell .lm-command-rail *,
    .lm-app-shell .lm-command-island * {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ========================================================================== 
   LAMEA Platform Operations Canvas — Phase 4
   Super Admin dashboard. Uses only existing dashboard data and no JavaScript.
   ========================================================================== */

.lm-app-shell .lm-platform-dashboard {
    --lm-platform-dark: #151820;
    --lm-platform-dark-soft: #1c202a;
    --lm-platform-line-dark: rgba(255, 255, 255, .105);
    --lm-platform-signal: #a79fff;
    --lm-platform-signal-soft: rgba(167, 159, 255, .13);
    display: grid;
    gap: clamp(1rem, 1.55vw, 1.35rem);
    width: 100%;
    padding-block-end: clamp(1rem, 2vw, 2rem);
}

/* ---------- stage / network field ---------- */

.lm-app-shell .lm-platform-stage {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(31rem, 1.08fr);
    min-height: clamp(28rem, 48vw, 36rem);
    overflow: hidden;
    color: var(--lm-ui-on-dark);
    background: var(--lm-platform-dark);
    border: 1px solid rgba(255, 255, 255, .075);
    border-radius: 2rem 2rem 5rem 2rem;
    box-shadow: 0 26px 64px rgba(20, 24, 32, .16);
}

[dir="rtl"] .lm-app-shell .lm-platform-stage {
    border-radius: 2rem 2rem 2rem 5rem;
}

.lm-app-shell .lm-platform-stage::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 1.2rem 1.2rem auto auto;
    width: 11rem;
    height: 11rem;
    border: 1px solid rgba(var(--lm-ui-primary-rgb), .34);
    border-radius: 50%;
    transform: translate(40%, -42%);
}

[dir="rtl"] .lm-app-shell .lm-platform-stage::before {
    inset: 1.2rem auto auto 1.2rem;
    transform: translate(-40%, -42%);
}

.lm-app-shell .lm-platform-stage::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: auto auto 1.8rem 1.8rem;
    width: 3.2rem;
    height: 3.2rem;
    border-inline-start: 1px solid rgba(255, 255, 255, .2);
    border-block-end: 1px solid rgba(255, 255, 255, .2);
    opacity: .65;
}

[dir="rtl"] .lm-app-shell .lm-platform-stage::after {
    inset: auto 1.8rem 1.8rem auto;
    border-inline-start: 0;
    border-inline-end: 1px solid rgba(255, 255, 255, .2);
}

.lm-app-shell .lm-platform-stage-copy {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: clamp(2.2rem, 4vw, 4.25rem);
    border-inline-end: 1px solid var(--lm-platform-line-dark);
}

.lm-app-shell .lm-platform-eyebrow {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .58rem;
    align-self: flex-start;
    margin-block-end: 1.35rem;
    color: #c6cad3;
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: .075em;
    text-transform: uppercase;
}

[dir="rtl"] .lm-app-shell .lm-platform-eyebrow {
    letter-spacing: 0;
}

.lm-app-shell .lm-platform-live-mark {
    position: relative;
    width: .58rem;
    height: .58rem;
    border-radius: 50%;
    background: #6fe0b5;
    box-shadow: 0 0 0 .28rem rgba(111, 224, 181, .09);
}

.lm-app-shell .lm-platform-live-mark::after {
    content: "";
    position: absolute;
    inset: -.34rem;
    border: 1px solid rgba(111, 224, 181, .28);
    border-radius: inherit;
}

.lm-app-shell .lm-platform-eyebrow-separator {
    width: 1.8rem;
    height: 1px;
    background: rgba(255, 255, 255, .18);
}

.lm-app-shell .lm-platform-stage h1 {
    max-width: 11ch;
    margin: 0;
    color: #fff;
    font-size: clamp(2.35rem, 5vw, 4.7rem);
    font-weight: 760;
    line-height: .98;
    letter-spacing: -.055em;
}

[dir="rtl"] .lm-app-shell .lm-platform-stage h1 {
    max-width: 13ch;
    line-height: 1.12;
    letter-spacing: 0;
}

.lm-app-shell .lm-platform-stage-copy > p {
    max-width: 38rem;
    margin: 1.35rem 0 0;
    color: #aeb5c2;
    font-size: clamp(.92rem, 1.2vw, 1.06rem);
    line-height: 1.8;
}

.lm-app-shell .lm-platform-primary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin-block-start: 2rem;
}

.lm-app-shell .lm-platform-action {
    display: inline-flex;
    align-items: center;
    gap: .62rem;
    min-height: 3.15rem;
    padding: .48rem .9rem .48rem .5rem;
    color: #f7f8fb;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: .92rem;
    background: rgba(255, 255, 255, .045);
    font-size: .8rem;
    font-weight: 760;
    text-decoration: none;
    transition:
        transform var(--lm-ui-motion-fast) var(--lm-ui-ease),
        border-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        background-color var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

[dir="rtl"] .lm-app-shell .lm-platform-action {
    padding: .48rem .5rem .48rem .9rem;
}

.lm-app-shell .lm-platform-action:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, .24);
    background: rgba(255, 255, 255, .075);
    transform: translateY(-2px);
}

.lm-app-shell .lm-platform-action--primary {
    color: #151820;
    border-color: #fff;
    background: #fff;
}

.lm-app-shell .lm-platform-action--primary:hover {
    color: #151820;
    border-color: #f4f2ff;
    background: #f4f2ff;
}

.lm-app-shell .lm-platform-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.08rem;
    height: 2.08rem;
    flex: 0 0 auto;
    border-radius: .66rem;
    background: rgba(255, 255, 255, .085);
}

.lm-app-shell .lm-platform-action--primary .lm-platform-action-icon {
    color: var(--lm-ui-primary);
    background: var(--lm-ui-primary-soft);
}

.lm-app-shell .lm-platform-network {
    position: relative;
    min-width: 0;
    min-height: 100%;
    overflow: hidden;
    background-color: var(--lm-platform-dark-soft);
    background-image: radial-gradient(circle at center, rgba(255, 255, 255, .055) 1px, transparent 1px);
    background-size: 23px 23px;
}

.lm-app-shell .lm-platform-network::after {
    content: "";
    position: absolute;
    inset: 12% 10%;
    border: 1px solid rgba(var(--lm-ui-primary-rgb), .095);
    border-radius: 2rem;
    transform: rotate(-7deg);
    pointer-events: none;
}

[dir="rtl"] .lm-app-shell .lm-platform-network::after {
    transform: rotate(7deg);
}

.lm-app-shell .lm-platform-network-ring {
    position: absolute;
    inset: 50% auto auto 50%;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.lm-app-shell .lm-platform-network-ring--outer {
    width: min(75%, 28rem);
    aspect-ratio: 1;
}

.lm-app-shell .lm-platform-network-ring--inner {
    width: min(47%, 17.5rem);
    aspect-ratio: 1;
    border-style: dashed;
    border-color: rgba(var(--lm-ui-primary-rgb), .35);
}

.lm-app-shell .lm-platform-network-line {
    position: absolute;
    z-index: 0;
    inset: 50% auto auto 50%;
    width: 29%;
    height: 1px;
    background: rgba(255, 255, 255, .13);
    transform-origin: left center;
}

.lm-app-shell .lm-platform-network-line--a { transform: rotate(-37deg); }
.lm-app-shell .lm-platform-network-line--b { transform: rotate(38deg); }
.lm-app-shell .lm-platform-network-line--c { transform: rotate(144deg); }
.lm-app-shell .lm-platform-network-line--d { transform: rotate(218deg); }

.lm-app-shell .lm-platform-network-core {
    position: absolute;
    z-index: 3;
    inset: 50% auto auto 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: clamp(9.5rem, 17vw, 12rem);
    aspect-ratio: 1;
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 50%;
    background: #171a22;
    box-shadow: 0 0 0 .65rem rgba(255, 255, 255, .02), 0 28px 55px rgba(0, 0, 0, .2);
    transform: translate(-50%, -50%);
}

.lm-app-shell .lm-platform-network-core > span {
    max-width: 9rem;
    color: #abb2bf;
    font-size: .65rem;
    font-weight: 720;
    line-height: 1.35;
}

.lm-app-shell .lm-platform-network-core > strong {
    margin-block: .22rem .12rem;
    color: #fff;
    font-size: clamp(2.2rem, 4vw, 3.45rem);
    font-weight: 760;
    line-height: 1;
    letter-spacing: -.055em;
}

.lm-app-shell .lm-platform-network-core > small {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: #75dfb9;
    font-size: .62rem;
    font-weight: 720;
}

.lm-app-shell .lm-platform-network-node {
    position: absolute;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: .62rem;
    max-width: 12.7rem;
    padding: .62rem .72rem .62rem .58rem;
    color: #eef0f5;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: .95rem;
    background: rgba(24, 28, 37, .94);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
}

[dir="rtl"] .lm-app-shell .lm-platform-network-node {
    padding: .62rem .58rem .62rem .72rem;
}

.lm-app-shell .lm-platform-network-node--subscriptions { inset: 12% auto auto 8%; }
.lm-app-shell .lm-platform-network-node--schools { inset: 15% 7% auto auto; }
.lm-app-shell .lm-platform-network-node--buses { inset: auto auto 13% 9%; }
.lm-app-shell .lm-platform-network-node--students { inset: auto 8% 16% auto; }

[dir="rtl"] .lm-app-shell .lm-platform-network-node--subscriptions { inset: 12% 8% auto auto; }
[dir="rtl"] .lm-app-shell .lm-platform-network-node--schools { inset: 15% auto auto 7%; }
[dir="rtl"] .lm-app-shell .lm-platform-network-node--buses { inset: auto 9% 13% auto; }
[dir="rtl"] .lm-app-shell .lm-platform-network-node--students { inset: auto auto 16% 8%; }

.lm-app-shell .lm-platform-network-node-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    color: var(--lm-platform-signal);
    border-radius: .62rem;
    background: var(--lm-platform-signal-soft);
}

.lm-app-shell .lm-platform-network-node-copy {
    display: grid;
    min-width: 0;
}

.lm-app-shell .lm-platform-network-node-copy strong {
    color: #fff;
    font-size: 1rem;
    line-height: 1.1;
}

.lm-app-shell .lm-platform-network-node-copy small {
    margin-block-start: .14rem;
    overflow: hidden;
    color: #aeb5c1;
    font-size: .59rem;
    line-height: 1.25;
    text-overflow: ellipsis;
}

/* ---------- flash notices ---------- */

.lm-app-shell .lm-platform-notice {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .85rem 1rem;
    color: var(--lm-ui-ink-soft);
    border-inline-start: 3px solid currentColor;
    border-radius: .65rem;
    background: var(--lm-ui-surface);
    box-shadow: var(--lm-ui-shadow-xs);
}

.lm-app-shell .lm-platform-notice > span {
    flex: 0 0 auto;
}

.lm-app-shell .lm-platform-notice--success { color: var(--lm-ui-success); }
.lm-app-shell .lm-platform-notice--danger { color: var(--lm-ui-danger); }

/* ---------- attention rail ---------- */

.lm-app-shell .lm-platform-attention {
    display: grid;
    grid-template-columns: minmax(12rem, .72fr) minmax(0, 2.3fr) minmax(10rem, .68fr);
    align-items: stretch;
    overflow: hidden;
    border-block: 1px solid var(--lm-ui-line-strong);
    background: rgba(255, 255, 255, .64);
}

.lm-app-shell .lm-platform-attention-lead,
.lm-app-shell .lm-platform-attention-footnote {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    padding: 1rem 1.15rem;
}

.lm-app-shell .lm-platform-attention-lead {
    border-inline-end: 1px solid var(--lm-ui-line);
}

.lm-app-shell .lm-platform-attention-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.55rem;
    height: 2.55rem;
    flex: 0 0 auto;
    color: var(--lm-ui-primary);
    border-radius: 50%;
    background: var(--lm-ui-primary-soft);
}

.lm-app-shell .lm-platform-attention-lead > div {
    display: grid;
}

.lm-app-shell .lm-platform-attention-lead span:not(.lm-platform-attention-symbol) {
    color: var(--lm-ui-muted);
    font-size: .67rem;
    font-weight: 750;
}

.lm-app-shell .lm-platform-attention-lead strong {
    color: var(--lm-ui-ink);
    font-size: 1.65rem;
    line-height: 1.05;
}

.lm-app-shell .lm-platform-attention-stream {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lm-app-shell .lm-platform-attention-item {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: .7rem;
    min-width: 0;
    padding: .88rem 1rem;
    border-inline-end: 1px solid var(--lm-ui-line);
}

.lm-app-shell .lm-platform-attention-item::before {
    content: "";
    position: absolute;
    inset-block: .8rem;
    inset-inline-start: 0;
    width: 2px;
    border-radius: 999px;
    background: var(--lm-ui-line-strong);
}

.lm-app-shell .lm-platform-attention-item.is-warning::before { background: var(--lm-ui-warning); }
.lm-app-shell .lm-platform-attention-item.is-danger::before { background: var(--lm-ui-danger); }
.lm-app-shell .lm-platform-attention-item.is-clear::before { background: var(--lm-ui-success); }

.lm-app-shell .lm-platform-attention-index {
    align-self: start;
    margin-block-start: .12rem;
    color: var(--lm-ui-faint);
    font-size: .57rem;
    font-weight: 800;
    letter-spacing: .06em;
}

.lm-app-shell .lm-platform-attention-item > div {
    display: grid;
    min-width: 0;
}

.lm-app-shell .lm-platform-attention-item strong {
    color: var(--lm-ui-ink);
    font-size: 1.15rem;
    line-height: 1.1;
}

.lm-app-shell .lm-platform-attention-item div > span {
    margin-block-start: .16rem;
    overflow: hidden;
    color: var(--lm-ui-muted);
    font-size: .62rem;
    line-height: 1.25;
    text-overflow: ellipsis;
}

.lm-app-shell .lm-platform-attention-footnote {
    justify-content: center;
    flex-direction: column;
    align-items: flex-start;
    gap: .12rem;
    color: var(--lm-ui-muted);
}

.lm-app-shell .lm-platform-attention-footnote span {
    font-size: .59rem;
}

.lm-app-shell .lm-platform-attention-footnote strong {
    color: var(--lm-ui-ink-soft);
    font-size: .72rem;
}

/* ---------- lower workspace ---------- */

.lm-app-shell .lm-platform-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(19rem, .72fr);
    gap: clamp(1rem, 1.6vw, 1.4rem);
    align-items: start;
}

.lm-app-shell .lm-platform-ledger,
.lm-app-shell .lm-platform-expiry {
    min-width: 0;
}

.lm-app-shell .lm-platform-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4.6rem;
    padding: .65rem .25rem .9rem;
    border-block-end: 1px solid var(--lm-ui-line-strong);
}

.lm-app-shell .lm-platform-section-head > div:first-child {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    min-width: 0;
}

.lm-app-shell .lm-platform-section-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    flex: 0 0 auto;
    margin-block-start: .16rem;
    color: var(--lm-ui-faint);
    border: 1px solid var(--lm-ui-line);
    border-radius: 50%;
    font-size: .55rem;
    font-weight: 800;
}

.lm-app-shell .lm-platform-section-kicker {
    display: block;
    margin-block-end: .1rem;
    color: var(--lm-ui-muted);
    font-size: .62rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .06em;
}

[dir="rtl"] .lm-app-shell .lm-platform-section-kicker {
    letter-spacing: 0;
}

.lm-app-shell .lm-platform-section-head h2 {
    margin: 0;
    color: var(--lm-ui-ink);
    font-size: clamp(1.05rem, 1.8vw, 1.35rem);
    font-weight: 760;
}

.lm-app-shell .lm-platform-text-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    flex: 0 0 auto;
    color: var(--lm-ui-primary);
    font-size: .7rem;
    font-weight: 780;
    text-decoration: none;
}

.lm-app-shell .lm-platform-text-link:hover {
    color: var(--lm-ui-primary-strong);
}

.lm-app-shell .lm-platform-company-list {
    border-block-end: 1px solid var(--lm-ui-line-strong);
}

.lm-app-shell .lm-platform-company-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(13rem, 1.35fr) minmax(6rem, .48fr) minmax(10rem, .9fr) minmax(9rem, .72fr) 2.75rem;
    align-items: center;
    gap: .9rem;
    min-height: 6.25rem;
    padding: .9rem .35rem .9rem 1rem;
    border-block-end: 1px solid var(--lm-ui-line);
    transition:
        background-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        transform var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

[dir="rtl"] .lm-app-shell .lm-platform-company-row {
    padding: .9rem 1rem .9rem .35rem;
}

.lm-app-shell .lm-platform-company-row:last-child {
    border-block-end: 0;
}

.lm-app-shell .lm-platform-company-row::before {
    content: "";
    position: absolute;
    inset-block: 1rem;
    inset-inline-start: 0;
    width: 2px;
    border-radius: 99px;
    background: var(--lm-ui-line-strong);
}

.lm-app-shell .lm-platform-company-row.is-active::before { background: var(--lm-ui-success); }
.lm-app-shell .lm-platform-company-row.is-suspended::before { background: var(--lm-ui-danger); }
.lm-app-shell .lm-platform-company-row.is-inactive::before { background: var(--lm-ui-faint); }

.lm-app-shell .lm-platform-company-row:hover {
    background: rgba(255, 255, 255, .68);
    transform: translateY(-1px);
}

.lm-app-shell .lm-platform-company-identity {
    display: flex;
    align-items: center;
    gap: .72rem;
    min-width: 0;
}

.lm-app-shell .lm-platform-company-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.7rem;
    height: 2.7rem;
    flex: 0 0 auto;
    color: var(--lm-ui-primary);
    border: 1px solid rgba(var(--lm-ui-primary-rgb), .1);
    border-radius: .85rem .85rem .85rem .28rem;
    background: var(--lm-ui-primary-soft);
    font-size: .9rem;
    font-weight: 820;
}

[dir="rtl"] .lm-app-shell .lm-platform-company-mark {
    border-radius: .85rem .85rem .28rem .85rem;
}

.lm-app-shell .lm-platform-company-identity > div,
.lm-app-shell .lm-platform-company-plan {
    display: grid;
    min-width: 0;
}

.lm-app-shell .lm-platform-company-name {
    overflow: hidden;
    color: var(--lm-ui-ink);
    font-size: .79rem;
    font-weight: 770;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-platform-company-name:hover {
    color: var(--lm-ui-primary);
}

.lm-app-shell .lm-platform-company-identity > div > span {
    margin-block-start: .13rem;
    overflow: hidden;
    color: var(--lm-ui-muted);
    font-size: .62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-platform-company-status {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    min-width: 0;
    color: var(--lm-ui-ink-soft);
    font-size: .65rem;
    font-weight: 730;
}

.lm-app-shell .lm-platform-status-dot {
    width: .48rem;
    height: .48rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--lm-ui-faint);
}

.lm-app-shell .lm-platform-company-row.is-active .lm-platform-status-dot { background: var(--lm-ui-success); }
.lm-app-shell .lm-platform-company-row.is-suspended .lm-platform-status-dot { background: var(--lm-ui-danger); }

.lm-app-shell .lm-platform-row-label,
.lm-app-shell .lm-platform-company-counts span {
    color: var(--lm-ui-muted);
    font-size: .57rem;
    font-weight: 690;
}

.lm-app-shell .lm-platform-company-plan > strong {
    margin-block-start: .13rem;
    overflow: hidden;
    color: var(--lm-ui-ink-soft);
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-platform-company-plan > small {
    margin-block-start: .08rem;
    overflow: hidden;
    color: var(--lm-ui-muted);
    font-size: .58rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-platform-plan-empty {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    margin-block-start: .2rem;
    width: fit-content;
    padding: .16rem .42rem;
    color: var(--lm-ui-muted);
    border-radius: 999px;
    background: var(--lm-ui-surface-muted);
    font-size: .58rem;
    font-weight: 700;
}

.lm-app-shell .lm-platform-company-counts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
}

.lm-app-shell .lm-platform-company-counts > div {
    display: grid;
    gap: .08rem;
    min-width: 0;
    padding-inline-start: .58rem;
    border-inline-start: 1px solid var(--lm-ui-line);
}

.lm-app-shell .lm-platform-company-counts strong {
    color: var(--lm-ui-ink);
    font-size: .78rem;
}

.lm-app-shell .lm-platform-row-action,
.lm-app-shell .lm-platform-expiry-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.45rem;
    height: 2.45rem;
    flex: 0 0 auto;
    color: var(--lm-ui-ink-soft);
    border: 1px solid var(--lm-ui-line);
    border-radius: 50%;
    background: rgba(255, 255, 255, .72);
    text-decoration: none;
    transition:
        color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        border-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        background-color var(--lm-ui-motion-fast) var(--lm-ui-ease),
        transform var(--lm-ui-motion-fast) var(--lm-ui-ease);
}

.lm-app-shell .lm-platform-row-action:hover,
.lm-app-shell .lm-platform-expiry-action:hover {
    color: #fff;
    border-color: var(--lm-ui-primary);
    background: var(--lm-ui-primary);
    transform: translateY(-2px);
}

/* ---------- expiry lane ---------- */

.lm-app-shell .lm-platform-expiry {
    position: relative;
    padding-inline: clamp(.85rem, 1.6vw, 1.25rem);
    border: 1px solid var(--lm-ui-line);
    border-radius: 1.4rem 1.4rem 2.7rem 1.4rem;
    background: rgba(255, 255, 255, .78);
    box-shadow: var(--lm-ui-shadow-xs);
}

[dir="rtl"] .lm-app-shell .lm-platform-expiry {
    border-radius: 1.4rem 1.4rem 1.4rem 2.7rem;
}

.lm-app-shell .lm-platform-section-head--compact {
    padding-inline: .1rem;
}

.lm-app-shell .lm-platform-expiry-track {
    position: relative;
    padding-block: .35rem .85rem;
}

.lm-app-shell .lm-platform-expiry-track::before {
    content: "";
    position: absolute;
    inset-block: .85rem 1.2rem;
    inset-inline-start: 1.03rem;
    width: 1px;
    background: var(--lm-ui-line-strong);
}

.lm-app-shell .lm-platform-expiry-event {
    position: relative;
    display: grid;
    grid-template-columns: 2rem 3rem minmax(0, 1fr) 2.45rem;
    align-items: center;
    gap: .68rem;
    min-height: 5.25rem;
    padding-block: .72rem;
    border-block-end: 1px solid var(--lm-ui-line);
}

.lm-app-shell .lm-platform-expiry-event:last-child {
    border-block-end: 0;
}

.lm-app-shell .lm-platform-expiry-point {
    position: relative;
    z-index: 2;
    justify-self: center;
    width: .62rem;
    height: .62rem;
    border: 2px solid var(--lm-ui-surface);
    border-radius: 50%;
    background: var(--lm-ui-warning);
    box-shadow: 0 0 0 1px rgba(179, 109, 5, .22);
}

.lm-app-shell .lm-platform-expiry-date {
    display: grid;
    justify-items: start;
}

.lm-app-shell .lm-platform-expiry-date strong {
    color: var(--lm-ui-ink);
    font-size: 1.12rem;
    line-height: 1;
}

.lm-app-shell .lm-platform-expiry-date span {
    margin-block-start: .08rem;
    color: var(--lm-ui-muted);
    font-size: .56rem;
    font-weight: 720;
    text-transform: uppercase;
}

.lm-app-shell .lm-platform-expiry-copy {
    display: grid;
    min-width: 0;
}

.lm-app-shell .lm-platform-expiry-copy > strong,
.lm-app-shell .lm-platform-expiry-copy > span,
.lm-app-shell .lm-platform-expiry-copy > small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-app-shell .lm-platform-expiry-copy > strong {
    color: var(--lm-ui-ink-soft);
    font-size: .7rem;
}

.lm-app-shell .lm-platform-expiry-copy > span {
    margin-block-start: .1rem;
    color: var(--lm-ui-muted);
    font-size: .6rem;
}

.lm-app-shell .lm-platform-expiry-copy > small {
    margin-block-start: .16rem;
    color: var(--lm-ui-faint);
    font-size: .54rem;
}

/* ---------- empty states ---------- */

.lm-app-shell .lm-platform-empty-state {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 13rem;
    padding: 1.5rem;
    color: var(--lm-ui-muted);
    border-block-end: 1px solid var(--lm-ui-line-strong);
}

.lm-app-shell .lm-platform-empty-state > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin-block-end: .7rem;
    color: var(--lm-ui-primary);
    border-radius: 1rem;
    background: var(--lm-ui-primary-soft);
    font-size: 1.2rem;
}

.lm-app-shell .lm-platform-empty-state p {
    max-width: 28rem;
    margin: 0 0 .7rem;
    color: var(--lm-ui-muted);
    font-size: .72rem;
}

.lm-app-shell .lm-platform-empty-state--compact {
    min-height: 12rem;
    border-block-end: 0;
}

/* ---------- responsive ---------- */

@media (max-width: 1399.98px) {
    .lm-app-shell .lm-platform-stage {
        grid-template-columns: minmax(0, .92fr) minmax(27rem, 1.08fr);
    }

    .lm-app-shell .lm-platform-company-row {
        grid-template-columns: minmax(12rem, 1.25fr) minmax(5.4rem, .45fr) minmax(9rem, .8fr) minmax(8.2rem, .7fr) 2.6rem;
        gap: .7rem;
    }
}

@media (max-width: 1199.98px) {
    .lm-app-shell .lm-platform-stage {
        grid-template-columns: minmax(0, 1fr) minmax(25rem, .92fr);
    }

    .lm-app-shell .lm-platform-stage-copy {
        padding: clamp(2rem, 3.5vw, 3rem);
    }

    .lm-app-shell .lm-platform-stage h1 {
        font-size: clamp(2.25rem, 4.2vw, 3.55rem);
    }

    .lm-app-shell .lm-platform-workspace {
        grid-template-columns: 1fr;
    }

    .lm-app-shell .lm-platform-expiry {
        border-radius: 1.4rem;
    }
}

@media (max-width: 991.98px) {
    .lm-app-shell .lm-platform-stage {
        grid-template-columns: 1fr;
        min-height: auto;
        border-radius: 1.6rem 1.6rem 3rem 1.6rem;
    }

    [dir="rtl"] .lm-app-shell .lm-platform-stage {
        border-radius: 1.6rem 1.6rem 1.6rem 3rem;
    }

    .lm-app-shell .lm-platform-stage-copy {
        border-inline-end: 0;
        border-block-end: 1px solid var(--lm-platform-line-dark);
    }

    .lm-app-shell .lm-platform-stage h1 {
        max-width: 14ch;
    }

    .lm-app-shell .lm-platform-network {
        min-height: 31rem;
    }

    .lm-app-shell .lm-platform-attention {
        grid-template-columns: 1fr;
    }

    .lm-app-shell .lm-platform-attention-lead {
        border-inline-end: 0;
        border-block-end: 1px solid var(--lm-ui-line);
    }

    .lm-app-shell .lm-platform-attention-footnote {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-block-start: 1px solid var(--lm-ui-line);
    }

    .lm-app-shell .lm-platform-company-row {
        grid-template-columns: minmax(12rem, 1.3fr) minmax(5.6rem, .5fr) minmax(9rem, .85fr) 2.6rem;
    }

    .lm-app-shell .lm-platform-company-counts {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .lm-app-shell .lm-platform-dashboard {
        gap: .85rem;
    }

    .lm-app-shell .lm-platform-stage-copy {
        padding: 1.55rem 1.3rem 1.7rem;
    }

    .lm-app-shell .lm-platform-stage h1 {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .lm-app-shell .lm-platform-stage-copy > p {
        font-size: .86rem;
        line-height: 1.7;
    }

    .lm-app-shell .lm-platform-primary-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .lm-app-shell .lm-platform-action {
        width: 100%;
    }

    .lm-app-shell .lm-platform-network {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .65rem;
        min-height: auto;
        padding: 1.2rem;
        background-image: none;
    }

    .lm-app-shell .lm-platform-network-ring,
    .lm-app-shell .lm-platform-network-line,
    .lm-app-shell .lm-platform-network::after {
        display: none;
    }

    .lm-app-shell .lm-platform-network-core,
    .lm-app-shell .lm-platform-network-node {
        position: static;
        inset: auto;
        transform: none;
    }

    .lm-app-shell .lm-platform-network-core {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 9rem;
        aspect-ratio: auto;
        border-radius: 1.2rem;
    }

    .lm-app-shell .lm-platform-network-node {
        max-width: none;
        min-height: 4.5rem;
    }

    .lm-app-shell .lm-platform-attention-stream {
        grid-template-columns: 1fr;
    }

    .lm-app-shell .lm-platform-attention-item {
        border-inline-end: 0;
        border-block-end: 1px solid var(--lm-ui-line);
    }

    .lm-app-shell .lm-platform-attention-item:last-child {
        border-block-end: 0;
    }

    .lm-app-shell .lm-platform-section-head {
        align-items: center;
        min-height: auto;
        padding-block: .7rem;
    }

    .lm-app-shell .lm-platform-company-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: .65rem .8rem;
        min-height: 0;
        padding-block: 1rem;
    }

    .lm-app-shell .lm-platform-company-identity {
        grid-column: 1;
    }

    .lm-app-shell .lm-platform-company-status {
        grid-column: 1;
        padding-inline-start: 3.42rem;
    }

    .lm-app-shell .lm-platform-company-plan {
        grid-column: 1 / -1;
        padding-inline-start: 3.42rem;
    }

    .lm-app-shell .lm-platform-row-action {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

@media (max-width: 479.98px) {
    .lm-app-shell .lm-platform-network {
        grid-template-columns: 1fr;
    }

    .lm-app-shell .lm-platform-network-core {
        grid-column: auto;
    }

    .lm-app-shell .lm-platform-eyebrow-separator,
    .lm-app-shell .lm-platform-eyebrow span:last-child {
        display: none;
    }

    .lm-app-shell .lm-platform-section-head {
        gap: .5rem;
    }

    .lm-app-shell .lm-platform-text-link span {
        display: none;
    }

    .lm-app-shell .lm-platform-expiry {
        padding-inline: .75rem;
    }

    .lm-app-shell .lm-platform-expiry-event {
        grid-template-columns: 1.7rem 2.55rem minmax(0, 1fr) 2.35rem;
        gap: .5rem;
    }

    .lm-app-shell .lm-platform-expiry-track::before {
        inset-inline-start: .85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lm-app-shell .lm-platform-dashboard * {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
