/* ── Multi Manager — App CSS ─────────────────────────────── */

:root {
    --mm-sidebar-width: 240px;
    --mm-sidebar-collapsed: 0px;
    --mm-topbar-height: 60px;
    --mm-primary: #1a56db;
    --mm-primary-dark: #1040b0;
    --mm-sidebar-bg: #0f172a;
    --mm-sidebar-text: #94a3b8;
    --mm-sidebar-active: #fff;
    --mm-sidebar-active-bg: rgba(255,255,255,.1);
    --mm-sidebar-section: #475569;
    --mm-bg: #f8fafc;
    --mm-card-shadow: 0 1px 3px rgba(0,0,0,.1);
    --mm-border: #e2e8f0;
}

/* ── Layout ─────────────────────────────────────────────── */
body.mm-app { background: var(--mm-bg); display: flex; margin: 0; }

.mm-sidebar {
    width: var(--mm-sidebar-width);
    min-height: 100vh;
    background: var(--mm-sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; z-index: 1040;
    transition: transform .25s ease;
    overflow-y: auto;
    overflow-x: hidden;
}
.mm-sidebar--closed { transform: translateX(calc(-1 * var(--mm-sidebar-width))); }

.mm-main {
    margin-left: var(--mm-sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .25s ease;
}
.mm-main--collapsed { margin-left: 0; }

.mm-topbar {
    height: var(--mm-topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--mm-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky; top: 0; z-index: 1030;
    box-shadow: var(--mm-card-shadow);
}

.mm-content {
    padding: 1.5rem;
    flex: 1;
}

/* ── Sidebar internals ──────────────────────────────────── */
.mm-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem .75rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.mm-sidebar__brand {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.mm-sidebar__toggle { color: var(--mm-sidebar-text) !important; }
.mm-sidebar__nav { padding: .5rem 0; flex: 1; overflow-y: auto; overflow-x: hidden; }
.mm-sidebar__nav .nav-link {
    color: var(--mm-sidebar-text);
    padding: .45rem 1rem;
    font-size: .875rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    border-radius: 6px;
    margin: 1px 8px;
    transition: background .15s, color .15s;
}
.mm-sidebar__nav .nav-link:hover,
.mm-sidebar__nav .nav-link.active {
    background: var(--mm-sidebar-active-bg);
    color: var(--mm-sidebar-active);
}
.mm-sidebar__section {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--mm-sidebar-section);
    padding: .75rem 1rem .25rem;
    list-style: none;
}
[x-cloak] { display: none !important; }
.mm-dropdown-toggle {
    display: flex !important;
    align-items: center;
    text-decoration: none;
    background: none;
    border: none;
    text-align: left;
    color: #cbd5e1 !important;
    font-size: .8rem !important;
    font-weight: 600 !important;
    letter-spacing: .04em;
}
.mm-dropdown-toggle:hover {
    color: #fff !important;
}
.mm-chevron {
    font-size: .7rem;
    transition: transform .2s ease;
    flex-shrink: 0;
    color: #cbd5e1;
}
.mm-dropdown-toggle[aria-expanded="true"] .mm-chevron {
    transform: rotate(180deg);
    color: #fff;
}
.mm-submenu {
    padding-left: .5rem;
}
.mm-submenu .nav-link {
    font-size: .825rem;
    padding-top: .35rem;
    padding-bottom: .35rem;
}
.mm-sidebar__footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,.08);
    position: sticky;
    bottom: 0;
    background: var(--mm-sidebar-bg);
    z-index: 1;
}
.mm-sidebar__user {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--mm-sidebar-text);
    font-size: .8rem;
    margin-bottom: .25rem;
}

/* ── Auth ───────────────────────────────────────────────── */
body.mm-auth-bg { background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%); }
.mm-auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

/* ── Stat Cards ─────────────────────────────────────────── */
.mm-stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--mm-card-shadow);
    border: 1px solid var(--mm-border);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.mm-stat-card__icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
}
.mm-stat-card__value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.mm-stat-card__label { font-size: .8rem; color: #64748b; }

/* ── Alerts banner ──────────────────────────────────────── */
.mm-alert-item {
    display: flex; align-items: flex-start; gap: .75rem;
    padding: .75rem 1rem;
    border-radius: 8px;
    border: 1px solid;
}
.mm-alert-item--danger  { border-color: #fca5a5; background: #fef2f2; }
.mm-alert-item--warning { border-color: #fde68a; background: #fffbeb; }
.mm-alert-item--info    { border-color: #93c5fd; background: #eff6ff; }

/* ── Status badges ──────────────────────────────────────── */
.badge-open        { background: #dbeafe; color: #1d4ed8; }
.badge-in_progress { background: #d1fae5; color: #065f46; }
.badge-scheduled   { background: #e0e7ff; color: #3730a3; }
.badge-waiting_parts { background: #fef3c7; color: #92400e; }
.badge-complete    { background: #f0fdf4; color: #166534; }
.badge-cancelled   { background: #f1f5f9; color: #475569; }
.badge-emergency   { background: #fee2e2; color: #991b1b; }
.badge-high        { background: #ffedd5; color: #9a3412; }
.badge-medium      { background: #fef9c3; color: #854d0e; }
.badge-low         { background: #f0fdf4; color: #166534; }

/* ── Table helpers ──────────────────────────────────────── */
.mm-table { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: var(--mm-card-shadow); }
.mm-table .table { margin: 0; }
.mm-table .table thead th { background: #f8fafc; border-bottom: 2px solid var(--mm-border); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }

/* ── Lifecycle score ────────────────────────────────────── */
.mm-score {
    width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .9rem;
}
.mm-score--good    { background: #d1fae5; color: #065f46; }
.mm-score--fair    { background: #fef3c7; color: #92400e; }
.mm-score--poor    { background: #fee2e2; color: #991b1b; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 991px) {
    .mm-sidebar { transform: translateX(calc(-1 * var(--mm-sidebar-width))); }
    .mm-sidebar--open { transform: translateX(0); }
    .mm-main { margin-left: 0 !important; }
}

/* ── Misc ───────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.mm-notif-panel { max-height: 360px; overflow-y: auto; }
