/**
 * MentorNova Design System — Aesthetic Build 1
 * Loaded after theme/app CSS; additive tokens and utilities.
 */

/* -------------------------------------------------------------------------- */
/* 1. Design tokens                                                           */
/* -------------------------------------------------------------------------- */

:root {
    --mn-primary: #c9182b;
    --mn-primary-dark: #9f1020;
    --mn-primary-soft: rgba(201, 24, 43, 0.1);

    --mn-bg: #f5f7fb;
    --mn-bg-soft: #eef1f6;

    --mn-surface: rgba(255, 255, 255, 0.72);
    --mn-surface-strong: rgba(255, 255, 255, 0.9);

    --mn-border: rgba(255, 255, 255, 0.55);
    --mn-border-soft: rgba(15, 23, 42, 0.08);

    --mn-text: #1f2937;
    --mn-muted: #6b7280;

    --mn-success: #16a34a;
    --mn-warning: #d97706;
    --mn-danger: #dc2626;
    --mn-info: #2563eb;

    --mn-radius-sm: 10px;
    --mn-radius-md: 14px;
    --mn-radius-lg: 18px;
    --mn-radius-xl: 24px;

    --mn-shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.06);
    --mn-shadow-md: 0 14px 35px rgba(15, 23, 42, 0.1);
    --mn-shadow-red: 0 12px 28px rgba(201, 24, 43, 0.25);
}

/* -------------------------------------------------------------------------- */
/* 2. Global shell background (does not replace auth layout tokens)          */
/* -------------------------------------------------------------------------- */

body.app-body,
body.auth-body {
    background:
        radial-gradient(circle at top right, rgba(201, 24, 43, 0.08), transparent 35%),
        linear-gradient(180deg, #f7f8fb 0%, #eef1f6 100%);
    color: var(--mn-text);
}

/* -------------------------------------------------------------------------- */
/* 3. Glass & surface utilities                                               */
/* -------------------------------------------------------------------------- */

.mn-glass {
    background: var(--mn-surface);
    border: 1px solid var(--mn-border);
    border-radius: var(--mn-radius-lg);
    box-shadow: var(--mn-shadow-sm);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mn-card {
    background: var(--mn-surface-strong);
    border: 1px solid var(--mn-border);
    border-radius: var(--mn-radius-lg);
    box-shadow: var(--mn-shadow-sm);
    padding: 1.125rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mn-panel {
    background: var(--mn-surface);
    border: 1px solid var(--mn-border-soft);
    border-radius: var(--mn-radius-md);
    box-shadow: var(--mn-shadow-sm);
    padding: 1rem 1.1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mn-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.35rem 1.4rem;
    border-radius: var(--mn-radius-xl);
    background: var(--mn-surface-strong);
    border: 1px solid var(--mn-border);
    box-shadow: var(--mn-shadow-md);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.mn-hero-main {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    min-width: 0;
    flex: 1 1 280px;
}

.mn-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    justify-content: flex-end;
    flex: 0 1 auto;
}

.mn-hero-actions--start {
    justify-content: flex-start;
}

.mn-span-full {
    grid-column: 1 / -1;
}

.mn-kpi-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    padding: 1rem 1.1rem;
    border-radius: var(--mn-radius-md);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(245, 247, 251, 0.88) 100%);
    border: 1px solid var(--mn-border-soft);
    box-shadow: var(--mn-shadow-sm);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.mn-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--mn-shadow-md);
}

/* Vertical rhythm block for module sections (e.g. RFID Control Center). */
.mn-section {
    margin-bottom: 1.5rem;
}

.mn-section:last-child {
    margin-bottom: 0;
}

/* -------------------------------------------------------------------------- */
/* 4. Buttons                                                                 */
/* -------------------------------------------------------------------------- */

.mn-btn {
    --mn-btn-h: 2.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: var(--mn-btn-h);
    padding: 0 1.1rem;
    border-radius: var(--mn-radius-md);
    font-size: 0.94rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}

.mn-btn:active {
    transform: translateY(1px);
}

.mn-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #ff4d4f, #c9182b);
    border-color: rgba(201, 24, 43, 0.35);
    box-shadow: 0 10px 25px rgba(201, 24, 43, 0.35);
}

.mn-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(201, 24, 43, 0.45);
}

.mn-btn-secondary {
    color: var(--mn-text);
    background: var(--mn-surface-strong);
    border-color: var(--mn-border-soft);
    box-shadow: var(--mn-shadow-sm);
}

.mn-btn-secondary:hover {
    transform: translateY(-2px);
    border-color: rgba(201, 24, 43, 0.2);
}

.mn-btn-ghost {
    color: var(--mn-text);
    background: rgba(255, 255, 255, 0.55);
    border-color: var(--mn-border-soft);
}

.mn-btn-ghost:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.85);
}

.mn-btn-danger {
    color: #fff;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    border-color: rgba(220, 38, 38, 0.35);
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.22);
}

.mn-btn-danger:hover {
    transform: translateY(-2px);
}

.mn-btn-icon {
    padding-inline: 0.85rem;
    min-width: var(--mn-btn-h);
}

