:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 60px;
    
    /* macOS Big Sur/Sonoma Color Palette */
    --mac-blue: #007AFF;
    --mac-blue-hover: #0051D5;
    --mac-gray: #8E8E93;
    --mac-gray-light: #F2F2F7;
    --mac-gray-dark: #1C1C1E;
    --mac-background: #F5F5F7;
    --mac-sidebar-bg: rgba(255, 255, 255, 0.85);
    --mac-sidebar-border: rgba(0, 0, 0, 0.1);
    --mac-card-bg: rgba(255, 255, 255, 0.9);
    --mac-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    --mac-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    
    /* Legacy support */
    --primary-color: var(--mac-blue);
    --primary-hover: var(--mac-blue-hover);
    --secondary-color: var(--mac-gray);
    --success-color: #34C759;
    --danger-color: #FF3B30;
    --warning-color: #FF9500;
    --info-color: #5AC8FA;
    --bg-primary: #FFFFFF;
    --bg-secondary: var(--mac-gray-light);
    --bg-sidebar: var(--mac-sidebar-bg);
    --bg-sidebar-hover: rgba(0, 122, 255, 0.1);
    --text-primary: #000000;
    --text-secondary: var(--mac-gray);
    --text-sidebar: #1C1C1E;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow: var(--mac-shadow);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: var(--mac-shadow-lg);
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--mac-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

.erp-body {
    overflow-x: hidden;
}

/* macOS Style Sidebar with Glassmorphism */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--mac-sidebar-bg);
    border-right: 1px solid var(--mac-sidebar-border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: var(--mac-shadow);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--mac-sidebar-border);
    min-height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.5);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
}

.sidebar-brand:hover {
    color: var(--mac-blue);
}

.sidebar-brand i {
    font-size: 1.5rem;
    color: var(--mac-blue);
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-brand-text {
    white-space: nowrap;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
}

.sidebar-toggle:hover {
    background: var(--bg-sidebar-hover);
    color: var(--mac-blue);
}

/* Menu Search */
.menu-search-container {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--mac-sidebar-border);
    background: rgba(255, 255, 255, 0.3);
    position: sticky;
    top: 0;
    z-index: 10;
}

.menu-search {
    position: relative;
    width: 100%;
}

.menu-search-input {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.menu-search-input::placeholder {
    color: var(--mac-gray);
}

.menu-search-input:focus {
    outline: none;
    border-color: var(--mac-blue);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.menu-search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mac-gray);
    font-size: 0.875rem;
    pointer-events: none;
    z-index: 1;
}

.menu-search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--mac-gray);
    cursor: pointer;
    padding: 0.25rem;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    z-index: 2;
}

.menu-search-clear:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-primary);
}

.menu-search-input:not(:placeholder-shown) ~ .menu-search-clear {
    display: flex;
}

/* Menu search dropdown specific styles */
#menuSearchDropdown {
    z-index: 10001 !important;
    max-height: 400px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

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

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

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

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

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

.nav-item {
    margin: 0.125rem 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--text-sidebar);
    text-decoration: none;
    border-radius: 10px;
    position: relative;
    font-weight: 500;
    font-size: 0.875rem;
}

.nav-link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--mac-blue);
    transform: translateX(2px);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.15) 0%, rgba(88, 86, 214, 0.1) 100%);
    color: var(--mac-blue);
    font-weight: 600;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--mac-blue);
    border-radius: 0 2px 2px 0;
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.nav-link:hover i {
    transform: scale(1.1);
}

.nav-text {
    white-space: nowrap;
    flex: 1;
}

.nav-link-toggle {
    position: relative;
    cursor: pointer;
}

.nav-link-toggle .fa-chevron-down {
    font-size: 0.7rem;
    margin-left: auto;
}

.nav-link-toggle[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

.nav-item-parent {
    position: relative;
}

.nav-submenu {
    list-style: none;
    padding-left: 0;
    background: rgba(0, 0, 0, 0.02);
    margin: 0.25rem 0 0 0;
    border-radius: 8px;
    overflow: hidden;
}

.nav-submenu .nav-item {
    margin: 0;
}

.nav-submenu .nav-link {
    padding-left: 3rem;
    font-size: 0.8125rem;
    font-weight: 400;
}

.nav-submenu .nav-link:hover {
    background: var(--bg-sidebar-hover);
    padding-left: 3.25rem;
}

.nav-submenu .nav-link.active {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.12) 0%, rgba(88, 86, 214, 0.08) 100%);
    color: var(--mac-blue);
    font-weight: 500;
}

