/* ==========================================================================
   JMYR Admin Theme - Light Theme (aligned with JMYR Figma design system)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Outfit:wght@400;700&display=swap');

/* Design tokens (JMYR Web App Figma) */
:root {
    --color-surface-primary: #ffffff;
    --color-surface-tertiary: #f1f5f9;
    --color-surface-brand-dark: #16171a;
    --color-text-primary: #334155;
    --color-text-secondary: #64748b;
    --color-text-tertiary: #cbd5e1;
    --color-text-helper: #5b6f8a;
    --color-border-primary: #cbd5e1;
    --color-border-tertiary: #475569;
    --color-action-brand: #2f3592;
    --color-action-brand-hover: #252a7a;
    --color-action-focus: #5c8cff;
    --color-action-disabled: #e2e8f0;
    --color-surface-success: #e6fbf4;
    --color-text-success: #1fa36b;
    --color-surface-warning: #fcf7df;
    --color-border-warning: #e3c96b;
    --color-surface-critical: #feefee;
    --color-border-critical: #e82d2d;
    --shadow-subtle: 0px 0px 12px 0px rgba(16, 36, 61, 0.05);
    --shadow-popover: 0px 8px 20px -4px rgba(23, 24, 24, 0.12), 0px 3px 6px -3px rgba(23, 24, 24, 0.08);
    --font-sans: 'Outfit', 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading-weight: 700;
    --header-height: 64px;
}

/* Base reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: #f8fafc;
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Figma type scale (Gilroy → Outfit as web equivalent) */
.heading-2xl {
    font-weight: var(--font-heading-weight);
    font-size: 2rem;
    line-height: 2.625rem;
}

.heading-xl {
    font-weight: var(--font-heading-weight);
    font-size: 1.5rem;
    line-height: 1.875rem;
}

.heading-lg {
    font-weight: var(--font-heading-weight);
    font-size: 1.25rem;
    line-height: 1.875rem;
}

.heading-md {
    font-weight: var(--font-heading-weight);
    font-size: 1rem;
    line-height: 1.5rem;
}

.body-md {
    font-size: 1rem;
    line-height: 1.5rem;
}

.body-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

/* ==========================================================================
   PrimeVue Menubar (backwards compatibility)
   ========================================================================== */

.p-menubar {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 100%) !important;
    border: none !important;
    border-bottom: 1px solid rgba(47, 53, 146, 0.2) !important;
}

.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link .p-menuitem-icon,
.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link .p-menuitem-text,
.p-menubar .p-menubar-root-list>.p-menuitem>.p-menuitem-link .p-submenu-icon {
    color: #e2e8f0;
}

