/* ============================================================================
   MMS additions on top of the shared LEAP CSS: layout.css / theme.css /
   login.css, and the Shared.Responsive files (sidebar, responsive, quicknav,
   grid, report). Only what is MMS's own lives here. Everything uses the theme
   variables, so it follows light/dark mode and the accent colour.
   ========================================================================== */

/* ── Login: RTL fixes ─────────────────────────────────────────────────────── */
[dir="rtl"] .bg-panel .tagline {
    left: auto;
    right: 48px;
    text-align: right;
}

[dir="rtl"] .btn-login .fa-arrow-right {
    transform: scaleX(-1);          /* "Next" points the reading direction */
}

.login-back {
    display: none;
    margin: 10px auto 0;
    background: none;
    border: none;
    color: var(--accent, #2C3E7B);
    font-size: .8rem;
    cursor: pointer;
    text-decoration: underline;
}

    .login-back.show { display: block; }

/* ── Sidebar: pages not migrated yet ─────────────────────────────────────── */
.soon-pill {
    margin-inline-start: auto;
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(0,0,0,.08);
    color: var(--ink-light);
    white-space: nowrap;
}

html[data-mode="dark"] .soon-pill { background: rgba(255,255,255,.10); }

.submenu-link.is-soon { opacity: .78; }
.submenu-link.is-soon:hover { opacity: 1; }

/* ── Topbar: company chip ────────────────────────────────────────────────── */
.topbar-company {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 16px;
    background: var(--surface-2);
    max-width: 280px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

@media (max-width: 900px) { .topbar-company { display: none; } }

/* ── Home ────────────────────────────────────────────────────────────────── */
.home-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.home-hero .hello { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.home-hero .sub   { font-size: .82rem;  color: var(--text-muted); }

.home-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.home-stat {
    background: var(--surface);
    border: 1.5px solid var(--border-clr);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

    .home-stat .ico {
        width: 40px; height: 40px;
        border-radius: 10px;
        display: inline-flex; align-items: center; justify-content: center;
        background: var(--accent);
        color: #fff;
        font-size: 1.05rem;
        flex-shrink: 0;
    }

    .home-stat .num { font-size: 1.35rem; font-weight: 700; color: var(--text); line-height: 1.1; }
    .home-stat .lbl { font-size: .74rem; color: var(--text-muted); }

/* ── Quick Navigation ─────────────────────────────────────────────────────
   The card, tiles, Clear and ✕ are Shared.Responsive/quicknav.css. The copy
   of those rules that sat here was deleted: it loaded after the shared file
   and would have overridden it. What MMS keeps is its LOOK, through the
   --qn-* variables the shared file reads: its defaults are literal light-mode
   colours with no dark variant, while MMS drew the card from the theme
   variables so it followed dark mode and the accent. */
:root {
    --qn-card-bg: var(--surface, #fff);
    --qn-border: var(--border-clr, #dde2f0);
    --qn-header-bg: var(--accent-dark, #1B2F6E);
    --qn-accent: var(--accent, #1B2F6E);
    --qn-tile-bg: var(--surface-2, #f8f9ff);
    --qn-tile-hover-bg: var(--row-hover, #eef1ff);
    --qn-empty-fg: var(--text-muted, #9aa3bd);
}

/* The accent navy is too dark to read on the dark surface; lift it, as the
   old copy did for the tile icon. */
html[data-mode="dark"] {
    --qn-accent: var(--accent-light, #4A5FAD);
}

/* ── Coming-soon page ────────────────────────────────────────────────────── */
.soon-wrap {
    text-align: center;
    padding: 48px 20px 40px;
}

    .soon-wrap .soon-icon {
        width: 84px; height: 84px;
        margin: 0 auto 18px;
        border-radius: 22px;
        display: flex; align-items: center; justify-content: center;
        background: var(--surface-2);
        color: var(--accent);
        font-size: 2.2rem;
    }

    html[data-mode="dark"] .soon-wrap .soon-icon { color: var(--accent-light, #4A5FAD); }

    .soon-wrap h2 { font-size: 1.25rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
    .soon-wrap p  { color: var(--text-muted); max-width: 520px; margin: 0 auto 18px; font-size: .9rem; }

    .soon-wrap code {
        display: inline-block;
        font-size: .78rem;
        padding: 4px 10px;
        border-radius: 6px;
        background: var(--surface-2);
        color: var(--text-muted);
        direction: ltr;
    }

/* ── Toasts (MMS.toast) ──────────────────────────────────────────────────── */
.mms-toast {
    position: fixed;
    top: 20px;
    z-index: 9999;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .2s, transform .2s;
}

    .mms-toast.ok   { background: var(--accent-dark, #1B2F6E); }
    .mms-toast.warn { background: #e67e22; }
    .mms-toast.show { opacity: 1; transform: none; }

/* ── Report criteria: vehicle-type radios ──────────────────────────────────
   The report card itself is Shared.Responsive/report.css. This is the one
   MMS-only piece of the retired css/report.css: the radio row a vehicle-type
   filter sits on (trucks / trailers / all), laid out along one line. */
.filter-card .radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    align-items: center;
}

    .filter-card .radio-row .form-check {
        font-size: .86rem;
        margin: 0;
    }

/* ── Grid filter row: multi-select (MMS.gridPlus filterMulti — copied from MMS_Extra) ───────────────────
   The button wears .col-filter (Shared.Responsive grid.css), so it has the same
   border, size and colours as the text filters; this only adds the arrow and
   keeps long selections on one line. The panel is fixed on <body>. */
.col-filter-multi {
    display: block;
    text-align: start;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    padding-inline-end: 22px !important;
    color: var(--text-muted) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238a93a6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 6px center !important;
    background-size: 10px 10px !important;
}

    .col-filter-multi.has-value { color: var(--text) !important; }

[dir="rtl"] .col-filter-multi { background-position: left 6px center !important; }

.mms-multi-panel {
    position: fixed;
    z-index: 1060;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    background: var(--surface, #fff);
    color: var(--text);
    border: 1.5px solid var(--border-clr, #dde2f0);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
}

.mms-multi-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: .82rem;
    cursor: pointer;
    white-space: nowrap;
}

    .mms-multi-option:hover { background: var(--row-hover, #eef1ff); }
    .mms-multi-option .form-check-input { margin: 0; flex-shrink: 0; }