.mn-btn .mn-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* -------------------------------------------------------------------------- */
/* 5. Icon system                                                             */
/* -------------------------------------------------------------------------- */

.mn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.mn-icon-box {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--mn-radius-sm);
    background: rgba(15, 23, 42, 0.06);
    border: 1px solid var(--mn-border-soft);
    font-size: 1.15rem;
}

.mn-page-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--mn-radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    background: var(--mn-primary-soft);
    border: 1px solid rgba(201, 24, 43, 0.12);
    box-shadow: var(--mn-shadow-sm);
}

.mn-action-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--mn-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--mn-border-soft);
}

/* Sidebar: emoji-friendly, light glow when active */
.sidebar .mn-sidebar-icon,
.sidebar .sidebar__icon.mn-sidebar-icon {
    text-transform: none;
    font-size: 1.05rem;
    line-height: 1;
    font-weight: 400;
    letter-spacing: normal;
}

.sidebar__link.is-active .mn-sidebar-icon,
.sidebar__link.is-active .sidebar__icon.mn-sidebar-icon {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 18px rgba(255, 255, 255, 0.25);
}

/* -------------------------------------------------------------------------- */
/* 6. Tables                                                                  */
/* -------------------------------------------------------------------------- */

.mn-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-radius: var(--mn-radius-lg);
    border: 1px solid var(--mn-border-soft);
    background: var(--mn-surface-strong);
    box-shadow: var(--mn-shadow-sm);
    -webkit-overflow-scrolling: touch;
}

.mn-table {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.92rem;
}

.mn-table th,
.mn-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    vertical-align: top;
}

.mn-table th {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mn-muted);
    background: rgba(15, 23, 42, 0.03);
}

.mn-table tr:last-child td {
    border-bottom: 0;
}

.mn-table tbody tr:hover td {
    background: rgba(201, 24, 43, 0.04);
}

/* -------------------------------------------------------------------------- */
/* 7. Badges                                                                  */
/* -------------------------------------------------------------------------- */

.mn-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.35;
    border: 1px solid transparent;
}

.mn-badge-muted {
    color: var(--mn-muted);
    background: rgba(15, 23, 42, 0.06);
    border-color: var(--mn-border-soft);
}

.mn-badge-primary {
    color: var(--mn-primary-dark);
    background: var(--mn-primary-soft);
    border-color: rgba(201, 24, 43, 0.15);
}

.mn-badge-success {
    color: #14532d;
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.2);
}

.mn-badge-warning {
    color: #7c2d12;
    background: rgba(217, 119, 6, 0.12);
    border-color: rgba(217, 119, 6, 0.22);
}

.mn-badge-danger {
    color: #7f1d1d;
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.2);
}

.mn-badge-info {
    color: #1e3a8a;
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.18);
}

/* -------------------------------------------------------------------------- */
/* 8. Forms                                                                   */
/* -------------------------------------------------------------------------- */

.mn-form-group {
    display: grid;
    gap: 0.4rem;
}

.mn-label {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--mn-text);
}

.mn-input,
.mn-select,
.mn-textarea {
    width: 100%;
    max-width: 100%;
    min-height: 2.65rem;
    padding: 0.55rem 0.85rem;
    border-radius: var(--mn-radius-sm);
    border: 1px solid var(--mn-border-soft);
    background: rgba(255, 255, 255, 0.92);
    color: var(--mn-text);
    font-size: 0.95rem;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.mn-textarea {
    min-height: 6rem;
    resize: vertical;
}

.mn-input:focus,
.mn-select:focus,
.mn-textarea:focus {
    outline: none;
    border-color: rgba(201, 24, 43, 0.45);
    box-shadow: 0 0 0 3px var(--mn-primary-soft);
}

.mn-help-text {
    font-size: 0.82rem;
    color: var(--mn-muted);
    line-height: 1.45;
}

.mn-form-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 720px) {
    .mn-form-grid--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* -------------------------------------------------------------------------- */
/* 9. Hero pattern                                                            */
/* -------------------------------------------------------------------------- */

.mn-eyebrow {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--mn-muted);
    margin-bottom: 0.35rem;
}

.mn-hero h1,
.mn-hero h2 {
    margin: 0 0 0.45rem;
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    line-height: 1.15;
    color: var(--mn-text);
    font-weight: 600;
}

.mn-hero-main p {
    margin: 0;
    max-width: 40rem;
    color: var(--mn-muted);
    line-height: 1.55;
    font-size: 0.96rem;
}

/* -------------------------------------------------------------------------- */
/* 10. Responsive                                                             */
/* -------------------------------------------------------------------------- */

@media (max-width: 720px) {
    .mn-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .mn-hero-actions {
        justify-content: flex-start;
    }

    .mn-hero-actions .mn-btn {
        flex: 1 1 auto;
        min-width: min(100%, 12rem);
        justify-content: center;
    }
}

/* -------------------------------------------------------------------------- */
/* 11. Layout grids & SPEECH Lab / dashboard utilities                        */
/* -------------------------------------------------------------------------- */

