@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
    --bg-main: #f8fafc;
    --bg-white: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    
    --success: #10b981;
    --success-light: #d1fae5;
    
    --danger: #ef4444;
    --warning: #f59e0b;
    --purple: #8b5cf6;
    
    --border: #e2e8f0;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: var(--primary);
}

/* Utilities */
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* =========================================================
   LUXURY SIDEBAR DESIGN SYSTEM
   ========================================================= */
.sidebar {
    width: 270px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 40;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.02);
}

.sidebar-header {
    height: 76px;
    display: flex;
    align-items: center;
    padding: 0 22px;
    border-bottom: 1px solid #f1f5f9;
}

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

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 6px 16px -2px rgba(37, 99, 235, 0.35);
    transition: transform 0.2s ease;
}

.brand-logo:hover .brand-icon {
    transform: scale(1.05);
}

.brand-text-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 1.25rem;
    color: #0f172a;
    letter-spacing: -0.5px;
}

.brand-badge-tag {
    font-size: 0.65rem;
    font-weight: 800;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

/* Operator Mini Hub Card */
.user-profile-widget {
    margin: 16px 14px 10px 14px;
    padding: 14px;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    border-radius: 16px;
    color: #ffffff;
    box-shadow: 0 10px 20px -5px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-profile-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px -5px rgba(15, 23, 42, 0.35);
}

.user-avatar-ring {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.avatar-online-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border: 2px solid #0f172a;
    border-radius: 50%;
}

.user-profile-widget .name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 2px;
}

.profile-tier-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    color: #60a5fa;
}

.profile-validity-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pulse-green-beacon {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 8px #34d399;
    display: inline-block;
}

/* Navigation Menu */
.sidebar-nav {
    flex: 1;
    padding: 6px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-section-label {
    font-size: 0.66rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    padding: 8px 12px 2px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #475569;
    font-weight: 600;
    font-size: 0.92rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    position: relative;
}

.nav-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #64748b;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.nav-icon-box svg {
    width: 18px;
    height: 18px;
}

.nav-label {
    flex: 1;
}

.nav-pill-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 8px;
    letter-spacing: 0.3px;
}

.nav-pill-badge.blue {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.nav-pill-badge.green {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.nav-pill-badge.amber {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

/* Nav Item Hover & Active States */
.nav-item:hover {
    background: #f8fafc;
    color: #0f172a;
    transform: translateX(4px);
}

.nav-item:hover .nav-icon-box {
    background: #f1f5f9;
    color: #2563eb;
}

.nav-item.active {
    background: linear-gradient(90deg, #eff6ff 0%, #f8fafc 100%);
    color: #1d4ed8;
    font-weight: 700;
    box-shadow: inset 3px 0 0 #2563eb;
}

.nav-item.active .nav-icon-box {
    background: #dbeafe;
    color: #2563eb;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 10px 14px 14px 14px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.engine-status-widget {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
}

.engine-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
    flex-shrink: 0;
}

.btn-logout {
    width: 100%;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #dc2626;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
    box-shadow: 0 6px 16px -2px rgba(220, 38, 38, 0.35);
    transform: translateY(-1px);
}

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

/* Top Header */
.top-header {
    height: 72px;
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.credit-badge {
    background-color: var(--success-light);
    color: #047857;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-muted);
}

/* Page Content */
.page-container {
    padding: 32px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Cards */
.card {
    background-color: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, #1e3a8a, #312e81);
    border-radius: var(--radius-lg);
    padding: 40px;
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}

.welcome-banner h2 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.welcome-banner p {
    color: #cbd5e1;
    max-width: 600px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-outline:hover {
    background-color: var(--primary-light);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.stat-icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Services Grid */
.section-header {
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 800;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.service-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.service-price-tag {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 12px;
    border-bottom-left-radius: var(--radius-md);
}

.service-card.green .service-price-tag { background-color: var(--success); }
.service-card.purple .service-price-tag { background-color: var(--purple); }
.service-card.orange .service-price-tag { background-color: var(--warning); }

.service-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
}

.service-card.blue .service-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.service-card.purple .service-icon { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.service-card.green .service-icon { background: linear-gradient(135deg, #10b981, #059669); }
.service-card.orange .service-icon { background: linear-gradient(135deg, #f97316, #ea580c); }
.service-card.teal .service-icon { background: linear-gradient(135deg, #14b8a6, #0f766e); }

.service-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}

.service-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Split Auth Layout */
.auth-layout {
    display: flex;
    min-height: 100vh;
}

.auth-left {
    flex: 1;
    background: linear-gradient(135deg, #1e3a8a, #172554);
    color: white;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-right {
    flex: 1;
    background-color: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.auth-form-container {
    width: 100%;
    max-width: 400px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .auth-layout {
        flex-direction: column;
    }
    .auth-left {
        padding: 32px 20px 24px 20px;
    }
    .auth-left h1 {
        font-size: 1.6rem !important;
    }
    .auth-left p {
        font-size: 0.9rem !important;
        margin-bottom: 20px !important;
    }
    .auth-right {
        padding: 28px 16px 40px 16px;
    }
}

/* Document Tabs */
.doc-tab-btn {
    color: var(--text-muted);
    background: transparent;
    transition: var(--transition);
}
.doc-tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Password Input & Error Box Enhancements */
.form-input.is-invalid {
    border-color: #ef4444 !important;
    background-color: #fff5f5 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-6px); }
    30%, 60%, 90% { transform: translateX(6px); }
}

.shake-animation {
    animation: inputShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.password-error-card {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1.5px solid #f87171;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.12);
    animation: fadeIn 0.3s ease-out;
}

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