.nav-divider {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.6875rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--mac-gray);
    letter-spacing: 0.08em;
}

.nav-item.hidden {
    display: none !important;
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Main Content */
.main-content {
    margin-left: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* macOS Style Top Bar */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid var(--mac-sidebar-border);
    display: flex;
    align-items: center;
    padding: 0 1.75rem;
    z-index: 1000;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
    gap: 1rem;
    flex-wrap: nowrap;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
}

.topbar-brand:hover {
    color: var(--mac-blue);
}

.topbar-brand i {
    font-size: 1.5rem;
    color: var(--mac-blue);
}

.topbar-logo-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

.topbar-brand-text {
    white-space: nowrap;
}

.topbar-home-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
}

.topbar-home-link:hover {
    background: rgba(0, 122, 255, 0.1);
    color: var(--mac-blue);
}

.topbar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
}

.topbar-toggle:hover {
    background: var(--bg-secondary);
    color: var(--mac-blue);
}

.topbar-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.topbar-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    min-width: 0;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 101;
}

.topbar-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 400px;
    flex-shrink: 0;
    z-index: 102;
}

.topbar-search i {
    position: absolute;
    left: 0.75rem;
    color: var(--mac-gray);
    font-size: 0.875rem;
    pointer-events: none;
    z-index: 103;
}

.topbar-search input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 102;
}

.topbar-search input::placeholder {
    color: var(--mac-gray);
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--mac-blue);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    position: relative;
    z-index: 101;
}

/* Tab Bar */
.tab-bar {
    position: sticky;
    top: var(--topbar-height);
    height: 40px;
    background: rgba(245, 245, 245, 0.95);
    border-bottom: 1px solid var(--mac-sidebar-border);
    z-index: 98;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: block;
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.tab-bar-content {
    display: flex;
    align-items: flex-end;
    height: 100%;
    padding: 0 0.5rem;
    gap: 0.25rem;
}

.tab-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--mac-sidebar-border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-width: 200px;
    min-width: 120px;
    position: relative;
    height: 36px;
    margin-top: 4px;
}

.tab-item:hover {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
}

.tab-item.active {
    background: #ffffff;
    color: var(--text-primary);
    font-weight: 500;
    border-color: var(--mac-sidebar-border);
    border-bottom-color: #ffffff;
    z-index: 1;
    height: 38px;
    margin-top: 2px;
}

.tab-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.tab-close {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    flex-shrink: 0;
}

.tab-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.tab-close i {
    font-size: 0.7rem;
}

.tab-loading,
.tab-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
    gap: 0.75rem;
}

.tab-loading i {
    font-size: 1.5rem;
    color: var(--mac-blue);
}

.tab-error i {
    font-size: 1.5rem;
    color: var(--danger);
}

.topbar-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-right: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.user-info-item {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background: rgba(0, 122, 255, 0.08);
    border-radius: 8px;
}

.user-info-item:hover {
    background: rgba(0, 122, 255, 0.12);
}

.user-info-item i {
    color: var(--mac-blue);
    margin-right: 0.375rem;
}

.topbar-company-demo {
    color: #dc3545;
    font-weight: 600;
    text-decoration: none;
}
.topbar-company-demo:hover {
    text-decoration: underline;
    color: #c82333;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto;
    min-height: calc(100vh - var(--topbar-height) - 40px - 60px); /* topbar + tabbar + dockbar */
}

/* Hide page titles - topbar shows them */
.page-content > .row:first-child h2,
.page-content > .row:first-child > div h2,
.page-content > h2:first-child,
.page-content > h1:first-child,
.page-content > h2.mb-4:first-child {
    display: none !important;
}

/* Stats cards styling - JavaScript will control visibility */
#statsCards {
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 100;
}

/* Ensure stats cards are visible when display is set to flex */
#statsCards[style*="display: flex"] {
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 100 !important;
}

.page-content:has(.finder-container) {
    padding: 0;
    max-width: 100%;
    position: relative;
    z-index: 0;
}

