﻿/* =========================================================
   CLOUDSERVER — APPLICATION SHELL COMPONENTS
   UI-0E / UI-0F
   ========================================================= */

/* =========================================================
   SIDEBAR BRAND
   ========================================================= */

.sidebar-brand {
    display: flex;
    align-items: center;

    min-height: 40px;

    margin-bottom: var(--space-5);
    padding: 0 var(--space-3);
}

.brand-link {
    display: flex;
    align-items: center;

    gap: var(--space-3);

    min-width: 0;
    width: 100%;

    color: inherit;
}

.brand-mark {
    width: 30px;
    height: 30px;

    display: grid;
    place-items: center;

    flex: 0 0 30px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--surface);
    color: var(--primary);
}

.brand-mark svg {
    width: 18px;
    height: 18px;

    display: block;
}

.brand-name {
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--text);

    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);

    letter-spacing: -0.01em;
}

/* =========================================================
   SIDEBAR UPLOAD
   ========================================================= */

.sidebar-upload {
    width: 100%;

    margin-bottom: var(--space-4);
}

.sidebar-upload-button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 42px;

    padding: 0 var(--space-4);

    border: 1px solid var(--primary);
    border-radius: var(--radius);

    background: var(--primary);
    color: #ffffff;

    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);

    transition:
        background var(--transition-fast),
        border-color var(--transition-fast);
}

.sidebar-upload-button:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.sidebar-upload-button .icon {
    margin-right: var(--space-2);
}

/* =========================================================
   SIDEBAR SECTIONS
   ========================================================= */

.sidebar-section {
    margin-top: var(--space-5);
}

.sidebar-section:first-of-type {
    margin-top: 0;
}

.sidebar-section-label {
    padding: 0 var(--space-3);
    margin-bottom: var(--space-2);

    color: var(--text-muted);

    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);

    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =========================================================
   SIDEBAR NAVIGATION
   ========================================================= */

.sidebar-nav {
    display: flex;
    flex-direction: column;

    gap: 2px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;

    width: 100%;
    min-height: 40px;

    padding: 0 var(--space-3);

    border: 0;
    border-radius: var(--radius);

    background: transparent;
    color: var(--text-secondary);

    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);

    text-align: left;

    transition:
        background var(--transition-fast),
        color var(--transition-fast);
}

.sidebar-nav-item:hover {
    background: var(--hover);
    color: var(--text);
}

.sidebar-nav-item.is-active {
    background: var(--selected);
    color: var(--primary);
}

.sidebar-nav-item.is-active:hover {
    background: var(--selected);
}

.sidebar-nav-item .icon {
    width: 20px;
    height: 20px;

    min-width: 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 20px;

    margin-right: var(--space-3);
}

.sidebar-nav-item .icon svg {
    width: 18px;
    height: 18px;

    display: block;
}

/* =========================================================
   SIDEBAR FOOTER
   ========================================================= */

.sidebar-footer {
    margin-top: auto;

    padding-top: var(--space-5);
}

.sidebar-footer-item {
    display: flex;
    align-items: center;

    width: 100%;
    min-height: 40px;

    padding: 0 var(--space-3);

    border: 0;
    border-radius: var(--radius);

    background: transparent;
    color: var(--text-secondary);

    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);

    text-align: left;

    transition:
        background var(--transition-fast),
        color var(--transition-fast);
}

.sidebar-footer-item:hover {
    background: var(--hover);
    color: var(--text);
}

.sidebar-footer-item .icon {
    width: 20px;
    height: 20px;

    min-width: 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 20px;

    margin-right: var(--space-3);
}

.sidebar-footer-item .icon svg {
    width: 18px;
    height: 18px;

    display: block;
}

/* =========================================================
   SIDEBAR USER
   ========================================================= */

.sidebar-user {
    display: flex;
    align-items: center;

    gap: var(--space-3);

    min-width: 0;

    margin-top: var(--space-3);
    padding: var(--space-3);

    border-radius: var(--radius);
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;

    min-width: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 32px;

    border: 1px solid var(--border);
    border-radius: 50%;

    background: var(--surface);
    color: var(--text-secondary);

    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

.sidebar-user-details {
    min-width: 0;
}

.sidebar-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--text);

    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.sidebar-user-role {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: var(--font-size-xs);
}

/* =========================================================
   TOPBAR
   ========================================================= */

.topbar .icon {
    width: 20px;
    height: 20px;

    min-width: 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 20px;
}

.topbar .icon svg {
    width: 18px;
    height: 18px;

    display: block;
}

/* =========================================================
   ACCOUNT MENU
   ========================================================= */

.account-menu {
    display: flex;
    align-items: center;

    gap: var(--space-3);

    flex-shrink: 0;
}

.account-avatar {
    width: 32px;
    height: 32px;

    min-width: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 50%;

    background: var(--surface);
    color: var(--text-secondary);

    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

/* =========================================================
   GLOBAL SEARCH
   ========================================================= */

.global-search {
    display: flex;
    align-items: center;
    width: min(420px, 42vw);
    min-width: 240px;
    height: 40px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);

    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast);
}

.global-search:hover {
    border-color: #d4d8de;
}

.global-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.global-search .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-left: 12px;

    color: var(--text-muted);
}

.global-search .icon svg {
    width: 17px;
    height: 17px;
}

.global-search input {
    flex: 1;
    min-width: 0;

    height: 100%;
    padding: 0 12px 0 9px;

    border: 0;
    outline: 0;

    background: transparent;
    color: var(--text);
}

.global-search input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.global-search input:focus {
    outline: none;
    box-shadow: none;
}

.global-search input::-webkit-search-cancel-button {
    cursor: pointer;
}



/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 820px) {

    .sidebar-brand {
        margin-bottom: var(--space-4);
    }

    .sidebar-footer {
        padding-top: var(--space-4);
    }

}

@media (max-width: 820px) {
    .global-search {
        width: min(320px, 38vw);
        min-width: 180px;
    }
}

@media (max-width: 560px) {
    .global-search {
        width: 100%;
        min-width: 0;
    }
}
