/* ═══════════════════════════════════════════════════════════════════
   NavMenu.razor.css — Sidebar desktop, collapsible mini/full
   
   Tokens đặt trên .ez-sidebar (tương thích CSS isolation).
   Mini width 56px, full width 240px (260px ≥1680).
   Khi mini: brand-text/search/labels/footer-meta ẩn,
             hover item hiện tooltip (data-tip).
   ═══════════════════════════════════════════════════════════════════ */

/* Override the container `.sidebar` from MainLayout */
::deep .sidebar {
    background: transparent !important;
    background-image: none !important;
    width: auto !important;
    border-right: none !important;
    flex-shrink: 0;
}

.ez-sidebar {
    /* ── Tokens ── */
    /* ① Menu trái & thanh trên — CÙNG ô cấu hình với `NavMenu.razor.css` (bản scoped). */
    --bg: var(--ez-nav-bg, #faf6f0);
    --surface: #ffffff;
    --surface-2: #fbf8f3;
    --ink: #2a2520;
    --ink-soft: #6b6158;
    --ink-mute: #a39a90;
    --line: #ece5db;
    --line-strong: #ddd2c3;
    --brand: #b8742a;
    --brand-deep: #8f5618;
    --brand-light: #d4984a;
    --brand-soft: #fbeedc;
    --brand-softer: #fdf5e9;
    --danger: #d63d54;
    --danger-soft: #fde8eb;
    --radius: 14px;
    --radius-sm: 10px;
    /* ── Sidebar sizing ── */
    --sb-mini: 56px;
    --sb-full: 240px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    width: var(--sb-mini);
    min-width: var(--sb-mini);
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
    background: linear-gradient(180deg, #fffaf2 0%, var(--bg) 100%) !important;
    border-right: 1px solid var(--line) !important;
    color: var(--ink);
    z-index: 50;
    transition: width .22s cubic-bezier(.4, 0, .2, 1), min-width .22s cubic-bezier(.4, 0, .2, 1);
}

    .ez-sidebar.open {
        width: var(--sb-full);
        min-width: var(--sb-full);
    }

@media (min-width: 1680px) {
    .ez-sidebar.open {
        --sb-full: 260px;
    }
}

/* ═══════════════════════════════════════════════════════
   BRAND BLOCK
   ═══════════════════════════════════════════════════════ */
.ez-sidebar .sb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 10px 12px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    cursor: pointer;
    transition: background .15s;
    overflow: hidden;
    min-height: 64px;
}

    .ez-sidebar .sb-brand:hover {
        background: var(--brand-softer);
    }

.ez-sidebar .sb-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #fff;
    display: grid;
    place-items: center;
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 17px;
    box-shadow: 0 4px 10px rgba(184, 116, 42, .28);
    flex-shrink: 0;
    margin-left: 2px;
}

.ez-sidebar .sb-brand-text {
    line-height: 1.15;
    flex: 1;
    min-width: 0;
    opacity: 0;
    transform: translateX(-6px);
    pointer-events: none;
    transition: opacity .18s, transform .22s;
}