/* When stats cards are shown, ensure they're above finder */
.page-content:has(#statsCards[style*="display: flex"]) {
    z-index: 10;
}

#statsCards {
    position: relative;
    z-index: 100;
}

/* When stats cards are shown, ensure page-content has proper padding */
.page-content:has(#statsCards:not([style*="display: none"])) {
    padding-top: 2rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* macOS Style Cards */
.card {
    background: var(--mac-card-bg);
    border: 1px solid var(--mac-sidebar-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--mac-shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--mac-shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--mac-sidebar-border);
    background: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.card-body {
    padding: 1.75rem;
}

/* macOS Style Buttons */
.btn {
    border-radius: 10px;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
    cursor: pointer;
}

.btn-primary {
    background: var(--mac-blue);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    background: var(--mac-blue-hover);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-color);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.3);
}

.btn-success:hover {
    background: #30D158;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-color);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
}

.btn-danger:hover {
    background: #FF2D20;
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.4);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 1.5px solid var(--mac-blue);
    color: var(--mac-blue);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--mac-blue);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--mac-gray);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-link {
    color: var(--mac-blue);
    text-decoration: none;
    background: none;
    padding: 0.25rem 0.5rem;
}

.btn-link:hover {
    color: var(--mac-blue-hover);
    background: rgba(0, 122, 255, 0.08);
}

/* Shared icon actions (Email Import pages) */
.file-action-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.file-icon-btn {
    width: 42px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    line-height: 1;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: #8e8e93 !important;
    transition: color 0.18s ease;
}

.file-icon-btn i {
    font-size: 0.92rem;
    color: inherit !important;
    transition: color 0.18s ease, transform 0.18s ease;
}

.file-icon-btn:hover,
.file-icon-btn:focus-visible {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: var(--mac-blue) !important;
}

.file-icon-btn:hover i,
.file-icon-btn:focus-visible i {
    transform: scale(1.06);
}

.file-icon-btn:active {
    color: #0051d5 !important;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* Unified table UX (authenticated pages) */
.unified-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.5);
}

.unified-table-toolbar-left,
.unified-table-toolbar-right {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.unified-table-toolbar .form-control,
.unified-table-toolbar .form-select {
    min-height: 32px;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    font-size: 0.8125rem;
}

.unified-table-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* macOS Style Forms */
.form-control,
.form-select {
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.9);
    letter-spacing: -0.01em;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--mac-blue);
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
    background: #ffffff;
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
}

/* macOS Style Tables */
.table {
    background: transparent;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 0;
}

.table thead {
    background: rgba(0, 0, 0, 0.02);
}

.table thead th {
    border-bottom: 1.5px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.table tbody td {
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: rgba(0, 122, 255, 0.04);
}

.table tbody tr:hover td {
    background: transparent;
}

/* macOS Style Alerts */
.alert {
    border-radius: var(--radius-lg);
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: rgba(52, 199, 89, 0.15);
    color: #1D4D2F;
    border-left: 3px solid var(--success-color);
}

.alert-danger {
    background: rgba(255, 59, 48, 0.15);
    color: #991B1B;
    border-left: 3px solid var(--danger-color);
}

.alert-info {
    background: rgba(90, 200, 250, 0.15);
    color: #0A4A5C;
    border-left: 3px solid var(--info-color);
}

.alert i {
    margin-right: 0.75rem;
    font-size: 1.125rem;
}

/* macOS Style Badges */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-primary {
    background: var(--mac-blue);
    color: #ffffff;
}

.badge-success {
    background: var(--success-color);
    color: #ffffff;
}

.badge-danger {
    background: var(--danger-color);
    color: #ffffff;
}

.badge-warning {
    background: var(--warning-color);
    color: #ffffff;
}

.badge-info {
    background: var(--info-color);
    color: #ffffff;
}

.badge-secondary {
    background: var(--mac-gray);
    color: #ffffff;
}

/* Modern Stats Cards */
.stats-card-modern {
    background: var(--mac-card-bg);
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    position: relative;
    min-height: 140px;
}

.stats-card-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.1);
}

