/* ============================================================================
   MMS additions on top of the shared LEAP layout/theme CSS (layout.css,
   theme.css and login.css are kept identical to WMS so both systems look the
   same). Everything here 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-nav-card {
    background: var(--surface);
    border: 1.5px solid var(--border-clr);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.quick-nav-header {
    background: var(--accent-dark, #1B2F6E);
    color: #fff;
    padding: 12px 16px;
    font-size: .88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    padding: 16px;
    min-height: 140px;
    transition: background .15s;
}

    .quick-nav-grid.drag-over {
        background: var(--row-hover);
        outline: 2px dashed var(--accent);
        outline-offset: -4px;
        border-radius: 8px;
    }

.quick-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--surface-2);
    border: 1.5px solid var(--border-clr);
    border-radius: 10px;
    padding: 14px 10px;
    text-decoration: none;
    color: var(--text);
    font-size: .8rem;
    font-weight: 600;
    text-align: center;
    position: relative;
    transition: all .15s;
    min-height: 90px;
}

    .quick-nav-item:hover { border-color: var(--accent); color: var(--text); background: var(--row-hover); }
    .quick-nav-item i.nav-icon { font-size: 1.4rem; color: var(--accent); }
    html[data-mode="dark"] .quick-nav-item i.nav-icon { color: var(--accent-light, #4A5FAD); }

.quick-nav-item .remove-btn {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #c0392b;
    color: #fff;
    border: none;
    font-size: 10px;
    cursor: pointer;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
}

.quick-nav-item:hover .remove-btn { display: flex; }

.quick-nav-empty {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: var(--text-muted);
    font-size: .84rem;
    padding: 24px;
    text-align: center;
}

    .quick-nav-empty i { font-size: 2rem; opacity: .35; }

.clear-btn {
    background: none;
    border: 1px solid rgba(255,255,255,.4);
    color: rgba(255,255,255,.85);
    font-size: .75rem;
    cursor: pointer;
    margin-inline-start: auto;
    padding: 3px 10px;
    border-radius: 4px;
    transition: .15s;
}

    .clear-btn:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ── 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; }

/* ── Searchable drop-down (MMS.searchable) ───────────────────────────────── */
.ss-box { position: relative; }
.ss-box .ss-native { display: none; }

.ss-button {
    width: 100%;
    text-align: start;
    background: var(--surface);
    color: var(--text);
    border: 1.5px solid var(--border-clr);
    border-radius: 6px;
    padding: 6px 12px;
    min-height: 38px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .ss-button:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px rgba(44,62,123,.15); }

.ss-box.disabled .ss-button { opacity: .6; cursor: not-allowed; }

.ss-panel {
    display: none;
    /* Fixed, so a form section with overflow:hidden cannot cut the list off.
       Its position is set by searchable-select.js when the list opens. */
    position: fixed;
    z-index: 1080;
    min-width: 220px;
    background: var(--surface);
    border: 1.5px solid var(--border-clr);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.16);
    padding: 8px;
}

.ss-box.open .ss-panel { display: block; }

.ss-search {
    width: 100%;
    border: 1.5px solid var(--border-clr);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: .82rem;
    background: var(--surface);
    color: var(--text);
    margin-bottom: 6px;
}

    .ss-search:focus { border-color: var(--accent); outline: none; }

.ss-list { max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }

.ss-item {
    padding: 7px 10px;
    line-height: 1.35;
    border-radius: 6px;
    font-size: .85rem;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .ss-item:hover, .ss-item.active { background: var(--row-hover); }
    .ss-item.selected { background: var(--accent); color: #fff; }

.ss-empty { padding: 8px 10px; font-size: .82rem; color: var(--text-muted); text-align: center; }