.ez-sidebar.open .sb-brand-text {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.ez-sidebar .sb-brand-text .module {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 15px;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

    .ez-sidebar .sb-brand-text .module .chev {
        color: var(--ink-mute);
        flex-shrink: 0;
    }

.ez-sidebar .sb-brand-text .hotel {
    font-size: 11px;
    color: var(--ink-mute);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════
   SEARCH
   ═══════════════════════════════════════════════════════ */
.ez-sidebar .sb-search {
    padding: 10px 12px 8px;
    position: relative;
    flex-shrink: 0;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: opacity .18s, height .22s;
}

.ez-sidebar.open .sb-search {
    opacity: 1;
    height: auto;
}

.ez-sidebar .sb-search input {
    width: 100%;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    padding: 0 36px 0 34px;
    font-family: inherit;
    font-size: 12.5px;
    color: var(--ink);
    outline: none;
    transition: border-color .15s;
}

    .ez-sidebar .sb-search input:focus {
        border-color: var(--brand);
    }

    .ez-sidebar .sb-search input::placeholder {
        color: var(--ink-mute);
    }

.ez-sidebar .sb-search .ic {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-mute);
    pointer-events: none;
}

.ez-sidebar .sb-search .kbd {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--ink-mute);
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 1px 5px;
    border-radius: 4px;
    pointer-events: none;
}

.ez-sidebar .sb-search .clear {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 4px;
    background: var(--surface-2);
    color: var(--ink-mute);
    font-size: 11px;
    cursor: pointer;
    display: grid;
    place-items: center;
}

    .ez-sidebar .sb-search .clear:hover {
        background: var(--danger-soft);
        color: var(--danger);
    }

/* ═══════════════════════════════════════════════════════
   BODY (scroll)
   ═══════════════════════════════════════════════════════ */
.ez-sidebar .sb-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 8px 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

    .ez-sidebar .sb-body::-webkit-scrollbar {
        width: 6px;
    }

    .ez-sidebar .sb-body::-webkit-scrollbar-thumb {
        background: var(--line-strong);
        border-radius: 99px;
    }

/* ═══════════════════════════════════════════════════════
   GROUP
   ═══════════════════════════════════════════════════════ */
.ez-sidebar .sb-group {
    margin-bottom: 4px;
}

    .ez-sidebar .sb-group h5 {
        margin: 14px 10px 4px;
        font-size: 10px;
        letter-spacing: .14em;
        text-transform: uppercase;
        color: var(--ink-mute);
        font-weight: 600;
        white-space: nowrap;
        opacity: 0;
        height: 0;
        overflow: hidden;
        transition: opacity .18s;
    }

.ez-sidebar.open .sb-group h5 {
    opacity: 1;
    height: auto;
    margin: 14px 10px 4px;
}

.ez-sidebar .sb-group:first-child h5 {
    margin-top: 6px;
}

/* divider line (replaces section header when collapsed) */
.ez-sidebar:not(.open) .sb-group + .sb-group {
    margin-top: 8px;
    position: relative;
}

    .ez-sidebar:not(.open) .sb-group + .sb-group::before {
        content: "";
        position: absolute;
        top: 0;
        left: 12px;
        right: 12px;
        height: 1px;
        background: var(--line);
    }

/* ═══════════════════════════════════════════════════════
   NAV ITEM (NavLink)
   ═══════════════════════════════════════════════════════ */
.ez-sidebar .sb-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    transition: background .12s, color .12s;
    position: relative;
    text-decoration: none !important;
    margin-bottom: 1px;
}

    .ez-sidebar .sb-item:hover {
        background: var(--brand-softer);
        color: var(--brand-deep);
    }

    .ez-sidebar .sb-item.active {
        background: var(--brand-soft);
        color: var(--brand-deep);
        font-weight: 600;
    }

        .ez-sidebar .sb-item.active::before {
            content: "";
            position: absolute;
            left: -1px;
            top: 8px;
            bottom: 8px;
            width: 3px;
            border-radius: 0 3px 3px 0;
            background: var(--brand);
            display: none;
        }

.ez-sidebar.open .sb-item.active::before {
    display: block;
}

/* icon */
.ez-sidebar .sb-item .ic {
    width: 20px;
    min-width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    color: var(--ink-soft);
    flex-shrink: 0;
}

.ez-sidebar .sb-item:hover .ic,
.ez-sidebar .sb-item.active .ic {
    color: var(--brand-deep);
}

/* label */
.ez-sidebar .sb-item .lbl {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity .18s;
}

.ez-sidebar.open .sb-item .lbl {
    opacity: 1;
    width: auto;
}

