/* Mobile-First App Navigation */
:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Header */
.app-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 60px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    height: 100%;
}

.hamburger {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    padding: 10px;
    color: var(--primary-color);
}

.app-title {
    font-size: 1.2em;
    color: var(--primary-color);
    font-weight: bold;
    flex: 1;
    text-align: center;
}

.user-badge {
    font-size: 0.85em;
    color: #666;
    display: none;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    background: var(--bg-gradient);
    color: white;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-header h2 {
    font-size: 1.3em;
    margin-bottom: 5px;
}

.sidebar-user {
    font-size: 0.9em;
    opacity: 0.9;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    border-bottom: 1px solid #f0f0f0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
    gap: 12px;
}

.nav-link:hover, .nav-link.active {
    background: #f8f9fa;
    color: var(--primary-color);
}

.nav-icon {
    font-size: 1.3em;
    width: 25px;
}

.nav-text {
    font-size: 1em;
    font-weight: 500;
}

.logout-link {
    color: var(--danger-color);
    margin-top: 20px;
}

/* Overlay */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.overlay.show {
    display: block;
}

/* Main Content */
.app-content {
    margin-top: 60px;
    padding: 15px;
    min-height: calc(100vh - 60px);
}

/* Page Container */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin: 0;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95em;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: #333;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85em;
}

.btn-block {
    width: 100%;
    margin-bottom: 10px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.quick-action-btn {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
}

.quick-action-icon {
    font-size: 2.5em;
}

.quick-action-text {
    font-weight: bold;
    font-size: 0.95em;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Tablet and Desktop */
@media (min-width: 768px) {
    .hamburger {
        display: none;
    }
    
    .user-badge {
        display: block;
    }
    
    .sidebar {
        left: 0;
    }
    
    .app-content {
        margin-left: 280px;
    }
    
    .overlay {
        display: none !important;
    }
    
    .app-header {
        left: 280px;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
