:root {
    --primary: #0f172a;       /* Slate 900 */
    --primary-light: #1e293b; /* Slate 800 */
    --accent: #3b82f6;        /* Blue 500 */
    --accent-hover: #2563eb;  /* Blue 600 */
    --success: #10b981;       /* Emerald 500 */
    --danger: #ef4444;        /* Red 500 */
    --background: #f8fafc;    /* Slate 50 */
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

[data-bs-theme="dark"] {
    --primary: #0f172a;       
    --primary-light: #1e293b; 
    --background: #121212;    
    --card-bg: #1e1e1e;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #333333;
}

html, body {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background) !important;
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Card overrides */
.card {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}

/* Utilities */
.bg-primary-custom {
    background-color: var(--primary) !important;
}

.text-primary-custom {
    color: var(--accent) !important;
}

.bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.1) !important;
}

.bg-danger-subtle {
    background-color: rgba(239, 68, 68, 0.1) !important;
}

.btn-custom {
    background-color: var(--accent);
    border-color: var(--accent);
    transition: all 0.2s ease;
}

.btn-custom:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
}

/* Sidebar */
.sidebar {
    width: 250px;
    z-index: 1000;
}

.main-content {
    margin-left: 250px;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

.sidebar-link {
    color: #94a3b8;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar-link:hover, .sidebar-link.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Cards */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05) !important;
}

.card-balance {
    background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
    color: white;
}

.icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Custom Radio Buttons for Modal */
.custom-radio .form-check-input {
    display: none;
}

.custom-radio .form-check-label {
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.custom-radio .form-check-input:checked + .form-check-label {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

/* Table */
.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    background-color: var(--card-bg) !important;
    color: var(--text-muted) !important;
}

.table td {
    vertical-align: middle;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    background-color: var(--card-bg) !important;
}

/* Calculator Grid */
.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.calc-btn {
    padding: 15px;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    background-color: rgba(100, 116, 139, 0.1);
    color: var(--text-main);
    transition: all 0.1s ease;
}

.calc-btn:active {
    transform: scale(0.95);
}

.calc-btn.op {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent);
}

.calc-btn.eq {
    background-color: var(--accent);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .stat-card {
        margin-bottom: 10px;
    }
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background-color: var(--card-bg);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border-color);
    z-index: 1040;
    padding-bottom: env(safe-area-inset-bottom);
    transition: background-color 0.3s ease;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    flex: 1;
    transition: color 0.2s;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.3rem;
    margin-bottom: 3px;
}

.mobile-bottom-nav .nav-item span {
    font-size: 0.7rem;
    font-weight: 600;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--accent);
}

.mobile-bottom-nav .nav-item-fab {
    position: relative;
    top: -25px;
    display: flex;
    justify-content: center;
    flex: 0.8;
}

.mobile-bottom-nav .nav-item-fab .btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 4px solid var(--background);
}