.stats-card-header {
    padding: 1.25rem 1.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stats-icon-modern {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.25rem;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
}

.stats-icon-modern.icon-primary-modern {
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
}

.stats-icon-modern.icon-success-modern {
    background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
}

.stats-icon-modern.icon-danger-modern {
    background: linear-gradient(135deg, #FF3B30 0%, #FF2D20 100%);
}

.stats-icon-modern.icon-warning-modern {
    background: linear-gradient(135deg, #FF9500 0%, #FF8800 100%);
}

.stats-card-body {
    padding: 0 1.5rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.stats-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0.5rem 0 0.25rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.stats-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    opacity: 0.8;
}

/* Legacy Stats Cards (for backward compatibility) */
.stats-card {
    background: var(--mac-card-bg);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    border: 1px solid var(--mac-sidebar-border);
    box-shadow: var(--mac-shadow);
}

.stats-card:hover {
    box-shadow: var(--mac-shadow-lg);
    transform: translateY(-4px);
}

.stats-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #ffffff;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.icon-primary {
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
}

.icon-success {
    background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
}

.icon-danger {
    background: linear-gradient(135deg, #FF3B30 0%, #FF2D20 100%);
}

.icon-warning {
    background: linear-gradient(135deg, #FF9500 0%, #FF8800 100%);
}

.stats-card h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.stats-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--mac-blue);
    background: rgba(0, 122, 255, 0.05);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: var(--success-color);
    background: rgba(52, 199, 89, 0.1);
}

.file-input {
    display: none;
}

.file-label {
    font-weight: 500;
    color: var(--text-primary);
}

.file-label.has-file {
    color: var(--success-color);
    font-weight: 600;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
}

/* Enhanced Autocomplete */
.autocomplete {
    position: relative;
    display: inline-block;
    width: 100%;
}

.input-group .autocomplete.flex-grow-1 {
    flex: 1 1 0%;
    min-width: 0;
    width: auto;
}

.input-group:has(.autocomplete) {
    flex-wrap: nowrap;
}

.input-group:has(.autocomplete) .btn {
    flex-shrink: 0;
}

.autocomplete.flex-grow-1 {
    flex: 1 1 auto;
}

.autocomplete-items {
    position: absolute;
    border: 1px solid var(--mac-sidebar-border);
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--mac-shadow-lg);
    border-radius: var(--radius-lg);
    max-height: 320px;
    overflow-y: auto;
    margin-top: 4px;
    padding: 0.5rem;
}

.autocomplete-items:empty {
    display: none !important;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    background: transparent;
    border-radius: 8px;
    margin-bottom: 0.25rem;
}

.autocomplete-item:last-child {
    margin-bottom: 0;
}

.autocomplete-item:hover,
.autocomplete-active {
    background: rgba(0, 122, 255, 0.1);
    color: var(--mac-blue);
    transform: translateX(4px);
}

.autocomplete-item small {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.autocomplete-item:hover small,
.autocomplete-active small {
    color: var(--mac-blue);
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .page-content {
        padding: 1.25rem;
    }
}

@media (max-width: 767.98px) {
    .page-content {
        padding: 1rem;
    }
    
    .page-content:has(.finder-container) {
        padding: 0;
    }
    
    .topbar {
        padding: 0 1rem;
    }
    
    .topbar-title {
        font-size: 1.125rem;
    }

    .topbar-brand-text {
        display: none;
    }
    
    .topbar-center {
        display: none !important;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .card-header {
        padding: 1.25rem;
    }
    
    .stats-card {
        padding: 1.5rem;
    }
    
    .stats-card h3 {
        font-size: 1.75rem;
    }

    .stats-card-modern {
        min-height: 120px;
    }

    .stats-card-header {
        padding: 1rem 1.25rem 0.5rem;
    }

    .stats-icon-modern {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .stats-card-body {
        padding: 0 1.25rem 1.25rem;
    }

    .stats-value {
        font-size: 1.5rem;
    }

    .stats-label {
        font-size: 0.75rem;
    }
    
    .upload-area {
        padding: 2rem 1.5rem;
    }
    
    .table-responsive {
        font-size: 0.8125rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.75rem 0.875rem;
    }
    
    .topbar-user-info {
        display: none;
    }
    
    .finder-container {
        bottom: 50px;
    }
}

@media (max-width: 575.98px) {
    .topbar-title {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    .page-content {
        padding: 0.75rem;
    }

    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    .topbar,
    .btn,
    .alert,
    .dockbar {
        display: none !important;
    }
    
    .page-content {
        padding: 0 !important;
    }
}

/* Utilities */
.text-muted {
    color: var(--text-secondary) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow {
    box-shadow: var(--shadow) !important;
}

.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
}

.login-card {
    max-width: 440px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-xl);
    box-shadow: var(--mac-shadow-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

.login-card .card-header {
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    color: #ffffff;
    text-align: center;
    padding: 2.5rem 2rem;
    border: none;
}

.login-card .card-header i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.login-card .card-header h3 {
    font-size: 1.625rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.login-card .card-body {
    padding: 2.5rem 2rem;
}

/* Smooth transitions removed for better visibility */

/* macOS Finder Style */
.finder-container {
    position: fixed;
    top: var(--topbar-height); /* topbar only */
    left: 0;
    right: 0;
    bottom: 60px; /* Space for dockbar */
    background: var(--mac-background);
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* Stats cards should be above finder */
#statsCards {
    position: relative;
    z-index: 100 !important;
}

/* Background Menu */
.finder-background-menu {
    position: fixed;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--mac-sidebar-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    z-index: 1000;
    min-width: 200px;
    backdrop-filter: blur(20px);
}

.background-menu-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--mac-sidebar-border);
    margin-bottom: 0.25rem;
}

.background-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.background-menu-item:hover {
    background: rgba(0, 122, 255, 0.1);
}

.background-menu-item.active {
    background: rgba(0, 122, 255, 0.15);
    font-weight: 500;
}

.background-menu-divider {
    height: 1px;
    background: var(--mac-sidebar-border);
    margin: 0.5rem 0;
}

.background-upload-item {
    color: var(--mac-blue);
}

.background-upload-item i {
    color: var(--mac-blue);
}

.background-remove-item {
    color: var(--danger-color);
}

.background-remove-item i {
    color: var(--danger-color);
}

.background-preview {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.finder-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--mac-sidebar-border);
    position: relative;
    z-index: 10;
}

.finder-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.finder-btn {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    visibility: visible;
    opacity: 1;
    position: relative;
    z-index: 11;
    pointer-events: auto;
}

.finder-btn:hover {
    background: rgba(0, 122, 255, 0.1);
    color: var(--mac-blue);
}

.finder-btn.active {
    background: rgba(0, 122, 255, 0.15);
    color: var(--mac-blue);
}

.finder-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.finder-btn:disabled:hover {
    background: transparent;
    color: var(--text-primary);
}

.finder-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 0.5rem;
}

.finder-toolbar-right {
    display: flex;
    align-items: center;
}

.finder-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 200px;
}

.finder-search i {
    position: absolute;
    left: 0.75rem;
    color: var(--mac-gray);
    font-size: 0.875rem;
    pointer-events: none;
}

.finder-search input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

.finder-search input:focus {
    outline: none;
    border-color: var(--mac-blue);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.finder-content {
    flex: 1;
    overflow: auto;
    padding: 2rem;
    background: var(--mac-background);
    height: calc(100% - 120px); /* Toolbar + Statusbar height */
}

/* Glow effect for all text in finder when background image is present */
.finder-container.has-background-image .finder-folder-name,
.finder-content.has-background-image .finder-folder-name {
    text-shadow: 
        0 1px 3px rgba(255, 255, 255, 0.95),
        0 1px 5px rgba(255, 255, 255, 0.8),
        0 0 10px rgba(255, 255, 255, 0.6),
        0 0 15px rgba(255, 255, 255, 0.4),
        0 0 20px rgba(255, 255, 255, 0.2);
}

.finder-container.has-background-image .finder-statusbar,
.finder-content.has-background-image .finder-statusbar,
.finder-container.has-background-image .finder-statusbar *,
.finder-content.has-background-image .finder-statusbar * {
    text-shadow: 
        0 1px 3px rgba(255, 255, 255, 0.95),
        0 1px 5px rgba(255, 255, 255, 0.8),
        0 0 8px rgba(255, 255, 255, 0.6);
}

.finder-container.has-background-image .finder-content p,
.finder-container.has-background-image .finder-content span,
.finder-container.has-background-image .finder-content div:not(.finder-folder-icon):not(.finder-folder-name),
.finder-content.has-background-image p,
.finder-content.has-background-image span,
.finder-content.has-background-image div:not(.finder-folder-icon):not(.finder-folder-name) {
    text-shadow: 
        0 1px 2px rgba(255, 255, 255, 0.9),
        0 1px 4px rgba(255, 255, 255, 0.7),
        0 0 8px rgba(255, 255, 255, 0.5);
}

.finder-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    flex-direction: column;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.7) 0%, rgba(240, 245, 255, 0.55) 60%, rgba(255, 255, 255, 0.42) 100%);
    border-radius: var(--radius);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(124, 147, 255, 0.25);
}