.p-menubar.p-menubar-mobile-active .p-menubar-root-list {
    background: linear-gradient(180deg, #0f0f23 0%, #1a1a3e 100%);
}

.p-menubar .p-menubar-button {
    color: #e2e8f0;
}

/* ==========================================================================
   PrimeVue DataTable - Light Theme
   ========================================================================== */

.p-datatable {
    background: var(--color-surface-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-subtle);
    overflow: hidden;
    font-size: 0.875rem;
}

.p-datatable .p-datatable-header {
    background: var(--color-surface-primary);
    border-color: var(--color-border-primary);
    color: var(--color-text-primary);
    padding: 1rem 1.5rem;
    font-size: 0.7rem;
}

.p-datatable .p-datatable-thead>tr>th {
    background: #f8fafc;
    border-color: var(--color-border-primary);
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

.p-datatable .p-datatable-tbody>tr {
    background: var(--color-surface-primary);
    color: var(--color-text-primary);
}

.p-datatable .p-datatable-tbody>tr>td {
    border-color: #f1f5f9;
    padding: 1rem 0.5rem;
}

.p-datatable .p-datatable-tbody>tr:hover {
    background: #f8fafc;
}

.p-datatable .p-datatable-tbody>tr:nth-child(even) {
    background: #fafbfc;
}

.p-datatable .p-datatable-tbody>tr:nth-child(even):hover {
    background: #f1f5f9;
}

.p-datatable .p-inputtext {
    font-size: 0.875rem;
    min-height: 2.25rem;
    padding: 6px 10px;
}

.p-datatable .p-dropdown {
    min-height: 2.25rem;
    font-size: 0.875rem;
}

.p-datatable .p-dropdown .p-inputtext {
    font-size: 0.875rem;
    min-height: auto;
    padding: 6px 10px;
}

/* Column filter overlay (filterDisplay="menu") — width for multi-field custom filters */
.p-column-filter-overlay.p-column-filter-overlay-menu {
    min-width: 16rem;
    max-width: min(24rem, 90vw);
    border-radius: 12px;
    box-shadow: var(--shadow-subtle);
}

.p-column-filter-overlay-menu .p-column-filter .p-inputtext,
.p-column-filter-overlay-menu .p-column-filter .p-inputnumber-input,
.p-column-filter-overlay-menu .p-dropdown {
    width: 100%;
    max-width: 100%;
}

.p-column-filter-overlay-menu .p-column-filter+.p-column-filter {
    margin-block-start: 0.375rem;
}

.p-column-filter-overlay-menu .p-column-filter-buttonbar {
    margin-block-start: 0.5rem;
    gap: 0.5rem;
}

.p-column-filter-clear-button.p-hidden-space {
    display: none;
}

/* ==========================================================================
   PrimeVue Paginator
   ========================================================================== */

.p-paginator {
    background: var(--color-surface-primary);
    border-color: var(--color-border-primary);
    padding: 0.75rem 1rem;
}

.p-paginator .p-paginator-pages .p-paginator-page {
    color: #64748b;
    border-radius: 8px;
    min-width: 2.5rem;
    height: 2.5rem;
}

.p-paginator .p-paginator-pages .p-paginator-page:hover {
    background: #f1f5f9;
    color: var(--color-text-primary);
}

.p-paginator .p-paginator-pages .p-paginator-page.p-highlight {
    background: var(--color-action-brand);
    border-color: var(--color-action-brand);
    color: #ffffff;
}

.p-paginator .p-paginator-first,
.p-paginator .p-paginator-prev,
.p-paginator .p-paginator-next,
.p-paginator .p-paginator-last {
    color: #64748b;
    border-radius: 8px;
}

.p-paginator .p-paginator-first:hover,
.p-paginator .p-paginator-prev:hover,
.p-paginator .p-paginator-next:hover,
.p-paginator .p-paginator-last:hover {
    background: #f1f5f9;
    color: var(--color-text-primary);
}

/* ==========================================================================
   PrimeVue Input Fields - Light Theme
   ========================================================================== */

.p-inputtext {
    background: var(--color-surface-primary);
    border: 1px solid var(--color-border-primary);
    color: var(--color-text-primary);
    border-radius: 8px;
    min-height: 48px;
    padding: 8px 12px;
    font-size: 16px;
    transition: all 0.2s ease;
}

.p-inputtext:enabled:focus {
    border-color: var(--color-action-brand);
    box-shadow: 0 0 0 3px rgba(47, 53, 146, 0.15);
}

.p-inputtext::placeholder {
    color: var(--color-text-secondary);
}

/* ==========================================================================
   PrimeVue Dropdown
   ========================================================================== */

.p-dropdown {
    background: var(--color-surface-primary);
    border: 1px solid var(--color-border-primary);
    border-radius: 8px;
}

/* The dropdown label inherits .p-inputtext — strip its own border/shadow */
.p-dropdown .p-inputtext {
    border: none;
    box-shadow: none;
    background: transparent;
}

.p-dropdown:not(.p-disabled):hover {
    border-color: #cbd5e1;
}

.p-dropdown:not(.p-disabled).p-focus {
    border-color: var(--color-action-brand);
    box-shadow: 0 0 0 3px rgba(47, 53, 146, 0.15);
}

.p-dropdown .p-dropdown-label {
    color: var(--color-text-primary);
}

.p-dropdown .p-dropdown-trigger {
    color: #64748b;
}

.p-dropdown-panel {
    background: var(--color-surface-primary);
    border: 1px solid var(--color-border-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-popover);
}

.p-dropdown-panel .p-dropdown-items .p-dropdown-item {
    color: var(--color-text-primary);
    padding: 0.625rem 1rem;
}

.p-dropdown-panel .p-dropdown-items .p-dropdown-item:hover {
    background: #f1f5f9;
}

.p-dropdown-panel .p-dropdown-items .p-dropdown-item.p-highlight {
    background: #eaecff;
    color: var(--color-action-brand);
}

/* ==========================================================================
   PrimeVue Buttons
   ========================================================================== */

.p-button {
    background: var(--color-action-brand);
    border: none;
    border-radius: 8px;
    font-weight: var(--font-heading-weight);
    font-size: 14px;
    padding: 0.625rem 1.25rem;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

/* Icon-only / compact buttons: avoid forcing 48px height */
.p-button.p-button-icon-only {
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
}

.p-button.p-button-sm {
    min-height: 2.25rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
}

.p-button:enabled:hover {
    background: var(--color-action-brand-hover);
    box-shadow: 0 4px 12px rgba(47, 53, 146, 0.35);
}

.p-button.p-button-secondary {
    background: var(--color-surface-tertiary);
    color: #475569;
    border: 1px solid var(--color-border-primary);
}

.p-button.p-button-secondary:enabled:hover {
    background: var(--color-action-disabled);
    color: var(--color-text-primary);
}

.p-button.p-button-success {
    background: #10b981;
}

.p-button.p-button-success:enabled:hover {
    background: #059669;
}

.p-button.p-button-danger {
    background: #ef4444;
}

.p-button.p-button-danger:enabled:hover {
    background: #dc2626;
}

.p-button.p-button-warning {
    background: #f59e0b;
}

.p-button.p-button-warning:enabled:hover {
    background: #d97706;
}

.p-button.p-button-outlined {
    background: transparent;
    border: 1px solid var(--color-action-brand);
    color: var(--color-action-brand);
}

.p-button.p-button-outlined:enabled:hover {
    background: #eaecff;
}

.p-button.p-button-text {
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-action-brand);
}

.p-button.p-button-text:enabled:hover {
    background: #eaecff;
    border-color: transparent;
    color: var(--color-action-brand-hover);
    transform: none;
    box-shadow: none;
}

.p-button.p-button-text:enabled:active {
    background: #d4d8f7;
    color: var(--color-action-brand);
}

.p-button.p-button-raised {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
}

.p-button.p-button-rounded {
    border-radius: 2rem;
}

/* Remove focus ring on buttons — handled by outline via :focus-visible */
.p-button:focus {
    box-shadow: none;
    outline: 2px solid rgba(47, 53, 146, 0.4);
    outline-offset: 2px;
}

/* ==========================================================================
   PrimeVue SelectButton
   ========================================================================== */

.p-selectbutton .p-button {
    background: var(--color-surface-tertiary);
    border: 1px solid var(--color-border-primary);
    color: #475569;
    font-weight: var(--font-heading-weight);
    transition: all 0.2s ease;
}

.p-selectbutton .p-button:not(.p-disabled):not(.p-highlight):hover {
    background: var(--color-action-disabled);
    border-color: var(--color-border-primary);
    color: var(--color-text-primary);
}

.p-selectbutton .p-button.p-highlight {
    background: var(--color-action-brand);
    border-color: var(--color-action-brand);
    color: #ffffff;
}

.p-selectbutton .p-button.p-highlight:hover {
    background: var(--color-action-brand-hover);
    border-color: var(--color-action-brand-hover);
    color: #ffffff;
}

/* ==========================================================================
   PrimeVue Dialog - Light Theme
   ========================================================================== */

.p-dialog {
    background: var(--color-surface-primary);
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-popover);
}

.p-dialog .p-dialog-header {
    background: var(--color-surface-primary);
    border-bottom: 1px solid #f1f5f9;
    color: var(--color-text-primary);
    padding: 1.25rem 1.5rem;
    border-radius: 16px 16px 0 0;
}

.p-dialog .p-dialog-header .p-dialog-title {
    font-weight: 600;
    font-size: 1.125rem;
}

.p-dialog .p-dialog-header .p-dialog-header-icon {
    color: #64748b;
}

.p-dialog .p-dialog-header .p-dialog-header-icon:hover {
    background: #f1f5f9;
    color: var(--color-text-primary);
}

.p-dialog .p-dialog-content {
    background: var(--color-surface-primary);
    color: #475569;
    padding: 1.5rem;
}

.p-dialog .p-dialog-footer {
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    padding: 1rem 1.5rem;
    border-radius: 0 0 16px 16px;
}

/* ==========================================================================
   PrimeVue Card - Light Theme
   ========================================================================== */

.p-card {
    background: var(--color-surface-primary);
    border: 1px solid var(--color-border-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-subtle);
}

.p-card .p-card-header {
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
}

.p-card .p-card-title {
    color: var(--color-text-primary);
    font-weight: 600;
}

.p-card .p-card-subtitle {
    color: #64748b;
}

.p-card .p-card-content {
    color: #475569;
}

/* ==========================================================================
   PrimeVue Toast - Light Theme
   ========================================================================== */

.p-toast .p-toast-message {
    background: var(--color-surface-primary);
    border: 1px solid var(--color-border-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-popover);
}

.p-toast .p-toast-message .p-toast-message-content .p-toast-summary {
    color: var(--color-text-primary);
    font-weight: 600;
}

.p-toast .p-toast-message .p-toast-message-content .p-toast-detail {
    color: #64748b;
}

.p-toast .p-toast-message.p-toast-message-success {
    border-left: 4px solid var(--color-text-success);
}

.p-toast .p-toast-message.p-toast-message-error {
    border-left: 4px solid #ef4444;
}

.p-toast .p-toast-message.p-toast-message-warn {
    border-left: 4px solid #f59e0b;
}

.p-toast .p-toast-message.p-toast-message-info {
    border-left: 4px solid #3b82f6;
}

/* ==========================================================================
   PrimeVue Calendar/Datepicker - Light Theme
   ========================================================================== */

.p-calendar .p-datepicker {
    background: var(--color-surface-primary);
    border: 1px solid var(--color-border-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-popover);
}

.p-datepicker .p-datepicker-header {
    background: var(--color-surface-primary);
    border-bottom: 1px solid #f1f5f9;
    color: var(--color-text-primary);
    padding: 0.75rem;
}

.p-datepicker .p-datepicker-header .p-datepicker-title {
    font-weight: 600;
}

.p-datepicker table td>span {
    color: var(--color-text-primary);
    border-radius: 8px;
}

.p-datepicker table td>span:hover {
    background: #f1f5f9;
}

.p-datepicker table td.p-datepicker-today>span {
    background: #eaecff;
    color: var(--color-action-brand);
}

.p-datepicker table td>span.p-highlight {
    background: var(--color-action-brand);
    color: #ffffff;
}

.p-datepicker .p-datepicker-header .p-datepicker-prev,
.p-datepicker .p-datepicker-header .p-datepicker-next {
    color: #64748b;
    border-radius: 8px;
}

.p-datepicker .p-datepicker-header .p-datepicker-prev:hover,
.p-datepicker .p-datepicker-header .p-datepicker-next:hover {
    background: #f1f5f9;
    color: var(--color-text-primary);
}

/* ==========================================================================
   PrimeVue Tags - Light Theme
   ========================================================================== */

.p-tag {
    font-weight: 600;
    border-radius: 6px;
    padding: 0.25rem 0.75rem;
}

.p-tag.p-tag-success {
    background: var(--color-surface-success);
    color: var(--color-text-success);
}

.p-tag.p-tag-warning {
    background: var(--color-surface-warning);
    color: #92400e;
    border: 1px solid var(--color-border-warning);
}

.p-tag.p-tag-danger {
    background: var(--color-surface-critical);
    color: #991b1b;
    border: 1px solid var(--color-border-critical);
}

.p-tag.p-tag-info {
    background: #dbeafe;
    color: #1e40af;
}

.p-tag.p-tag-secondary {
    background: #f1f5f9;
    color: #475569;
}

/* ==========================================================================
   Scrollbar Styling - Light Theme
   ========================================================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   Selection & Focus Styles
   ========================================================================== */

::selection {
    background: rgba(47, 53, 146, 0.2);
    color: var(--color-text-primary);
}

/* Status surfaces (Figma) */
.surface-success {
    background: var(--color-surface-success);
    color: var(--color-text-success);
}

.surface-warning {
    background: var(--color-surface-warning);
    border: 1px solid var(--color-border-warning);
}

.surface-critical {
    background: var(--color-surface-critical);
    border: 1px solid var(--color-border-critical);
}

:focus-visible {
    outline: 2px solid var(--color-action-brand);
    outline-offset: 2px;
}

/* ==========================================================================
   Link Styles
   ========================================================================== */

a {
    color: var(--color-action-brand);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-action-brand-hover);
}

