.app-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 240px;
    min-width: 240px;
    max-width: 240px;
    height: 100%;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.sidebar.is-collapsed {
    width: 64px;
    min-width: 64px;
    max-width: 64px;
}

.sidebar-top {
    padding: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.04);
    flex: 0 0 auto;
}

.brand-logo i {
    font-size: 20px;
    color: #69b1ff;
}

.brand-text {
    min-width: 0;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--sidebar-text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-sub {
    margin-top: 2px;
    font-size: 12px;
    color: var(--sidebar-text-muted);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-menu {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0;
}

.menu-item {
    appearance: none;
    border: 1px solid transparent;
    border-left: none;
    background: transparent;
    color: var(--sidebar-text);
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 8px;
    border-radius: 0;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    line-height: 1;
    position: relative;
}

.menu-item i {
    width: 24px;
    height: 24px;
    font-size: 18px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.menu-item:hover {
    background: var(--sidebar-hover);
    color: rgba(0, 0, 0, 0.88);
}

.menu-item.active {
    background: transparent;
    color: #1890ff;
}

.menu-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #1890ff;
    pointer-events: none;
}

.menu-item.active i,
.menu-item.active .menu-text {
    color: #1890ff;
}

.sidebar.is-collapsed .brand-text {
    display: none;
}

.sidebar.is-collapsed .menu-item {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 !important;
    gap: 0 !important;
    height: 44px;
}

.sidebar.is-collapsed .menu-item .menu-text {
    display: none !important;
    width: 0 !important;
    overflow: hidden !important;
}

.sidebar.is-collapsed .sidebar-menu {
    padding: 0;
}

.sidebar.is-collapsed .menu-item i {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar.is-collapsed .menu-item.active::before {
    left: 0;
}

.sidebar.is-collapsed .sidebar-logo {
    width: 38px !important;
    height: auto !important;
    margin: 0 auto !important;
    display: block !important;
}

.sidebar.is-collapsed .sidebar-header {
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.sidebar-bottom {
    margin-top: auto;
    padding: 8px 0 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar.is-collapsed .sidebar-bottom {
    padding-left: 0;
    padding-right: 0;
    align-items: center;
}

.logout-btn {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--sidebar-text);
    border-radius: 0;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    cursor: pointer;
    height: 44px;
    position: relative;
    text-decoration: none;
}

.logout-btn i {
    width: 24px;
    height: 24px;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.logout-btn .menu-text {
    font-size: 14px;
    line-height: 1;
    font-weight: 500;
    letter-spacing: 0;
    text-decoration: none;
}

.logout-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: rgba(0, 0, 0, 0.88);
}

.sidebar.is-collapsed .logout-btn {
    padding: 0 !important;
    width: 64px;
    justify-content: center;
}

.sidebar.is-collapsed .logout-btn .menu-text {
    display: none;
}

.sidebar-admin {
    width: 100%;
    border: none;
    background: transparent;
    border-radius: 0;
    padding: 0;
}

.sidebar-admin-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 44px;
    padding: 0 12px;
}

.sidebar-admin-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--sidebar-text);
    min-width: 0;
}

.sidebar-admin-label i {
    width: 24px;
    height: 24px;
    font-size: 18px;
    color: currentColor;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.sidebar-admin-label .menu-text {
    font-size: 14px;
    line-height: 1;
    font-weight: 500;
    letter-spacing: 0;
}

.sidebar.is-collapsed .sidebar-admin {
    padding: 10px 0;
    width: 44px;
}

.sidebar.is-collapsed .sidebar-admin-label .menu-text {
    display: none !important;
}

.sidebar.is-collapsed .sidebar-admin-item {
    justify-content: center;
    padding: 0 !important;
}

.sidebar.is-collapsed .sidebar-admin .switch {
    display: none !important;
}

.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 44px;
    height: 22px;
    flex: 0 0 auto;
}

.switch input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
}

.switch-track {
    width: 44px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.22);
    position: relative;
    transition: all 0.2s ease;
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    transition: all 0.2s ease;
}

.switch input:checked + .switch-track {
    background: var(--primary);
    border-color: var(--primary);
}

.switch input:checked + .switch-track::after {
    transform: translateX(22px);
}

.main-wrapper {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    height: 64px;
    background: #ffffff;
    box-shadow: var(--shadow-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 2;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
}

.header-icon-btn:hover {
    border-color: #d9d9d9;
    background: #fafafa;
}

.header-icon-btn i {
    font-size: 20px;
}

.header-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breadcrumb-bar {
    height: 48px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 1;
}

.breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

.breadcrumb i {
    color: rgba(0, 0, 0, 0.35);
    font-size: 16px;
}

.breadcrumb-current {
    color: var(--text);
    font-weight: 600;
}

.content-area {
    flex: 1;
    overflow: auto;
    background: var(--bg-layout);
    padding: 24px;
}

.content-panel {
    display: none;
}

.content-panel.active {
    display: block;
}

.panel-card {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}