.finder-loading p {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Futuristic Finder loader */
.finder-loader-orb {
    width: 78px;
    height: 78px;
    position: relative;
    filter: drop-shadow(0 0 10px rgba(100, 130, 255, 0.28));
}

.finder-loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: rgba(79, 125, 255, 0.95);
    border-right-color: rgba(79, 125, 255, 0.58);
    animation: finder-orbit-spin 1.15s linear infinite;
}

.finder-loader-ring.ring-two {
    inset: 8px;
    border-top-color: rgba(122, 234, 255, 0.95);
    border-right-color: rgba(122, 234, 255, 0.55);
    animation-duration: 0.95s;
    animation-direction: reverse;
}

.finder-loader-core {
    position: absolute;
    inset: 23px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #eff4ff 0%, #97b2ff 48%, #5377ff 100%);
    box-shadow:
        0 0 16px rgba(83, 119, 255, 0.55),
        0 0 32px rgba(83, 119, 255, 0.32),
        inset 0 0 8px rgba(255, 255, 255, 0.65);
    animation: finder-core-pulse 1.5s ease-in-out infinite;
}

@keyframes finder-orbit-spin {
    to { transform: rotate(360deg); }
}

@keyframes finder-core-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.95;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.finder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
    max-width: 100%;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.finder-grid.is-switching {
    opacity: 0.72;
    transform: translateY(3px);
}

