/* Mobile-First CSS for Cash Book App */
:root {
    --primary-color: #1976d2;
    --secondary-color: #dc3545;
    --success-color: #28a745;
    --dark-bg: #f8f9fa;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    padding-bottom: 70px;
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 8px 0;
}

.nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    font-size: 12px;
    transition: all 0.3s;
    padding: 8px 12px;
    border-radius: 8px;
}

.nav-item i {
    font-size: 24px;
    margin-bottom: 4px;
}

.nav-item.active {
    color: var(--primary-color);
    background: rgba(25, 118, 210, 0.1);
}

.nav-item:hover {
    color: var(--primary-color);
    background: rgba(25, 118, 210, 0.05);
}

/* App Header */
.app-header {
    background: white;
    padding: 12px 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 999;
}

/* Main Content */
.main-content {
    padding: 16px;
    min-height: calc(100vh - 70px);
}

.main-content.with-nav {
    margin-bottom: 70px;
}

/* Cards */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    margin-bottom: 16px;
    transition: transform 0.2s;
}

.card:active {
    transform: scale(0.98);
}

.card-header {
    background: white;
    border-bottom: 1px solid #eee;
    padding: 16px;
    font-weight: 600;
    border-radius: 16px 16px 0 0;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 12px;
    border: 1px solid #ddd;
    padding: 10px 12px;
    font-size: 16px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(25, 118, 210, 0.25);
}

/* Buttons */
.btn {
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    border: none;
}

.btn-primary:active {
    transform: scale(0.96);
}

/* Tables */
.table-responsive {
    border-radius: 12px;
    overflow-x: auto;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--dark-bg);
    font-weight: 600;
    font-size: 14px;
    padding: 12px;
}

.table tbody td {
    padding: 12px;
    vertical-align: middle;
    font-size: 14px;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1050;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-menu {
    padding: 20px;
}

.sidebar-item {
    display: block;
    padding: 12px 16px;
    margin-bottom: 8px;
    color: #333;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s;
}

.sidebar-item:hover {
    background: rgba(25, 118, 210, 0.1);
    color: var(--primary-color);
}

.sidebar-item i {
    margin-right: 12px;
    font-size: 20px;
    vertical-align: middle;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

/* Dashboard Stats */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: var(--card-shadow);
}

.stat-card i {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-card h3 {
    font-size: 24px;
    margin: 8px 0;
    font-weight: bold;
}

.stat-card p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Voucher Entries */
.voucher-entry {
    background: var(--dark-bg);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
}

.entry-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

/* Mobile Responsive */
@media (min-width: 768px) {
    .mobile-nav {
        display: none;
    }
    
    .main-content.with-nav {
        margin-bottom: 0;
    }
    
    .sidebar {
        position: sticky;
        top: 0;
        left: 0;
        width: 260px;
        height: 100vh;
        display: block;
    }
    
    .app-header .btn-link {
        display: none;
    }
    
    body {
        display: flex;
    }
    
    .sidebar ~ .main-content {
        flex: 1;
        margin-left: 0;
    }
}

@media (max-width: 767px) {
    .sidebar ~ .main-content {
        width: 100%;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    h1, h2, h3 {
        font-size: 1.5rem;
    }
    
    .table td, .table th {
        font-size: 13px;
        padding: 8px;
    }
}

/* Print Styles */
@media print {
    .mobile-nav, .app-header, .sidebar, .btn, .no-print {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}