:root {
    --bg-dark: #0d101d; /* Deep charcoal */
    --bg-card: #141724; /* Slightly lighter card bg */
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 107, 53, 0.4);
    --accent: #FF6B35;
    --accent-glow: rgba(255, 107, 53, 0.2);
    --text-primary: #ffffff;
    --text-secondary: #9aa0a6;
    --success: #34d399;
    --danger: #ef4444;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Open Sans', sans-serif;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Base Typo */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
}

.text-muted {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.positive {
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.negative {
    color: var(--danger);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Layout */
.sidebar {
    width: 260px;
    background: rgba(20, 23, 36, 0.5);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

/* Sidebar Styling */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #ff9b44);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.brand h2 {
    font-size: 1.25rem;
    letter-spacing: 0.5px;
}

.nav-group {
    margin-bottom: 24px;
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item i {
    width: 18px;
    height: 18px;
    transition: var(--transition);
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(255, 107, 53, 0.1);
    color: var(--accent);
}

.nav-item:hover i, .nav-item.active i {
    color: var(--accent);
}

.return-site-card {
    margin-top: auto;
    background: linear-gradient(to bottom, rgba(20,23,36,0.8), rgba(255,107,53,0.05));
    border: 1px dashed rgba(255, 107, 53, 0.3);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.return-site-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.btn-return {
    display: inline-block;
    padding: 8px 16px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-return:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

/* Topbar */
.topbar {
    height: 80px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(13, 16, 29, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 8px 20px;
    width: 300px;
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    padding-left: 12px;
    width: 100%;
    font-family: var(--font-body);
}

.search-bar i {
    color: var(--text-secondary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.icon-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.icon-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

/* Dashboard Container */
.dashboard {
    padding: 40px;
}

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
}

/* Metrics Grid (Bento style) */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.card-icon {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    background: rgba(255, 107, 53, 0.1);
    color: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.value {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
    margin-bottom: 12px;
}

/* Charts Layout */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

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

/* Fake CSS Bar Chart */
.fake-bar-chart {
    height: 250px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    padding-top: 20px;
    position: relative;
}

.fake-bar-chart::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.bar-wrapper {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.bar {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(to top, rgba(255, 107, 53, 0.1), var(--accent));
    border-radius: 6px 6px 0 0;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
    transform-origin: bottom;
    animation: growBar 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.bar:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 15px var(--accent-glow);
}

.bar-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Tables */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 16px 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 16px 8px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

tr:hover td {
    background: rgba(255,255,255,0.01);
}

.status {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status.active { background: rgba(52, 211, 153, 0.1); color: var(--success); }
.status.pending { background: rgba(255, 107, 53, 0.1); color: var(--accent); }

/* Animations */
.animate-delay-1 { animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both; }
.animate-delay-2 { animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both; }
.animate-delay-3 { animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both; }
.animate-delay-4 { animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both; }
.animate-delay-5 { animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both; }

@keyframes slideUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes growBar {
    0% { transform: scaleY(0); }
    100% { transform: scaleY(1); }
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.menu-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

@media (max-width: 1024px) {
    .menu-toggle {
        display: flex;
    }
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 20px 0 60px rgba(0,0,0,0.8);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .topbar {
        padding: 0 20px;
    }
    .search-bar {
        width: 180px;
    }
}

@media (max-width: 600px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    .dash-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .dash-header div {
        width: 100%;
        display: flex;
        gap: 8px;
    }
    .dash-header div button {
        flex: 1;
    }
    .search-bar {
        display: none;
    }
    .dashboard {
        padding: 20px;
    }
}

/* App Views */
.app-view {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.app-view.active {
    display: block;
    opacity: 1;
}

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* On mobile, center toast */
@media (max-width: 600px) {
    .toast-container {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }
    .toast {
        transform: translateY(120%);
    }
    .toast.show {
        transform: translateY(0);
    }
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

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

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

.toast.error i {
    color: var(--danger);
}

.toast.success {
    border-color: rgba(52, 211, 153, 0.5);
    background: rgba(52, 211, 153, 0.05);
}

.toast.success i {
    color: var(--success);
}

.toast.info {
    border-color: rgba(255, 107, 53, 0.5);
}

.toast.info i {
    color: var(--accent);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}
.form-group input {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition);
}
.form-group input:focus {
    border-color: var(--accent);
}
.form-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 6px;
}
