/* ==========================================================
   TOPBAR
========================================================== */

.topbar{

    background:var(--topbar);

    border-bottom:1px solid var(--border);

    display:flex;

    align-items:center;

    justify-content:space-between;

    padding:0 28px;

}

.topbar-left{

    display:flex;

    align-items:center;

    gap:18px;

    min-width:0;
    transition:gap .24s ease;

}

.topbar-right{

    display:flex;

    align-items:center;

    gap:14px;

    flex-shrink:0;

}


#sparkTooltip{

    position:fixed;

    pointer-events:none;

    z-index:99999;

    padding:8px 10px;

    border-radius:10px;

    background:var(--surface);

    border:1px solid rgba(var(--primary-rgb),.25);

    color:var(--text);

    font-size:12px;

    line-height:1.4;

    white-space:nowrap;

    box-shadow:var(--shadow);

    transform:translate(-50%,-115%);

}
#sparkTooltip{

    opacity:0;

    visibility:hidden;

    transition:.15s ease;

}

#sparkTooltip.show{

    opacity:1;

    visibility:visible;

}

/* ==========================================================
   PAGE HEADER
========================================================== */

.page-header{

    display:flex;

    align-items:flex-start;

    justify-content:space-between;

    gap:16px;

    margin-bottom:6px;

}

.page-header h1{

    margin:0 0 4px;

    color:var(--text);

    font-size:26px;

    line-height:1.1;

    letter-spacing:0;

}

.page-header p{

    margin:0;

    color:var(--text-muted);

    font-size:13px;

    line-height:1.35;

    font-weight:500;

}

/* ==========================================================
   GLOBAL TOASTS
========================================================== */

.toast-stack{

    position:fixed;

    right:33px;
    top:calc(var(--topbar-height) + 17px);

    z-index:99998;

    display:flex;
    flex-direction:column;
    align-items:flex-end;
    gap:10px;

    width:min(380px,calc(100vw - 28px));

    pointer-events:none;

}

.app-toast{

    position:relative;

    width:100%;
    min-height:58px;

    display:grid;
    grid-template-columns:36px minmax(0,1fr) 30px;
    align-items:center;
    gap:11px;

    padding:12px 12px 14px;

    overflow:hidden;

    border:1px solid var(--border);
    border-radius:14px;

    background:
        linear-gradient(135deg,rgba(var(--primary-rgb),.08),rgba(var(--primary-rgb),0)),
        var(--surface);

    color:var(--text);

    box-shadow:var(--shadow);

    opacity:0;
    transform:translateX(calc(100% + 24px)) scale(.98);

    pointer-events:auto;

    transition:opacity .2s ease, transform .2s ease;

}

.app-toast.show{

    opacity:1;
    transform:translateX(0) scale(1);

}

.app-toast.leaving{

    opacity:0;
    transform:translateX(calc(100% + 24px)) scale(.98);

}

.app-toast-icon{

    width:36px;
    height:36px;

    display:flex;
    align-items:center;
    justify-content:center;

    border-radius:12px;

    background:rgba(var(--primary-rgb),.14);
    color:var(--primary);

}

.app-toast.success .app-toast-icon{
    background:rgba(34,197,94,.14);
    color:#22c55e;
}

.app-toast.error .app-toast-icon{
    background:rgba(239,68,68,.14);
    color:#ef4444;
}

.app-toast.warning .app-toast-icon{
    background:rgba(245,158,11,.14);
    color:#f59e0b;
}

.app-toast-content{

    min-width:0;

    display:flex;
    flex-direction:column;
    gap:3px;

    font-size:13px;
    line-height:1.35;

}

.app-toast-content strong{

    width:fit-content;
    max-width:100%;

    padding:5px 8px;

    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;

    border:1px solid var(--border);
    border-radius:9px;

    background:rgba(var(--primary-rgb),.08);
    color:var(--text);

    font-size:13px;
    font-weight:800;
    font-family:'DIN 1451','Bahnschrift','SFMono-Regular','Consolas',monospace;

}

.app-toast-content span{

    color:var(--text-muted);

}

.app-toast-content code{

    width:fit-content;
    max-width:100%;

    margin-top:4px;
    padding:5px 8px;

    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;

    border:1px solid var(--border);
    border-radius:9px;

    background:rgba(var(--primary-rgb),.08);
    color:var(--text);

    font-size:12px;
    font-family:'DIN 1451','Bahnschrift','SFMono-Regular','Consolas',monospace;

}

.app-toast-close{

    width:30px;
    height:30px;

    display:flex;
    align-items:center;
    justify-content:center;

    border:1px solid var(--border);
    border-radius:10px;
    background:transparent;
    color:var(--text-muted);

    cursor:pointer;

    transition:var(--transition);

}

.app-toast-close:hover{

    border-color:rgba(var(--primary-rgb),.32);
    color:var(--text);
    background:rgba(var(--primary-rgb),.10);

}

.app-toast-timer{

    position:absolute;
    left:0;
    bottom:0;

    height:2px;
    width:100%;

    background:var(--primary);

    transform-origin:left center;
    animation:toast-timer var(--toast-duration,3200ms) linear forwards;

}

.app-toast.success .app-toast-timer{
    background:#22c55e;
}

.app-toast.error .app-toast-timer{
    background:#ef4444;
}

.app-toast.warning .app-toast-timer{
    background:#f59e0b;
}

@keyframes toast-timer{

    from{
        transform:scaleX(1);
    }

    to{
        transform:scaleX(0);
    }

}

@media (max-width:640px){

    .toast-stack{
        right:25px;
        top:calc(var(--topbar-height) + 9px);
        align-items:stretch;
    }

    .app-toast{
        grid-template-columns:34px minmax(0,1fr) 30px;
    }

}



/* ==========================================================
   BRAND
========================================================== */

.brand{

    display:flex;

    align-items:center;

    gap:8px;

    margin-right:8px;
    transition:gap .24s ease, margin-right .24s ease;

}

.brand-logo{
    width:68px;
    height:42px;
    flex:0 0 58px;
    display:grid;
    place-items:center;
    overflow:visible;
    transform:translateY(-15px);
}

.brand-logo-img{
    width:72px;
    height:72px;
    object-fit:contain;
    display:block;
    max-width:none;
}

.brand-logo-dark{
    display:none;
}

:root[data-theme="light"] .brand-logo-light{
    display:none;
}

:root[data-theme="light"] .brand-logo-dark{
    display:block;
}

.brand-title{

    display:inline-block;
    overflow:hidden;
    max-width:120px;
    font-size:24px;

    font-weight:700;

    letter-spacing:-.4px;
    white-space:nowrap;
    transition:max-width .24s ease, opacity .18s ease, transform .24s ease;

}

.brand-badge{

    display:inline-flex;
    overflow:hidden;
    max-width:42px;
    background:var(--primary);

    color:#fff;

    font-size:11px;

    font-weight:700;

    padding:4px 9px;

    border-radius:8px;
    white-space:nowrap;
    transition:max-width .24s ease, opacity .18s ease, transform .24s ease, padding .24s ease, margin .24s ease;

}

html.sidebar-collapsed .brand-title,
.sidebar-collapsed .brand-title,
.sidebar-collapsed .brand-badge,
html.sidebar-collapsed .brand-badge{
    max-width:0;
    opacity:0;
    transform:translateX(-8px);
    pointer-events:none;
}

html.sidebar-collapsed .brand-badge,
.sidebar-collapsed .brand-badge{
    padding-left:0;
    padding-right:0;
    border-width:0;
}


/* ==========================================================
   BUTTONS
========================================================== */

.icon-button{

    width:46px;

    height:46px;

    border:1px solid var(--border);

    border-radius:14px;

    background:var(--surface);

    color:var(--text);

    cursor:pointer;

    position:relative;

    display:flex;

    align-items:center;

    justify-content:center;

    transition:var(--transition);

}

.icon-button:hover{

    background:var(--surface-hover);

    border-color:var(--primary);

    box-shadow:0 0 0 3px rgba(var(--primary-rgb),.12);

}

.topbar-action{
    flex:0 0 46px;
    width:46px;
    min-width:46px;
    padding:0;
    border-color:transparent;
    background:transparent;
    box-shadow:none;
    font-size:0;
}

.topbar-action i{
    font-size:19px;
    line-height:1;
}

.topbar-action:hover,
.topbar-action.active,
.theme-dropdown.open .topbar-action{
    border-color:transparent;
    background:transparent;
    box-shadow:none;
    color:var(--primary);
}

:root[data-theme="light"] .icon-button{

    border-color:rgba(15,23,42,.11);
    box-shadow:0 1px 2px rgba(15,23,42,.04);

}

:root[data-theme="light"] .icon-button:hover,
:root[data-theme="light"] .theme-dropdown.open .icon-button{

    background:var(--surface);
    border-color:rgba(var(--primary-rgb),.45);
    box-shadow:0 1px 2px rgba(15,23,42,.04);

}

:root[data-theme="light"] .topbar-action:hover,
:root[data-theme="light"] .theme-dropdown.open .topbar-action,
.theme-dropdown.open .topbar-action,
.topbar-action:active,
.topbar-action:focus,
.topbar-action.active{
    border-color:transparent;
    background:transparent;
    box-shadow:none;
}

