/* * Tên file: assets/style.css
 * Phân hệ: System/Global
 * Phiên bản: v12.1 (High Contrast + Restore Dashboard UI)
 * Ngày cập nhật: Sprint 11
 * Mô tả: 
 * - HOTFIX (v12.1): Phục hồi toàn bộ kiến trúc 3 cột (Dashboard Info Hub) của clinic_today.php.
 * - HOTFIX (v12.1): Sửa lỗi mất cuộn dọc và Footer đè nội dung bằng cách tối ưu padding-bottom và overflow-y cho .main-content.
 * - SPRINT 11 (v12.0): Chuẩn hóa tương phản tuyệt đối. Triệt tiêu chữ xám mờ. Chữ trên Header/Sidebar 100% Trắng/Vàng.
 */

:root {
    --header-height: 60px;
    --sidebar-width: 260px;
    --footer-height: 55px; 
    
    /* BẢNG MÀU Y TẾ TƯƠI SÁNG & TƯƠNG PHẢN CAO */
    --color-primary: #1a73e8;    
    --color-primary-dark: #0d47a1; 
    
    --color-text-main: #0f172a;  /* Xanh đen cực đậm, dễ đọc hơn đen tuyền */
    --color-bg-body: #f4f7fb;    
    --color-bg-card: #ffffff;
    
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg-body);
    /* Nền họa tiết Y tế mờ (Chữ thập) */
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 15h10v10h-10z M20 5v30 M5 20h30' stroke='%231a73e8' stroke-width='1' fill='none' fill-rule='evenodd' opacity='0.04'/%3E%3C/svg%3E");
    color: var(--color-text-main);
    overflow-x: hidden;
}

/* =========================================================
   GLOBAL CONTRAST & ACCESSIBILITY FIXES (SPRINT 11)
   ========================================================= */
