:root {
    --sidebar-width: 260px;
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --sidebar-bg: #1e1b4b;
    --sidebar-text: #c7d2fe;
    --sidebar-hover: #312e81;
    --sidebar-active: #4f46e5;
}

body { font-family: 'Inter', system-ui, sans-serif; background: #f8fafc; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0; left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand h5 { color: #fff; font-weight: 700; margin: 0; font-size: 1rem; }
.sidebar-brand small { color: #a5b4fc; font-size: 0.75rem; }

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--sidebar-hover) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--sidebar-hover); border-radius: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: #4338ca; }

.sidebar-footer {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-label {
    padding: 0.5rem 1.5rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6366f1;
    font-weight: 600;
    margin-top: 0.5rem;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: 0.625rem 1.5rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
    border-left-color: #a5b4fc;
}

.sidebar-nav .nav-link i { font-size: 1rem; width: 1.25rem; }

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-content { padding: 1.5rem; flex: 1; }

/* Cards */
.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

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

/* Tables */
.table-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
    overflow: hidden;
}

.table { margin-bottom: 0; }
.table th { background: #f8fafc; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; font-weight: 600; border-bottom: 1px solid #e2e8f0; }
.table td { vertical-align: middle; font-size: 0.875rem; }

/* Forms */
.form-label { font-size: 0.8rem; font-weight: 600; color: #374151; }
.form-control, .form-select { font-size: 0.875rem; border-color: #d1d5db; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }

/* Buttons */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* Badges */
.badge { font-weight: 500; }

/* Page header */
.page-header { margin-bottom: 1.5rem; }
.page-header h4 { font-weight: 700; color: #111827; margin-bottom: 0.25rem; }
.page-header p { color: #6b7280; font-size: 0.875rem; margin: 0; }

/* Search bar */
.search-box { max-width: 280px; }

/* Empty state */
.empty-state { padding: 3rem; text-align: center; color: #9ca3af; }
.empty-state i { font-size: 3rem; margin-bottom: 1rem; }

/* Toast */
#toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; }

/* Login page */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4f46e5 100%);
    display: flex; align-items: center; justify-content: center;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
}

/* Spinner */
.table-spinner { padding: 3rem; text-align: center; }

/* Amount display */
.amount { font-weight: 600; font-family: 'Roboto Mono', monospace; }
.amount-green { color: #059669; }
.amount-red { color: #dc2626; }

/* Cash in hand badge */
.cash-badge {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