.mn-page-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.mn-stack {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.mn-muted {
    color: var(--mn-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.mn-muted--tight {
    margin: 0;
}

.mn-muted--below-title {
    margin: 0 0 1rem;
}

.mn-muted--spaced-top {
    margin-top: 1rem;
}

.mn-grid {
    display: grid;
    gap: 1rem;
    width: 100%;
    min-width: 0;
}

.mn-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mn-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

@media (max-width: 1080px) {
    .mn-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .mn-grid-2,
    .mn-grid-3,
    .mn-grid-4 {
        grid-template-columns: 1fr;
    }
}

.mn-card-title {
    margin: 0 0 0.35rem;
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--mn-text);
    line-height: 1.25;
}

.mn-section-title {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--mn-text);
    line-height: 1.25;
}

.mn-card-text {
    margin: 0 0 0.85rem;
    font-size: 0.92rem;
    color: var(--mn-muted);
    line-height: 1.55;
}

.mn-kpi-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.mn-kpi-card__icon,
.mn-kpi-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.mn-kpi-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.15rem;
}

.mn-stat-label,
.mn-kpi-label {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mn-muted);
}

.mn-stat-value,
.mn-kpi-value {
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--mn-text);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.mn-kpi-hint,
.mn-kpi-helper {
    font-size: 0.78rem;
    color: var(--mn-muted);
    line-height: 1.45;
    margin-top: 0.15rem;
}

/* Compact chips for KPI footers (e.g. AI mode banners) — light workspace */
.mn-kpi-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.35;
    border: 1px solid var(--mn-border-soft);
    background: rgba(15, 23, 42, 0.05);
    color: var(--mn-text);
}

.mn-kpi-chip--success {
    color: #14532d;
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.22);
}

.mn-kpi-chip--warning {
    color: #7c2d12;
    background: rgba(217, 119, 6, 0.14);
    border-color: rgba(217, 119, 6, 0.24);
}

.mn-kpi-chip--danger {
    color: #7f1d1d;
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.22);
}

.mn-kpi-chip--muted {
    color: var(--mn-muted);
    background: rgba(15, 23, 42, 0.05);
}

.mn-kpi-chip--info {
    color: #1e3a8a;
    background: rgba(37, 99, 235, 0.11);
    border-color: rgba(37, 99, 235, 0.2);
}

.mn-kpi-card--emphasis {
    border-color: rgba(217, 119, 6, 0.45);
    background: linear-gradient(180deg, rgba(254, 243, 199, 0.35) 0%, rgba(255, 255, 255, 0.92) 100%);
    box-shadow: 0 10px 26px rgba(217, 119, 6, 0.12);
}

/* Tone accents (light workspace; dark theme overrides card surface) */
.mn-kpi-card--neutral {
    box-shadow: inset 0 2px 0 0 rgba(100, 116, 139, 0.35), var(--mn-shadow-sm);
}

.mn-kpi-card--positive {
    box-shadow: inset 0 2px 0 0 rgba(34, 197, 94, 0.45), var(--mn-shadow-sm);
}

.mn-kpi-card--warning {
    box-shadow: inset 0 2px 0 0 rgba(245, 158, 11, 0.5), var(--mn-shadow-sm);
}

.mn-kpi-card--danger {
    box-shadow: inset 0 2px 0 0 rgba(239, 68, 68, 0.45), var(--mn-shadow-sm);
}

.mn-kpi-card--info {
    box-shadow: inset 0 2px 0 0 rgba(14, 165, 233, 0.45), var(--mn-shadow-sm);
}

.mn-kpi-card--ai {
    box-shadow: inset 0 2px 0 0 rgba(167, 139, 250, 0.5), var(--mn-shadow-sm);
}

.mn-empty-state {
    text-align: center;
    padding: 2.25rem 1.25rem;
}

.mn-empty-state__icon {
    font-size: 2.25rem;
    line-height: 1;
    margin-bottom: 0.65rem;
}

.mn-empty-state__title {
    margin: 0 0 0.4rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--mn-text);
}

.mn-empty-state__text {
    margin: 0 auto;
    max-width: 26rem;
    font-size: 0.94rem;
    color: var(--mn-muted);
    line-height: 1.55;
}

.mn-wrap-anywhere {
    overflow-wrap: anywhere;
}

.mn-card__footer {
    margin-top: auto;
    padding-top: 0.5rem;
}

.mn-card--action .mn-card__footer .mn-btn {
    font-weight: 600;
}

.mn-card--action {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.mn-card.mn-card--action:hover {
    transform: translateY(-4px);
    box-shadow: var(--mn-shadow-md);
    border-color: var(--mn-border);
}

.mn-card.mn-card--action.is-active {
    border-color: rgba(37, 99, 235, 0.38);
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.1);
}

.mn-card.mn-card--action .mn-card-text {
    flex: 1 1 auto;
}