/* 1. KHÔNG DÙNG CHỮ XÁM MỜ. Chuyển text-muted thành xám đậm sắc nét */
.text-muted { color: #374151 !important; font-weight: 600 !important; }
.text-secondary { color: #1e293b !important; font-weight: 700 !important; }

/* 2. KHÔNG CHO PHÉP OPACITY QUÁ THẤP. Nâng giới hạn làm mờ */
.opacity-25 { opacity: 0.75 !important; }
.opacity-50 { opacity: 0.85 !important; }
.opacity-75 { opacity: 0.95 !important; }

/* 3. MÀU TƯƠNG PHẢN TRÊN NỀN XANH (HEADER/SIDEBAR/FOOTER) */
.sidebar *, .top-header *, .footer-bar-single * { text-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.sidebar .text-muted, .top-header .text-muted, .footer-bar-single .text-muted,
.sidebar .opacity-50, .top-header .opacity-50, .footer-bar-single .opacity-50,
.sidebar .text-dark, .top-header .text-dark, .footer-bar-single .text-dark {
    color: #ffffff !important; 
    opacity: 1 !important;
}

/* 4. CHUẨN HÓA MÀU NỀN BADGE VÀ NỀN CHUNG */
.bg-light { background-color: #f8fafc !important; color: #0f172a !important; border: 1px solid #e2e8f0; }
.bg-secondary { background-color: #334155 !important; color: #ffffff !important; }
.badge { border: 1px solid rgba(0,0,0,0.1); padding: 0.45em 0.65em; font-weight: 700; letter-spacing: 0.3px; }
.badge.bg-light { background-color: #ffffff !important; color: #1e293b !important; border: 2px solid #cbd5e1 !important; }

/* 5. GHI ĐÈ MÀU CHỮ CHÍNH THEO CHUẨN (Đậm, Rực, Rõ nét) */
.text-info { color: #087990 !important; font-weight: 800 !important; }
.text-success { color: #15803d !important; font-weight: 800 !important; }
.text-warning { color: #b45309 !important; font-weight: 800 !important; }
.text-danger { color: #dc2626 !important; font-weight: 800 !important; }
.text-primary { color: #1d4ed8 !important; font-weight: 800 !important; }
.fst-italic { font-style: normal !important; } 

/* =========================================================
   LAYOUT CHÍNH
   ========================================================= */
.layout-fixed { height: 100vh; overflow: hidden; }

/* SIDEBAR */
.layout-fixed .sidebar {
    width: var(--sidebar-width);
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 1000;
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-right: 1px solid rgba(0,0,0,0.1);
    display: flex; flex-direction: column; color: white;
    box-shadow: 2px 0 15px rgba(0,0,0,0.15);
}

.sidebar-brand {
    height: var(--header-height);
    display: flex; align-items: center; padding: 0 20px;
    font-weight: 800; color: white; letter-spacing: 1px; text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.2); 
    background: rgba(255,255,255,0.1);
}

.nav-link {
    color: rgba(255,255,255,0.95); 
    padding: 12px 15px; margin: 4px 15px; 
    display: flex; align-items: center;
    text-decoration: none; font-weight: 700;
    border-radius: 12px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-link:hover { background-color: rgba(255,255,255,0.2); color: #ffffff; transform: translateX(5px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.nav-link.active { background-color: #ffffff; color: var(--color-primary-dark) !important; font-weight: 900; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }

.nav-link i { 
    margin-right: 12px; font-size: 1.2rem; width: 36px; height: 36px; 
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.15); border-radius: 10px; color: #ffffff !important; transition: all 0.3s ease;
}
.nav-link:hover i { transform: scale(1.08); background: rgba(255, 255, 255, 0.25); }
.nav-link.active i { background: var(--color-primary); color: #ffffff !important; box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3); }

/* HEADER */
.layout-fixed .top-header {
    height: var(--header-height); margin-left: var(--sidebar-width);
    background: linear-gradient(90deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    color: #ffffff; 
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; position: fixed; top: 0; right: 0; left: 0; z-index: 900;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

/* KHU VỰC NỘI DUNG CHÍNH (ĐÃ FIX LỖI CUỘN & CHE FOOTER) */
.layout-fixed .main-content {
    margin-left: var(--sidebar-width); 
    margin-top: var(--header-height);
    height: calc(100vh - var(--header-height)); 
    /* Padding-bottom cao hơn footer một chút để khi cuộn đến đáy không bị che thông tin */
    padding-bottom: calc(var(--footer-height) + 20px); 
    overflow-y: auto; 
    overflow-x: hidden;
    position: relative; 
}

/* FOOTER */
.footer-bar-single { 
    position: fixed; bottom: 0; left: var(--sidebar-width); right: 0; height: var(--footer-height); 
    background: linear-gradient(90deg, var(--color-primary-dark) 0%, var(--color-primary) 100%); 
    z-index: 1050; display: flex; align-items: center; justify-content: space-between; 
    padding: 0 30px; box-shadow: 0 -4px 15px rgba(0,0,0,0.15); color: white; border-top: 1px solid rgba(255,255,255,0.2);
}

/* BẢNG DỮ LIỆU & SCROLL */
.card, .card-custom, .detail-card, .widget-box, .card-main { 
    background: var(--color-bg-card); border-radius: 12px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.06); border: 1px solid rgba(13, 110, 253, 0.2); 
}
.table { border-collapse: separate; border-spacing: 0; }
.table th { background-color: #f1f5f9; color: #0f172a; font-weight: 900; border-bottom: 2px solid #cbd5e1; padding: 12px 10px; text-transform: uppercase;}
.table td { border-color: #e2e8f0; vertical-align: middle; font-weight: 500;}
.table-hover tbody tr:hover { background-color: #eff6ff !important; box-shadow: inset 4px 0 0 var(--color-primary); cursor: pointer;}

.scrollable-widget { max-height: 400px; overflow-y: auto; overflow-x: hidden; padding-right: 5px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px;}
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; border: 2px solid #f1f5f9;}
::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* KÍCH THƯỚC AVATAR CHỐNG VỠ GIAO DIỆN */
.user-avatar { 
    width: 35px !important; height: 35px !important; 
    border-radius: 50%; background: #fff; 
    border: 2px solid #e2e8f0; object-fit: cover;
}

.status-indicator { display: inline-block; width: 12px; height: 12px; border-radius: 50%; animation: blink 2s infinite; }
.status-indicator.online { background-color: #22c55e; box-shadow: 0 0 8px #22c55e; border: 2px solid #fff;}
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0.6; } 100% { opacity: 1; } }

/* =========================================================
   UI TRANG ĐIỀU PHỐI LỊCH (Bóc tách để dễ quản lý)
   ========================================================= */
.regimen-row { background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; transition: 0.2s; }
.sticky-left-col { position: sticky; top: 20px; align-self: flex-start; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 5px; padding-bottom: 20px;}

.left-menu-box { transition: all 0.2s; position: relative; border: 2px solid #e2e8f0; cursor: pointer; border-radius: 12px; background: #fff; padding: 15px;}
.left-menu-box:hover { border-color: var(--color-primary); box-shadow: 0 5px 15px rgba(13, 110, 253, 0.15); transform: translateY(-2px); }
.avatar-frame { width: 85px; height: 85px; border: 4px solid #f8fafc; box-shadow: 0 4px 10px rgba(0,0,0,0.15); object-fit: cover; border-radius: 50%; }

.list-dates { min-height: 250px; max-height: 520px; overflow-y: auto; background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 12px; padding: 12px; }
.row-session, .row-completed, .row-cancelled, .row-empty { padding: 8px 12px !important; margin-bottom: 10px !important; border-radius: 8px !important; background-color: #ffffff; border: 1px solid #cbd5e1;}
.row-completed { background-color: #f0fdf4 !important; border-left: 5px solid #16a34a !important; border-color: #bbf7d0 !important;}
.row-scheduled { border-left: 5px solid #2563eb !important; transition: 0.2s; border-color: #bfdbfe !important;}
.row-cancelled { background-color: #f8fafc !important; border-left: 5px solid #dc2626 !important; border-color: #fecaca !important;}
.row-empty { border: 2px dashed #94a3b8 !important; border-left: 5px solid #94a3b8 !important; background-color: #f8fafc !important;}

/* Mini Calendar */
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 800; color: var(--color-primary); }
.cal-btn { cursor: pointer; border: 2px solid #bfdbfe; background: #fff; color: var(--color-primary); border-radius: 6px; padding: 4px 12px; font-size: 0.9rem; transition: 0.2s; font-weight: 800;}
.cal-btn:hover { background: var(--color-primary); color: white; border-color: var(--color-primary);}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-day { padding: 8px 0; border: 2px solid #e2e8f0; cursor: pointer; border-radius: 6px; font-size: 0.85rem; font-weight: 700; background: #fff; transition: 0.2s; color: #1e293b;}
.cal-day:hover { background: #eff6ff; color: var(--color-primary); border-color: #93c5fd;}
.cal-day.selected { background: var(--color-primary) !important; color: #fff !important; box-shadow: 0 4px 10px rgba(13,110,253,0.3); border-color: var(--color-primary);}
.cal-day.completed { background: #16a34a !important; color: #fff !important; border-color: #15803d;}
.cal-day.disabled { cursor: not-allowed; pointer-events: none; background: #f1f5f9; border-color: #e2e8f0; color: #94a3b8; text-decoration: line-through;}

/* =========================================================
   RESTORED: DASHBOARD 3-COLUMN ARCHITECTURE & INFO HUB
   (Đã phục hồi hiển thị cột phải trên trang clinic_today.php)
   ========================================================= */
.dashboard-wrapper { height: calc(100vh - 135px); display: flex; gap: 15px; }
.workspace-center { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 15px; overflow-y: auto; padding-right: 5px; }
.workspace-right { flex: 0 0 320px; width: 320px; display: flex; flex-direction: column; gap: 15px; overflow-y: auto; padding-right: 5px; }

/* Các khối Widget bên trong */
.widget-box { background: rgba(255,255,255,0.95); border: 1px solid rgba(13, 110, 253, 0.2); border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.06); display: flex; flex-direction: column; overflow: hidden; }
.widget-header { background: #f8fafc; font-size: 0.85rem; font-weight: 900; padding: 12px 15px; border-bottom: 2px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 10; color: #0f172a; text-transform: uppercase;}

/* Bảng tin & Giấy nhớ (Right Hub) */
.sop-item { padding: 12px 15px; border-bottom: 1px dashed #cbd5e1; font-size: 0.9rem; display: flex; gap: 10px; align-items: flex-start; color: #1e293b; font-weight: 600;}
.sop-num { font-weight: 900; color: #ffffff; background: var(--color-primary); padding: 2px 8px; border-radius: 6px; box-shadow: 0 2px 5px rgba(26,115,232,0.3);}
.sys-notice { padding: 10px; margin: 10px 15px; border-radius: 8px; font-size: 0.85rem; background: #f0fdf4; border-left: 4px solid #16a34a; color: #15803d; font-weight: 700; box-shadow: 0 2px 5px rgba(0,0,0,0.02);}
.sticky-note { background: #fef08a; padding: 15px 15px 15px 20px; margin: 10px 15px; border-radius: 2px 12px 12px 12px; box-shadow: 2px 4px 12px rgba(0,0,0,0.1); font-family: 'Segoe UI', cursive, sans-serif; font-size: 0.9rem; font-weight: 800; position: relative; color: #451a03; line-height: 1.5; border: 1px solid #fde047;}
.sticky-note::before { content: ''; position: absolute; top: -1px; left: -1px; border-width: 0 20px 20px 0; border-style: solid; border-color: transparent #facc15 transparent transparent; }


/* PRINT CSS CỐT LÕI */
@media print {
    body { background: white !important; overflow: visible !important; color: #000 !important; }
    .no-print, .sidebar, .top-header, .footer-bar-single, .split-list { display: none !important; }
    .main-content { display: block !important; width: 100% !important; margin: 0 !important; padding: 0 !important; position: static !important; overflow: visible !important; height: auto !important; }
    img { max-width: 100% !important; }
    tr, .info-row, .section-title { page-break-inside: avoid; }
    @page { size: A4 portrait; margin: 15mm 20mm; }
}