.menu-button{

    transition:
        background-color .18s ease,
        border-color .18s ease,
        box-shadow .18s ease;

}

.notification-dot{

    position:absolute;

    top:11px;

    right:11px;

    width:8px;

    height:8px;

    border-radius:50%;

    background:var(--primary);

    opacity:0;
    transform:scale(.6);
    transition:var(--transition);

}

.notification-dot.show{
    opacity:1;
    transform:scale(1);
}

.notification-count{
    position:absolute;
    top:5px;
    right:4px;
    min-width:17px;
    height:17px;
    padding:0 5px;
    border-radius:999px;
    background:var(--primary);
    color:#fff;
    display:none;
    place-items:center;
    font-size:10px;
    font-weight:900;
    line-height:1;
    box-shadow:0 0 0 2px var(--bg);
}

.notification-count.show{
    display:grid;
}

.notification-dropdown{
    position:relative;
    display:inline-flex;
}

.notification-dropdown.open .topbar-action{
    background:transparent;
    border-color:transparent;
    box-shadow:none;
    color:var(--primary);
}

.notification-menu{
    position:absolute;
    top:calc(100% + 12px);
    right:-6px;
    z-index:900;
    width:min(370px, calc(100vw - 28px));
    max-height:min(520px, calc(100vh - 90px));
    padding:12px;
    border:1px solid var(--border);
    border-radius:18px;
    background:var(--surface);
    box-shadow:var(--shadow);
    display:grid;
    gap:10px;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transform:translateY(-8px) scale(.98);
    transform-origin:top right;
    transition:
        opacity .2s ease,
        transform .2s ease,
        visibility .2s ease;
}

.notification-dropdown.open .notification-menu{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transform:translateY(0) scale(1);
}

.notification-menu-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:14px;
}

.notification-menu-head strong{
    color:var(--text);
    font-size:15px;
}

.notification-menu-head span{
    display:block;
    margin-top:2px;
    color:var(--text-muted);
    font-size:12px;
}

.notification-menu-head button{
    min-height:32px;
    padding:0 10px;
    border:1px solid var(--border);
    border-radius:10px;
    background:transparent;
    color:var(--text-muted);
    font-size:12px;
    font-weight:900;
    cursor:pointer;
    transition:var(--transition);
}

.notification-menu-head button:hover:not(:disabled){
    border-color:rgba(var(--primary-rgb),.45);
    color:var(--primary);
    background:rgba(var(--primary-rgb),.08);
}

.notification-menu-head button:disabled{
    opacity:.45;
    cursor:not-allowed;
}

.notification-list{
    display:grid;
    gap:8px;
    overflow:auto;
    max-height:420px;
    padding-right:2px;
}

.notification-list::-webkit-scrollbar{
    width:8px;
}

.notification-list::-webkit-scrollbar-track{
    background:transparent;
}

.notification-list::-webkit-scrollbar-thumb{
    border-radius:999px;
    background:rgba(var(--primary-rgb),.28);
}

.notification-item,
.notification-empty{
    width:100%;
    border:1px solid var(--border);
    border-radius:14px;
    background:rgba(2,6,23,.18);
}

.notification-item{
    padding:10px;
    color:inherit;
    display:grid;
    grid-template-columns:34px minmax(0,1fr) auto;
    align-items:center;
    gap:10px;
    text-align:left;
    cursor:pointer;
    transition:var(--transition);
}

.notification-item:hover{
    border-color:rgba(var(--primary-rgb),.45);
    background:rgba(var(--primary-rgb),.08);
}

.notification-item.is-unread{
    border-color:rgba(var(--primary-rgb),.32);
}

.notification-item-icon{
    width:34px;
    height:34px;
    border-radius:11px;
    background:rgba(var(--primary-rgb),.12);
    color:var(--primary);
    display:grid;
    place-items:center;
}

.notification-item.is-warning .notification-item-icon{
    background:rgba(245,158,11,.13);
    color:#f59e0b;
}

.notification-item.is-error .notification-item-icon{
    background:rgba(239,68,68,.13);
    color:#ef4444;
}

.notification-item.is-success .notification-item-icon{
    background:rgba(34,197,94,.13);
    color:#22c55e;
}

.notification-item-body{
    min-width:0;
    display:grid;
    gap:2px;
}

.notification-item-topline{
    min-width:0;
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto;
    align-items:center;
    gap:10px;
}

.notification-item-title{
    min-width:0;
    color:var(--text);
    font-size:13px;
    font-weight:900;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.notification-item-message,
.notification-item-date,
.notification-empty{
    color:var(--text-muted);
    font-size:12px;
}

.notification-item-message{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.notification-item-date{
    white-space:nowrap;
    justify-self:end;
}

.notification-item-read{
    min-height:28px;
    padding:0 9px;
    border:1px solid var(--border);
    border-radius:999px;
    background:rgba(var(--primary-rgb),.08);
    color:var(--primary);
    display:inline-flex;
    align-items:center;
    gap:5px;
    font-size:11px;
    font-weight:900;
    line-height:1;
    opacity:0;
    transform:translateX(4px);
    pointer-events:none;
    transition:var(--transition);
}

.notification-item:hover .notification-item-read,
.notification-item:focus-visible .notification-item-read,
.notification-item-read:focus-visible{
    opacity:1;
    transform:translateX(0);
    pointer-events:auto;
}

.notification-item-read:hover{
    border-color:rgba(var(--primary-rgb),.55);
    background:rgba(var(--primary-rgb),.14);
}

.notification-empty{
    min-height:96px;
    padding:18px;
    display:grid;
    place-items:center;
    align-content:center;
    gap:6px;
    text-align:center;
}

.notification-empty i{
    color:var(--primary);
    font-size:22px;
}


/* ==========================================================
   SEARCH
========================================================== */

.search-box{

    position:relative;
    width:min(440px,38vw);

    height:48px;

    background:var(--surface);

    border:1px solid var(--border);

    border-radius:14px;

    display:flex;

    align-items:center;

    gap:12px;

    padding:0 16px;
    
    transition:var(--transition);
    
}

.global-search-results{
    position:absolute;
    top:calc(100% + 10px);
    left:0;
    right:0;
    z-index:1200;
    min-width:360px;
    max-height:min(420px, calc(100vh - var(--topbar-height) - 28px));
    overflow:auto;
    padding:8px;
    border:1px solid var(--border);
    border-radius:16px;
    background:var(--surface);
    box-shadow:var(--shadow);
    display:none;
    scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);
    scrollbar-width:thin;
}

.global-search-results.open{
    display:grid;
    gap:4px;
}

.global-search-result,
.global-search-empty{
    min-height:48px;
    border:0;
    border-radius:12px;
    background:transparent;
    color:var(--text);
}

.global-search-result{
    width:100%;
    padding:8px 10px;
    display:grid;
    grid-template-columns:30px minmax(0,1fr) auto;
    align-items:center;
    gap:10px;
    text-align:left;
    cursor:pointer;
    transition:var(--transition);
}

.global-search-result:hover,
.global-search-result.active{
    background:rgba(var(--primary-rgb),.10);
}

.global-search-result i{
    width:30px;
    height:30px;
    border-radius:10px;
    background:rgba(var(--primary-rgb),.13);
    color:var(--primary);
    display:grid;
    place-items:center;
}

.global-search-avatar{
    width:30px;
    height:30px;
    border-radius:10px;
    background:linear-gradient(135deg,var(--primary),var(--primary-hover));
    color:#fff;
    display:grid;
    place-items:center;
    font-size:11px;
    font-weight:850;
    letter-spacing:.02em;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.16);
}

.global-search-logo{
    width:30px;
    height:30px;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--bg);
    display:grid;
    place-items:center;
    overflow:hidden;
}

.global-search-logo img{
    width:24px;
    height:24px;
    object-fit:contain;
    display:block;
}