.finder-folder {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 1rem;
    border-radius: var(--radius-lg);
    position: relative;
    user-select: none;
}

.finder-folder:hover {
    background: rgba(0, 122, 255, 0.08);
    transform: translateY(-2px);
}

.finder-folder.selected {
    background: rgba(0, 122, 255, 0.15);
}

.finder-folder-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #ffffff;
    margin-bottom: 0.75rem;
    position: relative;
    border-radius: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Colorful Icon Gradients */
.icon-gradient-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.icon-gradient-green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
}

.icon-gradient-purple {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%) !important;
}

.icon-gradient-orange {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%) !important;
}

.icon-gradient-red {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%) !important;
}

.icon-gradient-cyan {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%) !important;
}

.icon-gradient-yellow {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%) !important;
}

.icon-gradient-gray {
    background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%) !important;
}

.icon-gradient-dark {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
}

.icon-gradient-default {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.finder-folder:hover .finder-folder-icon {
    transform: scale(1.1);
}

.finder-folder-name {
    font-size: 0.8125rem;
    color: var(--text-primary);
    text-align: center;
    font-weight: 500;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 0.25rem;
    border-radius: 4px;
    text-shadow: 
        0 1px 2px rgba(255, 255, 255, 0.7),
        0 1px 3px rgba(255, 255, 255, 0.5);
}

.finder-folder.selected .finder-folder-name {
    background: rgba(0, 122, 255, 0.2);
    color: var(--mac-blue);
    text-shadow: 
        0 1px 2px rgba(255, 255, 255, 0.9),
        0 1px 4px rgba(255, 255, 255, 0.7),
        0 0 8px rgba(255, 255, 255, 0.5);
}

.finder-statusbar {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-top: 1px solid var(--mac-sidebar-border);
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-shadow: 
        0 1px 2px rgba(255, 255, 255, 0.8),
        0 1px 3px rgba(255, 255, 255, 0.6);
}

.finder-statusbar * {
    text-shadow: 
        0 1px 2px rgba(255, 255, 255, 0.8),
        0 1px 3px rgba(255, 255, 255, 0.6);
}

/* macOS Dockbar */
.dockbar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.3);
    z-index: 1000;
    max-width: 90vw;
    overflow-x: visible;
    overflow-y: visible;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.dockbar::-webkit-scrollbar {
    display: none;
}

.dockbar {
    scrollbar-width: none;
}

.dockbar-content {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    overflow: visible;
}

