/* DaneTrades Dashboard Styles - EXACT COPY */
/* CSS Variables - EXACT from original */
:root {
    --primary-color: #1C69E5;
    --secondary-color: #0993B2;
    --bg-primary: #0a0a0a;
    --bg-card: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #BDBDBD;
    --text-muted: #666666;
    --border-radius: 8px;
    --gradient-primary: linear-gradient(135deg, #1C69E5 0%, #0993B2 100%);
}

/* ======================================================= */
/* ===    NEW: STYLES FOR PATCH NOTES LIST IN MODAL    === */
/* ======================================================= */
.patch-note-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.patch-note-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.patch-note-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.patch-note-content p {
    margin-top: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* ======================================================= */
/* ===         NEW: STYLES FOR PATCH NOTES MODAL       === */
/* ======================================================= */
.patch-notes-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.patch-notes-content {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Ensure modal is centered on mobile */
@media (max-width: 768px) {
    .patch-notes-content {
        width: 95%;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .patch-notes-content {
        padding: 1rem;
    }
}

.patch-notes-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

#patch-notes-body h2 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1.5rem;
}

#patch-notes-body p,
#patch-notes-body li,
#patch-notes-body div {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ======================================================= */
/* ===         FINAL: STYLES FOR DASHBOARD TABLES      === */
/* ======================================================= */
/* FIX #1: This now removes ALL borders, shadows, and padding from the container */
#activations-content .dashboard-card {
    background-color: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}

/* The main table structure */
.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    /* FIX #2: Ensure there are no external borders on the table itself */
    border: none;
}

/* The header section */
.dashboard-table thead {
    background-color: #1D2E4E;
    /* Dark blue highlight for the header */
}

/* Table Header Cells (th) */
.dashboard-table th {
    color: var(--text-secondary);
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    /* FIX #3: Only a bottom border, and add a right border for vertical lines */
    border-bottom: 1px solid #1D2E4E;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    /* Vertical dividing line */
    border-left: none;
    border-top: none;
}

/* Make the last header cell have no right border */
.dashboard-table th:last-child {
    border-right: none;
}

/* Table Body Cells (td) */
.dashboard-table td {
    color: var(--text-primary);
    padding: 16px;
    /* FIX #4: Only a bottom border, and add a right border for vertical lines */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    /* The horizontal dividing line */
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    /* The vertical dividing line */
    border-left: none;
    border-top: none;
}

/* Make the last cell in any row have no right border */
.dashboard-table td:last-child {
    border-right: none;
}

/* Remove the bottom border from the very last row to look cleaner */
.dashboard-table tr:last-child td {
    border-bottom: none;
}

/* Adds the hover effect */
.dashboard-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Status Badge Styling (ensure these are present) */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.status-active {
    background-color: rgba(9, 147, 178, 0.1);
    color: var(--secondary-color);
}

.status-badge.status-expired {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Auth Pages - EXACT COPY */
.auth-page {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1000px;
    width: 100%;
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-card {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    height: 50px;
    margin-bottom: 1.5rem;
}

.auth-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.auth-header p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

.auth-form {
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(20, 103, 206, 0.1);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked+.checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked+.checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--secondary-color);
}

.btn-full {
    width: 100%;
    margin-bottom: 1rem;
}

.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
    color: var(--text-muted);
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    background: var(--bg-card);
    padding: 0 1rem;
}

.demo-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.demo-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-footer p {
    color: var(--text-secondary);
    margin: 0;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    color: var(--secondary-color);
}

/* Auth Info Panel */
.auth-info {
    background: var(--gradient-primary);
    padding: 3rem;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.auth-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.info-content {
    position: relative;
    z-index: 1;
}

.info-content h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: white;
}

.feature-list {
    list-style: none;
    margin-bottom: 3rem;
}

.feature-list li {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.feature-list svg {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.testimonial {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: var(--border-radius);
    border-left: 4px solid rgba(255, 255, 255, 0.3);
}

.testimonial blockquote {
    font-size: 1.1rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
}

.testimonial cite {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* Dashboard Main - EXACT COPY */
.dashboard {
    display: grid;
    grid-template-columns: 280px 1fr;
    /* Reduced from 360px to 280px for better balance */
    min-height: 100vh;
    background: #0D0E12;
    transition: grid-template-columns 0.3s ease;
    padding-top: 2rem;
    /* Add top padding to pull the app down */
}

.dashboard.sidebar-collapsed {
    grid-template-columns: 70px 1fr;
    /* Slightly smaller collapsed width */
}

.sidebar {
    background: #181920;
    border-right: 1px solid #2D2E33;
    padding: 1.5rem 0.8rem;
    /* Reduced horizontal padding for more compact sidebar */
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sidebar.collapsed {
    padding: 1.5rem 0.5rem;
}

/* Option 1: Modern hamburger/close icon - MOVED OUTSIDE SIDEBAR */
.sidebar-toggle {
    position: fixed;
    top: 2rem;
    left: 300px;
    /* Adjusted for new sidebar width */
    width: 40px;
    height: 32px;
    background: #181920;
    border: 1px solid #2D2E33;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sidebar-toggle svg {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.sidebar.collapsed .sidebar-toggle svg,
.dashboard.sidebar-collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

.sidebar-toggle:hover {
    background: #2D2E33;
    transform: scale(1.05);
}

/* When collapsed, move closer to collapsed sidebar */
.sidebar.collapsed .sidebar-toggle,
.dashboard.sidebar-collapsed .sidebar-toggle {
    left: 100px;
    top: 2rem;
    /* Just outside the collapsed sidebar */
}

/* Alternative Option 2: Clean arrow button */
.sidebar-toggle.arrow-style {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    border: none;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(20, 103, 206, 0.3);
}

.sidebar-toggle.arrow-style:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.sidebar-toggle.arrow-style svg {
    width: 14px;
    height: 14px;
    color: white;
    transition: transform 0.3s ease;
}

/* When collapsed, move outside and point right */
.sidebar.collapsed .sidebar-toggle.arrow-style {
    right: -14px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
}

.sidebar.collapsed .sidebar-toggle.arrow-style svg {
    transform: rotate(180deg);
}

/* Alternative Option 3: Minimal line button */
.sidebar-toggle.minimal-style {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    gap: 3px;
}

.sidebar-toggle.minimal-style .line {
    width: 16px;
    height: 2px;
    background: var(--text-secondary);
    transition: all 0.3s ease;
    border-radius: 1px;
}

.sidebar-toggle.minimal-style:hover .line {
    background: var(--primary-color);
}

/* When collapsed, move outside and change to arrow */
.sidebar.collapsed .sidebar-toggle.minimal-style {
    right: -12px;
    background: #181920;
    border: 1px solid #2D2E33;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    gap: 0;
}

.sidebar.collapsed .sidebar-toggle.minimal-style .line:nth-child(1) {
    transform: rotate(45deg) translate(2px, 2px);
    width: 8px;
}

.sidebar.collapsed .sidebar-toggle.minimal-style .line:nth-child(2) {
    opacity: 0;
}

.sidebar.collapsed .sidebar-toggle.minimal-style .line:nth-child(3) {
    transform: rotate(-45deg) translate(2px, -2px);
    width: 8px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 1rem 1.5rem;
    /* Padding matches the horizontal padding of the links */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-header {
    padding: 0 0.5rem 1.5rem;
    justify-content: center;
}

.sidebar-logo {
    height: 32px;
    width: 32px;
    flex-shrink: 0;
}

.sidebar-title {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
    /* Bolder title */
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-title {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    /* Reduced gap for more compact layout */
    padding: 12px 14px;
    /* Reduced padding for more compact tabs */
    margin-bottom: 12px;
    /* Reduced margin for better spacing */
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    position: relative;
    white-space: nowrap;
    font-size: 14px;
    /* Slightly smaller font for better fit */
}

.sidebar.collapsed .sidebar-nav a {
    padding: 12px 6px;
    justify-content: center;
    gap: 0;
}

.sidebar-nav a .nav-text {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-nav a .nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Tooltip for collapsed sidebar */
.sidebar.collapsed .sidebar-nav a::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #2D2E33;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-left: 10px;
    z-index: 1000;
}

.sidebar.collapsed .sidebar-nav a:hover::after {
    opacity: 1;
    visibility: visible;
}

.sidebar-nav a:hover {
    /* --- CHANGE: Hover state now mimics the active state --- */
    background: rgba(28, 105, 229, 0.1);
    /* Subtle blue background on hover */
    color: var(--primary-color);
    /* Bright blue text on hover */
}

.sidebar-nav a.active {
    /* --- CHANGE: THE NEW HIGHLIGHT STYLE --- */
    /* This creates the rounded, inset background that fills the space */
    background: #1D2E4E;
    /* Dark blue background for the active tab */
    color: #3b82f6;
    /* Bright blue text for the active tab */
}

.sidebar-nav a svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: var(--primary-color);
    /* Primary color for default icon */
    transition: all 0.2s ease-in-out;
}

/* Make icon blue on hover or when active */
.sidebar-nav a:hover svg,
.sidebar-nav a.active svg {
    stroke: #3b82f6;
    /* Bright blue icon for active/hover */
}

/* Re-adding other dashboard rules that were part of the original block */
.main-content {
    padding: 2rem;
    overflow-y: auto;
    background: #101116;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-title {
    color: var(--text-primary);
    font-size: 2rem;
    margin: 0;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* Dashboard Cards - Enhanced Responsive */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* Reduced minimum width for better mobile fit */
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    /* Reduced padding for better mobile experience */
    transition: all 0.3s ease;
    min-width: 0;
    /* Allow cards to shrink below content width */
}

.dashboard-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(20, 103, 206, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin: 0;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.card-change {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-change.positive {
    color: var(--secondary-color);
}

.card-change.negative {
    color: #ef4444;
}

/* Buttons - EXACT COPY */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Enhanced Responsive Design */
@media (max-width: 1200px) {
    .dashboard {
        grid-template-columns: 260px 1fr;
        /* Slightly smaller sidebar on medium screens */
    }

    .sidebar {
        padding: 1.5rem 0.6rem;
    }

    .sidebar-nav a {
        padding: 10px 12px;
        font-size: 13px;
        gap: 10px;
    }

    .sidebar-toggle {
        left: 280px;
    }

    .dashboard.sidebar-collapsed .sidebar-toggle {
        left: 80px;
    }
}

@media (max-width: 992px) {
    .dashboard {
        grid-template-columns: 240px 1fr;
        /* Even smaller sidebar on tablets */
    }

    .sidebar-nav a {
        padding: 8px 10px;
        font-size: 12px;
        gap: 8px;
    }

    .sidebar-nav a svg {
        width: 18px;
        height: 18px;
    }

    .sidebar-toggle {
        left: 260px;
    }

    .dashboard.sidebar-collapsed .sidebar-toggle {
        left: 75px;
    }

    .main-content {
        padding: 1.5rem;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .dashboard-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .auth-container {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .auth-info {
        display: none;
    }

    .auth-card {
        padding: 2rem;
    }

    /* --- Modified Mobile Sidebar Behavior --- */
    /* Start collapsed, grid column reflects collapsed width */
    .dashboard {
        grid-template-columns: 70px 1fr;
        /* Always collapsed on mobile */
        /* Add position: relative to contain absolutely positioned children if needed */
        position: relative;
        /* Ensure it can handle the height */
        min-height: 100vh;
        padding-top: 0;
        /* Reset padding if it was causing offset */
    }

    /* Base collapsed state styles for sidebar */
    .sidebar {
        padding: 1.5rem 0.5rem;
        height: 100vh;
        /* Ensure it takes full height */
        /* Sidebar is part of the grid, not fixed */
        position: relative;
        /* Or static, part of document flow */
        z-index: 10;
        /* Lower than toggle and expanded sidebar */
    }

    /* Expanded state on mobile (via class toggle) */
    /* Use absolute positioning within the .dashboard container for stability */
    .sidebar:not(.collapsed) {
        position: absolute;
        /* Changed from fixed */
        top: 2rem;
        /* Account for dashboard padding-top */
        left: 0;
        /* Align with collapsed position */
        width: 260px;
        /* Or desired expanded width */
        height: calc(100vh - 2rem);
        /* Adjust height for top offset */
        z-index: 1000;
        /* High z-index to overlay content */
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
        /* Keep shadow */
        padding: 1.5rem 0.8rem;
        /* Revert to normal padding */
        /* Add background if it's not opaque */
        background: #181920;
    }

    /* Overlay effect when expanded */
    .sidebar:not(.collapsed)::after {
        content: '';
        position: fixed;
        /* Cover the area to the right of the sidebar */
        top: 0;
        left: 260px;
        /* Match expanded sidebar width */
        width: calc(100vw - 260px);
        /* Cover remaining viewport */
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        /* Below sidebar (1000) and toggle (1001) */
    }


    /* Adjust header and nav for collapsed state */
    .sidebar.collapsed .sidebar-header {
        padding: 0 0.5rem 1.5rem;
        justify-content: center;
    }

    .sidebar.collapsed .sidebar-title {
        opacity: 0;
        width: 0;
        overflow: hidden;
    }

    .sidebar.collapsed .sidebar-nav a {
        padding: 12px 6px;
        justify-content: center;
        gap: 0;
        margin-bottom: 8px;
    }

    .sidebar.collapsed .sidebar-nav a .nav-text {
        opacity: 0;
        width: 0;
        overflow: hidden;
    }

    .sidebar.collapsed .sidebar-nav a svg {
        width: 20px;
        height: 20px;
    }

    /* Show text/icons when sidebar is expanded */
    .sidebar:not(.collapsed) .sidebar-title {
        opacity: 1;
        width: auto;
    }

    .sidebar:not(.collapsed) .sidebar-nav a {
        padding: 12px 14px;
        justify-content: flex-start;
        gap: 10px;
        margin-bottom: 10px;
    }

    .sidebar:not(.collapsed) .sidebar-nav a .nav-text {
        opacity: 1;
        width: auto;
    }

    /* --- KEY CHANGES FOR TOGGLE STABILITY --- */
    /* Toggle button positioning for mobile */
    .sidebar-toggle {
        /* Always use fixed positioning for consistent viewport behavior */
        position: fixed;
        /* --- VERTICAL POSITION: Calculate based on dashboard top padding or fixed offset --- */
        /* The dashboard has padding-top: 2rem (32px). Let's place it 1rem (16px) from the top. */
        /* Adjust the '1rem' value if you want it higher or lower vertically. */
        top: 1rem;
        /* This should keep it stable */
        /* --- HORIZONTAL POSITION: Changes based on sidebar state --- */
        /* Initial position for COLLAPSED state (sidebar is 70px wide) */
        left: 80px;
        /* 70px (sidebar) + 10px gap. Adjust gap as needed. */
        z-index: 1001;
        /* High z-index to stay above sidebar and overlay */
        width: 32px;
        height: 32px;
        /* Ensure smooth transition for horizontal movement */
        transition: left 0.3s ease;
        /* Add background/border to ensure it's visible against content */
        background: #181920;
        /* Match sidebar background */
        border: 1px solid #2D2E33;
        /* Match sidebar border */
        border-radius: 6px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        display: flex;
        /* Ensure SVG centers */
        align-items: center;
        justify-content: center;
    }

    /* Move toggle when sidebar is expanded */
    .sidebar:not(.collapsed) .sidebar-toggle {
        /* Move it to the right of the expanded sidebar */
        left: 270px;
        /* 260px (expanded width) + 10px gap */
        top: 3rem;
        /* Match the sidebar's top position + some offset */
    }

    .main-content {
        padding: 1rem;
        /* Add top padding if content is hidden behind fixed elements */
        /* padding-top: calc(1rem + 32px + 1rem); */
        /* Example: 1rem base + 32px toggle height + 1rem gap */
        overflow-y: auto;
        position: relative;
        /* Needed for z-index context if required */
    }

    .dashboard-header {
        /* Ensure header has enough top space or margin */
        margin-top: 0;
        /* Reset if there was a margin */
        /* Or add padding-top if needed */
        /* padding-top: 1rem; */
    }

    /* Adjust grid for cards */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dashboard-title {
        font-size: 1.5rem;
        margin-left: 60px !important;
        padding-left: 0 !important;
        /* Move title to the right to avoid toggle button overlap */
    }

    /* More specific targeting for the title */
    .main-content .dashboard-header .dashboard-title {
        margin-left: 60px !important;
        padding-left: 0 !important;
    }

    /* Adjust auth form options */
    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    /* Make tab content more mobile-friendly */
    .tab-content {
        font-size: 14px;
    }

    /* Adjust table for mobile */
    .dashboard-table {
        font-size: 12px;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }

    .dashboard-table th,
    .dashboard-table td {
        padding: 8px 12px;
        min-width: 100px;
    }

    /* Patch Notes Modal - Ensure it's centered on mobile */
    .patch-notes-content {
        width: 95%;
        padding: 1.5rem;
    }

    /* Video Guides - Responsive Grid */
    .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        /* Better mobile fit */
        gap: 1.5rem;
    }

    .video-guides-container {
        padding: 1rem;
    }

    .video-guides-header h2 {
        font-size: 1.5rem;
    }

    /* Enhanced mobile table handling */
    .dashboard-table {
        min-width: 500px;
        /* Smaller minimum on mobile */
        font-size: 12px;
    }

    .dashboard-table th,
    .dashboard-table td {
        padding: 6px 8px;
        /* Tighter padding on mobile */
        font-size: 11px;
    }

    /* Stack cards vertically on mobile */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dashboard-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    /* Responsive status badges */
    .status-badge {
        padding: 2px 6px;
        font-size: 10px;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .sidebar:not(.collapsed) {
        width: 240px;
        /* Even smaller on very small screens */
    }

    .sidebar:not(.collapsed)::after {
        left: 240px;
        width: calc(100vw - 240px);
    }

    .sidebar:not(.collapsed) .sidebar-toggle {
        left: 224px;
    }

    .main-content {
        padding: 0.75rem;
    }

    .dashboard-header {
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }

    .dashboard-title {
        font-size: 1.25rem;
    }

    .dashboard-card {
        padding: 1rem;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .form-group input {
        padding: 10px 12px;
        font-size: 14px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/*
 Sidebar Brand Link Styling */
.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    cursor: pointer;
}

.sidebar-brand-link:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

.sidebar.collapsed .sidebar-brand-link {
    gap: 0;
    justify-content: center;
}

.sidebar.collapsed .sidebar-brand-link .sidebar-title {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Round buttons for orders table */
.dashboard-table .btn {
    border-radius: 20px !important;
    padding: 6px 12px !important;
}

/* Back to Home Button */
.back-to-home-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(20, 103, 206, 0.3);
}

.back-to-home-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 103, 206, 0.4);
    color: white;
    text-decoration: none;
}

.back-to-home-btn svg {
    flex-shrink: 0;
}

/* Responsive - hide text on mobile */
@media (max-width: 768px) {
    .back-to-home-btn span {
        display: none;
    }

    .back-to-home-btn {
        padding: 8px;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        justify-content: center;
    }
}

/* Fix over-rounded buttons - make them like subscription buttons */
.dashboard-table .btn {
    border-radius: 6px !important;
    /* Normal rounded corners, not pill-shaped */
    padding: 6px 12px !important;
}

/* Video Guides iframe - hide header/footer area */
#video-guides-content {
    position: relative;
}

#video-guides-iframe {
    width: 100% !important;
    height: 130% !important;
    margin-top: -100px !important;
    border: none !important;
    border-radius: 8px !important;
}

/* Modern Loading Bar */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-bar.active {
    opacity: 1;
}

.loading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--primary-color);
}

/* Animated loading effect */
.loading-progress.indeterminate {
    width: 30%;
    animation: loading-slide 2s infinite;
}

@keyframes loading-slide {
    0% {
        transform: translateX(-100%);
    }

    50% {
        transform: translateX(300%);
    }

    100% {
        transform: translateX(300%);
    }
}

/* Modern Video Guides Styling */
.video-guides-container {
    padding: 2rem;
    height: calc(100vh - 120px);
    overflow-y: auto;
}

.video-guides-header {
    margin-bottom: 2rem;
    text-align: center;
}

.video-guides-header h2 {
    color: var(--text-primary);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.video-guides-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

/* Video Grid Layout */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 400px));
    gap: 2rem;
    margin-bottom: 2rem;
    justify-content: start;
}

/* Individual Video Card */
.video-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 420px;
    /* Fixed height for consistent sizing */
}

.video-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(20, 103, 206, 0.2);
    transform: translateY(-2px);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 225px;
    background: #000;
    overflow: hidden;
}

.video-thumbnail iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.video-title {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    height: 2.8rem;
    /* Fixed height for 2 lines */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.video-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: auto;
    /* Push to bottom */
}

.video-duration {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.video-category {
    background: rgba(20, 103, 206, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Loading State */
.video-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .video-guides-container {
        padding: 1rem;
    }

    .video-guides-header h2 {
        font-size: 1.5rem;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        /* Better mobile fit */
        gap: 1.5rem;
    }
}

/* Enhanced Flexible Content Sizing */
.tab-content {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    /* Allow horizontal scrolling on small screens */
}

/* Flexible table containers */
.dashboard-table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Enhanced table responsiveness */
.dashboard-table {
    width: 100%;
    min-width: 600px;
    /* Minimum width to maintain readability */
    border-collapse: collapse;
    font-size: 14px;
    border: none;
}

/* Responsive text sizing */
.card-value {
    font-size: clamp(1.5rem, 4vw, 2rem);
    /* Responsive font size */
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.card-title {
    color: var(--text-primary);
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    /* Responsive title size */
    margin: 0;
}

.dashboard-title {
    color: var(--text-primary);
    font-size: clamp(1.5rem, 5vw, 2rem);
    /* Responsive main title */
    margin: 0;
}

/* Flexible form elements */
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Responsive button sizing */
.btn {
    padding: clamp(8px, 2vw, 12px) clamp(16px, 4vw, 24px);
    font-size: clamp(14px, 2.5vw, 16px);
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 0;
    /* Allow buttons to shrink */
}

/* Flexible sidebar brand */
.sidebar-logo {
    height: clamp(28px, 4vw, 32px);
    width: clamp(28px, 4vw, 32px);
    flex-shrink: 0;
}

.sidebar-title {
    color: #ffffff;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 700;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Enhanced mobile table handling */
@media (max-width: 768px) {
    .dashboard-table {
        min-width: 500px;
        /* Smaller minimum on mobile */
        font-size: 12px;
    }

    .dashboard-table th,
    .dashboard-table td {
        padding: 6px 8px;
        /* Tighter padding on mobile */
        font-size: 11px;
    }

    /* Stack cards vertically on mobile */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dashboard-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    /* Responsive status badges */
    .status-badge {
        padding: 2px 6px;
        font-size: 10px;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .dashboard-table {
        min-width: 400px;
        /* Even smaller on very small screens */
        font-size: 11px;
    }

    .dashboard-table th,
    .dashboard-table td {
        padding: 4px 6px;
        font-size: 10px;
    }

    .dashboard-card {
        padding: 0.75rem;
    }

    .card-value {
        font-size: 1.25rem;
    }

    .card-title {
        font-size: 0.9rem;
    }
}

/* Flexible content containers */
.content-container {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* Ensure all content respects container bounds */
* {
    box-sizing: border-box;
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

/* Flexible iframe for embedded content */
.responsive-iframe {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
}

.responsive-iframe iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--border-radius);
}