:root {
    --r2d-sidebar-bg: #1A3E53;
    --r2d-main-bg: #f8f9fa;
    --r2d-text-light: #ffffff;
    --r2d-text-dark: #333;
    --r2d-primary-red: #d9534f;
    --r2d-active-green: #5cb85c;
    --r2d-draft-blue: #337ab7;
    --r2d-closed-blue: #2c5b8b;
    --r2d-border-color: #e9ecef;
    --r2d-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.r2d-dashboard-container {
    display: flex;
}

.hidden {
    display: none !important;
}

/* --- Enhanced Sidebar Layout --- */
#r2d-dashboard-sidebar {
    background-color: var(--r2d-sidebar-bg);
    color: var(--r2d-text-light);
    width: 260px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    /* Key for fixed footer */
    height: 100vh;
    position: sticky;
    top: 0;
    transition: width 0.3s ease;
}

.r2d-sidebar-header {
    flex-shrink: 0;
    /* Prevent header from shrinking */
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding: 0 5px;
}

.r2d-sidebar-logo h2 {
    font-size: 1.4rem;
    font-weight: 700;
    white-space: nowrap;
}

#r2d-sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--r2d-text-light);
    font-size: 1.3rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

/* Scrollable Navigation Area */
.r2d-sidebar-nav-container {
    flex-grow: 1;
    /* Allows this section to fill space */
    overflow-y: auto;
    /* Adds scrollbar ONLY when needed */
    padding-right: 15px;
}

.r2d-sidebar-nav-container::-webkit-scrollbar {
    width: 6px;
}

.r2d-sidebar-nav-container::-webkit-scrollbar-track {
    background: transparent;
}

.r2d-sidebar-nav-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

.r2d-sidebar-section-title {
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    /* margin: 15px 0 8px 15px; */
    white-space: nowrap;
}

.r2d-sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 3px;
    text-decoration: none;
    color: #d0d5e1;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    font-size: 0.9rem;
    cursor: pointer;
}

.r2d-sidebar-nav-item i {
    width: 25px;
    font-size: 1rem;
    margin-right: 15px;
    text-align: center;
}

.r2d-sidebar-nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--r2d-text-light);
}

.r2d-sidebar-nav-item.r2d-active {
    background-color: var(--r2d-primary-red);
    color: var(--r2d-text-light);
    font-weight: 500;
}

/* Fixed Footer */
.r2d-sidebar-footer {
    flex-shrink: 0;
    /* Prevent footer from shrinking */
    padding-top: 10px;
}

.r2d-view-mode {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 0;
}

.r2d-view-mode-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #c0cde0;
}

.r2d-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.r2d-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.r2d-view-mode-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color:rgb(249, 99, 75);
    transition: .4s;
    border-radius: 26px;
}

.r2d-view-mode-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input#r2d-view-mode-toggle:checked+.r2d-view-mode-slider {
    background-color: var(--r2d-draft-blue);
}

/* User color */
input#r2d-view-mode-toggle:checked+.r2d-view-mode-slider:before {
    transform: translateX(24px);
}

/* --- Collapsed Sidebar --- */
#r2d-dashboard-sidebar.r2d-collapsed {
    width: 80px;
    padding: 15px 10px;
}

#r2d-dashboard-sidebar.r2d-collapsed .r2d-sidebar-logo h2,
#r2d-dashboard-sidebar.r2d-collapsed .r2d-sidebar-nav-item span,
#r2d-dashboard-sidebar.r2d-collapsed .r2d-sidebar-section-title,
#r2d-dashboard-sidebar.r2d-collapsed .r2d-view-mode-label {
    display: none;
}

#r2d-dashboard-sidebar.r2d-collapsed .r2d-sidebar-header,
#r2d-dashboard-sidebar.r2d-collapsed .r2d-sidebar-nav-item {
    justify-content: center;
}

#r2d-dashboard-sidebar.r2d-collapsed #r2d-sidebar-toggle {
    transform: rotate(180deg);
}

#r2d-dashboard-sidebar.r2d-collapsed .r2d-sidebar-nav-item i {
    margin-right: 0;
    font-size: 1rem;
}

/* --- Main Content --- */
#r2d-dashboard-main {
    flex-grow: 1;
    padding: 25px 30px;
    height: 100vh;
    overflow-y: auto;
}

