:root {
    --foc-primary: #3b82f6;
    --foc-primary-hover: #2563eb;
    --foc-bg: #f8fafc;
    --foc-sidebar: #0f172a;
    --foc-sidebar-hover: #1e293b;
    --foc-text: #1e293b;
    --foc-text-muted: #64748b;
    --foc-white: #ffffff;
    --foc-border: #e2e8f0;
    --foc-radius: 12px;
    --foc-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.foculuss-dashboard-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 80vh;
    background: var(--foc-bg);
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--foc-text);
    border-radius: var(--foc-radius);
    overflow: hidden;
    box-shadow: var(--foc-shadow);
}

.foculuss-sidebar {
    background: var(--foc-sidebar);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.sidebar-header h3 {
    color: var(--foc-white);
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 2rem;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header h3::before {
    content: '';
    width: 12px;
    height: 12px;
    background: var(--foc-primary);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--foc-primary);
}

.foculuss-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.foculuss-sidebar ul li {
    margin-bottom: 0.5rem;
}

.foculuss-sidebar ul li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.foculuss-sidebar ul li a:hover {
    background: var(--foc-sidebar-hover);
    color: var(--foc-white);
}

.foculuss-sidebar ul li a.active {
    background: var(--foc-primary);
    color: var(--foc-white);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.foculuss-main {
    padding: 2.5rem;
    background: var(--foc-bg);
    overflow-y: auto;
}

.main-header {
    margin-bottom: 2.5rem;
}

.main-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--foc-text);
    margin: 0;
    letter-spacing: -0.025em;
}

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

.stat-card {
    background: var(--foc-white);
    padding: 1.5rem;
    border-radius: var(--foc-radius);
    box-shadow: var(--foc-shadow);
    border: 1px solid var(--foc-border);
    transition: transform 0.2s ease;
}

.stat-card:hover { transform: translateY(-4px); }

.stat-card h4 {
    margin: 0;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--foc-text-muted);
}

.stat-card .number {
    display: block;
    font-size: 2.25rem;
    font-weight: 800;
    margin-top: 0.5rem;
    color: var(--foc-primary);
}

.foculuss-table-wrapper {
    background: var(--foc-white);
    border-radius: var(--foc-radius);
    border: 1px solid var(--foc-border);
    box-shadow: var(--foc-shadow);
    overflow: hidden;
}

.foculuss-table { width: 100%; border-collapse: collapse; }

.foculuss-table th {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--foc-text-muted);
    border-bottom: 1px solid var(--foc-border);
}

.foculuss-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--foc-border);
    font-size: 0.875rem;
}

.foculuss-card {
    background: var(--foc-white);
    padding: 2rem;
    border-radius: var(--foc-radius);
    box-shadow: var(--foc-shadow);
    border: 1px solid var(--foc-border);
}

.form-group label {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--foc-text);
}

.form-group input, .form-group select, .form-group textarea {
    background: #f1f5f9;
    border: 1px solid transparent;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    width: 100%;
    transition: all 0.2s;
}

.form-group input:focus {
    background: var(--foc-white);
    border-color: var(--foc-primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    outline: none;
}

.btn-primary {
    background: var(--foc-primary);
    color: var(--foc-white);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.notice {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.notice.success { background: #dcfce7; color: #166534; }
.notice.error { background: #fee2e2; color: #991b1b; }

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #166534; }

@media (max-width: 1024px) {
    .foculuss-dashboard-wrapper { grid-template-columns: 1fr; }
    .foculuss-sidebar { display: none; }
}

/* Top Header Bar */
.foculuss-top-bar {
    background: var(--foc-white);
    padding: 1rem 2.5rem;
    border-bottom: 1px solid var(--foc-border);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.user-profile-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile-nav .user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--foc-text);
}

.user-profile-nav .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--foc-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    overflow: hidden;
    border: 2px solid var(--foc-border);
}

.user-profile-nav .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Custom Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--foc-primary) 0%, #2563eb 100%);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(255,255,255,0.1);
    letter-spacing: 0.01em;
}

.btn-primary:hover {
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

/* Profile Form Specifics */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Notification badge */
.nav-badge {
    background: #ef4444;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 800;
}

/* Charts container */
.chart-container {
    background: white;
    padding: 2rem;
    border-radius: var(--foc-radius);
    border: 1px solid var(--foc-border);
    box-shadow: var(--foc-shadow);
    margin-bottom: 2rem;
}

/* Search bar */
.search-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}
.search-wrapper input {
    padding-left: 40px !important;
}
.search-wrapper .dashicons {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--foc-text-muted);
}