/* ==========================================================================
   Header Component - Light Theme
   ========================================================================== */

.top-header {
    --header-bg: #ffffff;
    --header-border: var(--color-border-primary);
    --text-primary: var(--color-text-primary);
    --text-secondary: #64748b;
    --accent-color: var(--color-action-brand);
    --hover-bg: #f8fafc;
}

.top-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 280px;
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 997;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-subtle);
}

.top-header.collapsed-sidebar {
    left: 72px;
}

.guest-header {
    left: 0 !important;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-action-brand) 0%, var(--color-action-focus) 100%);
    border-bottom: none;
}

.guest-header .logo-text {
    color: #ffffff !important;
}

/* Header Left */
.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    border-radius: 10px;
    transition: background 0.2s ease;
    position: relative;
    z-index: 1000;
    -webkit-tap-highlight-color: transparent;
}

.menu-toggle:hover {
    background: var(--hover-bg);
}

.menu-toggle:active {
    background: var(--color-action-disabled);
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hamburger .line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    margin: 3px 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
}

.breadcrumb-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

/* Header Center */
.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.header-logo .logo-img {
    height: 36px;
    width: auto;
    transition: transform 0.3s ease;
}

.header-logo:hover .logo-img {
    transform: scale(1.05);
}

.top-header .logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--hover-bg);
    border-radius: 12px;
    border: 1px solid var(--header-border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-action-brand) 0%, var(--color-action-focus) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.notification-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border: none;
    background: var(--hover-bg);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    border: 1px solid var(--header-border);
}

