/* Import font chữ Inter chuẩn UI hiện đại */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    /* Nền gradient nhẹ nhàng mang cảm giác y tế/công nghệ */
    background: linear-gradient(135deg, #f0f4f8 0%, #d7e3ec 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.auth-container {
    background: #ffffff;
    width: 420px;
    border-radius: 24px; /* Bo góc lớn, mềm mại hơn */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08); /* Đổ bóng sâu nhưng nhạt tạo độ nổi 3D */
    overflow: hidden;
}

.auth-header {
    /* Gradient xanh dương y tế */
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    text-align: center;
    padding: 35px 20px 25px;
}

.auth-header h2 {
    margin-bottom: 8px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.auth-header p {
    font-size: 14px;
    color: #e2e8f0;
    font-weight: 400;
}

.tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
    flex: 1;
    padding: 18px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn:hover {
    color: #1e3c72;
    background: #f1f5f9;
}

.tab-btn.active {
    color: #1e3c72;
    background: #ffffff;
}

/* Thanh gạch chân của tab chuyển động mượt hơn */
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #1e3c72;
    border-radius: 3px 3px 0 0;
}

.auth-form {
    display: none;
    padding: 35px 30px;
    animation: fadeIn 0.4s ease; /* Hiệu ứng mờ dần khi đổi tab */
}

.auth-form.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 15px;
    color: #1e293b;
    transition: all 0.2s ease;
}

.form-group input::placeholder {
    color: #94a3b8;
}

.form-group input:focus {
    outline: none;
    background: #ffffff;
    border-color: #2a5298;
    box-shadow: 0 0 0 4px rgba(42, 82, 152, 0.1); /* Vòng sáng glow khi nhấp vào ô nhập */
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.2);
}

.submit-btn:hover {
    transform: translateY(-2px); /* Hiệu ứng nút nảy lên khi di chuột */
    box-shadow: 0 6px 16px rgba(30, 60, 114, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.error-msg {
    color: #ef4444;
    font-size: 14px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 500;
}

.footer-note {
    text-align: center;
    padding: 20px;
    font-size: 13px;
    color: #94a3b8;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
}

/* =========================================================
   CSS CHO BẢNG ĐIỀU KHIỂN (TỐI ƯU CHO NGƯỜI CAO TUỔI)
   ========================================================= */
.dashboard-body {
    display: flex;
    background-color: #e2e8f0; /* Nền tối hơn một chút để làm nổi bật các thẻ trắng */
    margin: 0;
    min-height: 100vh;
    font-size: 16px; /* Tăng base font size */
}

/* Sidebar Navigation */
.sidebar {
    position: fixed; /* Cố định vị trí */
    top: 0;
    left: 0;
    width: 260px; /* Hoặc độ rộng bạn muốn */
    height: 100vh; /* Cao bằng toàn bộ màn hình */
    z-index: 1000; /* Luôn nằm trên các thành phần khác */
    background-color: #ffffff; /* Hoặc màu nền sidebar của bạn */
    box-shadow: 2px 0 5px rgba(0,0,0,0.1); /* Tạo bóng đổ nhẹ cho sang */
    overflow-y: auto; /* Nếu menu quá dài thì cho cuộn trong menu */
}

.sidebar-header {
    padding: 30px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 2px solid #f1f5f9;
}

.sidebar-header h2 {
    font-size: 24px; /* Chữ to hơn */
    color: #0f172a;
    font-weight: 700;
}

.nav-links {
    list-style: none;
    padding: 20px 0;
    flex: 1;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 25px; /* Vùng bấm to rành rọt */
    text-decoration: none;
    color: #475569;
    font-size: 18px; /* Chữ menu to rõ */
    font-weight: 600;
    transition: all 0.3s;
}

.nav-links li a i {
    width: 24px;
    font-size: 22px; /* Icon to hơn */
    text-align: center;
}

.nav-links li:hover a {
    background: #f8fafc;
    color: #1e3c72;
}

.nav-links li.active a {
    background: #eff6ff;
    color: #1d4ed8;
    border-right: 6px solid #1d4ed8; /* Vạch đánh dấu to, rõ */
}

.sidebar-footer {
    padding: 25px 20px;
    border-top: 2px solid #f1f5f9;
}

.logout-btn {
    width: 100%;
    padding: 16px;
    background: #fef2f2;
    color: #dc2626;
    border: 2px solid #f87171; /* Viền rõ ràng */
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    transition: 0.3s;
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.1); /* Nổi khối */
}

.logout-btn:hover {
    background: #dc2626;
    color: white;
}

/* Main Content Area */
.main-content {
    margin-left: 260px; /* Phải bằng với width của sidebar */
    padding: 20px;
    min-height: 100vh;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.top-header h1 {
    color: #0f172a; 
    font-size: 32px; /* Tiêu đề cực lớn */
    font-weight: 800;
}

.top-header p {
    color: #475569; 
    font-size: 18px; 
    margin-top: 8px;
    font-weight: 500;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 12px 25px;
    border-radius: 50px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.user-profile .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #1e3c72;
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile .info .name {
    font-weight: 700;
    color: #0f172a;
    font-size: 18px;
}

.user-profile .info .role {
    font-size: 14px;
    color: #64748b;
    font-weight: 600;
}

/* Lưới các ô thông tin (Dashboard Grid) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px; /* Giãn cách rộng hơn */
}

.card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
}

.card h3 {
    font-size: 22px; /* Tiêu đề thẻ to, dễ đọc */
    color: #0f172a;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.card h3 i {
    color: #2563eb;
    font-size: 26px;
}

.info-list p {
    margin-bottom: 15px;
    font-size: 18px; /* Chữ to */
    color: #334155; /* Đen nhạt, dễ đọc hơn xám */
    line-height: 1.5;
}

.info-card p {
    font-size: 18px;
    color: #334155;
    line-height: 1.8;
}

.info-card ul {
    font-size: 17px;
    color: #334155;
    margin-top: 15px;
    margin-left: 25px;
    line-height: 1.8;
}

.hospital-item {
    padding: 15px 20px; /* Vùng hiển thị rộng */
    background: #f8fafc;
    border-left: 5px solid #2563eb; /* Đánh dấu rõ ràng */
    border-radius: 8px;
    margin-bottom: 15px;
}

.hospital-item strong {
    color: #1e3c72; 
    font-size: 18px;
}

.hospital-item p {
    font-size: 16px; 
    color: #475569;
    margin-top: 5px;
}

/* Bảng Lịch sử */
.history-table th {
    font-weight: 700;
}
.history-table td {
    padding: 16px 15px;
    font-size: 17px;
    color: #334155;
    border-bottom: 1px solid #e2e8f0;
}
.history-table tbody tr:nth-child(even) {
    background-color: #f8fafc; /* Màu nền xen kẽ cho dễ đọc */
}
.history-table tbody tr:hover {
    background-color: #eff6ff; /* Sáng lên khi di chuột */
}
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    background: #e0e7ff;
    color: #3730a3;
    display: inline-block;
}