.global-search-result strong,
.global-search-result span{
    display:block;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.global-search-result strong{
    font-size:13px;
    font-weight:850;
}

.global-search-result span{
    margin-top:2px;
    color:var(--text-muted);
    font-size:12px;
    font-weight:650;
}

.global-search-result small{
    color:var(--text-muted);
}

.global-search-empty{
    padding:12px;
    color:var(--text-muted);
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    font-size:13px;
    font-weight:750;
}

/* ==========================================================
   GLOBAL VIEWERS
========================================================== */

.global-viewer-overlay{
    position:fixed;
    inset:0;
    z-index:2200;
    padding:clamp(14px,3vw,32px);
    background:rgba(2,6,23,.68);
    backdrop-filter:blur(10px);
    display:grid;
    place-items:center;
    opacity:0;
    pointer-events:none;
    transition:opacity .18s ease;
}

.global-viewer-overlay.open{
    opacity:1;
    pointer-events:auto;
}

.global-viewer-shell{
    width:min(920px,100%);
    max-height:min(860px,calc(100dvh - 44px));
    border:1px solid var(--border);
    border-radius:18px;
    background:var(--surface);
    box-shadow:var(--shadow);
    display:grid;
    grid-template-rows:auto minmax(0,1fr);
    overflow:hidden;
    transform:translateY(8px) scale(.985);
    transition:transform .18s ease;
}

.global-viewer-overlay.open .global-viewer-shell{
    transform:translateY(0) scale(1);
}

.global-viewer-head{
    min-height:66px;
    padding:14px 16px;
    border-bottom:1px solid var(--border);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
}

.global-viewer-head span,
.global-viewer-head strong{
    display:block;
}

.global-viewer-head span{
    color:var(--text-muted);
    font-size:12px;
    font-weight:850;
}

.global-viewer-head strong{
    margin-top:2px;
    color:var(--text);
    font-size:18px;
    font-weight:950;
}

.global-viewer-head strong i{
    margin-right:9px;
    color:var(--primary);
}

.global-viewer-actions{
    display:flex;
    align-items:center;
    gap:8px;
}

.global-viewer-actions a,
.global-viewer-actions button{
    min-width:42px;
    height:42px;
    padding:0 13px;
    border:1px solid var(--border);
    border-radius:13px;
    background:var(--surface);
    color:var(--text);
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    text-decoration:none;
    font:inherit;
    font-size:12px;
    font-weight:900;
    cursor:pointer;
    transition:var(--transition);
}

.global-viewer-actions a:hover,
.global-viewer-actions button:hover{
    border-color:var(--primary);
    color:var(--primary);
}

.global-viewer-note{
    width:min(620px,100%);
}

.global-viewer-note-body{
    margin:16px;
    padding:16px;
    border:1px solid var(--border);
    border-radius:14px;
    background:var(--bg);
    color:var(--text);
    line-height:1.55;
    white-space:pre-line;
    overflow:auto;
}

.global-viewer-pdf{
    width:min(1100px,100%);
    height:min(840px,calc(100dvh - 44px));
}

.global-viewer-pdf iframe{
    width:100%;
    height:100%;
    border:0;
    background:var(--bg);
}

.global-pdf-stage{
    position:relative;
    min-height:0;
    height:100%;
    background:var(--bg);
}

.global-pdf-stage iframe{
    display:block;
}

.global-pdf-loading{
    position:absolute;
    inset:0;
    z-index:2;
    display:grid;
    place-items:center;
    gap:10px;
    align-content:center;
    background:
        radial-gradient(circle at 50% 35%,rgba(var(--primary-rgb),.16),transparent 34%),
        var(--bg);
    color:var(--text-muted);
    font-size:14px;
    font-weight:900;
    transition:opacity .18s ease, visibility .18s ease;
}

.global-pdf-loading > *{
    transform:translateY(-32px);
}

.global-pdf-loading i{
    width:44px;
    height:44px;
    border-radius:15px;
    border:1px solid rgba(var(--primary-rgb),.24);
    background:rgba(var(--primary-rgb),.12);
    color:var(--primary);
    display:grid;
    place-items:center;
    font-size:18px;
}

.global-pdf-loading i::before{
    display:block;
    animation:globalPdfSpin .8s linear infinite;
}

.global-pdf-loading.is-hidden{
    opacity:0;
    visibility:hidden;
    pointer-events:none;
}

@keyframes globalPdfSpin{
    to{
        transform:rotate(360deg);
    }
}

.global-viewer-image{
    width:min(1040px,100%);
    grid-template-rows:auto minmax(0,1fr) auto;
}

.global-image-stage{
    min-height:0;
    position:relative;
    background:var(--bg);
    display:grid;
    place-items:center;
    overflow:hidden;
}

.global-image-stage img{
    max-width:100%;
    max-height:calc(100dvh - 230px);
    object-fit:contain;
    display:block;
}

.global-image-nav{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    width:44px;
    height:58px;
    border:1px solid var(--border);
    border-radius:14px;
    background:rgba(15,23,42,.74);
    color:#fff;
    display:grid;
    place-items:center;
    cursor:pointer;
    transition:var(--transition);
}

.global-image-nav:hover{
    border-color:var(--primary);
    color:var(--primary);
}

.global-image-nav.prev{
    left:14px;
}

.global-image-nav.next{
    right:14px;
}

.global-image-caption{
    min-height:58px;
    padding:12px 16px;
    border-top:1px solid var(--border);
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:4px 14px;
}

.global-image-caption strong{
    color:var(--text);
    font-weight:950;
}

.global-image-caption span,
.global-image-caption p{
    color:var(--text-muted);
    font-size:12px;
    font-weight:800;
}

.global-image-caption span{
    text-align:right;
}

.global-image-caption p{
    grid-column:1 / -1;
    margin:0;
    white-space:pre-line;
    line-height:1.45;
}

@media (max-width:640px){
    .global-viewer-overlay{
        padding:10px;
        align-items:end;
    }

    .global-viewer-shell{
        max-height:calc(100dvh - 20px);
        border-radius:18px 18px 0 0;
    }

    .global-viewer-head{
        padding:12px;
    }

    .global-viewer-head strong{
        font-size:16px;
    }

    .global-viewer-actions a{
        padding:0 10px;
    }

    .global-viewer-pdf{
        height:calc(100dvh - 20px);
    }

    .global-image-stage img{
        max-height:calc(100dvh - 210px);
    }

    .global-image-nav{
        width:40px;
        height:50px;
    }
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.12);
}

.search-box:focus-within .search-icon {
    color: var(--primary);
}

.search-icon {
    color: var(--text-muted);
    transition:var(--transition);
}


.search-box input{

    flex:1;

    min-width:0;

    border:none;

    outline:none;

    background:none;

    color:var(--text);

}

.search-box input::placeholder{

    color:var(--text-muted);

}

.search-shortcut{

    padding:4px 8px;

    border-radius:8px;

    background:rgba(var(--primary-rgb),.10);

    color:var(--text-muted);

    font-size:11px;

    font-weight:600;

}


/* ==========================================================
   PROFILE
========================================================== */

.profile-card{

    height:50px;

    padding:0 14px;

    background:var(--surface);

    border:1px solid var(--border);

    border-radius:15px;

    display:flex;

    align-items:center;

    gap:12px;

    cursor:pointer;

    transition:var(--transition);

}

.profile-card:hover,
.profile-dropdown.open .profile-card{

    background:var(--surface-hover);

    border-color:var(--primary);

    box-shadow:0 0 0 3px rgba(var(--primary-rgb),.12);

}

.profile-avatar{

    width:38px;

    height:38px;

    border-radius:50%;

    object-fit:cover;

}

.profile-avatar-fallback{

    flex-shrink:0;

    display:flex;

    align-items:center;

    justify-content:center;

    border-radius:50%;

    background:linear-gradient(135deg,var(--primary),var(--primary-hover));

    color:#fff;

    font-size:13px;

    font-weight:700;

    box-shadow:var(--shadow-primary);

}

.profile-details{

    display:flex;

    flex-direction:column;

}

.profile-name{

    font-size:14px;
    color: var(--text);
    font-weight:600;

}

.profile-role{

    font-size:12px;

    color:var(--text-muted);

}

.profile-chevron{

    margin-left:4px;

    color:var(--text-muted);

    transition:transform .2s ease;

}

.profile-dropdown.open .profile-chevron{

    transform:rotate(180deg);

}


/* ==========================================================
   SIDEBAR
========================================================== */

.sidebar{

    position:relative;
    background:var(--sidebar);

    border-right:1px solid var(--border);

    padding:18px 14px;

}

.sidebar-edge-toggle{
    position:fixed;
    top:50%;
    left:calc(250px - 18px);
    z-index:120;
    width:36px;
    height:36px;
    border:1px solid var(--border);
    border-radius:999px;
    background:var(--surface);
    color:var(--text-muted);
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    box-shadow:0 8px 20px rgba(0,0,0,.18);
    transform:translateY(-50%);
    transition:var(--transition);
}

.sidebar .sidebar-edge-toggle{
    display:flex;
}

.sidebar-edge-toggle:hover{
    border-color:rgba(var(--primary-rgb),.45);
    background:var(--surface-hover);
    color:var(--primary);
}

.sidebar-edge-toggle i{
    font-size:13px;
    transition:transform .25s ease;
}

html.sidebar-collapsed .sidebar-edge-toggle i,
.sidebar-collapsed .sidebar-edge-toggle i{
    transform:rotate(180deg);
}

html.sidebar-collapsed .sidebar-edge-toggle,
.sidebar-collapsed .sidebar-edge-toggle{
    left:calc(76px - 18px);
}

@media (max-width:900px){
    .sidebar-edge-toggle{
        display:none;
    }
}

.sidebar-nav{

    display:flex;

    flex-direction:column;

    gap:6px;

    flex:1;
    position:relative;

}

.nav-section{

    display:flex;
    flex-direction:column;
    gap:6px;
    position:relative;
    width:100%;

}

.nav-section + .nav-section{

    margin-top:2px;
    padding-top:8px;

}

.nav-section + .nav-section::before{

    content:"";
    position:absolute;
    top:0;
    left:14px;
    right:14px;
    height:1px;
    background:linear-gradient(90deg, transparent, rgba(var(--primary-rgb),.22), transparent);
    opacity:.65;

}

