/**
 * ENIGMAPI COMPONENT LIBRARY
 * Reusable UI components for admin dashboard
 *
 * Dependencies: design-system.css (must be loaded first)
 * Quality Standard: Enterprise-grade, WCAG 2.1 AA compliant
 *
 * Components:
 * - Buttons
 * - Forms (Inputs, Textareas, Selects, Validation)
 * - Tables (Sorting, Filtering, Bulk Actions)
 * - Cards
 * - Modals/Dialogs
 * - Toasts/Notifications
 * - Tabs
 * - Navigation (Sidebar, Header)
 * - Badges/Pills
 * - Dropdowns
 * - Search
 * - Filter Chips
 * - Empty States
 * - Loading States
 * - Wizards/Steps
 * - Entity Headers
 * - Autosave Indicators
 *
 * Last Updated: 2025-10-25
 */

/* ============================================================================
   BUTTONS
   Touch target: 44x44px minimum (WCAG AAA)
   Full keyboard support with visible focus states
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--button-padding-y-base) var(--button-padding-x-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
    text-decoration: none;
    white-space: nowrap;
    min-height: var(--touch-target-min);
    font-family: var(--font-family-base);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Primary Button */
.btn-primary {
    background: var(--accent);
    color: var(--text-on-accent);
    border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active:not(:disabled) {
    background: var(--accent-active);
    transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-default);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
}

/* Success Button */
.btn-success {
    background: var(--success);
    color: var(--text-on-success);
    border-color: var(--success);
}

.btn-success:hover:not(:disabled) {
    background: var(--success-hover);
    border-color: var(--success-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Danger Button */
.btn-danger {
    background: var(--danger);
    color: var(--text-on-danger);
    border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-hover);
    border-color: var(--danger-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Button Sizes */
.btn-sm {
    padding: var(--button-padding-y-sm) var(--button-padding-x-sm);
    font-size: var(--font-size-sm);
    min-height: 32px;
}

.btn-lg {
    padding: var(--button-padding-y-lg) var(--button-padding-x-lg);
    font-size: var(--font-size-lg);
    min-height: 52px;
}

/* Icon-only Button */
.btn-icon {
    padding: var(--space-2);
    width: var(--touch-target-min);
    height: var(--touch-target-min);
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
    padding: var(--space-1);
}

/* Button Group */
.btn-group {
    display: inline-flex;
    gap: var(--space-2);
}

.btn-group .btn {
    flex: 0 0 auto;
}

/* ============================================================================
   FORM ELEMENTS
   Accessible, keyboard-friendly, with validation states
   ============================================================================ */

/* Form Groups */
.form-group {
    margin-bottom: var(--space-6);
}

.form-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.form-group label .required {
    color: var(--danger);
    margin-left: var(--space-1);
}

/* Input Fields */
.form-input,
.form-textarea,
.form-select {
    width: 100%;
    height: var(--input-height-base);
    padding: var(--input-padding-y) var(--input-padding-x);
    font-size: var(--font-size-base);
    font-family: var(--font-family-base);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: all var(--transition-base) var(--ease-out);
}

.form-textarea {
    height: auto;
    min-height: 120px;
    resize: vertical;
    line-height: var(--line-height-normal);
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
    border-color: var(--border-strong);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}

.form-input:disabled,
.form-textarea:disabled,
.form-select:disabled {
    background: var(--bg-disabled);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Input with Icon */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--space-3);
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper .form-input {
    padding-left: var(--space-10);
}

/* Field Hints */
.field-hint {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

/* Validation States */
.form-input[aria-invalid="true"],
.form-textarea[aria-invalid="true"],
.form-select[aria-invalid="true"] {
    border-color: var(--danger);
}

.form-input[aria-invalid="false"]:not(:placeholder-shown),
.form-textarea[aria-invalid="false"]:not(:placeholder-shown) {
    border-color: var(--success);
}

/* Field Error */
.field-error {
    display: flex;
    align-items: start;
    gap: var(--space-2);
    padding: var(--space-3);
    margin-top: var(--space-2);
    background: var(--danger-light);
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.field-error[hidden] {
    display: none;
}

.field-error strong {
    color: var(--danger);
}

/* Checkbox & Radio */
.form-checkbox,
.form-radio {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    min-height: var(--touch-target-min);
}

.form-checkbox input[type="checkbox"],
.form-radio input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent);
}

.form-checkbox input[type="checkbox"]:focus-visible,
.form-radio input[type="radio"]:focus-visible {
    outline: var(--focus-ring-width) solid var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-subtle);
}

.form-actions .btn {
    flex: 0 0 auto;
}

/* ============================================================================
   SEARCH
   With keyboard shortcut support (/)
   ============================================================================ */

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-input {
    width: 100%;
    height: var(--input-height-base);
    padding: var(--space-2) var(--space-10) var(--space-2) var(--space-10);
    font-size: var(--font-size-base);
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-base) var(--ease-out);
}

.search-icon {
    position: absolute;
    left: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-shortcut {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}

.search-input:focus + .search-shortcut {
    display: none;
}

/* ============================================================================
   FILTER CHIPS
   Active/inactive states with counts
   ============================================================================ */

.filter-chips {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
    min-height: 36px;
}

.chip:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--text-primary);
}

