/* ========================================
   Nature Life Fusion Global - Dashboard Styles
   Distributor Back-Office
   ======================================== */

/* Base */
.dashboard-body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0e1a; color: #fff; line-height: 1.5;
    min-height: 100vh; overflow-x: hidden;
}

/* Glass Card */
.glass-card {
    background: rgba(15, 20, 35, 0.85);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

/* Sidebar */
.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 240px;
    background: #0a0e1a; border-right: 1px solid rgba(255,255,255,0.05);
    z-index: 100; display: flex; flex-direction: column;
    transition: transform 0.3s ease;
}
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 0 20px; height: 64px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sidebar-brand svg { width: 24px; height: 24px; color: #10b981; flex-shrink: 0; }
.sidebar-brand-text { font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 600; color: #fff; white-space: nowrap; }
.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; border-radius: 8px;
    color: rgba(255,255,255,0.6); font-size: 14px; font-weight: 500;
    transition: all 0.2s; margin-bottom: 2px; border-left: 2px solid transparent;
    white-space: nowrap;
}
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.sidebar-link.active {
    color: #34d399; background: rgba(16, 185, 129, 0.1);
    border-left-color: #34d399;
}
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer { padding: 8px; border-top: 1px solid rgba(255,255,255,0.05); }
.sidebar-footer a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; border-radius: 8px;
    color: rgba(255,255,255,0.4); font-size: 14px; font-weight: 500;
    transition: all 0.2s;
}
.sidebar-footer a:hover { color: #fff; background: rgba(255,255,255,0.05); }
.sidebar-footer a svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Top Bar */
.topbar {
    position: fixed; top: 0; right: 0; height: 64px;
    background: rgba(10, 14, 26, 0.8); backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    z-index: 99; display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; left: 240px; transition: left 0.3s;
}
@media (max-width: 1024px) { .topbar { left: 0 !important; padding-left: 64px; } }
.topbar-search { position: relative; }
.topbar-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: rgba(255,255,255,0.4); }
.topbar-search input {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; padding: 8px 12px 8px 36px; color: #fff; font-size: 13px;
    width: 240px; outline: none; transition: border-color 0.2s;
}
.topbar-search input:focus { border-color: rgba(16, 185, 129, 0.3); }
.topbar-search input::placeholder { color: rgba(255,255,255,0.4); }
@media (max-width: 768px) { .topbar-search { display: none; } }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-btn {
    width: 36px; height: 36px; border-radius: 8px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.6); transition: all 0.2s; position: relative;
}
.topbar-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.topbar-btn-badge {
    position: absolute; top: -4px; right: -4px;
    width: 16px; height: 16px; background: #ef4444;
    border-radius: 50%; font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.topbar-user { display: flex; align-items: center; gap: 12px; padding-left: 12px; border-left: 1px solid rgba(255,255,255,0.1); }
.topbar-user-info { text-align: right; }
@media (max-width: 768px) { .topbar-user-info { display: none; } }
.topbar-user-name { font-size: 13px; font-weight: 500; color: #fff; }
.topbar-user-rank { display: flex; align-items: center; gap: 4px; font-size: 11px; color: #34d399; }
.topbar-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #0d9488);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: #fff;
}

/* Main Content */
.main-content { padding-top: 64px; margin-left: 240px; min-height: 100vh; transition: margin-left 0.3s; }
@media (max-width: 1024px) { .main-content { margin-left: 0 !important; } }
.content-area { padding: 24px; }
@media (min-width: 1024px) { .content-area { padding: 32px; } }

/* Dashboard Grid */
.dashboard-grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Stat Cards */
.stat-card { padding: 20px; }
.stat-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-card-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-card-icon svg { width: 20px; height: 20px; }
.stat-card-icon.green { background: rgba(16, 185, 129, 0.1); color: #34d399; }
.stat-card-icon.blue { background: rgba(59, 130, 246, 0.1); color: #60a5fa; }
.stat-card-icon.amber { background: rgba(245, 158, 11, 0.1); color: #fbbf24; }
.stat-card-icon.purple { background: rgba(139, 92, 246, 0.1); color: #a78bfa; }
.stat-card-change { font-size: 11px; }
.stat-card-change.up { color: #34d399; }
.stat-card-change.neutral { color: rgba(255,255,255,0.4); }
.stat-card-value { font-size: 28px; font-weight: 700; color: #fff; }
.stat-card-label { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 4px; }

/* Welcome Banner */
.welcome-banner { padding: 24px; margin-bottom: 24px; }
.welcome-title { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.welcome-meta { display: flex; align-items: center; gap: 12px; }
.welcome-rank {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(16, 185, 129, 0.2); color: #34d399;
    font-size: 11px; padding: 4px 10px; border-radius: 20px;
}
.welcome-date { font-size: 11px; color: rgba(255,255,255,0.4); }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
    text-align: left; padding: 12px 16px; font-size: 11px;
    font-weight: 500; color: rgba(255,255,255,0.4);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.data-table tbody td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.03); }
.data-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.badge-paid { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-pending { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-delivered { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-processing { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-shipped { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-credit { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-debit { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: 8px; font-size: 13px;
    font-weight: 600; transition: all 0.2s; border: none; cursor: pointer;
}
.btn-green { background: #10b981; color: #fff; }
.btn-green:hover { background: #059669; }
.btn-outline {
    background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.1);
}
.btn-outline:hover { background: rgba(255,255,255,0.1); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; color: rgba(255,255,255,0.5); margin-bottom: 6px; }
.form-input {
    width: 100%; background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
    padding: 10px 14px; color: #fff; font-size: 13px;
    outline: none; transition: border-color 0.2s;
}
.form-input:focus { border-color: rgba(16, 185, 129, 0.4); }
.form-input::placeholder { color: rgba(255,255,255,0.3); }
select.form-input { appearance: none; cursor: pointer; }
select.form-input option { background: #1a1f2e; color: #fff; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid rgba(255,255,255,0.05); margin-bottom: 24px; }
.tab {
    padding: 12px 20px; font-size: 13px; font-weight: 500;
    color: rgba(255,255,255,0.5); border-bottom: 2px solid transparent;
    transition: all 0.2s; cursor: pointer; background: none; border-radius: 0;
}
.tab:hover { color: #fff; }
.tab.active { color: #34d399; border-bottom-color: #34d399; }

/* Progress Bar */
.progress-bar { height: 8px; background: rgba(255,255,255,0.05); border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }
.progress-bar-fill.green { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-bar-fill.blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }

/* Toggle Switch */
.toggle { position: relative; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: rgba(255,255,255,0.1); border-radius: 24px;
    transition: background 0.2s;
}
.toggle-slider::before {
    content: ''; position: absolute; height: 18px; width: 18px;
    left: 3px; bottom: 3px; background: #fff; border-radius: 50%;
    transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider { background: #10b981; }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Genealogy Tree */
.genealogy-canvas { background: #0d1117; border-radius: 8px; border: 1px solid rgba(255,255,255,0.05); overflow: auto; min-height: 400px; position: relative; }
.genealogy-svg { width: 100%; }
.genealogy-node {
    cursor: pointer; transition: opacity 0.2s;
}
.genealogy-node:hover { opacity: 0.8; }
.genealogy-node circle { transition: stroke-width 0.2s; }
.genealogy-node:hover circle { stroke-width: 3; }
.genealogy-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.genealogy-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: rgba(255,255,255,0.6); }
.genealogy-legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* Mobile Sidebar Toggle */
.sidebar-toggle {
    display: none; position: fixed; top: 16px; left: 16px; z-index: 101;
    width: 40px; height: 40px; border-radius: 8px;
    background: #0f1423; border: 1px solid rgba(255,255,255,0.1);
    align-items: center; justify-content: center; color: #fff;
}
@media (max-width: 1024px) { .sidebar-toggle { display: flex; } }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-content { background: #0f1423; border-radius: 16px; max-width: 500px; width: 100%; max-height: 80vh; overflow-y: auto; border: 1px solid rgba(255,255,255,0.1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { color: rgba(255,255,255,0.4); font-size: 24px; transition: color 0.2s; }
.modal-close:hover { color: #fff; }
.modal-body { padding: 20px 24px; }

/* Responsive */
@media (max-width: 1024px) {
    .hide-mobile { display: none !important; }
}
@media (min-width: 1025px) {
    .show-mobile { display: none !important; }
}
