Some checks failed
Deploy Application / deploy (push) Has been cancelled
482 lines
12 KiB
CSS
482 lines
12 KiB
CSS
/**
|
|
* Sidebar Component - Admin Interface
|
|
*
|
|
* Main navigation sidebar with collapsible sections and active states.
|
|
* Mobile: Off-canvas overlay, Tablet+: Fixed sidebar
|
|
*/
|
|
|
|
@layer components {
|
|
/**
|
|
* Sidebar Container
|
|
*
|
|
* Component styling for the admin sidebar.
|
|
* Grid positioning is handled in _layout.css (grid-area: sidebar).
|
|
*/
|
|
.admin-sidebar {
|
|
/* Internal Layout (Flexbox for content) */
|
|
display: flex;
|
|
flex-direction: column;
|
|
|
|
/* Styling */
|
|
background-color: var(--sidebar-bg);
|
|
color: var(--sidebar-text);
|
|
|
|
/* Spacing */
|
|
padding: var(--spacing-md) 0;
|
|
|
|
/* Mobile: Hidden by default, shown via toggle */
|
|
@media (max-width: 767px) {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
bottom: 0;
|
|
width: var(--sidebar-width-mobile);
|
|
max-width: 280px;
|
|
transform: translateX(-100%);
|
|
transition: transform var(--transition-base);
|
|
z-index: var(--z-sidebar);
|
|
overflow-y: auto;
|
|
|
|
/* Mobile Menu Open State */
|
|
&[data-mobile-menu-open="true"] {
|
|
transform: translateX(0);
|
|
}
|
|
}
|
|
|
|
/* Tablet+: Always visible */
|
|
@media (min-width: 768px) {
|
|
position: sticky;
|
|
top: 0;
|
|
height: 100vh;
|
|
overflow-y: auto;
|
|
border-right: 1px solid var(--sidebar-border);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Resize Handle
|
|
*/
|
|
.admin-sidebar__resize-handle {
|
|
display: none;
|
|
|
|
@media (min-width: 768px) {
|
|
display: block;
|
|
position: absolute;
|
|
right: 0;
|
|
top: 0;
|
|
bottom: 0;
|
|
width: 4px;
|
|
cursor: col-resize;
|
|
background-color: transparent;
|
|
transition: background-color var(--transition-base);
|
|
z-index: 10;
|
|
user-select: none;
|
|
|
|
&:hover {
|
|
background-color: var(--sidebar-border);
|
|
}
|
|
|
|
&:active {
|
|
background-color: var(--accent-primary);
|
|
}
|
|
|
|
/* Dark Theme Optimization */
|
|
@media (prefers-color-scheme: dark) {
|
|
&:hover {
|
|
background-color: oklch(from var(--sidebar-border) calc(l + 0.1) c h);
|
|
}
|
|
|
|
&:active {
|
|
background-color: var(--accent-primary);
|
|
opacity: 0.8;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Sidebar Header (Logo + Title)
|
|
*/
|
|
.admin-sidebar__header {
|
|
padding: 0 var(--spacing-lg);
|
|
margin-bottom: var(--spacing-md);
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--spacing-md);
|
|
}
|
|
|
|
.admin-sidebar__logo {
|
|
width: 40px;
|
|
height: 40px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.admin-sidebar__title {
|
|
font-size: var(--font-size-lg);
|
|
font-weight: 600;
|
|
color: var(--sidebar-text-hover);
|
|
margin: 0;
|
|
}
|
|
|
|
/**
|
|
* Navigation Section
|
|
*/
|
|
.admin-nav {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--spacing-xs);
|
|
}
|
|
|
|
.admin-nav__section {
|
|
padding: 0 var(--spacing-md);
|
|
}
|
|
|
|
/**
|
|
* Section Toggle (Summary)
|
|
*/
|
|
.admin-nav__section-toggle {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
width: 100%;
|
|
background: none;
|
|
border: none;
|
|
padding: 0;
|
|
cursor: pointer;
|
|
text-align: left;
|
|
transition: background-color var(--transition-base), opacity var(--transition-base);
|
|
list-style: none; /* Remove default list styling */
|
|
border-radius: var(--radius-sm);
|
|
|
|
/* Hide browser default marker */
|
|
&::-webkit-details-marker {
|
|
display: none;
|
|
}
|
|
|
|
&::marker {
|
|
display: none;
|
|
}
|
|
|
|
&:hover {
|
|
opacity: 1;
|
|
background-color: var(--hover-overlay);
|
|
}
|
|
|
|
/* Dark Theme Hover Optimization */
|
|
@media (prefers-color-scheme: dark) {
|
|
&:hover {
|
|
background-color: oklch(from var(--sidebar-bg) calc(l + 0.08) c h);
|
|
}
|
|
}
|
|
|
|
&:focus-visible {
|
|
outline: 2px solid var(--focus-ring);
|
|
outline-offset: 2px;
|
|
border-radius: var(--radius-sm);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Section Title (using element selector)
|
|
*/
|
|
.admin-nav summary h2 {
|
|
font-size: var(--font-size-xs);
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
color: var(--sidebar-text);
|
|
opacity: 0.7;
|
|
padding: var(--spacing-sm) var(--spacing-sm);
|
|
margin: var(--spacing-sm) 0 var(--spacing-xs);
|
|
pointer-events: none;
|
|
transition: opacity var(--transition-base), color var(--transition-base);
|
|
}
|
|
|
|
/**
|
|
* Section Toggle Icon (Chevron) - using element selector
|
|
*/
|
|
.admin-nav summary svg {
|
|
width: 16px;
|
|
height: 16px;
|
|
flex-shrink: 0;
|
|
color: var(--sidebar-text);
|
|
opacity: 0.5;
|
|
transition: transform var(--transition-base), opacity var(--transition-base);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.admin-nav summary:hover svg {
|
|
opacity: 0.8;
|
|
}
|
|
|
|
/**
|
|
* Collapsed Section State (details:not([open]))
|
|
*/
|
|
.admin-nav__section:not([open]) {
|
|
summary svg {
|
|
transform: rotate(-90deg);
|
|
}
|
|
|
|
ul {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Expanded Section State (details[open])
|
|
*/
|
|
.admin-nav__section[open] {
|
|
summary svg {
|
|
transform: rotate(0deg);
|
|
}
|
|
|
|
summary h2 {
|
|
opacity: 1;
|
|
color: var(--sidebar-text-hover);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Navigation List (using element selectors)
|
|
*/
|
|
.admin-nav ul {
|
|
list-style: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--spacing-xs);
|
|
}
|
|
|
|
/**
|
|
* Navigation Items (using element selectors)
|
|
*/
|
|
.admin-nav li {
|
|
margin: 0;
|
|
}
|
|
|
|
.admin-nav a {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--spacing-sm);
|
|
padding: var(--spacing-xs) var(--spacing-md);
|
|
border-radius: var(--radius-md);
|
|
color: var(--sidebar-text);
|
|
text-decoration: none;
|
|
font-size: var(--font-size-sm);
|
|
font-weight: 500;
|
|
transition: all var(--transition-base);
|
|
position: relative;
|
|
|
|
/* Hover State */
|
|
&:hover {
|
|
background-color: var(--hover-overlay);
|
|
color: var(--sidebar-text-hover);
|
|
}
|
|
|
|
/* Dark Theme Hover Optimization */
|
|
@media (prefers-color-scheme: dark) {
|
|
&:hover {
|
|
background-color: oklch(from var(--sidebar-bg) calc(l + 0.05) c h);
|
|
}
|
|
}
|
|
|
|
/* Focus State */
|
|
&:focus-visible {
|
|
outline: 2px solid var(--focus-ring);
|
|
outline-offset: 2px;
|
|
}
|
|
|
|
/* Active State */
|
|
&[aria-current="page"],
|
|
&.admin-nav__link--active {
|
|
background-color: var(--sidebar-active);
|
|
color: var(--sidebar-text-hover);
|
|
|
|
/* Active Indicator */
|
|
&::before {
|
|
content: '';
|
|
position: absolute;
|
|
left: 0;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
width: 3px;
|
|
height: 70%;
|
|
background-color: var(--accent-primary);
|
|
border-radius: 0 2px 2px 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Navigation Icons (using element selectors)
|
|
*/
|
|
.admin-nav svg,
|
|
.admin-nav .admin-nav__icon {
|
|
width: 20px;
|
|
height: 20px;
|
|
flex-shrink: 0;
|
|
opacity: 0.8;
|
|
}
|
|
|
|
.admin-nav a:hover svg,
|
|
.admin-nav a:hover .admin-nav__icon,
|
|
.admin-nav a[aria-current="page"] svg,
|
|
.admin-nav a[aria-current="page"] .admin-nav__icon {
|
|
opacity: 1;
|
|
}
|
|
|
|
/**
|
|
* Badge (Notification Counter)
|
|
*/
|
|
.admin-nav__badge {
|
|
margin-left: auto;
|
|
padding: 2px 8px;
|
|
background-color: var(--accent-error);
|
|
color: white;
|
|
font-size: var(--font-size-xs);
|
|
font-weight: 600;
|
|
border-radius: 10px;
|
|
min-width: 20px;
|
|
text-align: center;
|
|
}
|
|
|
|
/**
|
|
* Collapsible Submenu
|
|
*/
|
|
.admin-nav__submenu {
|
|
list-style: none;
|
|
margin: var(--spacing-xs) 0 0;
|
|
padding: 0 0 0 calc(var(--spacing-md) + 20px);
|
|
display: none;
|
|
flex-direction: column;
|
|
gap: var(--spacing-xs);
|
|
|
|
/* Show when parent is active or expanded */
|
|
.admin-nav__item--expanded > & {
|
|
display: flex;
|
|
}
|
|
}
|
|
|
|
.admin-nav__submenu a {
|
|
font-size: var(--font-size-xs);
|
|
padding: var(--spacing-xs) var(--spacing-sm);
|
|
}
|
|
|
|
/**
|
|
* Expand/Collapse Toggle
|
|
*/
|
|
.admin-nav__toggle {
|
|
margin-left: auto;
|
|
width: 16px;
|
|
height: 16px;
|
|
transition: transform var(--transition-base);
|
|
|
|
.admin-nav__item--expanded & {
|
|
transform: rotate(90deg);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Sidebar Footer
|
|
*/
|
|
.admin-sidebar__footer {
|
|
margin-top: auto;
|
|
padding: var(--spacing-lg);
|
|
border-top: 1px solid var(--sidebar-border);
|
|
}
|
|
|
|
.admin-sidebar__user {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--spacing-sm);
|
|
padding: var(--spacing-sm);
|
|
border-radius: var(--radius-md);
|
|
color: var(--sidebar-text);
|
|
text-decoration: none;
|
|
transition: background-color var(--transition-base);
|
|
|
|
&:hover {
|
|
background-color: var(--hover-overlay);
|
|
}
|
|
|
|
/* Dark Theme Optimization */
|
|
@media (prefers-color-scheme: dark) {
|
|
&:hover {
|
|
background-color: oklch(from var(--sidebar-bg) calc(l + 0.05) c h);
|
|
}
|
|
}
|
|
}
|
|
|
|
.admin-sidebar__avatar {
|
|
width: 32px;
|
|
height: 32px;
|
|
border-radius: 50%;
|
|
object-fit: cover;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.admin-sidebar__user-info {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.admin-sidebar__user-name {
|
|
font-size: var(--font-size-sm);
|
|
font-weight: 600;
|
|
color: var(--sidebar-text-hover);
|
|
display: block;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.admin-sidebar__user-role {
|
|
font-size: var(--font-size-xs);
|
|
color: var(--sidebar-text);
|
|
opacity: 0.8;
|
|
display: block;
|
|
}
|
|
|
|
/**
|
|
* Mobile Menu Toggle Button
|
|
*/
|
|
.admin-sidebar__mobile-toggle {
|
|
display: none;
|
|
|
|
@media (max-width: 767px) {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
position: fixed;
|
|
top: var(--spacing-md);
|
|
left: var(--spacing-md);
|
|
z-index: calc(var(--z-sidebar) + 1);
|
|
width: 44px;
|
|
height: 44px;
|
|
background-color: var(--sidebar-bg);
|
|
border: 1px solid var(--sidebar-border);
|
|
border-radius: var(--radius-md);
|
|
cursor: pointer;
|
|
transition: background-color var(--transition-base);
|
|
|
|
&:hover {
|
|
background-color: var(--sidebar-active);
|
|
}
|
|
|
|
&:focus-visible {
|
|
outline: 2px solid var(--focus-ring);
|
|
outline-offset: 2px;
|
|
}
|
|
}
|
|
}
|
|
|
|
.admin-sidebar__toggle-icon {
|
|
width: 24px;
|
|
height: 24px;
|
|
color: var(--sidebar-text-hover);
|
|
}
|
|
}
|