/* ============================================================
   PDFjin – User Dashboard (v2.0 Sync)
   Synced with Admin Control Panel aesthetics
   ============================================================ */

:root {
    --das-sidebar-w: 240px;
    --das-bg: #f1f5f9;
    --das-card: #ffffff;
    --das-sidebar: #0f172a;
    --das-sidebar2: #1e293b;
    --das-primary: #6366f1;
    --das-primary-hover: #4f46e5;
    --das-text: #1e293b;
    --das-muted: #64748b;
    --das-border: #e2e8f0;
    --das-radius: 14px;
    --das-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.dash-isolated {
    background-color: var(--das-bg);
    color: var(--das-text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* --- Layout --- */
.isolated-sidebar {
    width: var(--das-sidebar-w);
    background: var(--das-sidebar);
    color: white;
    height: 100vh;
    position: fixed;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    transition: var(--transition);
}

.isolated-main {
    margin-left: var(--das-sidebar-w);
    flex: 1;
    padding: 2.5rem;
    min-height: 100vh;
    width: 100%;
}

/* --- Sidebar Components --- */
.sidebar-header {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-logo span {
    color: var(--das-primary);
}

.sidebar-panel-label {
    font-size: 0.65rem;
    color: #475569;
    letter-spacing: 0.15em;
    margin-top: 6px;
    font-weight: 700;
    text-transform: uppercase;
}

.sidebar-nav {
    padding: 12px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    border-left: 3px solid transparent;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    opacity: 0.7;
}

.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
    color: white;
    background: rgba(99, 102, 241, 0.12);
    border-left-color: var(--das-primary);
}

.nav-item.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.1);
}

.user-profile-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.user-thumb {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--das-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-plan {
    font-size: 0.75rem;
    color: #94a3b8;
}

.btn-sidebar-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* --- Header --- */
.isolated-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--das-border);
}

.search-bar {
    background: white;
    border: 1.5px solid var(--das-border);
    border-radius: 12px;
    padding: 10px 16px;
    width: 320px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--das-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.9rem;
    width: 100%;
    color: var(--das-text);
}

.btn-premium {
    background: var(--das-primary);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.2);
}

.btn-premium:hover {
    background: var(--das-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

/* --- Content sections --- */
.welcome-msg h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--das-text);
}

.welcome-msg p {
    color: var(--das-muted);
    margin-bottom: 2rem;
}

/* --- Stats Bar --- */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 2.5rem;
}

.mini-stat {
    background: white;
    padding: 20px;
    border-radius: var(--das-radius);
    border: 1px solid var(--das-border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--das-shadow);
}

.mini-stat .label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--das-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mini-stat .value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--das-text);
}

/* --- Cards --- */
.isolated-card {
    background: white;
    border: 1px solid var(--das-border);
    border-radius: var(--das-radius);
    padding: 24px;
    box-shadow: var(--das-shadow);
    margin-bottom: 24px;
}

.section-title h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--das-text);
    margin-bottom: 20px;
}

/* --- Tools Grid --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .isolated-sidebar {
        width: 80px;
    }

    .isolated-sidebar .sidebar-panel-label,
    .isolated-sidebar .sidebar-logo span:last-child,
    .isolated-sidebar .user-info,
    .isolated-sidebar .btn-sidebar-logout span {
        display: none;
    }

    .isolated-sidebar .nav-item {
        justify-content: center;
        padding: 15px;
        border-left: none;
    }

    .isolated-sidebar .nav-item.active {
        background: rgba(99, 102, 241, 0.2);
    }

    .isolated-main {
        margin-left: 80px;
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .stats-bar {
        grid-template-columns: 1fr;
    }

    .isolated-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .search-bar {
        width: 100%;
    }
}

/* --- Auth/Logout Specifics --- */
.logout-link-simple {
    display: none;
    /* We use the sidebar logout now */
}

/* --- Existing Hover Effects Sync --- */
.dash-isolated .service-card {
    transition: var(--transition);
    border: 1px solid var(--das-border);
    background: white;
    border-radius: 12px;
}

.dash-isolated .service-card:hover {
    border-color: var(--das-primary) !important;
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06) !important;
}

.dash-isolated .service-card:hover .card-icon-wrap {
    background: rgba(99, 102, 241, 0.1) !important;
}

.dash-isolated .service-card:hover .card-arrow {
    color: var(--das-primary) !important;
    opacity: 1 !important;
    transform: translateX(3px) !important;
}