.nav-section-label{

    display:none;

}

.nav-active-indicator{

    position:absolute;
    left:0;
    top:0;
    z-index:0;
    width:var(--nav-active-width, 0);
    height:var(--nav-active-height, 48px);
    border-radius:14px;
    background:var(--primary);
    opacity:1;
    transform:translate3d(var(--nav-active-left, 0), var(--nav-active-top, 0), 0);
    transition:
        transform .28s cubic-bezier(.22,1,.36,1),
        width .28s cubic-bezier(.22,1,.36,1),
        height .28s cubic-bezier(.22,1,.36,1),
        opacity .2s ease;

}

html.sidebar-indicator-tracking .nav-active-indicator{

    transition:none;

}

@media (max-width:900px){

    .topbar{

        height:auto;

        min-height:68px;

        gap:12px;

        padding:10px 18px;

    }

    .topbar-left{

        flex:1;

        gap:12px;

    }

    .topbar-right{

        gap:8px;

    }

    .brand{

        margin-right:0;

    }

    .brand-title{

        font-size:21px;

    }

    .brand-badge{

        display:none;

    }

    .menu-button{

        margin-left:0;

    }

    .search-box{

        flex:1;

        width:auto;

        min-width:160px;

        height:44px;

        border-radius:13px;

    }

    .search-shortcut{

        display:none;

    }

    .icon-button{

        width:42px;

        height:42px;

        border-radius:13px;

    }

    .profile-card{

        width:42px;

        height:42px;

        padding:0;

        justify-content:center;

        border-radius:13px;

    }

    .profile-avatar{

        width:32px;

        height:32px;

    }

    .profile-details,
    .profile-chevron{

        display:none;

    }

    .profile-menu,
    .notification-menu{

        position:fixed;

        top:62px;

        right:18px;

        max-width:calc(100vw - 36px);

    }

    .sidebar{

        padding:8px 12px calc(8px + env(safe-area-inset-bottom, 0px));

        border-right:none;

        border-top:1px solid var(--border);

    }

    .sidebar-nav{

        flex-direction:row;

        gap:8px;

        width:max-content;

        min-width:100%;

    }

    .nav-item{

        height:48px;

        flex:0 0 auto;

        padding:0 14px;

        border-radius:14px;

    }

    .nav-item span{

        display:block;

        max-width:112px;

        overflow:hidden;

        text-overflow:ellipsis;

    }

    .sidebar-footer{

        display:none;

    }

    .sidebar-collapsed .nav-item{

        justify-content:flex-start;

        padding:0 14px;

    }

    .sidebar-collapsed .nav-item span{

        display:block;

    }

}

@media (max-width:640px){

    .topbar{

        flex-wrap:wrap;

        padding:10px 12px;

    }

    .topbar-left,
    .topbar-right{

        width:100%;

    }

    .topbar-left{

        display:grid;

        grid-template-columns:auto auto minmax(0,1fr);

    }

    .topbar-right{

        justify-content:flex-end;

    }

    .search-box{

        min-width:0;

    }

    .search-box input::placeholder{

        color:transparent;

    }

    .topbar-right .icon-button:nth-child(2),
    .topbar-right .icon-button:nth-child(3){

        display:none;

    }

    .profile-menu{

        top:116px;

        right:12px;

    }

}

@media (max-width:420px){

    .brand-logo{
        width:36px;
        height:36px;
        flex-basis:36px;
        transform:translateY(-12px);
    }

    .brand-logo-img{
        width:62px;
        height:62px;
    }

    .brand-title{

        display:none;

    }

    .brand-badge{
        display:none;
    }

    .topbar-left{

        gap:8px;

        grid-template-columns:auto auto minmax(0,1fr);

    }

    .search-box{

        padding:0 12px;

    }

    .nav-item{

        padding:0 12px;

    }

    .nav-item span{

        max-width:86px;

    }

}

@media (max-width:640px){

    .profile-menu,
    .notification-menu,
    .theme-menu{

        position:fixed;
        top:calc(var(--topbar-height) + 9px);
        right:12px;
        max-width:calc(100vw - 24px);

    }

    .profile-menu{

        width:min(240px, calc(100vw - 24px));

    }

    .notification-menu{

        width:min(370px, calc(100vw - 24px));

    }

    .theme-menu{

        width:min(286px, calc(100vw - 24px));

    }

}

@media (max-width:760px){
    .jobs-search,
    .services-search,
    .sms-search,
    .invoices-search{
        width:100% !important;
        height:52px !important;
        min-height:52px !important;
        padding:0 18px !important;
        align-items:center !important;
        flex-shrink:0;
    }

    .jobs-search input,
    .services-search input,
    .sms-search input,
    .invoices-search input{
        height:100% !important;
        min-height:48px !important;
        line-height:normal;
        font-size:16px;
        -webkit-appearance:none;
        appearance:none;
    }
}

.topbar .topbar-right .topbar-action,
.topbar .topbar-right .topbar-action:hover,
.topbar .topbar-right .topbar-action:active,
.topbar .topbar-right .topbar-action:focus,
.topbar .topbar-right .topbar-action.active,
.topbar .topbar-right .theme-dropdown.open .topbar-action,
:root[data-theme="light"] .topbar .topbar-right .topbar-action,
:root[data-theme="light"] .topbar .topbar-right .topbar-action:hover,
:root[data-theme="light"] .topbar .topbar-right .topbar-action:active,
:root[data-theme="light"] .topbar .topbar-right .topbar-action:focus,
:root[data-theme="light"] .topbar .topbar-right .topbar-action.active,
:root[data-theme="light"] .topbar .topbar-right .theme-dropdown.open .topbar-action{
    border-color:transparent;
    background:transparent;
    box-shadow:none;
}

.topbar .topbar-right .topbar-action:hover,
.topbar .topbar-right .topbar-action:active,
.topbar .topbar-right .topbar-action:focus,
.topbar .topbar-right .topbar-action.active,
.topbar .topbar-right .theme-dropdown.open .topbar-action,
:root[data-theme="light"] .topbar .topbar-right .topbar-action:hover,
:root[data-theme="light"] .topbar .topbar-right .topbar-action:active,
:root[data-theme="light"] .topbar .topbar-right .topbar-action:focus,
:root[data-theme="light"] .topbar .topbar-right .topbar-action.active,
:root[data-theme="light"] .topbar .topbar-right .theme-dropdown.open .topbar-action{
    color:var(--primary);
}

.finance-private-enabled [data-finance-private]{
    filter:blur(7px);
    user-select:none;
    transition:filter .18s ease, opacity .18s ease;
}

.nav-item{

    height:48px;

    display:flex;

    align-items:center;

    gap:14px;

    padding:0 16px;

    border-radius:14px;

    color:var(--text-muted);

    overflow:hidden;
    position:relative;
    z-index:0;

    transition:
        color .22s ease,
        background-color .22s ease,
        box-shadow .22s ease,
        transform .22s ease;

}

.nav-item::before{

    content:"";
    position:absolute;
    inset:0;
    z-index:0;
    border-radius:14px;
    background:var(--primary);
    opacity:0;
    transform:scale(.94);
    transition:
        opacity .24s ease,
        transform .24s cubic-bezier(.22,1,.36,1);

}

.nav-item i,
.nav-item span{

    position:relative;
    z-index:1;

}

.nav-item:hover{

    background:var(--surface-hover);

}

.nav-item.active{

    background:transparent;

    color:#fff;

}

.nav-item.active::before{

    opacity:0;

}

.nav-item i{

    width:20px;

    text-align:center;

    font-size:17px;

    flex-shrink:0;

}

.nav-item span{

    white-space:nowrap;

}


/* ==========================================================
   COMPANY
========================================================== */

.sidebar-footer{

    padding-top:18px;

}

.company-card{

    background:var(--surface);

    border:1px solid var(--border);

    border-radius:18px;

    padding:16px;

    display:flex;

    align-items:center;

    gap:14px;

    transition:all .25s ease;

}

.company-status{

    width:42px;

    height:42px;

    border-radius:12px;

    background:rgba(var(--primary-rgb),.15);

    color:var(--primary);

    display:flex;

    align-items:center;

    justify-content:center;

}

.company-status img{

    width:100%;

    height:100%;

    border-radius:inherit;

    object-fit:cover;

    display:block;

}

.company-info{

    flex:1;

}

.company-name{

    font-weight:600;

}

.company-role{

    font-size:12px;

    color:var(--text-muted);

}

.company-arrow{

    color:var(--text-muted);

}


/* ==========================================================
   SIDEBAR COLLAPSE
========================================================== */

.sidebar-collapsed .nav-item,
html.sidebar-collapsed .nav-item{

    justify-content:center;

    padding:0;

}

.sidebar-collapsed .nav-section,
html.sidebar-collapsed .nav-section{

    align-items:stretch;

}

.sidebar-collapsed .nav-section + .nav-section,
html.sidebar-collapsed .nav-section + .nav-section{

    margin-top:2px;
    padding-top:8px;

}

