/* css/layout.css */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    color: var(--text-inverse);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    flex-shrink: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 40px;
    color: var(--text-inverse);
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: 0.2s;
    cursor: pointer;
}

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

.nav-item.active {
    border-left: 3px solid var(--color-primary);
}

.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 99;
    display: none; opacity: 0; transition: opacity 0.3s;
}
.sidebar-overlay.active { display: block; opacity: 1; }

/* --- Main Content Area --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

.top-bar {
    padding: 20px 40px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky; top: 0; z-index: 90;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info-group {
    text-align: right;
    line-height: 1.2;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-hover);
}

/* --- View Sections --- */
.view-section {
    padding: 20px 40px 40px 40px;
    display: none;
    animation: fadeIn 0.3s ease;
}
.view-section.active { display: block; }

/* --- Payment Layout Grid --- */
.payment-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    height: calc(100vh - 140px); /* Desktop fixed height */
    overflow: hidden;
}
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}
.action-container {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 25px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

/* --- Mobile / Responsive --- */
.mobile-menu-btn { display: none; font-size: 20px; cursor: pointer; color: var(--text-main); background: none; border: none; margin-right: 15px; }

@media (max-width: 900px) {
    body {
        overflow: auto;
        flex-direction: column;
        height: auto;
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: fixed;
        left: -280px; top: 0; bottom: 0;
        height: 100vh;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }
    .sidebar.open { transform: translateX(280px); }

    .mobile-menu-btn { display: block; }
    .top-bar { padding: 15px 20px; }
    .main-content { overflow: visible; height: auto; }
    .view-section { padding: 20px; }

    .payment-grid {
        display: flex;
        flex-direction: column-reverse;
        height: auto;
        overflow: visible;
    }

    .action-container { height: auto; overflow: visible; }
}

.sidebar-footer {
   margin-top: auto;
   padding-top: 20px;
   display: flex;
   flex-direction: column; /* Stacks items vertically */
   align-items: center;    /* Centers items horizontally */
   gap: 10px;              /* Adds a nice bit of space between them */
}
.sidebar-footer a.nav-item {
    text-decoration: none; /* Removes the underline */
    color: var(--text-muted);        /* Keeps the text color consistent */
    display: flex;         /* Ensures the icon and text align like the others */
    width: 100%;           /* Ensures the hover effect spans the width */
}

.sidebar-footer a.nav-item:hover, a.nav-item.active {
    background: rgba(255,255,255,0.05);
    color: var(--text-inverse);
}

.sidebar-footer a.nav-item.active {
    border-left: 3px solid var(--color-primary);
}

/* The Version Badge Styling */
.version-badge {
    font-size: 11px;
    font-family: 'Monaco', 'Consolas', monospace; /* Tech/Code look */
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03); /* Very subtle background */
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

/* Hover Effect */
.version-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }