@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Roboto:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0');

:root {
    --primary: #0b57d0;
    --on-primary: #ffffff;
    --surface: #f6f8fc; /* Nền Gmail mới */
    --surface-bright: #ffffff;
    --text-main: #1f1f1f;
    --text-sub: #444746;
    --outline: #c4c7c5;
    --active-bg: #d3e3fd; /* Màu xanh active của Gmail */
    --active-text: #001d35;
    --sidebar-width: 260px;
    --header-height: 64px;
}

* { box-sizing: border-box; }
body { font-family: 'Roboto', sans-serif; background: var(--surface); color: var(--text-main); margin: 0; padding: 0; height: 100vh; overflow: hidden; }
h1, h2, h3, .brand { font-family: 'Google Sans', sans-serif; }
a { text-decoration: none; color: inherit; }
.material-symbols-outlined { font-size: 24px; vertical-align: middle; }

/* --- COMMON UTILS --- */
.btn { border: none; cursor: pointer; border-radius: 24px; padding: 0 24px; height: 40px; font-family: 'Google Sans'; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; transition: 0.2s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { box-shadow: 0 1px 3px rgba(0,0,0,0.3); background: #155cb0; }
.btn-text { background: transparent; color: var(--primary); }
.btn-icon { width: 40px; padding: 0; justify-content: center; border-radius: 50%; color: var(--text-sub); }
.btn-icon:hover { background: rgba(0,0,0,0.05); }

/* --- AUTH & INDEX --- */
.landing-body { overflow-y: auto; background: white; }
.landing-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 40px; max-width: 1200px; margin: 0 auto; }
.logo-area { display: flex; align-items: center; gap: 10px; font-size: 22px; color: #5f6368; font-family: 'Google Sans'; }
.hero-section { text-align: center; padding: 80px 20px; max-width: 900px; margin: 0 auto; }
.hero-title { font-size: 56px; line-height: 1.1; margin-bottom: 20px; color: #202124; }
.hero-desc { font-size: 20px; color: #5f6368; max-width: 600px; margin: 0 auto 40px; }

/* --- GMAIL DASHBOARD LAYOUT --- */
.g-layout { display: flex; flex-direction: column; height: 100vh; }
.g-header { height: var(--header-height); background: var(--surface); padding: 0 16px; display: flex; align-items: center; justify-content: space-between; }
.g-search-wrapper { flex: 1; max-width: 720px; margin: 0 20px; }
.g-search { background: #eaf1fb; border-radius: 24px; height: 48px; display: flex; align-items: center; padding: 0 16px; transition: 0.2s; }
.g-search:focus-within { background: white; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.g-search input { border: none; background: transparent; flex: 1; height: 100%; margin-left: 10px; font-size: 16px; outline: none; }

.g-body { display: flex; flex: 1; overflow: hidden; }
.g-sidebar { width: var(--sidebar-width); padding: 0 12px; display: flex; flex-direction: column; }
.g-compose-btn { background: #c2e7ff; color: #001d35; border-radius: 16px; height: 56px; width: 140px; margin: 8px 0 16px 0; font-weight: 600; padding: 0 20px; transition: 0.2s; border: none; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.g-compose-btn:hover { box-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.g-nav-item { padding: 0 12px 0 26px; height: 32px; border-radius: 16px; display: flex; align-items: center; gap: 18px; color: var(--text-main); font-size: 14px; cursor: pointer; font-weight: 500; }
.g-nav-item.active { background: var(--active-bg); color: var(--active-text); font-weight: 700; }
.g-nav-item .material-symbols-outlined { font-size: 20px; }

.g-main { flex: 1; background: white; border-radius: 16px; margin: 0 12px 12px 0; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 0 10px rgba(0,0,0,0.02); }
.g-toolbar { height: 48px; border-bottom: 1px solid #e0e0e0; display: flex; align-items: center; padding: 0 16px; gap: 20px; }
.g-list { overflow-y: auto; flex: 1; }
.g-row { display: flex; padding: 10px 16px; border-bottom: 1px solid #f2f2f2; cursor: pointer; align-items: center; }
.g-row:hover { box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px 0 rgba(60,64,67,.3); z-index: 1; position: relative; }
.g-row.unread { background: #fff; font-weight: 700; }
.g-row.read { background: rgba(242,246,252, 0.5); font-weight: 400; color: #444; }

/* --- ADMIN PANEL LAYOUT --- */
.admin-layout { display: flex; height: 100vh; background: #f8f9fa; }
.admin-sidebar { width: 280px; background: white; border-right: 1px solid #ddd; display: flex; flex-direction: column; }
.admin-logo { padding: 20px; font-size: 20px; font-weight: bold; color: var(--primary); border-bottom: 1px solid #eee; display: flex; align-items: center; gap: 10px; }
.admin-menu { padding: 20px; flex: 1; }
.admin-link { display: flex; align-items: center; gap: 15px; padding: 12px 15px; border-radius: 8px; color: #555; margin-bottom: 5px; transition: 0.2s; }
.admin-link:hover, .admin-link.active { background: #e8f0fe; color: var(--primary); }
.admin-content { flex: 1; overflow-y: auto; padding: 30px; }
.admin-card { background: white; border-radius: 8px; padding: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); margin-bottom: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat-box { background: white; padding: 20px; border-radius: 8px; border: 1px solid #eee; }
.stat-num { font-size: 28px; font-weight: bold; color: var(--text-main); margin: 10px 0; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.data-table th, .data-table td { text-align: left; padding: 12px; border-bottom: 1px solid #eee; font-size: 14px; }
.data-table th { color: #888; font-weight: 500; font-size: 12px; text-transform: uppercase; }
.badge { padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; }
.badge-green { background: #e6f4ea; color: #137333; }
.badge-red { background: #fce8e6; color: #c5221f; }
/* --- PHẦN BỔ SUNG CHO LOGIN & REGISTER --- */
.auth-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #f0f4f9; }
.auth-card { background: white; padding: 48px 40px 36px; border-radius: 28px; width: 100%; max-width: 450px; }
.auth-header { text-align: center; margin-bottom: 30px; }
.auth-title { font-size: 24px; font-weight: 400; color: var(--text-main); margin: 10px 0; }
.input-group { margin-bottom: 20px; }
.input-field { width: 100%; padding: 13px 15px; border: 1px solid var(--outline); border-radius: 4px; font-size: 16px; transition: 0.2s; box-sizing: border-box; }
.input-field:focus { border: 2px solid var(--primary); padding: 12px 14px; outline: none; }
.auth-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; }
.btn-link { color: var(--primary); font-weight: 500; font-size: 14px; }
.btn-outlined { border: 1px solid var(--outline); background: transparent; color: var(--primary); font-weight: 500; }
.btn-outlined:hover { background: #f0f4f9; border-color: var(--primary); }

/* Logo Text Branding */
.brand-text { font-family: 'Google Sans', sans-serif; font-size: 24px; color: var(--text-sub); display: flex; align-items: center; gap: 10px; justify-content: center; }