.sidebar-collapsed .nav-section + .nav-section::before,
html.sidebar-collapsed .nav-section + .nav-section::before{

    display:block;
    left:10px;
    right:10px;
    background:linear-gradient(90deg, transparent, rgba(var(--primary-rgb),.32), transparent);
    opacity:.7;

}

.sidebar-collapsed .nav-section-label,
html.sidebar-collapsed .nav-section-label{

    display:none;

}

.sidebar-collapsed .nav-item span,
html.sidebar-collapsed .nav-item span{

    display:none;

}

.sidebar-collapsed .nav-item i,
html.sidebar-collapsed .nav-item i{

    margin:0;

    font-size:20px;

}

.sidebar-collapsed .sidebar-footer,
html.sidebar-collapsed .sidebar-footer{

    padding:0;

    display:flex;

    justify-content:center;

}

.sidebar-collapsed .company-card,
html.sidebar-collapsed .company-card{

    width:52px;

    height:52px;

    padding:0;

    justify-content:center;

}

.sidebar-collapsed .company-status,
html.sidebar-collapsed .company-status{

    width:32px;

    height:32px;

    flex:0 0 32px;

}

.sidebar-collapsed .company-info,
.sidebar-collapsed .company-arrow,
html.sidebar-collapsed .company-info,
html.sidebar-collapsed .company-arrow{

    display:none;

}


/* ==========================================================
   PROFILE DROPDOWN
========================================================== */

.profile-dropdown{

    position:relative;

}

.profile-menu{

    position:absolute;

    top:calc(100% + 12px);

    right:0;

    width:240px;

    background:var(--surface);

    border:1px solid var(--border);

    border-radius:18px;

    padding:10px;

    box-shadow:var(--shadow);

    opacity:0;

    visibility:hidden;

    pointer-events:none;

    transform:translateY(-8px) scale(.98);

    transform-origin:top right;

    transition:
        opacity .2s ease,
        transform .2s ease,
        visibility .2s ease;

    z-index:1000;

}

.profile-dropdown.open .profile-menu{

    opacity:1;

    visibility:visible;

    pointer-events:auto;

    transform:translateY(0) scale(1);

}

.profile-menu a{

    display:flex;

    align-items:center;

    gap:12px;

    height:46px;

    padding:0 14px;

    border-radius:12px;

    color:var(--text);

    transition:var(--transition);

}

.profile-menu a:hover{

    background:var(--surface-hover);

}

.profile-menu a.logout{

    color:#ef4444;

}

.profile-menu hr{

    border:none;

    border-top:1px solid var(--border);

    margin:8px 0;

}

/* ==========================================================
   THEME DROPDOWN
========================================================== */

.theme-dropdown{

    position:relative;

}

.theme-dropdown.open .icon-button{

    background:var(--surface-hover);
    border-color:var(--primary);
    box-shadow:0 0 0 3px rgba(var(--primary-rgb),.12);

}

.theme-dropdown.open .topbar-action{
    background:transparent;
    border-color:transparent;
    box-shadow:none;
    color:var(--primary);
}

:root[data-theme="light"] .theme-dropdown.open .topbar-action,
:root[data-theme="light"] .topbar-action:hover,
:root[data-theme="light"] .topbar-action:active,
:root[data-theme="light"] .topbar-action:focus{
    background:transparent;
    border-color:transparent;
    box-shadow:none;
    color:var(--primary);
}

.theme-menu{

    position:absolute;
    top:calc(100% + 12px);
    right:0;
    width:286px;
    padding:12px;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:18px;
    box-shadow:var(--shadow);
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transform:translateY(-8px) scale(.98);
    transform-origin:top right;
    transition:opacity .2s ease, transform .2s ease, visibility .2s ease;
    z-index:1000;

}

.theme-dropdown.open .theme-menu{

    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transform:translateY(0) scale(1);

}

.theme-menu-header{

    display:flex;
    flex-direction:column;
    gap:3px;
    padding:4px 4px 12px;

}

.theme-menu-header strong{

    font-size:14px;
    font-weight:800;
    color:var(--text);

}

.theme-menu-header span,
.theme-menu-label{

    font-size:12px;
    font-weight:700;
    color:var(--text-muted);

}

.theme-mode-toggle{

    display:grid;
    grid-template-columns:1fr 1fr;
    gap:6px;
    padding:4px;
    background:rgba(var(--primary-rgb),.08);
    border:1px solid var(--border);
    border-radius:14px;

}

.theme-mode-toggle button,
.theme-color-grid button{

    border:1px solid transparent;
    background:transparent;
    color:var(--text-muted);
    cursor:pointer;
    transition:var(--transition);

}

.theme-mode-toggle button{

    height:38px;
    border-radius:11px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    font-weight:800;

}

.theme-mode-toggle button:hover,
.theme-mode-toggle button.active{

    background:var(--surface);
    color:var(--text);
    border-color:var(--border);
    box-shadow:var(--shadow-sm);

}

.theme-menu-label{

    display:block;
    padding:14px 4px 8px;

}

.theme-color-grid{

    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;

}

.theme-color-grid button{

    height:42px;
    border-radius:12px;
    padding:0 10px;
    display:flex;
    align-items:center;
    gap:9px;
    font-weight:800;
    background:rgba(255,255,255,.035);
    border-color:var(--border);

}

:root[data-theme="light"] .theme-color-grid button{

    background:rgba(15,23,42,.025);

}

.theme-color-grid button:hover,
.theme-color-grid button.active{

    color:var(--text);
    border-color:rgba(var(--primary-rgb),.35);
    background:rgba(var(--primary-rgb),.10);

}

.theme-color-grid button span{

    width:15px;
    height:15px;
    border-radius:50%;
    background:var(--swatch);
    box-shadow:0 0 0 3px rgba(255,255,255,.08);
    flex-shrink:0;

}

/* ==========================================================
   VIEW SWITCH
========================================================== */

.view-switch{

    display:flex;

    align-items:center;

    gap:5px;

    height:52px;

    padding:4px;

    background:var(--surface);

    border:1px solid var(--border);

    border-radius:16px;

    flex-shrink:0;

}

.view-switch button{

    all:unset;

    width:41px;

    height:41px;

    border-radius:12px;

    display:flex;

    align-items:center;

    justify-content:center;

    cursor:pointer;

    color:var(--text-muted);

    transition:var(--transition);

}

.view-switch button:hover{

    background:var(--soft-hover);

    color:var(--text);

}

.view-switch button.active{

    background:var(--primary);

    color:#fff;

}

.view-switch i{

    font-size:16px;

}

/* ==========================================================
   MODAL
========================================================== */

.modal-overlay{

    position:fixed;

    inset:0;

    display:none;

    align-items:center;

    justify-content:center;

    padding:40px;

    background:rgba(8,12,20,.72);

    backdrop-filter:blur(8px);

    z-index:5000;

}

.modal-overlay.open{

    display:flex;

}

.modal-window{

    width:100%;

    max-width:720px;

    background:var(--surface);

    border:1px solid var(--border);

    border-radius:22px;

    box-shadow:0 30px 80px rgba(0,0,0,.45);

    overflow:hidden;

}

.modal-header{

    height:72px;

    padding:0 24px;

    display:flex;

    align-items:center;

    justify-content:space-between;

    border-bottom:1px solid var(--border);

}

.modal-header h2{

    font-size:22px;

    font-weight:700;

}

.modal-body{

    padding:28px;

}

.modal-close{

    all:unset;

    width:42px;

    height:42px;

    border-radius:12px;

    display:flex;

    align-items:center;

    justify-content:center;

    cursor:pointer;

    color:var(--text-muted);

    transition:var(--transition);

}

.modal-close:hover{

    background:var(--soft-hover);

    color:var(--text);

}

/* ==========================================================
   FORM
========================================================== */

.form-grid{

    display:grid;

    grid-template-columns:repeat(2,1fr);

    gap:22px;

}

.form-group{

    display:flex;

    flex-direction:column;

    gap:8px;

}

.form-group label{

    font-size:14px;

    font-weight:600;

    color:var(--text);

}

.required{

    color:#ef4444;

}

.form-group input,
.form-group select,
.form-group textarea{

    width:100%;

    height:52px;

    padding:0 16px;

    border:1px solid var(--border);

    border-radius:14px;

    background:var(--bg);

    color:var(--text);

    transition:
        border-color .18s ease,
        box-shadow .18s ease;

    box-sizing:border-box;

}


.form-group textarea{

    min-height:120px;

    padding:14px 16px;

    resize:vertical;

}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus{

    outline:none;

    border-color:var(--primary);

    box-shadow:0 0 0 2px rgba(var(--primary-rgb),.15);

}

.form-actions{

    display:flex;

    justify-content:flex-end;

    gap:12px;

    margin-top:30px;

}

.btn-secondary{

    height:52px;

    padding:0 22px;

    border:1px solid var(--border);

    border-radius:16px;

    background:transparent;

    color:var(--text);

    cursor:pointer;

    transition:var(--transition);

}

.btn-secondary:hover{

    background:var(--soft-hover);

}

