* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
}

body {
    background: #fff;
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    flex: 0 0 auto;
    text-align: right;
    padding: 6px 16px;
    font-size: 13px;
    background: #f4f4f4;
    border-bottom: 1px solid #ddd;
}
.topbar a { color: #0033cc; text-decoration: none; margin-left: 6px; }
.topbar a:hover { text-decoration: underline; }

.lich-wrap {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 1.2vh 0 0.5vh;
    background: #fff url('img/bgLich.png') repeat;
}

.lich-header {
    flex: 0 0 auto;
}

.lich-title-row {
    position: relative;
}

.lich-logo {
    position: absolute;
    top: 50%;
    left: 11%; /* tâm cột "Thời gian" (rộng 22% bảng) */
    transform: translate(-50%, -50%) translateY(0.4em);
    height: clamp(34px, 4.4vw, 68px);
    width: auto;
}

.lich-title {
    flex: 0 0 auto;
    text-align: center;
    font-family: "Times New Roman", Times, serif;
    font-weight: bold;
    font-size: clamp(19px, 3.1vw, 46px);
    color: #fe0006;
    text-shadow: 3px 1.5px 1.5px rgba(150, 150, 150, 1);
    margin: 0;
    line-height: 1.25;
}

.lich-date {
    flex: 0 0 auto;
    text-align: center;
    font-family: "Times New Roman", Times, serif;
    font-weight: bold;
    font-size: clamp(13px, 1.7vw, 26px);
    color: #6d0404;
    margin: 0 0 0.4vh;
}

.lich-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.lich-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.lich-table {
    width: 100%;
    border-collapse: collapse;
    font-family: "Times New Roman", Times, serif;
    font-weight: bold;
    table-layout: fixed;
}
.lich-table th {
    background-color: #fe2a00;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    padding: 0.4vh 4px;
    font-size: clamp(12px, 1.9vw, 30px);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.4);
}
.lich-table td {
    padding: 0.6vh 8px;
    font-size: clamp(11px, 1.7vw, 28px);
    text-align: center;
    vertical-align: middle;
    word-wrap: break-word;
    border: 1px solid #ddd;
}
.lich-table td.col-noidung { text-align: left; }
.lich-table td.col-gio { text-align: left; }
.lich-table td.col-gio,
.lich-table td.col-diadiem,
.lich-table td.col-chutri { white-space: nowrap; }
.lich-table tbody tr:nth-child(even):not(.date-row) td { background: #f5f5f5; }

.lich-table .col-gio { width: 18%; }
.lich-table .col-noidung { width: 35%; }
.lich-table .col-chutri { width: 25%; }
.lich-table .col-diadiem { width: 22%; }

.lich-table tbody tr.is-today td {
    background: #ffd700;
    color: #6d0404;
}

.lich-table .tham-du {
    font-size: 0.85em;
    font-weight: normal;
    font-style: italic;
    color: #444;
}

.lich-table-today {
    flex: 0 0 auto;
}

.lich-divider {
    flex: 0 0 auto;
    text-align: center;
    font-family: "Times New Roman", Times, serif;
    font-weight: bold;
    font-size: clamp(13px, 1.8vw, 26px);
    color: #6d0404;
    margin: 1vh 0 0.5vh;
}

.lich-table tr.date-row td {
    background-color: #fe2a00;
    color: #fff;
    text-align: center;
}

.lich-table .empty {
    font-size: clamp(14px, 1.6vw, 22px);
    color: #888;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: normal;
    text-align: center;
}

@media (max-width: 700px) {
    .lich-wrap { padding: 8px 10px; }
}

.thong-bao-bar {
    flex: 0 0 auto;
    background: #e00000;
    color: #fff;
    overflow: hidden;
    white-space: nowrap;
    padding: 0.6vh 0;
}
.thong-bao-text {
    display: inline-block;
    padding-left: 100%;
    font-family: "Times New Roman", Times, serif;
    font-weight: bold;
    font-size: clamp(14px, 2vw, 26px);
    animation: thongbao-scroll 20s linear infinite;
}
@keyframes thongbao-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}
