* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: #f9f7f3;
    color: #2d3e2c;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

#app {
    width: 100%;
    max-width: 480px;
    background: white;
    box-shadow: 0 0 30px rgba(0,0,0,0.05);
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 32px 32px 0 0;
    overflow: hidden;
}

/* Responsive Desktop */
@media (min-width: 768px) {
    #app {
        max-width: 1200px;
        border-radius: 24px;
        margin: 20px;
        min-height: calc(100vh - 40px);
    }
}

/* Screens */
.screen {
    display: none;
    flex: 1;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    padding-bottom: 80px;
}

.screen.active {
    display: flex;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.app-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2b5e2b;
    letter-spacing: -0.5px;
}

.app-header i {
    cursor: pointer;
    font-size: 1.6rem;
    color: #2b5e2b;
}

.avatar {
    background: #e1f0da;
    padding: 10px;
    border-radius: 50%;
    color: #2b5e2b;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.avatar:hover {
    background: #d0e5c9;
    transform: scale(1.05);
}

.avatar-menu {
    position: absolute;
    top: 55px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 1000;
}

.avatar-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.avatar-menu-item {
    padding: 14px 18px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2d3e2c;
    font-size: 0.95rem;
}

.avatar-menu-item:first-child {
    border-radius: 12px 12px 0 0;
}

.avatar-menu-item:last-child {
    border-radius: 0 0 12px 12px;
    border-top: 1px solid #eee;
}

.avatar-menu-item:hover {
    background: #f5f5f5;
}

.avatar-menu-item i {
    width: 20px;
    text-align: center;
}

/* Cards */
.card {
    background: white;
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.02);
    border: 1px solid #f0eee7;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-item {
    background: #faf8f2;
    padding: 16px;
    border-radius: 20px;
    border-left: 5px solid #ffb347;
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2d3e2c;
}

/* Buttons */
.btn {
    background: #2b5e2b;
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    background: #1f4a1f;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #2b5e2b;
    border: 1.5px solid #2b5e2b;
}

.btn-outline:hover {
    background: #2b5e2b;
    color: white;
}

.btn-small {
    padding: 10px 16px;
    font-size: 0.85rem;
}

/* Lists */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #efebe2;
}

.item-actions i {
    margin-left: 12px;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
}

.item-actions i:hover {
    color: #2b5e2b;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    max-width: 480px;
    width: 100%;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    border-top: 1px solid #eae5db;
    border-radius: 30px 30px 0 0;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.02);
}

@media (min-width: 768px) {
    .bottom-nav {
        max-width: 1200px;
        border-radius: 0 0 24px 24px;
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #aaa;
    font-size: 0.75rem;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-item i {
    font-size: 1.4rem;
}

.nav-item.active {
    color: #2b5e2b;
    font-weight: 600;
}

/* Sidebar */
.sidebar-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 340px;
    height: 100vh;
    background: white;
    z-index: 1000;
    padding: 30px 20px;
    transition: 0.3s;
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    border-radius: 0 20px 20px 0;
    overflow-y: auto;
}

.sidebar-menu.open {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.sidebar-header h2 {
    color: #2b5e2b;
}

.sidebar-header i {
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-item {
    padding: 18px 12px;
    font-size: 1.1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #2d3e2c;
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar-item:hover {
    background: #f5f5f5;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 999;
    display: none;
}

.overlay.show {
    display: block;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 36px;
    width: 90%;
    max-width: 400px;
    z-index: 1100;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal.active {
    display: block;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions .btn {
    flex: 1;
}

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    font-weight: 500;
    display: block;
    margin-bottom: 6px;
    color: #5a7159;
}

.form-control, select.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid #e2e8e2;
    border-radius: 40px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: white;
}

.form-control:focus, select.form-control:focus {
    outline: none;
    border-color: #2b5e2b;
}

/* Login */
#login-screen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(145deg, #f5fce8, #e6f0da);
}

.login-card {
    background: white;
    padding: 40px 25px;
    border-radius: 48px;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 3.5rem;
    color: #2b5e2b;
}

.login-header h1 {
    font-size: 2rem;
    margin-top: 10px;
}

.login-header p {
    color: #5f735a;
}

.alert {
    color: #b33;
    font-size: 0.9rem;
    margin-top: 8px;
    text-align: center;
}

/* Utilities */
.text-success {
    color: #2b5e2b;
}

.bg-soft {
    background: #f4f1e9;
}

.i-lg {
    font-size: 1.8rem;
}

.go-back {
    cursor: pointer;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #2d3e2c;
    color: white;
    padding: 14px 24px;
    border-radius: 40px;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    background: #2b5e2b;
}

.toast-error {
    background: #b33;
}

.toast-info {
    background: #2d3e2c;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2b5e2b;
    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); }
}

/* Responsive improvements */
@media (max-width: 767px) {
    .app-header h1 {
        font-size: 1.4rem;
    }
    
    .stat-number {
        font-size: 1.3rem;
    }
    
    .card {
        padding: 16px;
    }
}

@media (min-width: 768px) {
    .bottom-nav {
        padding: 16px 0;
    }
    
    .nav-item {
        font-size: 0.85rem;
    }
    
    .nav-item i {
        font-size: 1.6rem;
    }
    
    .sidebar-menu {
        max-width: 280px;
    }
}

/* Touch improvements for mobile */
@media (hover: none) and (pointer: coarse) {
    .btn, .nav-item, .sidebar-item {
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }
    
    .btn:active {
        transform: scale(0.98);
    }
}