.mn-kpi-grid {
    display: grid;
    gap: 14px;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.mn-card__icon-sm {
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 0.35rem;
    border-radius: var(--mn-radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    background: var(--mn-primary-soft);
    border: 1px solid rgba(201, 24, 43, 0.12);
    box-shadow: var(--mn-shadow-sm);
}

.mn-card__icon-sm--emerald {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(5, 150, 105, 0.22);
}

.mn-card__icon-sm--sky {
    background: rgba(59, 130, 246, 0.11);
    border-color: rgba(37, 99, 235, 0.22);
}

.mn-card__icon-sm--indigo {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(79, 70, 229, 0.2);
}

/* RFID Control Center — live status strip */
.mn-rfid-control-header {
    margin-bottom: 1rem;
}

.mn-rfid-control-header h2 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    font-weight: 650;
    color: var(--mn-text);
    line-height: 1.2;
}

.mn-rfid-foundation-line {
    margin: 0.65rem 0 0;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mn-muted);
}

.mn-rfid-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1.1rem;
}

.mn-rfid-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex: 1 1 10rem;
    min-width: 0;
    padding: 0.55rem 0.75rem;
    border-radius: var(--mn-radius-md);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%);
    border: 1px solid var(--mn-border-soft);
    box-shadow: var(--mn-shadow-sm);
    font-size: 0.84rem;
    color: var(--mn-muted);
}

.mn-rfid-stat strong {
    font-size: 0.95rem;
    font-weight: 650;
    color: var(--mn-text);
}

.mn-rfid-stat__icon {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

.mn-rfid-stat--active {
    border-color: rgba(16, 185, 129, 0.28);
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.65) 0%, rgba(255, 255, 255, 0.92) 100%);
}

.mn-rfid-stat--devices {
    border-color: rgba(59, 130, 246, 0.22);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.7) 0%, rgba(255, 255, 255, 0.92) 100%);
}

.mn-rfid-stat--cards {
    border-color: rgba(100, 116, 139, 0.2);
}

.mn-rfid-stat--logs {
    border-color: rgba(59, 130, 246, 0.18);
    background: linear-gradient(180deg, rgba(238, 242, 255, 0.55) 0%, rgba(255, 255, 255, 0.94) 100%);
}

.mn-rfid-stat--amber {
    border-color: rgba(245, 158, 11, 0.35);
    background: linear-gradient(180deg, rgba(255, 251, 235, 0.85) 0%, rgba(255, 255, 255, 0.94) 100%);
}

.mn-rfid-stat__dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    flex-shrink: 0;
    background: #94a3b8;
}

.mn-rfid-stat__dot--green {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

.mn-rfid-stat__dot--amber {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}

.mn-rfid-stat__dot--neutral {
    background: #64748b;
}

.mn-rfid-card-hint {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    color: var(--mn-muted);
}

/* -------------------------------------------------------------------------- */
/* RFID live feed (foundation-layer activity)                                */
/* -------------------------------------------------------------------------- */

.mn-live-feed-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.mn-live-feed-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    min-width: 0;
}

.mn-live-feed-status .mn-refresh-note {
    font-size: 0.82rem;
    line-height: 1.45;
    max-width: 22rem;
}

.mn-live-feed-board-note {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem 0.65rem;
    margin: 0 0 1rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--mn-radius-md);
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.14);
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--mn-text);
}

.mn-live-feed-board-note__body {
    flex: 1 1 12rem;
    min-width: 0;
}

.mn-live-feed-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: var(--mn-radius-md);
    border: 1px solid var(--mn-border-soft);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

.mn-live-feed-item {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    transition: background 0.15s ease;
}

.mn-live-feed-item:last-child {
    border-bottom: 0;
}

.mn-live-feed-item:hover {
    background: rgba(15, 23, 42, 0.03);
}

.mn-live-feed-item__icon-pill {
    flex-shrink: 0;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--mn-border-soft);
    box-shadow: var(--mn-shadow-sm);
}

.mn-live-feed-item__main {
    flex: 1 1 auto;
    min-width: 0;
}

.mn-live-feed-item__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
}

.mn-live-feed-item__uid {
    min-width: 0;
    font-size: 0.92rem;
}

.mn-live-feed-item__meta {
    font-size: 0.82rem;
    color: var(--mn-muted);
    line-height: 1.45;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.mn-live-feed-item__sep {
    opacity: 0.55;
}

.mn-live-feed-item__notes {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--mn-muted);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.mn-live-feed-item__time {
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--mn-muted);
    text-align: right;
    align-self: flex-start;
    white-space: nowrap;
}

.mn-live-feed-empty {
    padding: 1.75rem 1.25rem;
    text-align: center;
}

.mn-live-feed-empty__icon {
    font-size: 1.75rem;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.mn-live-feed-empty__title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--mn-text);
}

.mn-live-feed-empty__text {
    margin: 0 auto;
    max-width: 26rem;
    font-size: 0.9rem;
    color: var(--mn-muted);
    line-height: 1.55;
}

.mn-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
    flex-shrink: 0;
}

.mn-pulse-dot--live {
    background: var(--mn-success);
    box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.12);
    animation: mn-pulse-dot-live 2s ease-in-out infinite;
}

.mn-pulse-dot--delayed {
    background: #f59e0b;
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.15);
    animation: none;
}

@keyframes mn-pulse-dot-live {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.75;
    }
}

