@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ==========================================
   Theme Variables System
   ========================================== */

/* Light Mode (Default Theme) */
:root {
    --bg-dark: #f8fafc;
    --bg-gradient-1: rgba(99, 102, 241, 0.04);
    --bg-gradient-2: rgba(6, 182, 212, 0.04);
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(15, 23, 42, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --cyan-500: #0891b2;
    --cyan-400: #06b6d4;
    --cyan-glow: rgba(8, 145, 178, 0.12);
    --indigo-500: #4f46e5;
    --indigo-glow: rgba(79, 70, 229, 0.12);
    --success-500: #059669;
    --warning-500: #d97706;
    --danger-500: #dc2626;
    
    --sidebar-bg: rgba(241, 245, 249, 0.85);
    --sidebar-border: rgba(15, 23, 42, 0.06);
    --modal-overlay-bg: rgba(15, 23, 42, 0.3);
    --shadow-premium: 0 10px 30px -10px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.03);
    --input-bg: rgba(15, 23, 42, 0.04);
    --modal-bg: #ffffff;
    
    --header-bg: rgba(255, 255, 255, 0.45);
    --header-border: rgba(15, 23, 42, 0.06);
    --logo-gradient: linear-gradient(to right, #0f172a, #334155);

    --hover-bg: rgba(15, 23, 42, 0.04);
    --hover-border: rgba(15, 23, 42, 0.06);
    --menu-active-color: var(--cyan-500);
    --menu-active-bg: rgba(8, 145, 178, 0.08);
    --menu-active-border: rgba(8, 145, 178, 0.2);

    /* Plan Badges Theme Colors */
    --plan-a-bg: rgba(100, 116, 139, 0.08);
    --plan-a-color: #475569;
    --plan-a-border: rgba(100, 116, 139, 0.2);

    --plan-b-bg: rgba(8, 145, 178, 0.08);
    --plan-b-color: #0891b2;
    --plan-b-border: rgba(8, 145, 178, 0.2);

    --plan-c-bg: rgba(79, 70, 229, 0.08);
    --plan-c-color: #4f46e5;
    --plan-c-border: rgba(79, 70, 229, 0.2);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-dark: #0b0f19;
    --bg-gradient-1: rgba(99, 102, 241, 0.08);
    --bg-gradient-2: rgba(6, 182, 212, 0.08);
    --card-bg: rgba(17, 24, 39, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --cyan-500: #06b6d4;
    --cyan-400: #22d3ee;
    --cyan-glow: rgba(6, 182, 212, 0.3);
    --indigo-500: #6366f1;
    --indigo-glow: rgba(99, 102, 241, 0.3);
    --success-500: #10b981;
    --warning-500: #f59e0b;
    --danger-500: #ef4444;
    
    --sidebar-bg: rgba(11, 15, 25, 0.85);
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --modal-overlay-bg: rgba(11, 15, 25, 0.75);
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --input-bg: rgba(0, 0, 0, 0.2);
    --modal-bg: #111827;
    
    --header-bg: rgba(11, 15, 25, 0.3);
    --header-border: rgba(255, 255, 255, 0.05);
    --logo-gradient: linear-gradient(to right, #ffffff, #cbd5e1);

    --hover-bg: rgba(255, 255, 255, 0.03);
    --hover-border: rgba(255, 255, 255, 0.05);
    --menu-active-color: #ffffff;
    --menu-active-bg: rgba(6, 182, 212, 0.08);
    --menu-active-border: rgba(6, 182, 212, 0.2);

    /* Plan Badges Theme Colors */
    --plan-a-bg: rgba(156, 163, 175, 0.12);
    --plan-a-color: #e5e7eb;
    --plan-a-border: rgba(156, 163, 175, 0.25);

    --plan-b-bg: rgba(6, 182, 212, 0.12);
    --plan-b-color: var(--cyan-400);
    --plan-b-border: rgba(6, 182, 212, 0.25);

    --plan-c-bg: rgba(99, 102, 241, 0.12);
    --plan-c-color: #c7d2fe;
    --plan-c-border: rgba(99, 102, 241, 0.25);
}

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

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 10% 20%, var(--bg-gradient-1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, var(--bg-gradient-2) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    padding-bottom: 0;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Scrollbar Style */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(6, 182, 212, 0.3);
}

.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: var(--shadow-premium);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s ease, border-color 0.3s ease;
}

.glass-panel:hover {
    border-color: rgba(6, 182, 212, 0.25);
    box-shadow: var(--shadow-premium), 0 12px 40px 0 var(--cyan-glow);
}

/* Layout Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
header {
    padding: 30px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 40px;
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-glow {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--cyan-500), var(--indigo-500));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

.app-header .logo-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-title h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--logo-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: background 0.3s ease;
}

.logo-title p {
    font-size: 12px;
    color: var(--cyan-500);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.kpi-card {
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
}

.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-card.cyan .kpi-icon {
    background: rgba(6, 182, 212, 0.1);
    color: var(--cyan-500);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.kpi-card.indigo .kpi-icon {
    background: rgba(99, 102, 241, 0.1);
    color: var(--indigo-500);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.kpi-card.success .kpi-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-500);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.kpi-value {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 4px;
}

.kpi-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Dashboard Sections */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}

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

/* Table Controls */
.table-header-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, var(--cyan-500), var(--indigo-500));
    border-radius: 2px;
    display: block;
}