.dockbar-item {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    font-size: 1.5rem;
    color: #ffffff;
    text-decoration: none;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.dockbar-item.icon-gradient-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.dockbar-item.icon-gradient-green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
}

.dockbar-item.icon-gradient-purple {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%) !important;
}

.dockbar-item.icon-gradient-orange {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%) !important;
}

.dockbar-item.icon-gradient-red {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%) !important;
}

.dockbar-item.icon-gradient-cyan {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%) !important;
}

.dockbar-item.icon-gradient-yellow {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%) !important;
}

.dockbar-item.icon-gradient-gray {
    background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%) !important;
}

.dockbar-item.icon-gradient-dark {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
}

.dockbar-item.icon-gradient-default {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.dockbar-item:hover {
    transform: translateY(-8px) scale(1.15);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.dockbar-item.active {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.2) 0%, rgba(88, 86, 214, 0.15) 100%);
    border-color: var(--mac-blue);
}

.dockbar-item i {
    pointer-events: none;
}

.dockbar-item.dragging {
    transform: scale(0.9);
}

.dockbar-separator {
    width: 1px;
    height: 40px;
    background: rgba(0, 0, 0, 0.15);
    margin: 0 0.25rem;
    flex-shrink: 0;
}

.dockbar-fullscreen {
    background: rgba(0, 122, 255, 0.1);
    border-color: rgba(0, 122, 255, 0.3);
    color: var(--mac-blue);
}

.dockbar-fullscreen:hover {
    background: rgba(0, 122, 255, 0.2);
    transform: translateY(-8px) scale(1.15);
}

.dockbar-toggle {
    background: rgba(128, 128, 128, 0.1);
    border-color: rgba(128, 128, 128, 0.3);
    color: var(--text-secondary);
}

.dockbar-toggle:hover {
    background: rgba(128, 128, 128, 0.2);
    transform: translateY(-8px) scale(1.15);
}

/* Dockbar Search - Completely rewritten for center screen positioning */
.dockbar-search-container {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 10005;
}

.dockbar-search-btn {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.dockbar-search-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    transform: translateY(-8px) scale(1.15);
}

/* Search input wrapper - centered on screen */
.dockbar-search-input-wrapper {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 1rem 3rem 1rem 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.15);
    width: 0;
    max-width: 500px;
    opacity: 0;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    pointer-events: none;
    z-index: 10005;
    min-height: 56px;
    white-space: nowrap;
}

.dockbar-search-input-wrapper.dockbar-search-active {
    width: 500px;
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%);
}

.dockbar-search-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--text-primary);
    width: 100%;
    min-width: 300px;
    line-height: 1.5;
    padding: 0;
}

.dockbar-search-input::placeholder {
    color: var(--text-secondary);
    font-size: 1.6rem;
}

.dockbar-search-close {
    position: absolute;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
}

.dockbar-search-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

/* Dropdown - positioned above search input */
.dockbar-search-dropdown {
    position: fixed;
    top: calc(50% - 200px);
    left: 50%;
    transform: translate(-50%, 0);
    min-width: 400px;
    max-width: 600px;
    max-height: 50vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.15);
    z-index: 10006;
    display: none;
    margin: 0;
    padding: 0;
    margin-bottom: 1rem;
}

.dockbar-search-dropdown::-webkit-scrollbar {
    width: 6px;
}

.dockbar-search-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.dockbar-search-dropdown::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.dockbar-search-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.dockbar-search-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dockbar-search-item:first-child {
    border-radius: 16px 16px 0 0;
}

.dockbar-search-item:last-child {
    border-bottom: none;
    border-radius: 0 0 16px 16px;
}

.dockbar-search-item:hover,
.dockbar-search-item.dockbar-search-active {
    background: rgba(0, 122, 255, 0.1);
}

.dockbar-search-item i {
    font-size: 1.4rem;
    color: var(--mac-blue);
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.dockbar-search-item-content {
    flex: 1;
    min-width: 0;
}

.dockbar-search-item-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.dockbar-search-item-folder {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.dockbar-search-no-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Dockbar hidden state */
.dockbar.dockbar-hidden {
    transform: translateX(-50%) translateY(calc(100% + 20px));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

/* Show dockbar button (when hidden) */
.dockbar-show-button {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-secondary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dockbar-show-button:hover {
    transform: translateX(-50%) translateY(-4px);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    color: var(--mac-blue);
}

/* Finder Folder Modal */
.finder-folder-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        visibility: hidden;
    }
    to {
        visibility: visible;
    }
}

.finder-folder-modal .card {
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
    }
    to {
        transform: translateY(0);
    }
}

.finder-folder-modal .card-body {
    overflow-y: auto;
    flex: 1;
}

.finder-folder-item-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
}