.mn-refresh-note {
    display: inline;
}

.mn-live-feed-warning {
    font-size: 0.78rem;
    font-weight: 500;
    color: #9a3412;
    background: rgba(254, 243, 199, 0.65);
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
}

@media (max-width: 640px) {
    .mn-live-feed-item {
        flex-wrap: wrap;
    }

    .mn-live-feed-item__time {
        width: 100%;
        text-align: left;
        padding-left: calc(2.35rem + 0.75rem);
    }
}

.mn-btn--sm {
    min-height: 2.4rem;
    padding: 0 0.75rem;
    font-size: 0.85rem;
}

/* -------------------------------------------------------------------------- */
/* Accounting — Finance Command Center                                        */
/* -------------------------------------------------------------------------- */

.mn-accounting-shell {
    min-width: 0;
    margin-bottom: 1.25rem;
    overflow-x: hidden;
    border-radius: var(--mn-radius-lg);
    border: 1px solid var(--mn-border-soft);
    background: var(--mn-surface-strong);
    padding: 1rem 1.1rem;
    box-shadow: var(--mn-shadow-sm);
}

.mn-accounting-shell--flush {
    border: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.mn-accounting-shell__summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    min-width: 0;
}

.mn-accounting-shell__heading {
    margin: 0.25rem 0 0.35rem;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 650;
    color: var(--mn-text);
    line-height: 1.2;
}

.mn-accounting-shell__lede {
    margin: 0;
    max-width: 42rem;
    font-size: 0.9rem;
    color: var(--mn-muted);
    line-height: 1.5;
}

.mn-accounting-shell__body {
    margin-top: 1rem;
}

.mn-accounting-shell--flush .mn-accounting-shell__body {
    margin-top: 0;
}

.mn-accounting-shell.is-collapsed .mn-accounting-shell__body {
    display: none;
}

.mn-accounting-hero .mn-btn-primary {
    box-shadow: 0 8px 22px rgba(201, 24, 43, 0.16);
}

.mn-accounting-hero .mn-btn-primary:hover {
    box-shadow: 0 10px 26px rgba(201, 24, 43, 0.22);
}

.mn-accounting-overview-kpis {
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.mn-accounting-overview-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-height: 9.5rem;
    min-width: 0;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.mn-accounting-overview-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--mn-shadow-md);
}

.mn-accounting-overview-card__top {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.mn-accounting-overview-card__emoji {
    font-size: 1.35rem;
    line-height: 1;
}

.mn-accounting-overview-card__title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 650;
    color: var(--mn-text);
}

.mn-accounting-overview-card__text {
    margin: 0;
    flex: 1 1 auto;
    font-size: 0.86rem;
    color: var(--mn-muted);
    line-height: 1.5;
}

.mn-accounting-overview-card__action {
    margin-top: auto;
    padding-top: 0.35rem;
}

/* -------------------------------------------------------------------------- */
/* Module workspace navigation — dark glass tiles (shared across ERP modules) */
/* -------------------------------------------------------------------------- */

.mn-module-nav {
    min-width: 0;
}

.mn-module-nav--flex {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    max-width: 100%;
}

.mn-hr-tabs.mn-module-nav--flex,
.hr-module-tabs.mn-module-nav--flex,
.procurement-workspace-tabs__items.mn-module-nav--flex,
.inventory-workspace-tabs__items.mn-module-nav--flex {
    gap: 12px;
}

.mn-accounting-links.mn-module-nav {
    gap: 12px;
}

.mn-module-nav__item,
.mn-action-tile {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 14px 16px;
    border-radius: 16px;
    text-decoration: none;
    color: #f4f7fb;
    background: rgba(18, 22, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.35;
    box-sizing: border-box;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
    .mn-module-nav__item,
    .mn-action-tile {
        transition: none;
    }
}

.mn-module-nav__item:hover,
.mn-action-tile:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 75, 95, 0.42);
    box-shadow: 0 14px 34px rgba(225, 29, 72, 0.18);
}

.mn-module-nav__item:focus-visible,
.mn-action-tile:focus-visible {
    outline: 2px solid rgba(225, 29, 72, 0.55);
    outline-offset: 2px;
}

.mn-module-nav__item:active,
.mn-action-tile:active {
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .mn-module-nav__item:hover,
    .mn-action-tile:hover,
    .mn-module-nav__item:active,
    .mn-action-tile:active {
        transform: none;
    }
}