.controls-right {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--cyan-500), var(--indigo-500));
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1.5px);
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.35);
}

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

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

/* Order Table */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

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

th {
    padding: 16px 24px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.01);
    white-space: nowrap;
}

td {
    padding: 16px 24px;
    font-size: 14px;
    border-bottom: 1px solid var(--card-border);
    vertical-align: middle;
    white-space: nowrap;
}

tr:hover td {
    background: var(--hover-bg);
}

.partner-info {
    display: flex;
    flex-direction: column;
}

.partner-name {
    font-weight: 700;
    color: var(--text-primary);
}

.partner-id {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    margin-top: 2px;
}

/* Plan Badge */
.plan-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    text-transform: uppercase;
    display: inline-block;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.plan-badge.plan-a {
    background: var(--plan-a-bg);
    color: var(--plan-a-color);
    border: 1px solid var(--plan-a-border);
}

.plan-badge.plan-b {
    background: var(--plan-b-bg);
    color: var(--plan-b-color);
    border: 1px solid var(--plan-b-border);
}

.plan-badge.plan-c {
    background: var(--plan-c-bg);
    color: var(--plan-c-color);
    border: 1px solid var(--plan-c-border);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

/* Status Dot Badge */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
}

.status-pill.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-500);
}

.status-pill.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-500);
}

.status-pill.expired {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-500);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-pill.active .status-dot { background-color: var(--success-500); box-shadow: 0 0 8px var(--success-500); }
.status-pill.warning .status-dot { background-color: var(--warning-500); box-shadow: 0 0 8px var(--warning-500); }
.status-pill.expired .status-dot { background-color: var(--danger-500); box-shadow: 0 0 8px var(--danger-500); }

/* Key Mask Block */
.key-mask-block {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.key-text {
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.btn-icon-sm {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-flex;
}

.btn-icon-sm:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--cyan-500);
}

.actions-row {
    display: flex;
    gap: 8px;
}

/* Modal Window styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--modal-overlay-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease, background-color 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-window {
    width: 90%;
    max-width: 550px;
    padding: 32px;
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: var(--modal-bg) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.modal-overlay.show .modal-window {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

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

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

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    outline: none;
    transition: all 0.2s, background-color 0.3s ease, color 0.3s ease;
}

input:focus, select:focus {
    border-color: var(--cyan-500);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

/* Sync Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(16, 185, 129, 0.95);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #ffffff;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 3000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.error {
    background: rgba(239, 68, 68, 0.95);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Sidebar Analytics Panels */
.side-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.chart-container {
    padding: 24px;
}

.chart-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-info-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.plan-info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.plan-info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.plan-info-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.plan-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.plan-color-dot.a { background-color: #9ca3af; }
.plan-color-dot.b { background-color: var(--cyan-500); }
.plan-color-dot.c { background-color: var(--indigo-500); }

.plan-info-name {
    font-size: 14px;
    font-weight: 600;
}

.plan-info-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--cyan-500);
}