.finder-folder-item-link:hover {
    text-decoration: none !important;
}

.finder-folder-item-link .finder-folder {
}

.finder-folder-item-link:hover .finder-folder {
    transform: translateY(-4px);
    background: rgba(0, 122, 255, 0.1);
}

/* Context Menu */
.finder-context-menu {
    position: fixed;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: var(--mac-shadow-lg);
    border: 1px solid var(--mac-sidebar-border);
    padding: 0.5rem;
    z-index: 10001;
    min-width: 180px;
    display: none;
}

.finder-context-menu.show {
    display: block;
}

.finder-context-menu-item {
    padding: 0.625rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.finder-context-menu-item:hover {
    background: rgba(0, 122, 255, 0.1);
    color: var(--mac-blue);
}

/* Dockbar Context Menu */
.dockbar-context-menu {
    position: fixed;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: var(--mac-shadow-lg);
    border: 1px solid var(--mac-sidebar-border);
    padding: 0.5rem;
    z-index: 10001;
    min-width: 200px;
    display: block;
}

.dockbar-context-menu-item {
    padding: 0.625rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dockbar-context-menu-item:hover {
    background: rgba(255, 59, 48, 0.1);
    color: var(--danger-color);
}

.dockbar-context-menu-item i {
    width: 16px;
    text-align: center;
}

.finder-context-menu-item i {
    width: 16px;
    text-align: center;
}

/* Responsive Dockbar */
@media (max-width: 767.98px) {
    .dockbar {
        bottom: 10px;
        padding: 0.5rem 0.75rem;
        border-radius: 16px;
    }

    .dockbar.dockbar-hidden {
        transform: translateX(-50%) translateY(calc(100% + 10px));
    }

    .dockbar-item {
        width: 48px;
        height: 48px;
        min-width: 48px;
        font-size: 1.25rem;
    }

    .dockbar-show-button {
        bottom: 10px;
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .dockbar-search-input-wrapper {
        padding: 0.75rem 2.5rem 0.75rem 1.25rem;
        min-height: 48px;
    }

    .dockbar-search-input-wrapper.dockbar-search-active {
        width: 320px;
        max-width: 90vw;
    }
    
    .dockbar-search-dropdown {
        position: fixed;
        top: calc(50% - 120px);
        left: 50%;
        transform: translate(-50%, 0);
        min-width: 300px;
        max-width: 90vw;
        max-height: 300px;
        margin: 0;
        padding: 0;
    }

    .dockbar-search-input {
        min-width: 200px;
        font-size: 1.4rem;
    }

    .dockbar-search-input::placeholder {
        font-size: 1.4rem;
    }

    .dockbar-search-close {
        right: 0.75rem;
        font-size: 1rem;
        width: 28px;
        height: 28px;
    }

    .dockbar-search-item {
        padding: 0.875rem 1rem;
        gap: 0.875rem;
    }

    .dockbar-search-item i {
        font-size: 1.2rem;
        width: 24px;
    }

    .dockbar-search-item-name {
        font-size: 1rem;
    }

    .dockbar-search-item-folder {
        font-size: 0.85rem;
    }

    .finder-container {
        bottom: 50px;
    }
    
    .topbar-center {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        max-width: 200px;
        padding: 0 0.5rem;
    }
    
    .topbar-search {
        max-width: 100%;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .finder-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 1rem;
    }

    .finder-folder-icon {
        width: 64px;
        height: 64px;
        font-size: 2.5rem;
    }
}

@media (max-width: 575.98px) {
    .dockbar {
        max-width: 95vw;
    }

    .finder-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.75rem;
    }

    .finder-folder-icon {
        width: 56px;
        height: 56px;
        font-size: 2rem;
    }
}

/* Prevent empty validation/alert boxes from rendering */
.validation-summary-valid,
.field-validation-valid {
    display: none !important;
}

.alert:empty {
    display: none !important;
}