.mn-module-nav__item.is-active,
.mn-module-nav__item--active,
.mn-action-tile.is-active,
.mn-action-tile.mn-module-nav__item--active {
    background: linear-gradient(135deg, #e11d48, #991b1b);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
    box-shadow: 0 16px 36px rgba(225, 29, 72, 0.28);
}

.mn-module-nav__item--center {
    justify-content: center;
    text-align: center;
}

/* Procurement / accounting strip — overrides app.css pale tiles */
.accounting-nav__link.mn-module-nav__item,
.procurement-workspace-tabs__link.mn-module-nav__item,
.inventory-workspace-tabs__link.mn-module-nav__item {
    display: inline-flex;
    flex: 1 1 9.5rem;
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

.accounting-nav__link.mn-module-nav__item {
    justify-content: flex-start;
    text-align: left;
}

.mn-accounting-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    min-width: 0;
}

.mn-accounting-group {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.mn-accounting-group:hover {
    transform: translateY(-2px);
    box-shadow: var(--mn-shadow-md);
}

.mn-accounting-group__head {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    min-width: 0;
}

.mn-accounting-group__icon {
    flex-shrink: 0;
    width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
    border-radius: var(--mn-radius-md);
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid var(--mn-border-soft);
}

.mn-accounting-group__title {
    margin: 0 0 0.2rem;
    font-size: 1.05rem;
    font-weight: 650;
    color: var(--mn-text);
}

.mn-accounting-group__text {
    margin: 0;
    font-size: 0.84rem;
    color: var(--mn-muted);
    line-height: 1.5;
}

.mn-accounting-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    min-width: 0;
}

.mn-accounting-links--inline {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.mn-accounting-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.mn-accounting-link.mn-module-nav__item {
    font-weight: 600;
}

.mn-accounting-link:not(.mn-module-nav__item) {
    padding: 0.85rem 1rem;
    border-radius: var(--mn-radius-md);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--mn-border-soft);
    text-decoration: none;
    color: var(--mn-text);
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.35;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.mn-accounting-link:not(.mn-module-nav__item):hover {
    transform: translateY(-2px);
    box-shadow: var(--mn-shadow-sm);
    border-color: rgba(201, 24, 43, 0.25);
}

.mn-accounting-link__icon {
    flex-shrink: 0;
    width: 1.75rem;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1;
}

.mn-module-icon {
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.6rem;
    background: rgba(201, 24, 43, 0.10);
    border: 1px solid rgba(201, 24, 43, 0.18);
    color: rgba(201, 24, 43, 0.95);
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1;
    box-sizing: border-box;
}

.mn-module-icon::before {
    content: attr(data-fallback);
}

/* Accounting icon keys (ASCII-only fallbacks) */
.mn-module-icon--dashboard { }
.mn-module-icon--journal { }
.mn-module-icon--trial-balance { }
.mn-module-icon--statements { }
.mn-module-icon--cashiering { }
.mn-module-icon--payments { }
.mn-module-icon--cash-receipts { }
.mn-module-icon--cashless-demo { }
.mn-module-icon--billing-notices { }
.mn-module-icon--collections { }
.mn-module-icon--students { }
.mn-module-icon--assessments { }
.mn-module-icon--ledger { }
.mn-module-icon--soa { }
.mn-module-icon--procurement { }
.mn-module-icon--purchase-requests { }
.mn-module-icon--purchase-orders { }
.mn-module-icon--receiving-reports { }
.mn-module-icon--inventory { }
.mn-module-icon--payables { }
.mn-module-icon--ap-invoices { }
.mn-module-icon--ap-payments { }
.mn-module-icon--payables-aging { }
.mn-module-icon--payment-queue { }
.mn-module-icon--expenses { }
.mn-module-icon--vendors { }
.mn-module-icon--disbursements { }
.mn-module-icon--posting { }
.mn-module-icon--allocation { }
.mn-module-icon--banking { }
.mn-module-icon--bank-accounts { }
.mn-module-icon--banking-transactions { }
.mn-module-icon--bank-reconciliation { }
.mn-module-icon--cash-flow { }
.mn-module-icon--budget { }
.mn-module-icon--budgets { }
.mn-module-icon--department-budgets { }
.mn-module-icon--budget-vs-actual { }
.mn-module-icon--budget-overrides { }
.mn-module-icon--budget-policies { }
.mn-module-icon--approval-matrix { }
.mn-module-icon--policy-evaluations { }
.mn-module-icon--budget-approvals { }
.mn-module-icon--forecast-pipeline { }
.mn-module-icon--budget-projection { }
.mn-module-icon--cash-projection { }
.mn-module-icon--reports { }
.mn-module-icon--income-statement { }
.mn-module-icon--general-ledger { }
.mn-module-icon--receivables { }
.mn-module-icon--posting-controls { }
.mn-module-icon--configuration { }
.mn-module-icon--chart-accounts { }
.mn-module-icon--accounting { }

.mn-accounting-link__label {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.mn-accounting-quick-card {
    margin-top: 0.25rem;
}

.accounting-dashboard-grid--stacked {
    grid-template-columns: 1fr;
}

/* -------------------------------------------------------------------------- */
/* HR management — workspace selector (glass pills)                           */
/* -------------------------------------------------------------------------- */

.mn-hr-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.mn-hr-tab.mn-module-nav__item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 16px;
    border-radius: 16px;
    cursor: pointer;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    font-weight: 600;
}

.mn-hr-tab:not(.mn-module-nav__item) {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
    font-weight: 500;
    text-decoration: none;
    color: var(--mn-text, #0f172a);
    box-sizing: border-box;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mn-hr-tab__icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(201, 24, 43, 0.08);
    font-size: 16px;
    line-height: 1;
}

.mn-hr-tab__label {
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: left;
}

.mn-hr-tab:not(.mn-module-nav__item):hover {
    transform: translateY(-2px);
    box-shadow: var(--mn-shadow-sm);
    border-color: rgba(201, 24, 43, 0.25);
}

.mn-hr-tab:not(.mn-module-nav__item).is-active {
    background: linear-gradient(135deg, #c9182b, #9f1020);
    color: #fff;
    box-shadow: var(--mn-shadow-red);
    border-color: rgba(255, 255, 255, 0.2);
}

.mn-module-nav__item.is-active .mn-hr-tab__icon,
.mn-hr-tab.is-active.mn-module-nav__item .mn-hr-tab__icon {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
}

.mn-hr-tab:not(.mn-module-nav__item):active {
    transform: scale(0.96);
}

.mn-hr-tab:not(.mn-module-nav__item).is-active:active {
    transform: scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
    .mn-hr-tab:not(.mn-module-nav__item):hover,
    .mn-hr-tab:not(.mn-module-nav__item):active,
    .mn-hr-tab:not(.mn-module-nav__item).is-active:active {
        transform: none;
    }
}

.mn-hr-tab.mn-module-nav__item:not(.is-active) .mn-hr-tab__icon {
    background: rgba(255, 255, 255, 0.1);
}

/* Optional per-module icon tint (inactive; wins over default tile icon chip) */
.mn-hr-tab--payroll:not(.is-active) .mn-hr-tab__icon {
    background: rgba(34, 197, 94, 0.12);
}

.mn-hr-tab--reports:not(.is-active) .mn-hr-tab__icon {
    background: rgba(59, 130, 246, 0.12);
}

.mn-hr-tab--loans:not(.is-active) .mn-hr-tab__icon {
    background: rgba(245, 158, 11, 0.12);
}

.mn-hr-workspace-indicator {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.mn-hr-workspace-indicator span {
    color: var(--mn-text, #0f172a);
}

/* -------------------------------------------------------------------------- */
/* HR Employee Master List — responsive cards                                 */
/* -------------------------------------------------------------------------- */

.mn-employee-list {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.mn-employee-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: var(--mn-radius-lg);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--mn-border-soft);
    text-decoration: none;
    color: var(--mn-text);
    box-shadow: var(--mn-shadow-sm);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
    min-width: 0;
    max-width: 100%;
}

.mn-employee-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--mn-shadow-md);
}

.mn-employee-card__body {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(0, 3fr);
    gap: 1rem;
    align-items: start;
    min-width: 0;
}

.mn-employee-card__identity {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    border-radius: var(--mn-radius-md);
    padding: 0.15rem;
    margin: -0.15rem;
    transition: background 0.15s ease;
}

.mn-employee-card__identity:hover {
    background: rgba(201, 24, 43, 0.06);
}

.mn-employee-card__identity-text {
    min-width: 0;
    flex: 1 1 auto;
}

.mn-employee-card__name {
    display: block;
    font-size: 1.02rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.mn-employee-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.82rem;
    line-height: 1.35;
}

.mn-employee-card__meta-sep {
    opacity: 0.45;
}

.mn-employee-card__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    min-width: 0;
}

.mn-field {
    min-width: 0;
}

.mn-field__label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mn-muted);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.mn-field__icon {
    margin-right: 0.2rem;
}

.mn-field strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.mn-field .hr-status-badge {
    display: inline-block;
    margin-top: 0.25rem;
}

.mn-field__sub {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: var(--mn-muted);
    line-height: 1.35;
}

.mn-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--mn-primary), var(--mn-primary-dark));
    color: #fff;
    font-weight: 800;
    font-size: 0.78rem;
    box-shadow: var(--mn-shadow-red);
    flex: 0 0 auto;
}