/* ==========================================
   Login Screen & Security Gateway
   ========================================== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--modal-overlay-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, transform 0.5s ease, background-color 0.3s ease;
}

.login-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.05);
}

.login-card {
    width: 90%;
    max-width: 400px;
    padding: 40px;
    text-align: center;
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 20px;
    box-shadow: var(--shadow-premium), 0 0 50px var(--indigo-glow) !important;
    transition: all 0.3s ease;
}

.login-card h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.login-error-text {
    color: var(--danger-500);
    font-size: 13px;
    font-weight: 600;
    margin-top: 16px;
    display: none;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

/* Shake Animation */
.shake {
    animation: shake 0.4s ease-in-out;
    border-color: rgba(239, 68, 68, 0.5) !important;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3) !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* Fade-in for Main Dashboard once unlocked */
.fade-in-app {
    display: flex !important;
    animation: fadeInApp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ==========================================
   Collapsible Sidebar Layout & UX Styles
   ========================================== */

.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.app-sidebar {
    width: 260px;
    height: 100vh;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s ease, border-color 0.3s ease;
    z-index: 100;
    position: relative;
    overflow: hidden;
}

.app-sidebar.collapsed {
    width: 78px;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    height: 90px;
    overflow: hidden;
    transition: padding 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.app-sidebar.collapsed .sidebar-header {
    padding: 24px 15px;
    justify-content: center;
    flex-direction: column;
    height: auto;
    gap: 12px;
}

.sidebar-header .logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
    width: 100%;
}

.app-sidebar.collapsed .logo-section {
    justify-content: center;
    gap: 0;
}

.sidebar-logo-text {
    white-space: nowrap;
    transition: opacity 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.2s;
    opacity: 1;
    visibility: visible;
}

.app-sidebar.collapsed .sidebar-logo-text {
    opacity: 0;
    visibility: hidden;
    width: 0;
    pointer-events: none;
}

.sidebar-logo-text h2 {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
    background: var(--logo-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: background 0.3s ease;
}

.sidebar-logo-text p {
    font-size: 10px;
    color: var(--cyan-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.sidebar-toggle-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    border-radius: 12px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sidebar-toggle-btn:hover {
    background: rgba(6, 182, 212, 0.1);
    color: var(--cyan-400);
    border-color: var(--cyan-400);
    box-shadow: 0 0 15px var(--cyan-glow);
    transform: scale(1.08);
}

.sidebar-toggle-btn:active {
    transform: scale(0.95);
}

/* Sidebar Menu styling */
.sidebar-menu {
    list-style: none;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.app-sidebar.collapsed .sidebar-menu {
    padding: 20px 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-secondary);
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
    border: 1px solid transparent;
    background: transparent;
    width: 100%;
    text-align: left;
}

.menu-item:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
    border-color: var(--hover-border);
}

.menu-item.active {
    color: var(--menu-active-color);
    background: var(--menu-active-bg);
    border-color: var(--menu-active-border);
    box-shadow: inset 0 0 12px rgba(6, 182, 212, 0.1);
}

.menu-item.active .menu-icon {
    filter: drop-shadow(0 0 5px rgba(6, 182, 212, 0.5));
}

.menu-icon {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.menu-item:hover .menu-icon {
    transform: scale(1.05);
}

.menu-text {
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.2s;
    opacity: 1;
    visibility: visible;
}

.app-sidebar.collapsed .menu-text {
    opacity: 0;
    visibility: hidden;
    width: 0;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.app-sidebar.collapsed .menu-item {
    justify-content: center;
    padding: 12px;
    gap: 0;
}

/* Sidebar Footer & Logout styling */
.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
}

.app-sidebar.collapsed .sidebar-footer {
    padding: 16px 8px;
}

.logout-item {
    color: rgba(239, 68, 68, 0.85) !important;
}

.logout-item:hover {
    color: #ffffff !important;
    background: var(--danger-500) !important;
    border-color: var(--danger-500) !important;
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.4) !important;
}

/* Main Content Area */
.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
    padding-bottom: 0;
}

.dashboard-content {
    padding: 40px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding-bottom: 80px; /* offset the bottom space beautifully */
}

.app-header {
    padding: 30px 40px;
    border-bottom: 1px solid var(--header-border);
    margin-bottom: 40px;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

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

.btn-theme-toggle {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-premium);
}

.btn-theme-toggle:hover {
    transform: translateY(-1.5px);
    border-color: var(--cyan-400);
    box-shadow: 0 0 15px var(--cyan-glow);
}

.btn-theme-toggle:active {
    transform: translateY(0);
}

/* Override old full-page header styles to clean up layout */
header {
    border-bottom: none !important;
    margin-bottom: 0 !important;
}

/* Tooltip style when sidebar is collapsed */
.app-sidebar.collapsed .menu-item {
    position: relative;
}

.app-sidebar.collapsed .menu-item::after {
    content: attr(title);
    position: absolute;
    left: 88px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: rgba(11, 15, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.app-sidebar.collapsed .menu-item:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

@media (max-width: 1024px) {
    .dashboard-content {
        padding: 20px 20px 60px 20px;
    }
    .app-header {
        padding: 20px;
    }
}

/* ==========================================
   Tab View switching & transitions
   ========================================== */
.tab-view {
    display: none;
    width: 100%;
    animation: tabFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tab-view.active {
    display: block;
}

#tab-plans-view.active {
    display: grid;
}

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

/* ==========================================
   Plans & Pricing Page Grid & Card Styles
   ========================================== */
.plans-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 32px;
    align-items: start;
    width: 100%;
}

.plan-info-card-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="dark"] .plan-info-card-item {
    background: rgba(0, 0, 0, 0.15);
}

.plan-info-card-item:hover {
    transform: translateY(-3px);
    border-color: var(--cyan-400);
    box-shadow: 0 10px 25px -5px var(--cyan-glow);
}

.plan-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.plan-info-details {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 20px;
}

@media (max-width: 1024px) {
    .plans-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Server Sync Indicator Style */
.sync-badge {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-premium);
    transition: all 0.3s ease;
    border: 1px solid var(--card-border);
}

.sync-badge.online {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.25);
}

.sync-badge.offline {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.25);
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
    display: inline-block;
}

