/* Design System and Palette */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    /* Elegant Dark Slate & Indigo Palette */
    --bg-main: #0b0f19;
    --bg-sidebar: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --border-glass: rgba(255, 255, 255, 0.06);
    --border-glass-hover: rgba(255, 255, 255, 0.15);
    
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --primary-hover: #4f46e5;
    --secondary: #a855f7;
    --secondary-glow: rgba(168, 85, 247, 0.25);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --color-oem: #10b981;
    --color-distributor: #3b82f6;
    --color-alert: #ef4444;
    --color-warning: #f59e0b;
    
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Layout framework */
.app-container {
    display: flex;
    width: 100vw;
    min-height: 100vh;
}

/* Sidebar navigation */
@keyframes pulseGlow {
    from {
        box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
        border-color: rgba(255, 255, 255, 0.1);
    }
    to {
        box-shadow: 0 0 25px rgba(99, 102, 241, 0.5);
        border-color: rgba(99, 102, 241, 0.55);
    }
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.7) 0%, rgba(30, 41, 59, 0.3) 100%);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 2.75rem;
    padding-left: 0.5rem;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: white;
    font-size: 1.3rem;
    animation: pulseGlow 3s infinite alternate ease-in-out;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-grow: 1;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.15rem;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.88rem;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.nav-item a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-item.active a::before, .nav-item a:hover::before {
    transform: scaleY(1);
}

.nav-item a:hover, .nav-item.active a {
    color: white;
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.15);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.06);
    transform: translateX(4px);
}

.nav-item a span {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.nav-item a:hover span {
    transform: scale(1.2) rotate(4deg);
}

.nav-item.active a {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.25);
}

/* Category navigation items specific styling */
.category-item a::before {
    background: var(--secondary) !important;
}

.category-item a:hover, .category-item.active a {
    background: rgba(168, 85, 247, 0.08);
    border-color: rgba(168, 85, 247, 0.15);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.06);
}

.category-item.active a {
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.25);
}

.sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 700;
    margin-top: 2.25rem;
    margin-bottom: 0.85rem;
    letter-spacing: 0.1em;
    padding-left: 1rem;
    font-family: var(--font-heading);
}

.sidebar-section-title::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(99, 102, 241, 0.25), transparent);
    margin-left: 0.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    margin-top: auto;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

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

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

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

/* Main Content Area */
.main-content {
    flex-grow: 1;
    padding: 2.5rem;
    overflow-y: auto;
    max-height: 100vh;
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(to right, #ffffff, #a5b4fc, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Dashboard statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    box-shadow: var(--card-shadow);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glass-hover);
    box-shadow: 0 12px 40px 0 rgba(99, 102, 241, 0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Glass Cards general */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0.5;
}

.glass-card.no-border-top::before {
    display: none;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, var(--primary-hover), var(--secondary));
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-glass-hover);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Partner Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-oem {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-oem);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-distributor {
    background: rgba(59, 130, 246, 0.15);
    color: var(--color-distributor);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-approved {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-oem);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Contacts grid */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.contact-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
}

.contact-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.15);
}

.contact-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.contact-company {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.contact-name {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.contact-detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.75rem;
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #1e293b;
    border: 1px solid var(--border-glass-hover);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: modalSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: none;
}

.modal-close:hover {
    color: white;
}

/* Forms styling */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: white;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
    background: rgba(15, 23, 42, 0.8);
}

select.form-control {
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Search Bar layout */
.search-bar-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
}

.search-input-wrapper .form-control {
    padding-left: 2.75rem;
    border-radius: 12px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Table styling for interactions & users */
.custom-table-container {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    padding: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.custom-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.9rem;
    color: var(--text-primary);
}

.custom-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.01);
}

/* OEM Detail Page layout */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 992px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

.card-media-container {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.card-img-wrapper {
    flex: 1;
    aspect-ratio: 16/9;
    border: 1px dashed var(--border-glass-hover);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.01);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.card-img-wrapper:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.03);
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-img-placeholder {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

/* Portfolio items lists */
.portfolio-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .portfolio-section {
        grid-template-columns: 1fr;
    }
}

.portfolio-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.portfolio-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.portfolio-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.item-delete-btn {
    color: var(--color-alert);
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
}

.item-delete-btn:hover {
    opacity: 1;
}

/* Scrape status panel */
.scrape-meta {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.scrape-status-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    margin-top: 0.5rem;
}

.scrape-status-message.success {
    border-left: 3px solid var(--color-oem);
}

.scrape-status-message.partial {
    border-left: 3px solid var(--color-warning);
}

/* Auth Pages Layout */
.auth-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1e1b4b 0%, #0b0f19 70%);
    padding: 1rem;
}