.btn-primary{

    height:52px;

    padding:0 22px;

    border:0;

    border-radius:16px;

    background:var(--primary);

    color:#fff;

    font-weight:700;

    cursor:pointer;

    display:inline-flex;

    align-items:center;

    justify-content:center;

    gap:10px;

    white-space:nowrap;

    transition:var(--transition);

}

.btn-primary:hover{

    transform:translateY(-2px);

    filter:brightness(1.08);

    box-shadow:var(--shadow-primary-hover);

}

/* ==========================================================
   VEHICLE FORM MODAL
========================================================== */

.vehicle-modal-window{

    max-width:980px;
    overflow:visible;

}

#vehicleModal{

    overflow:visible;

}

.vehicle-modal-window .modal-body{

    overflow:visible;

}

.vehicle-form{

    display:grid;
    gap:20px;

}

.vehicle-lookup-panel{

    display:grid;
    gap:10px;
    padding:14px;
    border:1px solid var(--border);
    border-radius:18px;
    background:linear-gradient(135deg, rgba(var(--primary-rgb), .12), transparent 70%);

}

.vehicle-lookup-input,
.vehicle-form .form-input-icon{

    min-height:52px;
    display:flex;
    align-items:center;
    gap:12px;
    padding:0 14px;
    border:1px solid var(--border);
    border-radius:14px;
    background:var(--bg);
    transition:
        border-color .18s ease,
        box-shadow .18s ease;

}

.vehicle-lookup-input:focus-within,
.vehicle-form .form-input-icon:focus-within{

    border-color:var(--primary);
    box-shadow:0 0 0 2px rgba(var(--primary-rgb), .15);

}

.vehicle-lookup-input > i,
.vehicle-form .form-input-icon > i{

    color:var(--primary);
    flex:0 0 auto;

}

.vehicle-lookup-input input,
.vehicle-form .form-input-icon input{

    height:auto;
    min-width:0;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;

}

.vehicle-lookup-input input:focus,
.vehicle-form .form-input-icon input:focus{

    box-shadow:none;

}

.vehicle-lookup-button{

    height:38px;
    flex:0 0 auto;
    padding:0 13px;
    border:1px solid rgba(var(--primary-rgb), .28);
    border-radius:12px;
    background:rgba(var(--primary-rgb), .13);
    color:var(--primary);
    display:inline-flex;
    align-items:center;
    gap:8px;
    font-weight:700;
    cursor:pointer;
    transition:var(--transition);

}

.vehicle-lookup-button:hover{

    background:rgba(var(--primary-rgb), .2);
    border-color:rgba(var(--primary-rgb), .46);

}

.vehicle-lookup-status{

    min-height:30px;
    display:flex;
    align-items:center;
    gap:9px;
    color:var(--text-muted);
    font-size:13px;

}

.vehicle-lookup-status i{

    color:var(--primary);

}

.vehicle-lookup-status[data-state="loading"] i{

    animation:spin .85s linear infinite;

}

.vehicle-lookup-status[data-state="success"]{

    color:#22c55e;

}

.vehicle-lookup-status[data-state="error"]{

    color:#f87171;

}

.vehicle-form-grid{

    grid-template-columns:repeat(12, minmax(0, 1fr));
    gap:16px;

}

.vehicle-form-grid > .form-group{

    min-width:0;

}

.vehicle-form-customer{

    grid-column:span 8;

}

.vehicle-form-type{

    grid-column:span 4;

}

.vehicle-form-brand{

    grid-column:span 4;

}

.vehicle-form-model{

    grid-column:span 5;

}

.vehicle-form-year{

    grid-column:span 3;

}

.vehicle-form-trim{

    grid-column:span 5;

}

.vehicle-form-engine-code{

    grid-column:span 3;

}

.vehicle-form-mileage{

    grid-column:span 4;

}

.vehicle-form-vin{

    grid-column:span 5;

}

.vehicle-form-engine-type{

    grid-column:span 7;

}

.vehicle-select{

    position:relative;
    height:42px;
    min-width:0;

}

.vehicle-select-trigger{

    width:100%;
    min-width:0;
    height:42px;
    display:flex;
    align-items:center;
    gap:10px;
    padding:0 12px;
    border:1px solid var(--border);
    border-radius:12px;
    background:var(--soft-hover);
    color:var(--text);
    font:inherit;
    text-align:left;
    cursor:pointer;
    transition:var(--transition);

}

.vehicle-select-trigger span{

    flex:1;
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;

}

.vehicle-select-leading{

    color:var(--primary);

}

.vehicle-select-chevron{

    flex:0 0 auto;
    order:2;
    color:var(--text-muted);
    font-size:14px;
    transition:transform .2s ease, color .2s ease;

}

.vehicle-select-trigger:hover,
.vehicle-select.open .vehicle-select-trigger{

    border-color:var(--primary);
    box-shadow:0 0 0 2px rgba(var(--primary-rgb), .15);

}

.vehicle-select.open .vehicle-select-trigger i{

    color:var(--primary);

}

.vehicle-select.open .vehicle-select-chevron{

    color:var(--primary);
    transform:rotate(180deg);

}

.vehicle-select-menu{

    position:absolute;
    top:calc(100% + 10px);
    left:0;
    right:0;
    z-index:2400;
    display:grid;
    gap:4px;
    max-height:260px;
    padding:10px;
    border:1px solid var(--border);
    border-radius:16px;
    background:var(--surface);
    box-shadow:var(--shadow);
    opacity:0;
    visibility:hidden;
    transform:translateY(-6px);
    overflow:auto;
    scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);
    scrollbar-gutter:stable;
    scrollbar-width:thin;
    transition:all .2s ease;

}

.vehicle-select.open .vehicle-select-menu{

    opacity:1;
    visibility:visible;
    transform:translateY(0);

}

.vehicle-select-search{

    height:40px;
    margin-bottom:8px;
    padding:0 10px;
    border:1px solid var(--border);
    border-radius:12px;
    background:var(--soft-hover);
    display:flex;
    flex-direction:row;
    align-items:center;
    gap:9px;
    color:var(--text-muted);
    font-weight:400;

}

.vehicle-select-search i{

    color:var(--text-muted);

}

.vehicle-select-search input{

    flex:1;
    width:auto;
    min-width:0;
    height:auto;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none !important;
    color:var(--text);
    outline:0;

}

.vehicle-select-results{

    display:grid;
    gap:4px;

}

.vehicle-select-menu button{

    width:100%;
    min-height:42px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:12px;
    padding:0 14px;
    border:0;
    border-radius:12px;
    background:transparent;
    color:var(--text);
    font:inherit;
    text-align:left;
    cursor:pointer;
    transition:var(--transition);

}

.vehicle-search-select .vehicle-select-menu button{

    height:auto;
    min-height:46px;
    flex-direction:column;
    align-items:flex-start;
    justify-content:center;
    gap:3px;
    padding:8px 10px;

}

.vehicle-select-menu button small{

    flex:0 0 auto;
    color:var(--text-muted);
    font-size:12px;
    font-weight:700;

}

.vehicle-select-menu button:hover,
.vehicle-select-menu button.active{

    background:var(--soft-hover);

}

.vehicle-select-menu button.active{

    color:var(--primary);

}

.vehicle-select-menu button.active small{

    color:var(--primary);

}

.vehicle-form select{

    appearance:none;
    -webkit-appearance:none;
    padding-right:42px;
    background-color:var(--bg);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 22px) 50%,
        calc(100% - 16px) 50%;
    background-size:6px 6px, 6px 6px;
    background-repeat:no-repeat;
    cursor:pointer;

}

.vehicle-form select:hover,
.vehicle-locked-customer:hover{

    border-color:rgba(var(--primary-rgb), .36);

}

.vehicle-form select:focus{

    background-image:
        linear-gradient(135deg, transparent 50%, var(--primary) 50%),
        linear-gradient(45deg, var(--primary) 50%, transparent 50%);

}

.vehicle-locked-customer{

    min-height:52px;
    display:flex;
    align-items:center;
    gap:12px;
    padding:0 14px;
    border:1px solid var(--border);
    border-radius:14px;
    background:var(--bg);
    color:var(--text);

}

.vehicle-locked-customer i{

    color:var(--primary);

}

@keyframes spin{

    to{ transform:rotate(360deg); }

}

@media (max-width:700px){

    .form-grid{

        grid-template-columns:1fr;

    }

}

