/* ═══════════════════════════════════════════════════════════
   SOLARIS ERP — Navigation System v4.0
   File: public/css/nav.css
   Loads on every admin page after solaris.css.
   Covers: slim sidebar, horizontal module menu, dropdowns,
           ARIA floating assistant, module icon tiles.
   NO inline styles. All layout handled here.
   ═══════════════════════════════════════════════════════════ */

/* ── RESET APP SHELL ────────────────────────────────────── */
/* Override old sidebar width so slim sidebar fits */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════
   SLIM SIDEBAR
   72px wide. Icons + labels only. Dark navy background.
   Common items: Home, Org, Settings, ARIA.
   ═══════════════════════════════════════════════════════════ */
.slim-sidebar {width: 60px;min-width: 60px;background: #181824;border-right: 1px solid #181824;display: flex;flex-direction: column;align-items: center;padding: 12px 0 14px;height: 100vh;/*overflow: hidden;*/flex-shrink: 0;z-index: 110;}

.slim-sidebar .sb-logo {width: 42px;height: 42px;background: #0f1012;border-radius: 6px;display: flex;align-items: center;justify-content: center;margin-bottom: 14px;flex-shrink: 0;border: none;padding: 0;}

.slim-sidebar .sb-logo img {width: 100%;height: 100%;object-fit: contain;border-radius: 6px;}

.slim-sidebar .sb-logo-initials {color: #fff;font-size: 13px;font-weight: 700;font-family: 'Inter', sans-serif;line-height: 1;}

/* Nav items in slim sidebar */
.slim-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 1;
    width: 100%;
    padding: 0 8px;
}

.slim-nav-item {width: 42px;height: 42px;border-radius: 6px;text-align: center;display: flex;flex-direction: column;align-items: center;justify-content: center;gap: 3px;cursor: pointer;text-decoration: none;transition: background 0.15s;position: relative;border: none;background: transparent;color:#666;padding: 1px;}
.slim-nav-item:hover {color: #111;}
.slim-nav-item.active {color: #fff;background: #0d6efd;padding: 1px;}
.slim-nav-item i {width: 40px;height: 40px;border-radius: 6px;font-size: 22px;color: #656972;line-height: 38px;display: block;-webkit-transition: 600ms;-moz-transition: 600ms;-o-transition: 600ms;transition: 600ms;}
.slim-nav-item:hover i {color: #959daf;background: #181824;width: 40px;height: 40px;border-radius: 6px;}
.slim-nav-item.active i {color: #fff;background: #0d6efd;width: 40px;height: 40px;border-radius: 6px;}
.slim-nav-item.red {background: rgb(255 0 0 / 10%);}
.slim-nav-item.red:hover {}
.slim-nav-item.red i {color: rgb(255 0 0 / 50%);}
.slim-nav-item.red:hover i {color:rgb(255 0 0);}
.slim-nav-item.red i.fal {font-size: 18px;}
    /* Locked / upgrade module sidebar item */
    .slim-nav-item.sb-upgrade {
        opacity: 0.5;
        position: relative;
    }
    .slim-nav-item.sb-upgrade:hover {
        opacity: 0.75;
    }
    .sb-lock {
        position: absolute;
        top: 5px;
        right: 4px;
        font-size: 7px;
        color: #F69B63;
        line-height: 1;
    }


.slim-nav-label {font-size: 11px;font-family: 'Inter', sans-serif;letter-spacing: 0;line-height: 18px;display:none;}

.slim-nav-item:hover .slim-nav-label {
    color: #111;
}

.slim-nav-item.active .slim-nav-label {
    color: #111;
}

/* Separator line */
.slim-nav-sep {
    width: 36px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 6px auto;
    flex-shrink: 0;
}

/* Spacer pushes ARIA to bottom */
.slim-nav-spacer {
    flex: 1;
}

/* ARIA button — special gradient */
.slim-nav-item.aria-btn {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    position: relative;
}

.slim-nav-item.aria-btn:hover {
    background: linear-gradient(135deg, #4338ca, #6d28d9);
}

.slim-nav-item.aria-btn i {
    color: #fff;
}

.slim-nav-item.aria-btn .slim-nav-label {
    color: rgba(255, 255, 255, 0.9);
}

/* Online pulse dot on ARIA */
.aria-pulse {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 7px;
    height: 7px;
    background: #34d399;
    border-radius: 50%;
    border: 1.5px solid #0f1012;
}

/* User avatar at bottom of slim sidebar 
.slim-user-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f1012, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.15);
    text-decoration: none;
    flex-shrink: 0;
    margin-top: 8px;
}*/

/* Tooltip on hover for slim sidebar items */
.slim-nav-item[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: #fff;
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ═══════════════════════════════════════════════════════════
   MAIN WRAP — right of slim sidebar
   ═══════════════════════════════════════════════════════════ */
.main-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ═══════════════════════════════════════════════════════════
   TOP BAR — module name + horizontal menu + right actions
   ═══════════════════════════════════════════════════════════ */


/* Active module label — left of horizontal menu */
.topbar-module-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    border-right: 1px solid rgba(52, 105, 231, 0.12);
    font-size: 12px;
    font-weight: 600;
    color: var(--t, #0f172a);
    white-space: nowrap;
    flex-shrink: 0;
    font-family: 'Inter', sans-serif;
}

.topbar-module-label i {
    font-size: 16px;
    color: #0f1012;
}

/* ── HORIZONTAL MENU ─────────────────────────────────────── */
/* overflow MUST be visible — dropdowns render outside topbar height */
.topbar {
    overflow: visible !important;
}

.h-menu {
    display: flex;
    align-items: stretch;
    flex: 1;
    overflow: visible;
    scrollbar-width: none;
}

.h-menu::-webkit-scrollbar {
    display: none;
}

.h-menu-item {font-weight:500;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    color: #777c88;
    cursor: pointer;

    white-space: nowrap;
    position: relative;
    flex-shrink: 0;
    transition: color 0.12s, background 0.12s;
    text-decoration: none;
    background: transparent;
    border-top: none;
    border-left: none;
    border-right: 1px solid #323240;
    height: 100%;-webkit-transition: 300ms;-moz-transition: 300ms;-o-transition: 300ms;transition: 300ms;
}



.h-menu-item.h-active {color: #fff;font-weight: 500;}

/* Chevron for items with dropdown */
.h-menu-chevron {
    font-size: 11px;
    opacity: 0.5;
    margin-left: -2px;
    transition: transform 0.2s ease;
}

.h-menu-item.dd-active {color: #fff;background: #0d6efd;font-weight: 500;}


/* ── DROPDOWN ────────────────────────────────────────────── */
/* Shown/hidden via JS click — no hover */
.h-dropdown {display: none;position: absolute;top: 100%;left: 0;min-width: 210px;background: #fff;border: 1px solid rgba(52, 105, 231, 0.18);border-radius: 0 0 6px 6px;padding: 5px 10px;flex-direction: column;gap: 1px;z-index: 200;}

.h-dropdown.dd-open {
    display: flex;
}

/* Parent item open state — chevron rotates */
.h-menu-item.dd-active .h-menu-chevron {
    transform: rotate(180deg);
}

.h-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 11px;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    color: var(--t2, #334155);
    border-radius: 7px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.1s, color 0.1s;
    white-space: nowrap;
}

.h-dropdown-item i {
    font-size: 15px;
    color: var(--t3, #64748b);
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.h-dropdown-item:hover {
    background: rgba(52, 105, 231, 0.07);
    color: #0f1012;
}

.h-dropdown-item:hover i {
    color: #0f1012;
}

/* Badge inside dropdown item */
.h-dropdown-badge {
    margin-left: auto;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 20px;
    font-weight: 700;
    background: rgba(52, 105, 231, 0.1);
    color: #0f1012;
}

.h-dropdown-sep {
    height: 1px;
    background: rgba(52, 105, 231, 0.1);
    margin: 3px 5px;
}

/* ── TOPBAR RIGHT ACTIONS ────────────────────────────────── 


.tb-icon-btn {
    width: 34px;
    height: 34px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--t3, #64748b);
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
    position: relative;
}
*/
.tb-icon-btn i {
    font-size: 18px;
}

/*.tb-icon-btn:hover {
    background: var(--surface2, #f8fafc);
    color: var(--t, #0f172a);
}*/

/* Topbar user avatar 
.tb-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f1012, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
}*/

/* ═══════════════════════════════════════════════════════════
   MODULE ICON TILES — dashboard grid
   ═══════════════════════════════════════════════════════════ */
.mod-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}

.mod-tile {
    background: #fff;
    border: 1px solid rgba(52, 105, 231, 0.15);
    border-radius: 14px;
    padding: 16px 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    text-decoration: none;
}

.mod-tile:hover {
    border-color: #0f1012;
    box-shadow: 0 4px 14px rgba(52, 105, 231, 0.12);
    transform: translateY(-1px);
}

.mod-tile.mod-active {
    border-color: #0f1012;
    border-width: 2px;
}

.mod-tile-icon {
    width: 52px;
    height: 52px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mod-tile-icon i {
    font-size: 26px;
}

/* Module icon colour variants */
.mod-icon-blue   { background: #eef3ff; }
.mod-icon-blue i { color: #0f1012; }

.mod-icon-green   { background: #e8f5ee; }
.mod-icon-green i { color: #0f6e56; }

.mod-icon-amber   { background: #fff3e8; }
.mod-icon-amber i { color: #ba7517; }

.mod-icon-purple   { background: #f0eefb; }
.mod-icon-purple i { color: #534ab7; }

.mod-icon-pink   { background: #faedf0; }
.mod-icon-pink i { color: #993556; }

.mod-icon-teal   { background: #e6f4fb; }
.mod-icon-teal i { color: #185fa5; }

.mod-icon-indigo   { background: #eaf3de; }
.mod-icon-indigo i { color: #3b6d11; }

.mod-icon-orange   { background: #fdf0e8; }
.mod-icon-orange i { color: #854f0b; }

.mod-icon-gray   { background: #f1efe8; }
.mod-icon-gray i { color: #5f5e5a; }

.mod-tile-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--t, #0f172a);
    text-align: center;
    line-height: 1.3;
    font-family: 'Inter', sans-serif;
}

.mod-tile-meta {
    font-size: 10px;
    color: var(--t3, #64748b);
    font-family: 'Inter', sans-serif;
}

.mod-tile-badge {
    font-size: 9px;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 600;
    background: rgba(52, 105, 231, 0.1);
    color: #0f1012;
    font-family: 'Inter', sans-serif;
}

.mod-tile-badge.warning {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

/* ═══════════════════════════════════════════════════════════
   ARIA FLOATING ASSISTANT
   ═══════════════════════════════════════════════════════════ */

/* FAB button — bottom right corner */
.aria-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
    transition: box-shadow 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.aria-fab:hover {
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
    transform: scale(1.06);
}

.aria-fab i {
    font-size: 22px;
    color: #fff;
}

.aria-fab .aria-pulse {
    border-color: #fff;
}

/* ARIA popup panel */
.aria-popup {
    position: fixed;
    bottom: 82px;
    right: 24px;
    width: 340px;
    height: 500px;
    background: #fff;
    border: 1px solid rgba(52, 105, 231, 0.18);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
    transition: opacity 0.15s, transform 0.15s;
    transform-origin: bottom right;
}

.aria-popup.aria-hidden {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

/* ARIA popup header */
.aria-popup-head {
    padding: 12px 14px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
}

.aria-popup-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aria-popup-avatar i {
    font-size: 16px;
    color: #fff;
}

.aria-popup-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    font-family: 'Inter', sans-serif;
    flex: 1;
}

.aria-popup-status {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 3px;
    font-family: 'Inter', sans-serif;
}

.aria-online-dot {
    width: 5px;
    height: 5px;
    background: #34d399;
    border-radius: 50%;
    display: inline-block;
}

.aria-popup-close {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.aria-popup-close i {
    font-size: 14px;
}

.aria-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ARIA messages area */
.aria-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}

.aria-faq-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(52, 105, 231, 0.07);
    border-radius: 7px;
    padding: 7px 10px;
    font-size: 10.5px;
    color: var(--t3, #64748b);
    font-family: 'Inter', sans-serif;
}

.aria-faq-notice i {
    font-size: 12px;
    color: #0f1012;
    flex-shrink: 0;
}

/* Chat bubble */
.aria-msg {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.aria-msg.aria-msg-user {
    align-items: flex-end;
}

.aria-msg.aria-msg-bot {
    align-items: flex-start;
}

.aria-bubble {
    padding: 8px 11px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--t, #0f172a);
    max-width: 90%;
    font-family: 'Inter', sans-serif;
}

.aria-msg-user .aria-bubble {
    background: #0f1012;
    color: #fff;
    border-radius: 10px 10px 2px 10px;
}

.aria-msg-bot .aria-bubble {
    background: var(--surface2, #f8fafc);
    border-radius: 10px 10px 10px 2px;
}

.aria-cache-tag {
    font-size: 9px;
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    padding: 1px 7px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: 'Inter', sans-serif;
}

.aria-cache-tag i {
    font-size: 10px;
}

.aria-msg-time {
    font-size: 10px;
    color: var(--t4, #94a3b8);
    font-family: 'Inter', sans-serif;
    padding: 0 2px;
}

/* Suggested chips */
.aria-suggest {
    padding: 7px 10px;
    border-top: 1px solid rgba(52, 105, 231, 0.1);
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.aria-suggest-label {
    font-size: 10px;
    color: var(--t3, #64748b);
    font-family: 'Inter', sans-serif;
}

.aria-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.aria-chip {
    font-size: 10px;
    padding: 4px 9px;
    border-radius: 20px;
    border: 1px solid rgba(52, 105, 231, 0.2);
    color: var(--t2, #334155);
    cursor: pointer;
    background: #fff;
    font-family: 'Inter', sans-serif;
    transition: background 0.12s, color 0.12s;
}

.aria-chip:hover {
    background: rgba(52, 105, 231, 0.08);
    color: #0f1012;
}

/* Input row */
.aria-input-row {
    padding: 8px 10px;
    border-top: 1px solid rgba(52, 105, 231, 0.1);
    display: flex;
    gap: 6px;
    align-items: flex-end;
    flex-shrink: 0;
}

.aria-textarea {
    flex: 1;
    background: var(--surface2, #f8fafc);
    border: 1px solid rgba(52, 105, 231, 0.15);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    color: var(--t, #0f172a);
    resize: none;
    font-family: 'Inter', sans-serif;
    min-height: 34px;
    max-height: 80px;
    outline: none;
    transition: border-color 0.15s;
}

.aria-textarea:focus {
    border-color: #0f1012;
}

.aria-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #0f1012;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}

.aria-send-btn i {
    font-size: 16px;
    color: #fff;
}

.aria-send-btn:hover {
    background: #2a58c8;
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD — page header strip
   ═══════════════════════════════════════════════════════════ */
.dash-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.dash-header-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-header-icon i {
    font-size: 26px;
}

.dash-header-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--t, #0f172a);
    font-family: 'Inter', sans-serif;
}

.dash-header-sub {
    font-size: 11px;
    color: var(--t3, #64748b);
    margin-top: 2px;
    font-family: 'Inter', sans-serif;
}

.dash-header-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ═══════════════════════════════════════════════════════════
   SECTION HEADER (above module tiles, above tables)
   ═══════════════════════════════════════════════════════════ */
.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--t3, #64748b);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-family: 'Inter', sans-serif;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .mod-tiles-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }

    .tb-date {
        display: none;
    }
}

@media (max-width: 768px) {
    .slim-sidebar {
        position: fixed;
        left: -72px;
        top: 0;
        bottom: 0;
        transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 200;
    }

    .slim-sidebar.open {
        left: 0;
    }

    .topbar-module-label {
        display: none;
    }

    .aria-popup {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 76px;
    }
}