.mn-progress {
    height: 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    overflow: hidden;
    margin-top: 0.35rem;
}

.mn-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--mn-primary), var(--mn-danger));
}

.mn-employee-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

@media (max-width: 900px) {
    .mn-employee-card__body {
        grid-template-columns: 1fr;
    }
}

/* -------------------------------------------------------------------------- */
/* Service Offices — Student Services control center                          */
/* -------------------------------------------------------------------------- */

.mn-service-offices-page .mn-page-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.mn-service-hero-actions__primary {
    box-shadow:
        0 10px 25px rgba(201, 24, 43, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.mn-service-offices-page .mn-service-hero-actions__primary:hover {
    box-shadow:
        0 14px 32px rgba(201, 24, 43, 0.42),
        0 0 0 1px rgba(255, 255, 255, 0.16) inset;
}

.mn-service-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.mn-service-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 0.95rem;
    border-radius: var(--mn-radius-md);
    border: 1px solid var(--mn-border-soft);
    background: rgba(255, 255, 255, 0.78);
    color: var(--mn-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    min-width: 0;
    max-width: 100%;
    box-shadow: var(--mn-shadow-sm);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
}

.mn-service-tab:hover {
    transform: translateY(-2px);
    box-shadow: var(--mn-shadow-md);
    border-color: rgba(201, 24, 43, 0.22);
}

.mn-service-tab.is-active {
    background: linear-gradient(135deg, #c9182b, #9f1020);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: var(--mn-shadow-red);
}

.mn-service-tab__icon {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--mn-radius-sm);
    background: rgba(201, 24, 43, 0.08);
    font-size: 1.05rem;
    line-height: 1;
    flex-shrink: 0;
}

.mn-service-tab.is-active .mn-service-tab__icon {
    background: rgba(255, 255, 255, 0.2);
}

.mn-service-tab__label {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.mn-service-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.mn-service-visits-section {
    overflow-x: hidden;
    max-width: 100%;
}

.mn-service-visit-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.mn-service-visit-card {
    padding: 1rem 1.1rem;
    border-radius: var(--mn-radius-lg);
    border: 1px solid var(--mn-border-soft);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--mn-shadow-sm);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
    min-width: 0;
    max-width: 100%;
}

.mn-service-visit-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--mn-shadow-md);
    border-color: rgba(201, 24, 43, 0.12);
}

