/* ===========================================================================
   App shell — sidebar + navbar + content (MainLayout)
   =========================================================================== */
.app-shell { display: flex; min-height: 100vh; background: var(--bg, #f4f5f8); }
.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.app-content { padding: 22px 26px; flex: 1; }

/* ------------------------------ Sidebar -------------------------------- */
.app-sidebar {
    width: 258px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #edeff3;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
}
.app-sidebar__brand { padding: 18px 18px 14px; display: flex; align-items: center; justify-content: center; }
.app-sidebar__brand img { max-width: 100%; width: auto; height: auto; max-height: 46px; object-fit: contain; display: block; }

.app-sidebar__nav { flex: 1; overflow-y: auto; padding: 6px 14px 24px; }
.app-sidebar__nav::-webkit-scrollbar { width: 6px; }
.app-sidebar__nav::-webkit-scrollbar-thumb { background: #dde1e8; border-radius: 3px; }

.nav-section-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .8px;
    color: #a2a9b5;
    text-transform: uppercase;
    padding: 16px 12px 6px;
}

.nav-link-item {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    padding: 9px 12px;
    margin: 1px 0;
    border-radius: 10px;
    color: #5a6372;
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.nav-link-item .material-symbols-rounded { font-size: 21px; color: #8b94a3; transition: color .12s; }
.nav-link-item:hover { background: #f7f8fa; color: var(--primary-color); }
.nav-link-item:hover .material-symbols-rounded { color: var(--primary-color); }

.nav-link-item.active {
    background: var(--brand-tint, #f6ecee);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary-color);
}
.nav-link-item.active .material-symbols-rounded { color: var(--primary-color); }

.nav-link-item.is-soon { color: #b7bdc7; cursor: default; }
.nav-link-item.is-soon .material-symbols-rounded { color: #cfd4dc; }
.nav-link-item.is-soon:hover { background: transparent; color: #b7bdc7; }
.nav-link-item__text { flex: 1; }

.soon-badge {
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .5px;
    color: #9aa1ad;
    background: #eef0f3;
    padding: 2px 7px;
    border-radius: 6px;
}

/* ------------------------------ Navbar --------------------------------- */
.app-navbar {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid #edeff3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.navbar-left { display: flex; align-items: center; gap: 10px; }
.navbar-right { display: flex; align-items: center; gap: 12px; }

/* vertical filter dropdown */
.vertical-select {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 10px 0 14px;
    border: 1px solid #e3e6ec;
    border-radius: 10px;
    background: #fff;
    color: #4b5059;
}
.vertical-select > .material-symbols-rounded:first-child { font-size: 19px; color: #8b94a3; }
.vertical-select__chev { font-size: 20px; color: #8b94a3; pointer-events: none; }
.vertical-select__input {
    border: none; background: transparent; outline: none;
    font-size: .92rem; font-weight: 600; color: var(--ink);
    appearance: none; padding-right: 6px; cursor: pointer; min-width: 120px;
}

/* icon buttons */
.navbar-icon-btn {
    width: 42px; height: 42px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 11px;
    border: 1px solid #e9ebf0; background: #fff; cursor: pointer;
    color: #6b7280; position: relative;
}
.navbar-icon-btn:hover { background: #f5f6f8; }
.navbar-icon-btn .material-symbols-rounded { font-size: 22px; }
.navbar-badge {
    position: absolute; top: 9px; right: 10px;
    width: 8px; height: 8px; border-radius: 50%;
    background: #d64545; border: 2px solid #fff;
}

/* user */
.navbar-user { display: flex; align-items: center; gap: 10px; padding-left: 4px; }
.navbar-user__avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--primary-color); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .82rem; font-weight: 700; letter-spacing: .5px;
}
.navbar-user__fullname { font-weight: 600; font-size: .92rem; color: var(--ink); }

/* responsive: collapse sidebar to icons */
@media (max-width: 991px) {
    .app-sidebar { width: 72px; }
    .nav-link-item { justify-content: center; padding: 10px; }
    .nav-link-item__text, .soon-badge, .nav-section-label { display: none; }
    .app-sidebar__brand img { height: 26px; }
    .navbar-user__fullname { display: none; }
}

/* ---- Custom dropdown (client / vertical pickers) ---- */
.cdd { position: relative; }
.cdd__trigger { cursor: pointer; user-select: none; min-width: 190px; }
.cdd__value {
    flex: 1; font-size: .92rem; font-weight: 600; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px;
}
.cdd__value.is-placeholder { color: var(--muted); font-weight: 500; }

.cdd__backdrop { position: fixed; inset: 0; z-index: 1999; }
.cdd__panel {
    position: absolute; top: calc(100% + 6px); left: 0;
    min-width: 100%; width: max-content; max-width: 340px;
    background: #fff; border: 1px solid #e6e8ee; border-radius: 12px;
    box-shadow: 0 12px 34px rgba(16,24,40,.14); z-index: 2000;
    padding: 6px; max-height: 340px; display: flex; flex-direction: column;
}
.cdd__search {
    width: 100%; height: 36px; margin-bottom: 6px; padding: 0 12px;
    border: 1px solid #e6e8ee; border-radius: 8px; font-size: .88rem; outline: none;
}
.cdd__search:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(122,31,43,.1); }
.cdd__list { overflow-y: auto; }
.cdd__list::-webkit-scrollbar { width: 7px; }
.cdd__list::-webkit-scrollbar-thumb { background: #d8dce3; border-radius: 4px; }
.cdd__option {
    padding: 9px 12px; border-radius: 8px; cursor: pointer;
    font-size: .89rem; color: #4b5059; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.cdd__option:hover { background: var(--brand-tint, #f6ecee); color: var(--primary-color); }
.cdd__option.selected { background: var(--brand-tint, #f6ecee); color: var(--primary-color); font-weight: 600; }
.cdd__empty { padding: 12px; text-align: center; color: var(--muted); font-size: .85rem; }

/* ---- Header session badge (selected client + partner) ---- */
.session-badge {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 14px; border: 1px solid #e3e6ec; border-radius: 10px;
    background: #fff; max-width: 340px;
}
.session-badge__icon { font-size: 20px; color: var(--primary-color); }
.session-badge__text { line-height: 1.15; min-width: 0; }
.session-badge__client { font-size: .9rem; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-badge__partner { font-size: .76rem; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-badge__partner .material-symbols-rounded { font-size: 14px; }

/* A sidebar item that is a <button> (Logout) looks exactly like the link items. */
.nav-link-item--button { border: 0; background: none; text-align: left; font-family: inherit; }

/* ---- "Are you sure?" popup (ConfirmDialog) ---- */
.app-navbar:has(.cf-overlay) { z-index: 4000; }
.cf-overlay { position: fixed; inset: 0; z-index: 4000; background: rgba(35, 38, 50, .5); display: flex; align-items: center; justify-content: center; padding: 20px; }
.cf-dialog { width: min(400px, 100%); background: #fff; border-radius: 16px; padding: 26px 26px 22px; text-align: center; box-shadow: 0 20px 50px rgba(20, 20, 40, .3); }
.cf-icon { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; background: #f6e9ed; color: var(--primary-color); display: flex; align-items: center; justify-content: center; }
.cf-icon .material-symbols-rounded { font-size: 28px; }
.cf-title { margin: 0 0 6px; font-size: 1.2rem; font-weight: 700; color: #1c1416; }
.cf-text { margin: 0 0 20px; color: #5b6270; font-size: .94rem; line-height: 1.4; }
.cf-buttons { display: flex; justify-content: center; gap: 12px; }
.cf-btn { min-width: 110px; height: 44px; padding: 0 20px; border-radius: 10px; font: inherit; font-size: .94rem; font-weight: 600; cursor: pointer; }
.cf-btn--ghost { border: 1px solid #d9dde3; background: #fff; color: var(--ink); }
.cf-btn--ghost:hover:not(:disabled) { border-color: var(--primary-color); color: var(--primary-color); }
.cf-btn--primary { border: 1px solid var(--primary-color); background: var(--primary-color); color: #fff; }
.cf-btn--primary:hover:not(:disabled) { filter: brightness(1.1); }
.cf-btn:disabled { opacity: .6; cursor: wait; }
