/* --- Global Variables & Reset --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #6366f1;
    /* Indigo */
    --primary-dark: #4f46e5;
    --secondary: #06b6d4;
    /* Cyan */
    --accent-pink: #ec4899;
    /* Pink */
    --bg-light: #f8fafc;
    --bg-off: #f1f5f9;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);

    /* Aurora Gradients */
    --grad-aurora: linear-gradient(135deg, #6366f1 0%, #06b6d4 50%, #ec4899 100%);
    --grad-glass: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));

    /* Font */
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- Utilities --- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Logo --- */
.logo {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-dark);
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.8rem 2rem;
    border-radius: 99px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--text-dark);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: #0f172a;
}

/* --- Aurora Background System (Global) --- */
.aurora-bg-fixed {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--bg-light);
    overflow: hidden;
}

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 10s infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--grad-aurora);
}

.blob-2 {
    top: 20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--secondary);
    animation-delay: -5s;
}

.blob-3 {
    bottom: -20%;
    left: 20%;
    width: 50vw;
    height: 50vw;
    background: var(--accent-pink);
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 30px) scale(1.1);
    }
}

/* --- Glass Dashboard Layout --- */
.dashboard-body {
    display: flex;
    min-height: 100vh;
    background: transparent;
    width: 100%;
    position: relative;
    overflow-x: hidden;
}

/* Fix for legacy HTML structure wrapping sidebar/main in .container or .container-fluid */
.dashboard-body .container,
.dashboard-body .container-fluid {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
}

/* Sidebar (Glass Premium) */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    top: 0;
    left: 0;
    overflow-y: auto;
    /* Fix: Enable Scroll */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollbar styling for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 99px;
}

.sidebar-header {
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: 0.3s;
}

.sidebar-user:hover {
    background: white;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--text-dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.user-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
    margin-bottom: 2px;
}

.user-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

/* Toggle Button - Hide by default on desktop */
.sidebar-toggle {
    display: none;
}

/* Nav Items */
.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
    border-radius: 16px;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--primary);
    transform: translateX(5px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
}

.nav-item.active i {
    color: white;
}

.nav-item i {
    width: 24px;
    text-align: center;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    /* Offset for fixed sidebar */
    padding: 2rem 3rem;
    width: calc(100% - 280px);
    position: relative;
    z-index: 1;
}

/* Generic Glass Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
}

.header-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

/* Header Actions (Right Side) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notification-bell {
    position: relative;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: 0.3s;
}

.notification-bell i {
    font-size: 1.25rem;
    color: var(--text-dark);
}

.notification-bell:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.notification-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--accent-pink);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid white;
}

.network-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.network-indicator i {
    font-size: 0.5rem;
    color: #22c55e;
}

/* Wallet Button (Premium Gradient) */
.wallet-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: var(--text-dark);
    color: white;
    border-radius: 99px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    z-index: 50;
    transition: all 0.3s;
}

.wallet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    background: #0f172a;
}

/* Welcome Section (Hero Style in Dashboard) */
.welcome-message {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
    border: 1px solid white;
    padding: 3rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.welcome-message h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.welcome-message p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
}

.welcome-icon {
    position: absolute;
    right: 2rem;
    bottom: -2rem;
    font-size: 10rem;
    opacity: 0.05;
    transform: rotate(-15deg);
    color: var(--primary);
    pointer-events: none;
}

.page {
    display: none;
    animation: fadeIn 0.4s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Internal Glass Cards */
.glass-panel,
.card,
.info-card,
.welcome-message,
.section {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
    margin-bottom: 2rem;
}

/* Dashboard Grid Layout (Restored for Admin etc) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 160px;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--bg-off), white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.stat-body {
    margin-top: auto;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
}

.stat-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.glass-panel:hover {
    transform: translateY(-3px);
}

/* Table Styles */
.data-table,
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    background: rgba(255, 255, 255, 0.5);
    padding: 1.25rem 1rem;
    vertical-align: middle;
}

tr td:first-child {
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
    padding-left: 1.5rem;
}

tr td:last-child {
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
    padding-right: 1.5rem;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.8);
}

/* Inputs */
.form-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    transition: 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

/* Modals & Notifications - Force Hide Default */
.modal,
.notification-panel {
    display: none !important;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
}

.modal.active,
.notification-panel.active {
    display: flex !important;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 24px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ============================================
   RESPONSIVE DESIGN - Mobile First Approach
============================================ */

/* Sidebar Toggle Button (Hidden by default on desktop) */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    font-size: 1.5rem;
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

/* Large Tablets and Small Desktops */
@media (max-width: 1200px) {
    .sidebar {
        width: 240px;
        padding: 1.5rem 1rem;
    }

    .main-content {
        margin-left: 240px;
        padding: 2rem 1.5rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets */
@media (max-width: 1024px) {
    .sidebar-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        padding: 2rem 1.5rem;
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1.5rem;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem 1.5rem;
        padding-left: 4rem;
        /* Space for hamburger */
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .welcome-section,
    .welcome-message {
        min-height: auto;
        padding: 2rem 1.5rem;
    }

    .welcome-section h2,
    .welcome-message h2 {
        font-size: 1.75rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Mobile Landscape & Small Tablets */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 1rem;
        padding-left: 3.5rem;
    }

    .header-actions {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .wallet-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .network-indicator {
        font-size: 0.75rem;
        padding: 0.35rem 0.75rem;
    }

    .welcome-section,
    .welcome-message {
        padding: 1.5rem 1rem;
    }

    .welcome-section h2,
    .welcome-message h2 {
        font-size: 1.5rem;
    }

    .welcome-section p,
    .welcome-message p {
        font-size: 0.95rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .page-content {
        padding: 1rem;
    }

    .glass-card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    /* Tables become scrollable on mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }

    th,
    td {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        margin: 1rem;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }

    .main-content {
        padding: 1rem;
    }

    .dashboard-header {
        padding: 0.75rem;
        padding-left: 3rem;
        gap: 0.75rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .page-subtitle {
        font-size: 0.85rem;
    }

    .header-actions {
        justify-content: space-between;
    }

    .wallet-btn {
        width: 100%;
        justify-content: center;
    }

    .welcome-section,
    .welcome-message {
        padding: 1rem;
        margin: 0.5rem 0;
    }

    .welcome-section h2,
    .welcome-message h2 {
        font-size: 1.25rem;
    }

    .welcome-icon {
        font-size: 2rem;
    }

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .form-input {
        padding: 0.85rem 1rem;
    }

    .nav-menu {
        gap: 0.25rem;
    }

    .nav-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .nav-item i {
        font-size: 1rem;
        min-width: 1.5rem;
    }
}

/* Sidebar Overlay for Mobile */
@media (max-width: 1024px) {
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }

    .sidebar.active+.sidebar-overlay,
    .sidebar-overlay.active {
        display: block;
    }
}

/* Print Styles */
@media print {

    .sidebar,
    .sidebar-toggle,
    .header-actions,
    .aurora-bg-fixed {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 1rem;
    }
}