.sync-badge.online .sync-dot {
    background-color: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: sync-pulse-green 2s infinite ease-in-out;
}

.sync-badge.offline .sync-dot {
    background-color: #f59e0b;
    box-shadow: 0 0 10px #f59e0b;
    animation: sync-pulse-orange 2s infinite ease-in-out;
}

@keyframes sync-pulse-green {
    0% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes sync-pulse-orange {
    0% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
    100% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}


/* All Orders View Enhancements: Filters & Pagination */
.table-filters {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    margin: 0 16px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-select {
    width: auto;
    min-width: 100px;
    padding: 6px 32px 6px 12px;
    font-size: 13px;
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(148, 163, 184, 0.8)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
}

.filter-select:hover {
    border-color: var(--cyan-500);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.1);
}

.filter-select:focus {
    border-color: var(--cyan-500);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.01);
    flex-wrap: wrap;
    gap: 16px;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-info span {
    font-weight: 600;
    color: var(--text-primary);
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pag-btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--input-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.pag-btn:hover:not(:disabled) {
    border-color: var(--cyan-500);
    background: rgba(6, 182, 212, 0.1);
    color: var(--cyan-500);
    transform: translateY(-1px);
}

.pag-btn.active {
    background: linear-gradient(135deg, var(--cyan-500), var(--indigo-500));
    border-color: transparent;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(6, 182, 212, 0.2);
}

.pag-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Make sure filters flow beautifully on smaller viewports */
@media (max-width: 992px) {
    .table-header-control {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .table-filters {
        margin: 0;
        width: 100%;
        justify-content: flex-start;
    }
}

/* ==========================================
   Annual Revenue Analysis Tab Component Styles
   ========================================== */
#tab-revenue-view select.filter-select {
    padding: 8px 12px;
    min-width: 140px;
    font-size: 13px;
    border-radius: 8px;
}

#tab-revenue-view .kpi-card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#tab-revenue-view .kpi-card:hover {
    transform: translateY(-4px);
}

/* Premium consolidated progress bars */
.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding-right: 12px;
}

.progress-track {
    flex-grow: 1;
    height: 8px;
    background: rgba(156, 163, 175, 0.1);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .progress-track {
    background: rgba(0, 0, 0, 0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #06b6d4);
    border-radius: 99px;
    width: 0; /* Animated dynamically via JS */
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    width: 48px;
    text-align: right;
    color: var(--text-primary);
}

/* Glassmorphic border glow highlights for revenue bars */
#revenueChart {
    filter: drop-shadow(0px 4px 8px rgba(6, 182, 212, 0.15));
}