.chip[aria-pressed="true"],
.chip.active {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

.chip .remove {
    margin-left: var(--space-1);
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
}

.chip .remove:hover {
    color: var(--danger);
}

/* ============================================================================
   TABLES
   Sortable, filterable, with bulk actions
   ============================================================================ */

.table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.table thead {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-default);
}

.table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    white-space: nowrap;
    height: var(--table-header-height);
}

.table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: var(--space-8);
}

.table th.sortable:hover {
    background: var(--bg-hover);
}

.table th.sortable::after {
    content: '↕';
    position: absolute;
    right: var(--space-3);
    color: var(--text-muted);
}

.table th.sortable[data-sort="asc"]::after {
    content: '↑';
    color: var(--accent);
}

.table th.sortable[data-sort="desc"]::after {
    content: '↓';
    color: var(--accent);
}

.table td {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    height: var(--table-row-height);
}

.table tbody tr {
    transition: background var(--transition-fast) var(--ease-out);
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.table tbody tr.selected {
    background: var(--accent-subtle);
}

/* Table Cell Types */
.table td.status-cell {
    font-weight: var(--font-weight-medium);
}

.table td.action-cell {
    text-align: right;
}

.table td.checkbox-cell,
.table th.checkbox-cell {
    width: 48px;
    padding-right: 0;
}

/* Bulk Selection */
.table-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* ============================================================================
   BULK ACTIONS TOOLBAR
   Appears when rows are selected
   ============================================================================ */

.bulk-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
}

.bulk-toolbar[hidden] {
    display: none;
}

.selected-count {
    font-weight: var(--font-weight-semibold);
    color: var(--accent);
    margin-right: auto;
}

/* ============================================================================
   BADGES & STATUS PILLS
   ============================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
    border: 1px solid var(--info);
}

.badge-neutral {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

/* ============================================================================
   CARDS
   ============================================================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--card-padding);
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.card-body {
    color: var(--text-secondary);
}

.card-footer {
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
}

/* ============================================================================
   MODALS / DIALOGS
   Accessible with focus trap and Esc key support
   ============================================================================ */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal-backdrop);
    animation: fadeIn var(--transition-base) var(--ease-out);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: var(--z-modal);
    animation: slideUp var(--transition-base) var(--ease-out);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast) var(--ease-out);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
    padding: var(--space-6);
    border-top: 1px solid var(--border-subtle);
}

/* ============================================================================
   TOASTS / NOTIFICATIONS
   ARIA live regions for screen readers
   ============================================================================ */

.toast-container {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 420px;
}

.toast {
    display: flex;
    align-items: start;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    animation: slideInRight var(--transition-base) var(--ease-out);
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.toast-message {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 20px;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* Toast Variants */
.toast-success {
    border-color: var(--success);
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-warning {
    border-color: var(--warning);
}

.toast-warning .toast-icon {
    color: var(--warning);
}

.toast-danger {
    border-color: var(--danger);
}

.toast-danger .toast-icon {
    color: var(--danger);
}

.toast-info {
    border-color: var(--info);
}

.toast-info .toast-icon {
    color: var(--info);
}

/* ============================================================================
   TABS
   Accessible with keyboard navigation (arrow keys)
   ============================================================================ */

.tabs {
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-6);
}

.tab-list {
    display: flex;
    gap: var(--space-2);
    list-style: none;
}

.tab {
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
    min-height: var(--touch-target-min);
}

.tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.tab[aria-selected="true"] {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-panel[hidden] {
    display: none;
}

/* ============================================================================
   EMPTY STATES
   Helpful, actionable messaging when no data exists
   ============================================================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-16) var(--space-8);
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-state h2 {
    font-size: var(--font-size-2xl);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.empty-state p {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    max-width: 400px;
    margin-bottom: var(--space-6);
}

.empty-actions {
    display: flex;
    gap: var(--space-3);
}

/* ============================================================================
   LOADING STATES
   Spinners and skeleton screens
   ============================================================================ */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-default);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal-backdrop);
}