@media (max-width:760px){

    #vehicleModal{

        align-items:flex-end;
        overflow:hidden;

    }

    .vehicle-modal-window{

        max-width:calc(100vw - 16px);
        overflow:hidden;

    }

    .vehicle-modal-window .modal-body{

        padding:16px;
        overflow-y:auto;
        overflow-x:hidden;

    }

    .vehicle-form-grid{

        grid-template-columns:1fr;

    }

    .vehicle-form-wide{

        grid-column:auto;

    }

    .vehicle-form-customer,
    .vehicle-form-type,
    .vehicle-form-brand,
    .vehicle-form-model,
    .vehicle-form-trim,
    .vehicle-form-year,
    .vehicle-form-mileage,
    .vehicle-form-vin,
    .vehicle-form-engine-code,
    .vehicle-form-engine-type{

        grid-column:auto;

    }

    .vehicle-lookup-input{

        align-items:stretch;
        flex-wrap:wrap;
        padding:12px;

    }

    .vehicle-lookup-input input{

        min-height:34px;
        flex:1 1 160px;

    }

    .vehicle-lookup-button{

        flex:1 1 100%;
        justify-content:center;

    }

    #vehicleModal .form-actions{

        position:sticky;
        bottom:-16px;
        z-index:40;
        display:grid;
        grid-template-columns:1fr 1.25fr;
        gap:10px;
        margin:18px -16px -16px;
        padding:18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
        background:var(--surface);
        border-top:1px solid var(--border);
        box-shadow:0 -24px 0 var(--surface);

    }

    #vehicleModal .form-actions button{

        width:100%;
        justify-content:center;

    }

}

@media (max-width:700px){
    html.modal-open,
    html.modal-open body,
    html.modal-open .app,
    html.modal-open .app-body,
    html.modal-open .app-content{
        max-width:100%;
        overflow:hidden;
    }

    html.modal-open .page-content{
        transform:none !important;
    }

    .modal-overlay,
    #customerModal,
    #vehicleModal{
        width:100%;
        height:100dvh;
        min-height:100dvh;
        align-items:flex-end !important;
        justify-content:center;
        padding:10px 8px 0 !important;
        overflow:hidden !important;
    }

    .modal-window,
    .customer-modal-window,
    .vehicle-modal-window{
        width:100%;
        max-width:720px;
        max-height:calc(100dvh - 10px);
        border-radius:20px 20px 0 0;
        display:flex;
        flex-direction:column;
        overflow:hidden !important;
    }

    .modal-header{
        flex:0 0 62px;
        height:62px;
        padding:0 16px;
    }

    .modal-header h2{
        font-size:19px;
    }

    .modal-body,
    .customer-modal-window .modal-body,
    .vehicle-modal-window .modal-body{
        flex:1 1 auto;
        min-height:0;
        padding:16px;
        overflow-y:auto !important;
        overflow-x:hidden !important;
        overscroll-behavior:contain;
        scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);
        scrollbar-width:thin;
    }

    .modal-body::-webkit-scrollbar{
        width:10px;
    }

    .modal-body::-webkit-scrollbar-track{
        background:var(--scrollbar-track);
    }

    .modal-body::-webkit-scrollbar-thumb{
        background:var(--scrollbar-thumb);
        background-clip:content-box;
        border:3px solid transparent;
        border-radius:999px;
    }

    .modal-body .form-actions{
        position:sticky;
        bottom:-16px;
        z-index:40;
        display:grid;
        grid-template-columns:1fr 1.25fr;
        gap:10px;
        margin:18px -16px -16px;
        padding:18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
        background:var(--surface) !important;
        border-top:1px solid var(--border);
        box-shadow:0 -24px 0 var(--surface);
    }

    .modal-body .form-actions button{
        width:100%;
        justify-content:center;
    }

    .user-modal-overlay,
    .profile-modal-overlay,
    .customer-confirm-dialog,
    .vehicle-confirm-dialog,
    .global-viewer-overlay,
    .services-stock-modal,
    .vehicle-inspection-modal,
    .invoice-book-confirm,
    .invoice-email-dialog,
    .invoice-message-dialog,
    .invoice-pdf-viewer,
    .invoice-draft-viewer,
    .scheduler-job-dialog,
    .request-reply-modal{
        width:100% !important;
        height:100dvh !important;
        min-height:100dvh !important;
        padding:10px 8px 0 !important;
        align-items:flex-end !important;
        justify-content:center !important;
        overflow:hidden !important;
    }

    .user-modal,
    .profile-modal,
    .customer-confirm-card,
    .global-viewer-shell,
    .services-stock-dialog,
    .vehicle-inspection-modal-card,
    .invoice-book-card,
    .invoice-email-card,
    .invoice-message-card,
    .invoice-pdf-shell,
    .invoice-draft-shell,
    .scheduler-job-dialog-card,
    .request-reply-dialog{
        width:100% !important;
        max-width:720px !important;
        max-height:calc(100dvh - 10px) !important;
        border-radius:20px 20px 0 0 !important;
        display:flex !important;
        flex-direction:column !important;
        overflow:hidden !important;
    }

    .user-modal-header,
    .profile-modal-header,
    .customer-confirm-head,
    .global-viewer-head,
    .vehicle-inspection-modal-head,
    .invoice-book-head,
    .invoice-pdf-head,
    .scheduler-job-dialog-head,
    .request-reply-head{
        flex:0 0 62px !important;
        min-height:62px !important;
        align-items:center !important;
        padding:0 16px !important;
        border-bottom:1px solid var(--border) !important;
        background:var(--surface) !important;
    }

    .user-modal-body,
    .user-form,
    .profile-modal-body,
    .profile-picture-form,
    .customer-confirm-copy,
    .global-viewer-note-body,
    .services-stock-dialog form,
    .vehicle-inspection-modal-body,
    .invoice-email-card form,
    .invoice-draft-document,
    .scheduler-job-dialog-body{
        flex:1 1 auto !important;
        min-height:0 !important;
        overflow-y:auto !important;
        overflow-x:hidden !important;
        overscroll-behavior:contain !important;
        scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track) !important;
        scrollbar-width:thin !important;
    }

    .user-modal-actions,
    .profile-modal-actions,
    .customer-confirm-actions,
    .services-stock-actions,
    .invoice-book-actions,
    .scheduler-job-dialog-actions,
    .request-reply-actions{
        flex:0 0 auto !important;
        display:grid !important;
        grid-template-columns:1fr 1.25fr !important;
        gap:10px !important;
        margin:0 !important;
        padding:18px 16px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
        border-top:1px solid var(--border) !important;
        background:var(--surface) !important;
        box-shadow:0 -24px 0 var(--surface) !important;
    }

    .user-modal-actions button,
    .profile-modal-actions button,
    .customer-confirm-actions button,
    .services-stock-actions button,
    .invoice-book-actions button,
    .scheduler-job-dialog-actions button,
    .request-reply-actions button{
        width:100% !important;
        justify-content:center !important;
    }
}

@media (max-width:900px){
    #customerModal.modal-overlay.open{
        width:100% !important;
        height:100dvh !important;
        min-height:100dvh !important;
        padding:10px 8px 0 !important;
        align-items:flex-end !important;
        justify-content:center !important;
        overflow:hidden !important;
    }

    #customerModal .customer-modal-window{
        width:100% !important;
        max-width:720px !important;
        max-height:calc(100dvh - 10px) !important;
        border-radius:20px 20px 0 0 !important;
        display:flex !important;
        flex-direction:column !important;
        overflow:hidden !important;
    }

    #customerModal .modal-header{
        flex:0 0 62px !important;
        min-height:62px !important;
        height:62px !important;
        padding:0 16px !important;
        border-bottom:1px solid var(--border) !important;
        background:var(--surface) !important;
    }

    #customerModal .modal-body{
        flex:1 1 auto !important;
        min-height:0 !important;
        padding:0 !important;
        display:flex !important;
        overflow:hidden !important;
    }

    #customerModal #customerForm{
        flex:1 1 auto !important;
        min-height:0 !important;
        display:flex !important;
        flex-direction:column !important;
    }

    #customerModal .customer-form-grid{
        flex:1 1 auto !important;
        min-height:0 !important;
        padding:16px !important;
        overflow-y:auto !important;
        overflow-x:hidden !important;
        overscroll-behavior:contain !important;
        scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track) !important;
        scrollbar-width:thin !important;
    }

    #customerModal .form-actions{
        flex:0 0 auto !important;
        position:static !important;
        display:grid !important;
        grid-template-columns:1fr 1.25fr !important;
        gap:10px !important;
        margin:0 !important;
        padding:18px 16px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
        border-top:1px solid var(--border) !important;
        background:var(--surface) !important;
        box-shadow:0 -24px 0 var(--surface) !important;
    }

    .scheduler-job-dialog.open .scheduler-invoice-dialog.scheduler-job-dialog-card{
        width:100% !important;
        max-width:720px !important;
        max-height:calc(100dvh - 10px) !important;
        padding:0 !important;
        border-radius:20px 20px 0 0 !important;
        display:flex !important;
        flex-direction:column !important;
        gap:0 !important;
        overflow:hidden !important;
    }

    .scheduler-invoice-dialog .scheduler-job-dialog-head{
        flex:0 0 62px !important;
        min-height:62px !important;
        margin:0 !important;
        padding:0 16px !important;
        align-items:center !important;
        border-bottom:1px solid var(--border) !important;
        background:var(--surface) !important;
    }

    .scheduler-invoice-dialog .scheduler-invoice-scroll{
        flex:1 1 auto !important;
        min-height:0 !important;
        display:grid !important;
        align-content:start !important;
        gap:12px !important;
        padding:16px !important;
        overflow-y:auto !important;
        overflow-x:hidden !important;
        overscroll-behavior:contain !important;
        scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track) !important;
        scrollbar-width:thin !important;
    }

    .scheduler-invoice-dialog .scheduler-job-dialog-actions{
        flex:0 0 auto !important;
        display:grid !important;
        grid-template-columns:1fr !important;
        margin:0 !important;
        padding:18px 16px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
        border-top:1px solid var(--border) !important;
        background:var(--surface) !important;
        box-shadow:0 -24px 0 var(--surface) !important;
    }
}