.r2d-content-page {
    border-radius: 8px;
}

.r2d-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.r2d-dashboard-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.r2d-dashboard-header-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.r2d-header-icon {
    font-size: 1.3rem;
    color: #555;
    cursor: pointer;
}

.r2d-admin-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

/* Placeholder Pages */
.r2d-placeholder-page {
    padding: 40px;
    background-color: #fff;
    border: 1px solid var(--r2d-border-color);
    border-radius: 8px;
    text-align: center;
}

.r2d-placeholder-page i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 20px;
}

.r2d-placeholder-page h2 {
    font-size: 2rem;
    color: #555;
}

.r2d-placeholder-page p {
    color: #888;
}

/* Original Dashboard Page Styles */
.r2d-dataroom-overview {
    margin-bottom: 30px;
}

.r2d-overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.r2d-create-dataroom-btn {
    background-color: var(--r2d-primary-red);
    color: white;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.r2d-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.r2d-stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--r2d-shadow);
    border: 1px solid var(--r2d-border-color);
}

.r2d-stat-card-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.r2d-stat-info p {
    color: #888;
    font-size: 0.9rem;
}

.r2d-stat-info h3 {
    font-size: 2.2rem;
    font-weight: 600;
}

.r2d-stat-icon {
    padding: 10px;
    border-radius: 6px;
    font-size: 1.3rem;
    color: white;
}

.r2d-icon-total {
    background-color: var(--r2d-primary-red);
}

.r2d-icon-active {
    background-color: var(--r2d-active-green);
}

.r2d-icon-draft {
    background-color: var(--r2d-draft-blue);
}

.r2d-icon-closed {
    background-color: var(--r2d-closed-blue);
}

/* --- All Datarooms Section --- */
.r2d-all-datarooms {
    background: var(--r2d-text-light);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--r2d-shadow);
    border: 1px solid var(--r2d-border-color);
}

.r2d-all-datarooms h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.r2d-dataroom-list-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr;
    padding: 0 15px 15px 15px;
    border-bottom: 2px solid var(--r2d-border-color);
    font-weight: 600;
    color: #777;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.r2d-dataroom-item {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--r2d-border-color);
}

.r2d-dataroom-item:last-child {
    border-bottom: none;
}

.r2d-dataroom-name {
    display: flex;
    align-items: center;
    gap: 15px;
}

.r2d-dataroom-icon {
    background-color: var(--r2d-closed-blue);
    color: white;
    min-width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.r2d-dataroom-details p {
    font-weight: 600;
    font-size: 0.95rem;
}

.r2d-dataroom-details span {
    font-size: 0.75rem;
    color: #888;
    line-height: 1.4;
}

.r2d-dataroom-status span {
    padding: 4px 12px;
    border-radius: 15px;
    font-weight: 500;
    font-size: 0.8rem;
    color: white;
}

.r2d-status-active {
    background-color: var(--r2d-active-green);
}

.r2d-status-draft {
    background-color: var(--r2d-draft-blue);
}

.r2d-dataroom-duration {
    font-size: 0.9rem;
    color: #555;
}

.r2d-dataroom-duration i {
    margin-right: 8px;
}

.r2d-dataroom-duration span {
    font-size: 0.75rem;
    color: #888;
    display: block;
}

.r2d-dataroom-actions a {
    color: #555;
    font-size: 1.1rem;
    margin-right: 15px;
    text-decoration: none;
    transition: color 0.2s;
}

.r2d-dataroom-actions a:hover {
    color: var(--r2d-primary-red);
}

/* --- Responsive Design --- */
@media (max-width: 1200px) {

    .r2d-dataroom-list-header,
    .r2d-dataroom-item {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

@media (max-width: 992px) {
    .r2d-dataroom-item {
        grid-template-columns: 1fr;
        gap: 15px;
        text-align: left;
    }

    .r2d-dataroom-status,
    .r2d-dataroom-duration,
    .r2d-dataroom-actions {
        padding-left: 53px;
    }

    /* Align with dataroom text */
    #r2d-dashboard-sidebar {
        left: -280px;
        z-index: 1000;
        position: fixed;
    }

    #r2d-dashboard-sidebar.r2d-show {
        left: 0;
    }

}