:root {
    --ideas-primary: #1e3a8a;
    --ideas-primary-dark: #0f172a;
    --ideas-accent: #0284c7;
    --ideas-accent-light: #e0f2fe;
    --sidebar-width: 270px;
    --header-height: 64px;
}

body {
    background-color: #f8fafc;
    color: #1e293b;
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Wrapper Layout with RIGHT Sidebar */
.app-wrapper {
    display: flex;
    flex-direction: row-reverse; /* Places sidebar on the RIGHT side */
    min-height: calc(100vh - var(--header-height));
    position: relative;
}

/* Right Sidebar */
.app-sidebar-right {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    min-height: calc(100vh - var(--header-height));
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.02);
    transition: margin-right 0.3s ease, transform 0.3s ease;
    z-index: 1020;
}

.app-sidebar-right.collapsed {
    margin-right: calc(-1 * var(--sidebar-width));
}

.sidebar-nav {
    padding: 1.25rem 0.75rem;
}

.sidebar-header {
    padding: 0.5rem 0.75rem 1rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    color: #475569;
    font-weight: 500;
    font-size: 0.925rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    margin-bottom: 0.25rem;
}

.sidebar-link .link-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-link i {
    font-size: 1.15rem;
    color: #64748b;
    transition: color 0.2s;
}

.sidebar-link:hover {
    background-color: var(--ideas-accent-light);
    color: var(--ideas-primary);
}

.sidebar-link:hover i {
    color: var(--ideas-accent);
}

.sidebar-link.active {
    background-color: var(--ideas-primary);
    color: #ffffff;
}

.sidebar-link.active i {
    color: #38bdf8;
}

/* Main Content Area */
.app-content {
    flex-grow: 1;
    width: calc(100% - var(--sidebar-width));
    padding: 1.75rem 2rem;
    transition: width 0.3s ease;
}

.app-sidebar-right.collapsed + .app-content {
    width: 100%;
}

/* Navbar */
.app-navbar {
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.brand-badge {
    background: linear-gradient(135deg, #0284c7 0%, #1e3a8a 100%);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

/* Cards & Widgets */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    background: #ffffff;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 1.25rem;
}

.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 0.75rem;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* Badges for status */
.badge-status {
    padding: 0.35rem 0.65rem;
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: 20px;
}

.status-pending { background-color: #fef3c7; color: #b45309; }
.status-approved { background-color: #dcfce7; color: #15803d; }
.status-rejected { background-color: #fee2e2; color: #b91c1c; }
.status-in-progress { background-color: #e0f2fe; color: #0369a1; }
.status-paid { background-color: #d1fae5; color: #047857; }
.status-partial { background-color: #fef08a; color: #854d0e; }

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .app-sidebar-right {
        position: fixed;
        right: 0;
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
        transform: translateX(0);
    }
    
    .app-sidebar-right.collapsed {
        transform: translateX(100%);
        margin-right: 0;
    }
    
    .app-content {
        width: 100% !important;
        padding: 1.25rem 1rem;
    }
}