.auth-card {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    animation: modalSlide 0.4s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.alert-message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Spinner loader */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

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

.loading-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-bullet-list {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    list-style-type: square;
}

.custom-bullet-list li {
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

/* Mobile Responsive Style Updates */
.mobile-toggle-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.75rem;
    color: white;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: var(--transition);
}

.mobile-toggle-btn:hover {
    color: var(--primary);
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        padding: 1.25rem 1.5rem;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        border-right: none;
        border-bottom: 1px solid var(--border-glass);
        gap: 0;
    }
    
    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .mobile-toggle-btn {
        display: block;
    }
    
    .nav-container {
        display: none;
        width: 100%;
        margin-top: 1rem;
        animation: slideDown 0.3s ease-out;
    }
    
    .user-profile {
        display: none;
        width: 100%;
        margin-top: 1.25rem;
        animation: slideDown 0.3s ease-out;
    }
    
    /* Show menu items when sidebar is open */
    .sidebar.menu-open .nav-container {
        display: block;
    }
    
    .sidebar.menu-open .user-profile {
        display: flex;
    }
    
    .main-content {
        padding: 1.5rem 1.25rem;
        max-height: none;
        overflow-y: visible;
    }
    
    .header-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .header-bar .btn {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .contacts-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .search-bar-container {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch !important;
    }
    
    .search-bar-container div,
    .search-bar-container button,
    .search-bar-container select {
        width: 100% !important;
        justify-content: center;
    }
    
    .visiting-card-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .modal-content {
        padding: 1.5rem 1.25rem;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard Two-Column Grid Layout */
.dashboard-layout-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 992px) {
    .dashboard-layout-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Page Entrance Staggered Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contact-card {
    animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Hover Zoom effects for tactical engagement */
.contact-card:hover {
    transform: translateY(-4px) scale(1.015);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 15px rgba(99, 102, 241, 0.15);
    border-color: var(--border-glass-hover);
}

/* Progress Bar Overlay Styling */
.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    font-family: var(--font-heading);
}

.progress-container {
    width: 320px;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-glass);
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    box-shadow: 0 0 14px var(--primary);
    border-radius: 6px;
    transition: width 0.1s ease-out;
}

.progress-title {
    font-weight: 800;
    font-size: 1.4rem;
    color: white;
    letter-spacing: -0.02em;
}

.progress-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ==========================================
   PORTAL PERSONALIZATION THEMES
   ========================================== */

/* Slate Dark (Default Theme) */
body.theme-slate-dark {
    --bg-main: #0b0f19;
    --bg-sidebar: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --border-glass: rgba(255, 255, 255, 0.06);
    --border-glass-hover: rgba(255, 255, 255, 0.15);
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --primary-hover: #4f46e5;
    --secondary: #a855f7;
    --secondary-glow: rgba(168, 85, 247, 0.25);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
}

/* Cyberpunk Neon */
body.theme-cyberpunk {
    --bg-main: #080210;
    --bg-sidebar: #130324;
    --bg-card: rgba(26, 6, 48, 0.75);
    --border-glass: rgba(255, 0, 128, 0.12);
    --border-glass-hover: rgba(0, 242, 254, 0.3);
    --primary: #ff007f; /* Neon Hot Pink */
    --primary-glow: rgba(255, 0, 127, 0.4);
    --primary-hover: #e6006f;
    --secondary: #00f2fe; /* Cyan */
    --secondary-glow: rgba(0, 242, 254, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #ffb3d9;
    --text-muted: #8c73a6;
}

/* Emerald Forest */
body.theme-forest {
    --bg-main: #06100a;
    --bg-sidebar: #0b1c12;
    --bg-card: rgba(13, 34, 22, 0.7);
    --border-glass: rgba(16, 185, 129, 0.1);
    --border-glass-hover: rgba(16, 185, 129, 0.25);
    --primary: #10b981; /* Emerald Green */
    --primary-glow: rgba(16, 185, 129, 0.35);
    --primary-hover: #059669;
    --secondary: #34d399;
    --secondary-glow: rgba(52, 211, 153, 0.25);
    --text-primary: #ecfdf5;
    --text-secondary: #a7f3d0;
    --text-muted: #6b7280;
}

/* Ocean Breeze */
body.theme-ocean {
    --bg-main: #04101a;
    --bg-sidebar: #091c2e;
    --bg-card: rgba(9, 28, 46, 0.7);
    --border-glass: rgba(56, 189, 248, 0.08);
    --border-glass-hover: rgba(56, 189, 248, 0.2);
    --primary: #0ea5e9; /* Sky Blue */
    --primary-glow: rgba(14, 165, 233, 0.35);
    --primary-hover: #0284c7;
    --secondary: #38bdf8;
    --secondary-glow: rgba(56, 189, 248, 0.2);
    --text-primary: #f0f9ff;
    --text-secondary: #bae6fd;
    --text-muted: #4b5563;
}

/* Sunset Orange */
body.theme-sunset {
    --bg-main: #100a08;
    --bg-sidebar: #1a100d;
    --bg-card: rgba(26, 16, 13, 0.75);
    --border-glass: rgba(249, 115, 22, 0.1);
    --border-glass-hover: rgba(249, 115, 22, 0.25);
    --primary: #f97316; /* Intense Orange */
    --primary-glow: rgba(249, 115, 22, 0.35);
    --primary-hover: #ea580c;
    --secondary: #fb923c;
    --secondary-glow: rgba(251, 146, 60, 0.25);
    --text-primary: #fff7ed;
    --text-secondary: #fed7aa;
    --text-muted: #78716c;
}

/* Classic Light */
body.theme-light {
    --bg-main: #f1f5f9;
    --bg-sidebar: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.75);
    --border-glass: rgba(15, 23, 42, 0.08);
    --border-glass-hover: rgba(15, 23, 42, 0.15);
    --primary: #4f46e5;
    --primary-glow: rgba(79, 70, 229, 0.15);
    --primary-hover: #3730a3;
    --secondary: #7c3aed;
    --secondary-glow: rgba(124, 58, 237, 0.15);
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --card-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}

body.theme-light .sidebar-title {
    color: var(--primary);
}

body.theme-light .category-badge,
body.theme-light .btn-secondary {
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-primary);
    border-color: rgba(15, 23, 42, 0.08);
}

body.theme-light .modal-content {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
    color: var(--text-primary);
}

body.theme-light .form-control {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.1);
    color: var(--text-primary);
}