/* Full Height Layout */
body, html { height: 100%; margin: 0; }
.foculuss-dashboard-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh; /* Full screen height */
    max-height: 100vh;
    border-radius: 0; /* Full screen looks better without corner radius */
}

.foculuss-main {
    flex: 1;
    overflow-y: auto;
    height: calc(100vh - 72px); /* Subtract top bar height */
}

/* Dark Mode Support */
.dark-mode {
    --foc-bg: #0f172a;
    --foc-white: #1e293b;
    --foc-text: #f8fafc;
    --foc-text-muted: #94a3b8;
    --foc-border: #334155;
}
.dark-mode .foculuss-top-bar { background: #1e293b; border-bottom-color: #334155; }
.dark-mode .stat-card { background: #1e293b; }
.dark-mode .foculuss-card { background: #1e293b; }
.dark-mode .foculuss-table th { background: #334155; color: #f8fafc; }
.dark-mode .foculuss-table td { color: #cbd5e1; }
.dark-mode .form-group input { background: #0f172a; color: white; }

/* Activity Feed */
.activity-feed { list-style: none; padding: 0; }
.activity-item { 
    padding: 12px 0; 
    border-left: 2px solid var(--foc-primary); 
    padding-left: 15px; 
    margin-bottom: 15px; 
    position: relative;
}
.activity-item::before {
    content: ''; width: 8px; height: 8px; background: var(--foc-primary); 
    border-radius: 50%; position: absolute; left: -5px; top: 18px;
}

/* File Upload */
.upload-area {
    border: 2px dashed var(--foc-border);
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.upload-area:hover { border-color: var(--foc-primary); background: rgba(59, 130, 246, 0.05); }

/* Skeleton */
.skeleton { background: #e2e8f0; animation: pulse 1.5s infinite; border-radius: 4px; }
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

/* Sidebar gap */
.foculuss-sidebar ul li a span.dashicons {
    margin-right: 18px !important;
    font-size: 20px;
}

/* Modern Table */
.foculuss-table {
    border: none;
    border-radius: 12px;
}
.foculuss-table th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    padding: 16px 20px;
    letter-spacing: 0.05em;
}
.foculuss-table td {
    padding: 18px 20px;
    border-bottom: 1px solid #f1f5f9;
}
.foculuss-table tr:hover td {
    background: #fcfdfe;
}

/* Auth Page Modernization */
.foculuss-auth-container {
    background: radial-gradient(circle at top right, #3b82f6 0%, #1e3a8a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.foculuss-auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.foculuss-tabs {
    background: #f1f5f9;
    padding: 6px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
}
.foculuss-tabs button {
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    transition: all 0.3s;
}
.foculuss-tabs button.active {
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    color: var(--foc-primary);
}

/* Knowledge Base Cards */
.kb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.kb-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--foc-shadow);
    transition: all 0.3s;
    border: 1px solid var(--foc-border);
}
.kb-card:hover { transform: translateY(-5px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }
.kb-thumb { height: 160px; background: #e2e8f0; display: flex; align-items: center; justify-content: center; color: #94a3b8; }
.kb-content { padding: 20px; }

/* Mobile Fixes */
@media (max-width: 1024px) {
    .foculuss-dashboard-wrapper {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
    }
    .foculuss-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s ease;
        display: flex !important; /* Show when active */
    }
    .foculuss-sidebar.mobile-open {
        left: 0;
    }
    .foculuss-main {
        padding: 1.5rem;
        height: auto;
        overflow: visible;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .chart-container, .foculuss-card {
        grid-column: span 2;
    }
    /* Grid system fix for mobile */
    div[style*="display: grid"] {
        grid-template-columns: 1fr !important;
    }
}

.mobile-menu-toggle {
    display: none;
    background: var(--foc-sidebar);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
}

@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: block;
    }
    .foculuss-top-bar {
        padding: 1rem;
    }
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}
.sidebar-overlay.active { display: block; }

/* Modal Background Blur and Darken */
[x-show="showForm"] {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

[x-show="showForm"]::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7); /* Slate 900 with opacity */
    backdrop-filter: blur(8px);
    z-index: -1;
}

/* Ensure the form card is above the blur */
[x-show="showForm"] .foculuss-card {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Close button for modals */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
    color: var(--foc-text-muted);
}
