/**
 * Dashboard Layout Styles
 * @version 2.0.0
 * @last_updated 2026-04-06
 */

/* ============================================
   CSS RESET & BASE VARIABLES
   ============================================ */

:root {
    --ink-deep: #0F172A;
    --ink-main: #1E3A8A;
    --ink-light: #E5E7EB;
    --accent-warm: #F97316;
    --accent-soft: #FEF3C7;
    --accent-soft-blue: #DBEAFE;
    --bg: #F9FAFB;
    --bg-soft: #EFF6FF;
    --surface: #FFFFFF;
    --surface-soft: #F3F4F6;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-pill: 999px;
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-medium: 0 16px 40px rgba(15, 23, 42, 0.12);
    --transition: all 0.25s ease;
    --gradient-primary: linear-gradient(135deg, #1E3A8A 0%, #0EA5E9 55%, #22C55E 100%);
    --nav-brand-primary: #6366F1;
    --nav-brand-secondary: #8B5CF6;
    --error: #B91C1C;
    --error-bg: #FEF2F2;
    --sidebar-width: 260px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg);
    overflow-x: hidden;
}

/* ============================================
   LAYOUT
   ============================================ */

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition);
    overflow-y: auto;
}

/* Sidebar Header / Logo */
.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sidebar-logo-badge {
    width: 32px;
    height: 32px;
    border-radius: 14px;
    background: radial-gradient(circle at 20% 0, #FFFFFF 0, #4F46E5 40%, #1E293B 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.35), 0 12px 28px rgba(37, 99, 235, 0.5);
}

.sidebar-logo-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--nav-brand-primary), var(--nav-brand-secondary));
}

.sidebar-logo-text {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.02em;
    color: var(--text-main);
}

.sidebar-logo-text span:last-child {
    color: var(--nav-brand-secondary);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
}

.sidebar-nav-section {
    margin-bottom: 24px;
}

.sidebar-nav-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding: 0 12px;
    font-weight: 600;
}

.sidebar-nav-menu {
    list-style: none;
}

.sidebar-nav-menu li {
    margin-bottom: 4px;
}

.sidebar-nav-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    transition: var(--transition);
}

.sidebar-nav-menu li a i {
    width: 20px;
    font-size: 16px;
    text-align: center;
}

.sidebar-nav-menu li a:hover {
    background-color: var(--bg-soft);
    color: var(--ink-main);
}

.sidebar-nav-menu li a.active {
    background: linear-gradient(135deg, var(--nav-brand-primary), var(--nav-brand-secondary));
    color: white;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid var(--border);
}

/* Upgrade Card */
.upgrade-card {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    color: #E5E7EB;
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 16px;
}

.upgrade-card h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.upgrade-card p {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 12px;
}

.upgrade-card .btn-upgrade {
    width: 100%;
    padding: 8px;
    border-radius: var(--radius-pill);
    border: none;
    background: #FFFFFF;
    color: #0F172A;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.upgrade-card .btn-upgrade:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* User Info in Sidebar */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-soft);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.user-email {
    font-size: 11px;
    color: var(--text-muted);
}

/* Plan Badge */
.user-plan-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    margin-top: 4px;
}

.plan-free { background: #e5e7eb; color: #374151; }
.plan-starter { background: #e0e7ff; color: #4338ca; }
.plan-pro { background: #dbeafe; color: #1e40af; }
.plan-business { background: #fef3c7; color: #92400e; }
.plan-enterprise { background: #d1fae5; color: #065f46; }

/* Logout Link */
.logout-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    color: var(--error);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    transition: var(--transition);
}

.logout-link:hover {
    background: #FEE2E2;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* Page Container */
.page-container {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Footer */
.dashboard-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 16px 32px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   MOBILE & RESPONSIVE
   ============================================ */

/* Mobile Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 200;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

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

    .main-content {
        margin-left: 0;
    }

    .page-container {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .page-container {
        padding: 16px;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--border);
}

::-webkit-scrollbar-thumb {
    background: var(--ink-main);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--nav-brand-primary);
}