/* pin star & badge (right side) */
.ez-sidebar .sb-item .pin-star {
    margin-left: auto;
    color: var(--brand);
    flex-shrink: 0;
    opacity: 0;
    transition: opacity .18s;
}

.ez-sidebar.open .sb-item .pin-star {
    opacity: 1;
}

.ez-sidebar .sb-item .badge-sm {
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    background: var(--danger);
    color: #fff;
    padding: 1px 6px;
    border-radius: 999px;
    opacity: 0;
    transition: opacity .18s;
}

.ez-sidebar.open .sb-item .badge-sm {
    opacity: 1;
}

/* collapsed: show small red dot instead of badge */
.ez-sidebar:not(.open) .sb-item:has(.badge-sm)::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 14px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--danger);
}

/* collapsed: show amber dot for pinned */
.ez-sidebar:not(.open) .sb-item:has(.pin-star)::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 14px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
}

/* ═══════════════════════════════════════════════════════
   TOOLTIP (collapsed only, from data-tip)
   ═══════════════════════════════════════════════════════ */
.ez-sidebar:not(.open) .sb-item:hover::before {
    content: attr(data-tip);
    position: absolute;
    left: calc(var(--sb-mini) - 6px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--ink);
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 200;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}

/* ═══════════════════════════════════════════════════════
   EMPTY SEARCH STATE
   ═══════════════════════════════════════════════════════ */
.ez-sidebar .sb-empty {
    padding: 16px 12px;
    text-align: center;
    color: var(--ink-mute);
    border-top: 1px dashed var(--line);
    margin-top: 8px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

.ez-sidebar.open .sb-empty {
    opacity: 1;
    height: auto;
}

.ez-sidebar .sb-empty .se-title {
    font-family: 'Fraunces', serif;
    font-size: 13px;
    color: var(--ink);
    margin-bottom: 2px;
}

.ez-sidebar .sb-empty .se-sub {
    font-size: 11px;
}

/* ═══════════════════════════════════════════════════════
   FOOTER (user)
   ═══════════════════════════════════════════════════════ */
.ez-sidebar .sb-footer {
    border-top: 1px solid var(--line);
    padding: 10px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-2);
    flex-shrink: 0;
}

    .ez-sidebar .sb-footer .av {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: linear-gradient(135deg, #e89647, var(--brand));
        color: #fff;
        display: grid;
        place-items: center;
        font-weight: 600;
        font-size: 13px;
        flex-shrink: 0;
        margin-left: 4px;
    }

    .ez-sidebar .sb-footer .meta {
        line-height: 1.2;
        flex: 1;
        min-width: 0;
        opacity: 0;
        width: 0;
        overflow: hidden;
        transition: opacity .18s;
    }

.ez-sidebar.open .sb-footer .meta {
    opacity: 1;
    width: auto;
}

.ez-sidebar .sb-footer .name {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    font-family: 'Fraunces', serif;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ez-sidebar .sb-footer .role {
    display: block;
    font-size: 9.5px;
    color: var(--ink-mute);
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ez-sidebar .sb-footer .logout {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    display: grid;
    place-items: center;
    color: var(--danger);
    cursor: pointer;
    transition: all .15s;
    flex-shrink: 0;
    opacity: 0;
    width: 0;
    padding: 0;
    border: none;
    transition: opacity .18s, width .22s, border .22s;
}

.ez-sidebar.open .sb-footer .logout {
    opacity: 1;
    width: 30px;
    border: 1px solid var(--line-strong);
}

.ez-sidebar .sb-footer .logout:hover {
    background: var(--danger-soft);
    border-color: #f0c4cb;
}

.ez-sidebar .sb-footer .logout:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.ez-sidebar .lo-spin {
    width: 12px;
    height: 12px;
    border: 2px solid var(--line-strong);
    border-top-color: var(--danger);
    border-radius: 50%;
    animation: sb-spin .8s linear infinite;
}

@keyframes sb-spin {
    to {
        transform: rotate(360deg);
    }
}
