/* =========================================
   CORE & VARIABLES
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-color: #F2F2F7;
    --surface: #FFFFFF;
    --primary: #007AFF;
    --primary-bg: #E5F1FF;
    --text-main: #1C1C1E;
    --text-muted: #8E8E93;
    --border-color: rgba(60, 60, 67, 0.1);
    --danger: #FF3B30;
    --nav-height: 65px;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Inter', -apple-system, sans-serif; 
    -webkit-tap-highlight-color: transparent; 
}

body { 
    background-color: var(--bg-color); 
    color: var(--text-main); 
}

body.has-bottom-nav {
    padding-bottom: calc(var(--nav-height) + 20px);
}

.container { 
    padding: 20px; 
    max-width: 768px; 
    margin: 0 auto; 
    width: 100%;
}

/* =========================================
   TOP NAVIGATION
   ========================================= */
.top-bar { 
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px); 
    padding: 16px 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    position: sticky; 
    top: 0; 
    z-index: 10; 
    border-bottom: 1px solid var(--border-color); 
}
.top-title { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }
.top-action { color: var(--danger); text-decoration: none; font-size: 24px; display: flex; align-items: center; }

/* =========================================
   BOTTOM NAVIGATION
   ========================================= */
.bottom-nav { 
    background: rgba(255, 255, 255, 0.9); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px); 
    border-top: 1px solid var(--border-color); 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    height: var(--nav-height); 
    display: flex; 
    justify-content: space-around; 
    align-items: center; 
    z-index: 100; 
    padding-bottom: env(safe-area-inset-bottom); 
}
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: var(--text-muted); font-size: 11px; font-weight: 500; width: 25%; height: 100%; }
.nav-item i { font-size: 24px; margin-bottom: 3px; }
.nav-item.active { color: var(--primary); }
@media (min-width: 769px) { .bottom-nav { max-width: 768px; left: 50%; transform: translateX(-50%); border-radius: 20px 20px 0 0; } }

/* =========================================
   CARDS & LISTS
   ========================================= */
.section-title { font-size: 15px; font-weight: 600; color: var(--text-main); margin-bottom: 12px; margin-top: 24px; }
.card { background: var(--surface); border-radius: 16px; padding: 24px 20px; box-shadow: 0 4px 24px rgba(0,0,0,0.04); }

.module-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
.module-card { background: var(--surface); border-radius: 16px; padding: 20px 16px; text-decoration: none; display: flex; flex-direction: column; align-items: flex-start; box-shadow: 0 2px 8px rgba(0,0,0,0.04); transition: transform 0.2s; }
.module-card:active { transform: scale(0.96); }
.module-name { font-size: 15px; font-weight: 600; color: var(--text-main); margin-bottom: 4px; }
.module-desc { font-size: 12px; color: var(--text-muted); }

/* =========================================
   ICONS (Tái sử dụng cho mọi module)
   ========================================= */
.icon-box { width: 44px; height: 44px; border-radius: 12px; display: flex; justify-content: center; align-items: center; font-size: 24px; margin-bottom: 12px; }
.icon-blue { background: #E5F1FF; color: #007AFF; }
.icon-green { background: #E8F5E9; color: #34C759; }
.icon-purple { background: #F3E5F5; color: #AF52DE; }
.icon-orange { background: #FFF3E0; color: #FF9500; }

/* =========================================
   FORMS & BUTTONS (Dùng chung cho Login & Cài đặt)
   ========================================= */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-input { width: 100%; background: var(--bg-color); border: 2px solid transparent; border-radius: 12px; padding: 14px 16px; font-size: 16px; transition: all 0.3s ease; outline: none; color: var(--text-main); }
.form-input:focus { border-color: rgba(0, 122, 255, 0.3); background: var(--surface); box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1); }

.btn { width: 100%; text-align: center; border: none; border-radius: 12px; padding: 16px; font-size: 16px; font-weight: 600; cursor: pointer; transition: opacity 0.2s, transform 0.2s; text-decoration: none; display: block; }
.btn:active { opacity: 0.8; transform: scale(0.98); }
.btn-primary { background: var(--primary); color: white; }

.alert-error { background: rgba(255, 59, 48, 0.1); color: var(--danger); padding: 14px; border-radius: 12px; font-size: 14px; margin-bottom: 20px; text-align: center; font-weight: 500; }