/* Skeleton Loader */
.skeleton {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-text {
    height: 16px;
    margin-bottom: var(--space-2);
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: var(--space-4);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================================================
   WIZARD / MULTI-STEP FORMS
   Progress indicator with step validation
   ============================================================================ */

.wizard-steps {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-8);
}

.wizard-step {
    display: flex;
    align-items: center;
    flex: 1;
}

.wizard-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-default);
    color: var(--text-muted);
    font-weight: var(--font-weight-bold);
    margin-right: var(--space-3);
}

.wizard-step-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.wizard-step.active .wizard-step-number {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.wizard-step.active .wizard-step-label {
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
}

.wizard-step.completed .wizard-step-number {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.wizard-step-connector {
    flex: 1;
    height: 2px;
    background: var(--border-subtle);
    margin: 0 var(--space-4);
}

.wizard-step.completed + .wizard-step .wizard-step-connector,
.wizard-step.completed .wizard-step-connector {
    background: var(--success);
}

/* ============================================================================
   ENTITY HEADER
   Standardized detail page header
   ============================================================================ */

.entity-header {
    display: flex;
    align-items: start;
    gap: var(--space-4);
    padding: var(--space-6);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

.entity-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: var(--font-weight-bold);
    color: var(--accent);
    flex-shrink: 0;
}

.entity-info {
    flex: 1;
}

.entity-title {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.entity-meta {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.entity-actions {
    display: flex;
    gap: var(--space-2);
}

/* ============================================================================
   AUTOSAVE INDICATOR
   Visual feedback for auto-saving
   ============================================================================ */

.autosave-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-base) var(--ease-out);
}

.autosave-indicator.saving {
    color: var(--text-muted);
}

.autosave-indicator.saved {
    color: var(--success);
}

.autosave-indicator.error {
    color: var(--danger);
}

/* ============================================================================
   DROPDOWN MENUS
   ============================================================================ */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--space-2);
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    padding: var(--space-2);
}

.dropdown-menu[hidden] {
    display: none;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast) var(--ease-out);
    min-height: 36px;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-2) 0;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================================================
   NAVIGATION
   Sidebar and Header
   ============================================================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: var(--z-fixed);
}

.sidebar-header {
    padding: var(--space-6) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-extrabold);
    color: var(--accent);
    text-decoration: none;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-4);
}

.nav-section {
    margin-bottom: var(--space-6);
}

.nav-section-title {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-2);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-3);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-base) var(--ease-out);
    min-height: var(--touch-target-min);
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: var(--font-weight-semibold);
}

.nav-icon {
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.page-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-4) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

.page-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.page-body {
    flex: 1;
    padding: var(--space-6);
}

/* ============================================================================
   RESPONSIVE NAVIGATION
   ============================================================================ */

@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-base) var(--ease-out);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }
}

.mobile-menu-toggle {
    display: none;
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
}
/*
 * Dashboard Enhancements - World-Class UI Polish
 * Applies MARKETING-level quality to dashboard components
 * Version: 2.0.0
 *
 * IMPORTANT: This file ONLY contains visual component styling
 * All layout structure is handled by layouts.css (CSS Grid approach)
 */

/* ================================
   ENHANCED CARDS
   ================================ */