/* ==========================================================
   AVATAR
========================================================== */

.customer-avatar{

    width:42px;

    height:42px;

    flex-shrink:0;

    border-radius:14px;

    background:linear-gradient(135deg,var(--primary),var(--primary-hover));

    color:#fff;

    font-size:15px;

    font-weight:700;

    display:flex;

    align-items:center;

    justify-content:center;

    letter-spacing:.5px;

    box-shadow:var(--shadow-primary);

}

.customer-avatar-customer-page{

    width:62px;

    height:62px;

    flex-shrink:0;

    border-radius:14px;

    background:linear-gradient(135deg,var(--primary),var(--primary-hover));

    color:#fff;

    font-size:24px;

    font-weight:700;

    display:flex;

    align-items:center;

    justify-content:center;

    letter-spacing:.5px;

    box-shadow:var(--shadow-primary);

}

.btn-secondary-sm{

    height:40px;

    padding:0 16px;

    border:1px solid var(--border);

    border-radius:12px;

    background:transparent;

    color:var(--text);

    display:flex;

    align-items:center;

    gap:8px;

    cursor:pointer;

    transition:var(--transition);

}

.btn-secondary-sm:hover{

    background:var(--soft-hover);

}

/* ==========================================================
   SECTION HEADER
========================================================== */

.section-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    min-height:42px;

    margin-bottom:18px;

}

.section-header h2,
.section-header h3{

    margin:0;

    font-size:22px;

    font-weight:700;

}

/* ==========================================================
   INITIALS BADGE
========================================================== */

.initials-badge{

    width:34px;

    height:34px;

    border-radius:50%;

    display:inline-flex;

    align-items:center;

    justify-content:center;

    flex-shrink:0;

    background:linear-gradient(135deg,var(--primary),var(--primary-hover));

    box-shadow: var(--shadow-primary);

    color:#fff;

    font-size:13px;

    font-weight:700;

    user-select:none;

}

/* ==========================================================
   PANEL SCROLL
========================================================== */

.panel-scroll{

    flex:1;

    max-height:620px;

    overflow-y:auto;

    padding:2px 6px 2px 2px;
    scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);
    scrollbar-gutter:stable;
    scrollbar-width:thin;

}

.panel-scroll::-webkit-scrollbar{

    width:8px;

}

.panel-scroll::-webkit-scrollbar-track{

    background:var(--scrollbar-track);

}

.panel-scroll::-webkit-scrollbar-thumb{

    background:var(--scrollbar-thumb);

    border-radius:999px;

}

.panel-scroll::-webkit-scrollbar-thumb:hover{

    background:var(--scrollbar-thumb-hover);

}

@media (max-width:900px){

    .topbar{

        height:auto;

        min-height:68px;

        gap:12px;

        padding:10px 18px;

    }

    .topbar-left{

        flex:1;

        min-width:0;

        gap:12px;

    }

    .topbar-right{

        flex-shrink:0;

        gap:8px;

    }

    .brand{

        margin-right:0;

        flex-shrink:0;

    }

    .brand-title{

        font-size:21px;

    }

    .brand-badge,
    .search-shortcut{

        display:none;

    }

    .menu-button{

        margin-left:0;

    }

    .search-box{

        flex:1;

        width:auto;

        min-width:160px;

        height:44px;

        border-radius:13px;

    }

    .icon-button{

        width:42px;

        height:42px;

        border-radius:13px;

    }

    .profile-card{

        width:42px;

        height:42px;

        padding:0;

        justify-content:center;

        border-radius:13px;

    }

    .profile-avatar{

        width:32px;

        height:32px;

    }

    .profile-details,
    .profile-chevron{

        display:none;

    }

    .profile-menu{

        position:fixed;

        top:62px;

        right:18px;

        max-width:calc(100vw - 36px);

    }

    .sidebar{

        padding:8px 12px calc(8px + env(safe-area-inset-bottom, 0px));

        border-right:none;

        border-top:1px solid var(--border);

    }

    .sidebar-nav{

        flex-direction:row;

        gap:8px;

        width:max-content;

        min-width:100%;

    }

    .nav-section{

        flex-direction:row;
        gap:8px;
        align-items:center;
        width:auto;

    }

    .nav-section + .nav-section{

        margin-top:0;
        padding-top:0;

    }

    .nav-section + .nav-section::before,
    .nav-section-label{

        display:none;

    }

    .nav-item,
    .sidebar-collapsed .nav-item,
    html.sidebar-collapsed .nav-item{

        height:48px;
        min-height:48px;
        line-height:1;

        flex:0 0 auto;

        justify-content:flex-start;

        padding:0 14px;

        border-radius:14px;

    }

    .nav-item span,
    .sidebar-collapsed .nav-item span,
    html.sidebar-collapsed .nav-item span{

        display:block;
        line-height:1;

        max-width:112px;

        overflow:hidden;

        text-overflow:ellipsis;

    }

    .sidebar-footer{

        display:none;

    }

}

@media (max-width:640px){

    .topbar{

        flex-wrap:wrap;

        padding:10px 12px;

    }

    .topbar-left,
    .topbar-right{

        width:100%;

    }

    .topbar-left{

        display:grid;

        grid-template-columns:auto auto minmax(0,1fr);

    }

    .topbar-right{

        justify-content:flex-end;

    }

    .search-box{

        min-width:0;

    }

    .search-box input::placeholder{

        color:transparent;

    }

    .topbar-right .icon-button:nth-child(2),
    .topbar-right .icon-button:nth-child(3){

        display:none;

    }

    .profile-menu{

        top:116px;

        right:12px;

    }

}

@media (max-width:420px){

    .brand-title{

        font-size:18px;

    }

    .topbar-left{

        gap:8px;

        flex:0 1 auto;

    }

    .brand{

        min-width:0;

    }

    .brand-title{

        max-width:78px;

        overflow:hidden;

        text-overflow:ellipsis;

        white-space:nowrap;

    }

    .search-box{

        padding:0 12px;

    }

    .nav-item,
    .sidebar-collapsed .nav-item,
    html.sidebar-collapsed .nav-item{

        padding:0 12px;
        height:48px;
        min-height:48px;
        line-height:1;

    }

    .nav-item span,
    .sidebar-collapsed .nav-item span,
    html.sidebar-collapsed .nav-item span{

        max-width:86px;
        line-height:1;

    }

}

@media (max-width:900px){

    .brand-badge{

        display:inline-flex;

        align-items:center;

        height:22px;

        padding:0 7px;

        border-radius:7px;

        font-size:10px;

    }

    .menu-button{

        display:none;

    }

}

@media (max-width:420px){
    .topbar .brand-title,
    .topbar .brand-badge{
        display:none;
    }
}

@media (max-width:900px){
    .sidebar-edge-toggle,
    .sidebar .sidebar-edge-toggle{
        display:none !important;
    }
}

@media (max-width:640px){

    .topbar{

        flex-wrap:nowrap;

        min-height:62px;

    }

    .topbar-left,
    .topbar-right{

        width:auto;

    }

    .topbar-left{

        flex:1;

        display:flex;

        min-width:0;

    }

    .topbar-right{

        flex-shrink:0;

    }

    .search-box{

        width:42px;

        min-width:42px;

        flex:0 0 42px;

        padding:0;

        justify-content:center;

    }

    .search-box input{

        display:none;

    }

    .topbar.search-open .brand,
    .topbar.search-open .topbar-right{

        display:none;

    }

    .topbar.search-open .topbar-left{

        flex:1 1 100%;

        width:100%;

    }

    .topbar.search-open .search-box{

        width:100%;

        min-width:0;

        flex:1 1 auto;

        padding:0 16px;

        justify-content:flex-start;

    }

    .topbar.search-open .search-box input{

        display:block;

    }

    .topbar.search-open .search-box input::placeholder{

        color:var(--text-muted);

    }

}

@media (min-width:641px){
    .topbar{
        padding-left:5px;
    }

    .topbar .search-box{
        margin-left:43px;
    }

    html.sidebar-collapsed .topbar .search-box,
    .sidebar-collapsed .topbar .search-box{
        margin-left:-10px;
    }
}

@media (max-width:640px){
    .topbar:not(.search-open) .search-box{
        margin-left: 15px;
    }
}

@media (max-width:640px){

    .profile-menu,
    .notification-menu,
    .theme-menu{

        position:fixed;
        top:calc(var(--topbar-height) + 9px);
        right:12px;
        max-width:calc(100vw - 24px);

    }

    .profile-menu{

        width:min(240px, calc(100vw - 24px));

    }

    .notification-menu{

        width:min(370px, calc(100vw - 24px));

    }

    .theme-menu{

        width:min(286px, calc(100vw - 24px));

    }

}