.notification-btn:hover {
    background: #f1f5f9;
    color: var(--accent-color);
    border-color: #cbd5e1;
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* Header Responsive */
@media (max-width: 1023px) {
    .top-header {
        left: 0;
        padding: 0 16px;
    }

    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .header-center {
        display: none;
    }

    .user-info {
        display: none;
    }

    .user-menu {
        padding: 8px;
    }
}

@media (max-width: 640px) {
    .breadcrumb-text {
        font-size: 1rem;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-right {
        gap: 12px;
    }

    .notification-btn {
        width: 40px;
        height: 40px;
    }
}

/* Animation for hamburger on open state */
.menu-toggle.active .hamburger .line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active .hamburger .line:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger .line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ==========================================================================
   Sidebar Component - Dark Theme (matches app shell, recedes vs main content)
   ========================================================================== */

.sidebar {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 72px;
    --sidebar-bg: #151628;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --text-primary: #e2e8f0;
    --text-secondary: #8891a8;
    --accent-color: #7c83db;
    --accent-light: rgba(124, 131, 219, 0.15);
    --hover-bg: rgba(255, 255, 255, 0.06);
    --active-bg: linear-gradient(90deg, rgba(124, 131, 219, 0.15) 0%, transparent 100%);
    --transition-speed: 0.3s;
}

/* Overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) ease;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
}

/* Main Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    z-index: 999;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.05);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    height: var(--header-height);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.sidebar .logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.sidebar .logo-text {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.collapse-btn,
.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.collapse-btn:hover,
.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 0;
    background: var(--sidebar-bg);
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0 12px;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-size: 0.925rem;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--accent-color);
    border-radius: 0 3px 3px 0;
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.nav-link:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.nav-link:hover::before {
    transform: scaleY(1);
}

.nav-link.router-link-active,
.nav-link.router-link-exact-active {
    background: var(--active-bg);
    color: var(--accent-color);
    font-weight: 600;
}

.nav-link.router-link-active::before,
.nav-link.router-link-exact-active::before {
    transform: scaleY(1);
}

.nav-icon {
    width: 20px;
    font-size: 1.1rem;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.nav-link:hover .nav-icon {
    transform: scale(1.1);
    color: var(--accent-color);
}

.nav-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-link,
.nav-link:hover,
.nav-link:focus,
.nav-link:active {
    text-decoration: none !important;
}

.submenu-toggle {
    font-family: inherit;
}

.submenu-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.submenu-toggle.expanded .submenu-arrow {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.submenu.open {
    max-height: 500px;
    opacity: 1;
    padding: 4px 0 4px 20px;
}

.submenu-link {
    padding: 10px 16px;
    font-size: 0.875rem;
}

.submenu-link .nav-icon {
    font-size: 0.75rem;
    width: 16px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 9px;
    border-top: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    width: 100%;
    border: none;
    background: transparent;
    color: #ef4444;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.925rem;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.logout-btn .nav-icon {
    width: 20px;
    font-size: 1.1rem;
}

/* Sidebar Collapsed State */
.sidebar.collapsed .logo-container {
    justify-content: center;
}

.sidebar.collapsed .sidebar-header {
    padding: 20px 8px;
    justify-content: center;
}

.sidebar.collapsed .collapse-btn {
    position: absolute;
    right: -16px;
    background: #ffffff;
    border: 1px solid var(--sidebar-border);
    color: var(--text-secondary);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed .collapse-btn:hover {
    background: var(--accent-light);
    color: var(--accent-color);
}

.sidebar.collapsed .nav-list {
    padding: 0 8px;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .nav-link .nav-icon {
    margin: 0;
}

.sidebar.collapsed .logout-btn {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .has-submenu {
    position: relative;
}

/* Sidebar Mobile Styles */
@media (max-width: 1023px) {
    .sidebar-overlay {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }

    .sidebar.collapsed {
        width: var(--sidebar-width);
    }

    .close-btn {
        display: flex !important;
    }

    .collapse-btn {
        display: none !important;
    }
}

/* Sidebar Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nav-item {
    animation: slideIn 0.3s ease forwards;
    animation-delay: calc(var(--item-index, 0) * 0.05s);
}