.card {
    background: rgba(15, 22, 41, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

.stat-card {
    background: rgba(15, 22, 41, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 16px;
    padding: 1.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1 0%, #a855f7 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.75rem;
}

.stat-value {
    font-size: 36px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.1;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;  /* Monospace numbers for alignment */
    font-feature-settings: "tnum";  /* Tabular number spacing */
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 13px;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
}

.stat-change.positive {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.stat-change.negative {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

/* ================================
   ENHANCED BUTTONS
   ================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-light);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.btn-secondary:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 13px;
}

.btn-group {
    display: inline-flex;
    gap: 0.5rem;
}

/* ================================
   ENHANCED BADGES
   ================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid;
}

.badge-sm {
    padding: 0.25rem 0.625rem;
    font-size: 11px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

.badge-info {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
}

/* ================================
   ENHANCED TABLES
   ================================ */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.table thead th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.table tbody tr {
    background: rgba(15, 22, 41, 0.4);
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(15, 22, 41, 0.6);
    transform: scale(1.01);
}

.table tbody td {
    padding: 1.25rem;
    font-size: 14px;
    color: var(--text-primary);
    border-top: 1px solid rgba(148, 163, 184, 0.05);
    border-bottom: 1px solid rgba(148, 163, 184, 0.05);
}

.table tbody tr td:first-child {
    border-left: 1px solid rgba(148, 163, 184, 0.05);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.table tbody tr td:last-child {
    border-right: 1px solid rgba(148, 163, 184, 0.05);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* ================================
   FORM INPUTS
   ================================ */
.form-input,
.form-select {
    padding: 0.75rem 1rem;
    background: rgba(15, 22, 41, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.25s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* ================================
   LOADING & EMPTY STATES
   ================================ */
.loading-state,
.error-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(99, 102, 241, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-icon,
.empty-icon {
    font-size: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.error-state h3,
.empty-state h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.error-state p,
.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ================================
   USER MENU
   ================================ */
.user-menu {
    position: relative;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: rgba(15, 22, 41, 0.98);
    backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
}

.user-menu-item:hover {
    background: rgba(99, 102, 241, 0.08);
}

/* ================================
   DROPDOWN MENU COMPONENT
   ================================ */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.dropdown-toggle:hover {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: rgba(15, 22, 41, 0.98);
    backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-light);
}

.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

.dropdown-item.warning:hover {
    background: rgba(251, 191, 36, 0.08);
    color: #fbbf24;
}

.dropdown-divider {
    height: 1px;
    background: rgba(148, 163, 184, 0.08);
    margin: 0.5rem 0;
}

/* Card Actions with Dropdown */
.card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-actions .btn-primary {
    flex: 1;
}

/* ================================
   UTILITY CLASSES
   ================================ */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 2.5rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 2.5rem; }

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* Number formatting utilities */
.number-display {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    letter-spacing: -0.02em;
}

/* Make all numbers in dashboard tidier */
[id*="pnl"],
[id*="capital"],
[id*="rate"],
.stat-value,
.position-symbol,
div[style*="font-size: 24px"],
div[style*="font-size: 32px"],
div[style*="font-size: 36px"] {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* ================================
   RESPONSIVE UTILITIES
   ================================ */
@media (max-width: 768px) {
    .stat-card {
        padding: 1.5rem;
    }

    .stat-value {
        font-size: 28px;
    }

    .card {
        padding: 1.5rem;
    }
}

/* ================================
   SCROLLBAR STYLING (Global)
   ================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 14, 39, 0.4);
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}
/* World-Class Navbar Styles */
.wc-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    height: 64px;
}

.wc-navbar__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1.5rem;
    max-width: 100%;
}

.wc-navbar__left, .wc-navbar__right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.wc-navbar__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-navbar__toggle:hover {
    background: rgba(148, 163, 184, 0.08);
    color: #e2e8f0;
}

.wc-navbar__toggle:active {
    transform: scale(0.95);
}

.wc-navbar__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-navbar__brand:hover {
    transform: translateY(-1px);
}

.wc-navbar__brand-text {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.wc-navbar__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #818cf8;
    letter-spacing: 0.02em;
}

.wc-navbar__icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-navbar__icon-btn:hover {
    background: rgba(148, 163, 184, 0.08);
    color: #e2e8f0;
}

.wc-navbar__icon-btn:active {
    transform: scale(0.95);
}

.wc-navbar__badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border: 2px solid #0a0e27;
    border-radius: 50%;
    animation: pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Profile Dropdown */
.wc-profile-dropdown {
    position: relative;
}

.wc-profile-dropdown__trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 10px;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-profile-dropdown__trigger:hover {
    background: rgba(148, 163, 184, 0.05);
    border-color: rgba(148, 163, 184, 0.2);
}

.wc-profile-dropdown__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-radius: 8px;
    color: #818cf8;
}

.wc-profile-dropdown__name {
    font-size: 14px;
    font-weight: 600;
}

.wc-profile-dropdown__arrow {
    color: #64748b;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-profile-dropdown__trigger[aria-expanded="true"] .wc-profile-dropdown__arrow {
    transform: rotate(180deg);
}

.wc-profile-dropdown__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: rgba(15, 22, 41, 0.98);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.1) inset;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-profile-dropdown__menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wc-profile-dropdown__header {
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
}

.wc-profile-dropdown__user-name {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 0.25rem;
}

.wc-profile-dropdown__user-email {
    font-size: 12px;
    color: #64748b;
}

.wc-profile-dropdown__divider {
    height: 1px;
    background: rgba(148, 163, 184, 0.1);
    margin: 0.5rem 0;
}

.wc-profile-dropdown__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-profile-dropdown__item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #fff;
}

.wc-profile-dropdown__item svg {
    flex-shrink: 0;
}

.wc-profile-dropdown__item--danger {
    color: #f87171;
}

.wc-profile-dropdown__item--danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

@media (max-width: 768px) {
    .wc-navbar__badge {
        display: none;
    }
    .wc-navbar__brand-text {
        font-size: 16px;
    }
}

/* World-Class Sidebar Styles */
.wc-sidebar {
    width: 260px;
    height: calc(100vh - 64px);
    background: rgba(10, 14, 39, 0.6);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(148, 163, 184, 0.08);
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-sidebar__content {
    padding: 1.5rem 1rem;
}

.wc-sidebar__section {
    margin-bottom: 2rem;
}

.wc-sidebar__section:last-child {
    margin-bottom: 0;
}

.wc-sidebar__section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    padding: 0 0.75rem;
    margin-bottom: 0.75rem;
}

.wc-sidebar__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.25rem;
    background: transparent;
    border-radius: 10px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.wc-sidebar__link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-sidebar__link:hover {
    color: #e2e8f0;
    transform: translateX(4px);
}

.wc-sidebar__link:hover::before {
    opacity: 1;
}

.wc-sidebar__link--active {
    color: #fff;
    background: rgba(99, 102, 241, 0.12);
}

.wc-sidebar__link--active::before {
    opacity: 1;
}

.wc-sidebar__link--active .wc-sidebar__icon {
    color: #818cf8;
}

.wc-sidebar__icon {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-sidebar__link:hover .wc-sidebar__icon {
    transform: scale(1.1);
}

.wc-sidebar__text {
    position: relative;
    z-index: 1;
}

.wc-sidebar__indicator {
    position: absolute;
    right: 0.75rem;
    width: 4px;
    height: 4px;
    background: #6366f1;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-sidebar__link--active .wc-sidebar__indicator {
    opacity: 1;
    transform: scale(1);
}

/* Scrollbar styling */
.wc-sidebar::-webkit-scrollbar {
    width: 6px;
}

.wc-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.wc-sidebar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 3px;
}

.wc-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.3);
}

/* Mobile responsive */
.wc-sidebar.is-hidden {
    transform: translateX(-100%);
}

@media (max-width: 768px) {
    .wc-sidebar {
        position: fixed;
        top: 64px;
        left: 0;
        z-index: 90;
        transform: translateX(-100%);
    }

    .wc-sidebar.is-visible {
        transform: translateX(0);
    }
}

/* Smooth hover glow effect */
@keyframes sidebar-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
    50% {
        box-shadow: 0 0 20px 0 rgba(99, 102, 241, 0.2);
    }
}

.wc-sidebar__link--active {
    animation: sidebar-glow 3s ease-in-out infinite;
}

/* Layout adjustments for world-class components */
.app-layout__body {
    display: flex;
    height: calc(100vh - 64px);
}

.app-layout__main {
    flex: 1;
    overflow-y: auto;
}

/* ============================================
   MODAL STYLES - World-Class Glassmorphism
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.modal-content {
    position: relative;
    z-index: 1001;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(15, 22, 41, 0.98);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.1) inset;
    animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

/* Modal scrollbar */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.05);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.3);
}

/* Form checkbox styling */
.form-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-checkbox:checked {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-color: #6366f1;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .modal {
        padding: 0;
        align-items: flex-end;
    }
    
    .modal-content {
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
}