.mn-service-visit-card__head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    min-width: 0;
}

.mn-service-visit-card__icon {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    line-height: 1;
    border-radius: var(--mn-radius-md);
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid var(--mn-border-soft);
}

.mn-service-visit-card__head-main {
    flex: 1 1 auto;
    min-width: 0;
}

.mn-service-visit-card__person {
    display: block;
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--mn-text);
}

.mn-service-visit-card__when {
    margin-top: 0.25rem;
    font-size: 0.82rem;
    color: var(--mn-muted);
    line-height: 1.4;
}

.mn-service-visit-card__when-sep {
    opacity: 0.45;
    padding: 0 0.2rem;
}

.mn-service-visit-card__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
    gap: 0.75rem 1rem;
    min-width: 0;
}

.mn-service-visit-card__cell {
    min-width: 0;
}

.mn-service-visit-card__cell--wide {
    grid-column: 1 / -1;
}

.mn-service-visit-card__label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mn-muted);
    margin-bottom: 0.2rem;
}

.mn-service-visit-card__value {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--mn-text);
    line-height: 1.45;
}

.mn-service-visit-card__notes {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--mn-muted);
}

.mn-service-visit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    min-width: 0;
}

.mn-service-form-inline {
    display: inline;
}

.mn-service-form-inline .mn-btn {
    vertical-align: middle;
}

button.mn-btn {
    font-family: inherit;
}

/* Service Offices — context panel + sticky tab strip */
.mn-service-tabs-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-bottom: 0.35rem;
    margin-bottom: 0.25rem;
    background: linear-gradient(180deg, rgba(245, 247, 251, 0.96) 0%, rgba(245, 247, 251, 0.75) 100%);
    border-radius: var(--mn-radius-lg);
    border: 1px solid var(--mn-border-soft);
    box-shadow: var(--mn-shadow-sm);
}

@media (min-width: 900px) {
    .mn-service-tabs-wrap {
        position: sticky;
        top: calc(var(--topbar-height, 76px) + 0.35rem);
        z-index: 20;
    }
}

.mn-service-context-panel {
    overflow-x: hidden;
    max-width: 100%;
}

.mn-service-context-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
    min-width: 0;
}

.mn-service-context-panel__head .mn-page-icon {
    flex-shrink: 0;
}

.mn-service-context-panel__head h2 {
    margin: 0.2rem 0 0.35rem;
    font-size: clamp(1.2rem, 2vw, 1.45rem);
    font-weight: 600;
    color: var(--mn-text);
    line-height: 1.2;
}

.mn-service-context-panel__kpis {
    margin-top: 1rem;
}

.mn-service-context-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    margin-top: 1.1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    min-width: 0;
}

.mn-service-context-panel code {
    font-size: 0.82em;
}

/* -------------------------------------------------------------------------- */
/* Parent / Student Portal — responsive tab strips                            */
/* -------------------------------------------------------------------------- */

.mn-portal-tabs,
.mn-portal-subtabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.65rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: visible;
}

.mn-portal-tab,
.mn-portal-subtab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 0;
    min-height: 44px;
    padding: 0.65rem 0.8rem;
    border-radius: var(--mn-radius-md);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--mn-border-soft);
    color: var(--mn-text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--mn-shadow-sm);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.mn-portal-tab:hover,
.mn-portal-subtab:hover {
    transform: translateY(-2px);
    box-shadow: var(--mn-shadow-md);
    border-color: rgba(201, 24, 43, 0.24);
}

.mn-portal-tab.is-active,
.mn-portal-subtab.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--mn-primary), var(--mn-primary-dark));
    box-shadow: var(--mn-shadow-red);
    border-color: rgba(255, 255, 255, 0.22);
    font-weight: 600;
}

.mn-portal-tab__label,
.mn-portal-subtab__label {
    min-width: 0;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mn-portal-tab__icon,
.mn-portal-subtab__icon {
    flex-shrink: 0;
    font-size: 0.9rem;
    line-height: 1;
}

@media (max-width: 720px) {
    .mn-portal-tabs,
    .mn-portal-subtabs {
        grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    }
}