body.theme-light .form-control:focus {
    background: #ffffff;
}

body.theme-light .contact-card {
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
}

body.theme-light .logo-text {
    background: linear-gradient(to right, var(--primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.theme-light .page-title {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.theme-light .contact-company {
    color: var(--text-primary);
}

body.theme-light .nav-item a:hover,
body.theme-light .nav-item.active a {
    color: var(--primary);
    background-color: rgba(79, 70, 229, 0.08);
}

body.theme-light .custom-table th {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

body.theme-light .custom-table td {
    border-bottom-color: rgba(15, 23, 42, 0.04);
}

/* ==========================================
   PAGE LOADING OVERLAY & KEYFRAMES
   ========================================== */

#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0b0f19;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

body.theme-light #page-loader {
    background-color: #f1f5f9;
}

.loader-logo {
    font-size: 2.4rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: white;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
    animation: pulse 1.8s ease-in-out infinite;
}

.loader-bar-container {
    width: 240px;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

body.theme-light .loader-bar-container {
    background: rgba(15, 23, 42, 0.08);
}

.loader-bar {
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 10px;
    position: absolute;
    left: -50%;
    animation: loader-anim 1.5s infinite ease-in-out;
}

@keyframes loader-anim {
    0% { left: -50%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.05); opacity: 1; }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUpCard {
    from {
        opacity: 0;
        transform: translateY(35px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: slideInUpCard 0.6s cubic-bezier(0.16, 1, 0.3, 1) both !important;
}

.dashboard-layout-grid, .detail-grid, .admin-card {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ==========================================
   COLLAPSED ACCORDION CATEGORIES DIRECTORY
   ========================================== */

.category-group {
    background: rgba(30, 41, 59, 0.35);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    margin-bottom: 1.25rem;
    overflow: hidden;
    transition: var(--transition);
}

body.theme-light .category-group {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.06);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.02);
}

.category-group:hover {
    border-color: var(--primary-glow);
    background: rgba(30, 41, 59, 0.45);
}

body.theme-light .category-group:hover {
    border-color: rgba(79, 70, 229, 0.2);
    background: #ffffff;
}

.category-header {
    padding: 1.15rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    background: rgba(15, 23, 42, 0.25);
    transition: var(--transition);
}

body.theme-light .category-header {
    background: #f8fafc;
}

.category-header:hover {
    background: rgba(15, 23, 42, 0.4);
}

body.theme-light .category-header:hover {
    background: #f1f5f9;
}

.category-icon {
    font-size: 1.25rem;
}

.category-name {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.category-count {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.25);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    margin-left: 0.5rem;
}

body.theme-light .category-count {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
    border-color: rgba(79, 70, 229, 0.15);
}

.accordion-arrow {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.category-group.expanded .accordion-arrow {
    transform: rotate(180deg);
}

.category-content {
    display: none;
    padding: 1.5rem;
    background: transparent;
    border-top: 1px solid var(--border-glass);
    animation: slideDown 0.3s ease-out forwards;
}

body.theme-light .category-content {
    border-color: rgba(15, 23, 42, 0.04);
}

.category-group.expanded .category-content {
    display: block;
}

/* Single Column Override */
.dashboard-layout-grid.layout-single-column {
    grid-template-columns: 1fr !important;
}

/* Card Deletion Badge Overlay */
.card-media-delete-overlay {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(239, 68, 68, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--transition);
}

.card-media-delete-overlay:hover {
    background: #dc2626;
    transform: scale(1.05);
}

#actions-dropdown-menu .btn {
    transition: background 0.2s ease, color 0.2s ease;
}
#actions-dropdown-menu .btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--primary) !important;
}



