/* =========================================================================
   Ngày Tốt — Stylesheet độc lập
   Đặc điểm: cỡ chữ lớn & tự co giãn theo màn hình, màu trạng thái rõ ràng,
             giao diện tối ưu cho cả PC và điện thoại.
   ========================================================================= */
:root {
    --brand:   #7c2d12;
    --brand-2: #b45309;

    --good-bg: #d1fae5; --good-bd: #10b981; --good-fg: #065f46;
    --mid-bg:  #fef3c7; --mid-bd:  #f59e0b; --mid-fg:  #92400e;
    --bad-bg:  #fecaca; --bad-bd:  #ef4444; --bad-fg:  #991b1b;
    --hol-bg:  #e0e7ff; --hol-bd:  #6366f1; --hol-fg:  #3730a3;

    --ink:   #111827;
    --muted: #6b7280;
    --line:  #e5e7eb;
    --radius: 16px;
}

/* ---------- Cỡ chữ cơ bản: lớn dần theo bề rộng màn hình ---------- */
html { font-size: 16px; }
@media (min-width: 768px)  { html { font-size: 17px; } }
@media (min-width: 1280px) { html { font-size: 18px; } }

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f3f5f9;
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 14px; }
@media (min-width: 1024px) { .wrap { max-width: 1240px; padding: 22px 28px; } }

/* ---------- Thanh trên ---------- */
.topbar {
    display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff; border-radius: var(--radius); padding: 16px 20px; margin-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand .logo { font-size: 2.4rem; line-height: 1; }
.brand h1 { margin: 0; font-size: 1.65rem; }
.brand .sub { margin: 3px 0 0; font-size: .98rem; opacity: .92; }
.picker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.picker label { font-size: 1.05rem; }
.picker input[type=date] {
    padding: 11px 14px; border-radius: 12px; border: 0; font-size: 1.1rem; color: var(--ink); font-family: inherit;
}
.picker button {
    padding: 11px 18px; border-radius: 12px; border: 0; cursor: pointer;
    background: #fff; color: var(--brand); font-weight: 700; font-size: 1.1rem; font-family: inherit;
}
.picker button:hover { background: #ffedd5; }
.btn {
    display: inline-block; padding: 10px 16px; border-radius: 12px; font-size: 1.05rem; cursor: pointer;
    background: #fff; color: var(--brand); font-weight: 600; border: 1px solid transparent;
}
.btn.ghost { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.45); }
.btn.ghost:hover { background: rgba(255,255,255,.3); }
.btn.solid { background: #fde68a; color: #92400e; }
.btn.solid:hover { background: #fcd34d; }

@media (max-width: 640px) {
    .topbar { flex-direction: column; align-items: stretch; }
    .picker { width: 100%; }
    .picker label { display: none; }
    .picker input[type=date] { flex: 1 1 140px; min-width: 0; }
    .picker button, .picker .btn { flex: 0 0 auto; }
}

/* ---------- Điều hướng ngày ---------- */
.daynav {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 18px; margin-bottom: 14px;
}
.daynav .btn.ghost { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.daynav .btn.ghost:hover { background: #fde68a; }
.daytitle { text-align: center; min-width: 0; }
.daytitle strong { display: block; font-size: 1.32rem; }
.daylunar { font-size: 1.02rem; color: var(--muted); }
@media (max-width: 640px) {
    .daynav { flex-wrap: wrap; justify-content: center; }
    .daynav .btn.ghost { flex: 1 1 auto; text-align: center; }
    .daytitle { order: -1; flex-basis: 100%; }
}

/* ---------- Bố cục ---------- */
.layout { display: grid; grid-template-columns: 420px 1fr; gap: 16px; align-items: start; }
@media (min-width: 1280px) { .layout { grid-template-columns: 460px 1fr; gap: 20px; } }
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.sec-h { margin: 0 0 14px; font-size: 1.3rem; color: #92400e; border-bottom: 2px solid #fde68a; padding-bottom: 9px; }
.sec-h small { color: var(--muted); font-weight: 400; font-size: .94rem; }

/* ---------- Lịch tháng ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head strong { font-size: 1.2rem; }
.cal-head a {
    width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
    background: #fef3c7; color: #92400e; font-weight: 700; font-size: 1.4rem;
}
.cal-head a:hover { background: #fde68a; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: .96rem; font-weight: 700; color: var(--muted); padding: 3px 0; }
.cal-dow.cn { color: #b91c1c; }

.cal-cell {
    position: relative; aspect-ratio: 1; min-height: 62px; border-radius: 14px; border: 2px solid var(--line);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    background: #fff; padding: 8px 5px 6px; overflow: hidden; transition: transform .08s ease;
}
.cal-cell .cd { font-size: 1.25rem; font-weight: 800; line-height: 1; }
.cal-cell .cl { font-size: .72rem; color: var(--muted); font-weight: 800; line-height: 1.15; }
.cal-cell .csrow { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: .82rem; font-weight: 800; line-height: 1.1; }
.cal-cell .cs { font-size: .82rem; font-weight: 800; opacity: 1; }
.cal-cell:hover { transform: translateY(-1px); }
.cal-cell .cal-hol {
    font-size: .65rem; font-weight: 800; color: var(--hol-fg); line-height: 1.15;
    max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
}

/* Trạng thái ngày tốt / bình thường / kém — màu rõ ràng, khớp đúng bảng ghi chú */
.cal-cell.good { background: var(--good-bg); border-color: var(--good-bd); }
.cal-cell.good .cd, .cal-cell.good .cs { color: var(--good-fg); }
.cal-cell.mid  { background: var(--mid-bg);  border-color: var(--mid-bd); }
.cal-cell.mid .cd, .cal-cell.mid .cs  { color: var(--mid-fg); }
.cal-cell.bad  { background: var(--bad-bg);  border-color: var(--bad-bd); }
.cal-cell.bad .cd, .cal-cell.bad .cs  { color: var(--bad-fg); }

/* Ngày lễ: vạch màu phía dưới + tên lễ */
.cal-cell.holiday { box-shadow: inset 0 -6px 0 var(--hol-bd); }
.cal-cell .cal-hol {
    font-size: .68rem; font-weight: 700; color: var(--hol-fg); line-height: 1.2;
    max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-cell .cal-hol.off { color: #b91c1c; }

.cal-cell.sel { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(180,83,9,.4); }
.cal-cell.today::before {
    content: ''; position: absolute; top: 6px; right: 6px; width: 9px; height: 9px;
    border-radius: 50%; background: #b91c1c;
}

/* ---------- Thống kê loại ngày trong tháng ---------- */
.cal-stats { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.cal-stats-title { font-size: .9rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.cal-stats-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-stat-chip {
    display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px;
    font-size: .92rem; font-weight: 700; border: 1px solid transparent; background: #f3f4f6; color: var(--ink);
}
.cal-stat-chip .stat-count { font-size: 1.05rem; }
.cal-stat-chip.stat-excellent { background: var(--good-bg); color: var(--good-fg); border-color: var(--good-bd); }
.cal-stat-chip.stat-verygood { background: #dcfce7; color: #166534; border-color: #22c55e; }
.cal-stat-chip.stat-good { background: var(--mid-bg); color: var(--mid-fg); border-color: var(--mid-bd); }
.cal-stat-chip.stat-mid { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.cal-stat-chip.stat-bad { background: var(--bad-bg); color: var(--bad-fg); border-color: var(--bad-bd); }

/* ---------- Ngày lễ trong tháng (hiện dưới cụm lịch tháng) ---------- */
.cal-holidays { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.cal-holidays-title { font-size: .9rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.cal-holidays-list { display: flex; flex-direction: column; gap: 6px; }
.cal-hol-item {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: .95rem;
    transition: border-color .2s, box-shadow .2s;
}
.cal-hol-item:hover { border-color: #cbd5e1; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.cal-hol-item .hol-dd { font-size: .85rem; color: var(--muted); min-width: 44px; text-align: center; font-weight: 800; }
.cal-hol-item .hol-name { flex: 1; min-width: 0; }
.cal-hol-item .hol-lunar { font-size: .8rem; color: #b91c1c; font-weight: 800; white-space: nowrap; }
.cal-hol-item .hol-off { font-size: .76rem; font-weight: 800; color: #991b1b; background: #fee2e2; border: 1px solid #fecaca; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.cal-hol-item.off .hol-name { color: #b91c1c; }

@media (max-width: 640px) {
    .cal-cell { min-height: 48px; padding: 6px 4px 5px; gap: 3px; }
    .cal-cell .cd { font-size: 1rem; }
    .cal-cell .csrow { font-size: .72rem; gap: 4px; }
    .cal-cell .cal-hol { display: none; }
    .cal-stats-list { gap: 5px; }
    .cal-stat-chip { padding: 5px 8px; font-size: .85rem; }
    .cal-stat-chip .stat-count { font-size: 1rem; }
}
.cal-cell.empty { background: transparent; border-color: transparent; min-height: 28px; }

.cal-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; font-size: 1rem; color: #374151; }
.cal-legend span { display: inline-flex; align-items: center; }
.cal-legend i { width: 16px; height: 16px; border-radius: 5px; display: inline-block; margin-right: 7px; }
.lg-good { background: var(--good-bd); }
.lg-mid  { background: var(--mid-bd); }
.lg-bad  { background: var(--bad-bd); }
.lg-hol  { background: var(--hol-bd); }

/* Thu gọn ở màn hình nhỏ: vẫn giữ số ngày lớn, ẩn bớt phần phụ */
@media (max-width: 560px) {
    .cal-cell { min-height: 60px; border-radius: 11px; }
    .cal-cell .cs, .cal-cell .cal-hol { display: none; }
    .cal-cell .cd { font-size: 1.2rem; }
    .cal-grid { gap: 5px; }
}

/* ---------- Ngày lễ (khối thông báo) ---------- */
.holiday-list { display: flex; flex-direction: column; gap: 10px; }
.holiday-item {
    display: flex; align-items: flex-start; gap: 12px;
    background: var(--hol-bg); border: 1px solid #c7d2fe; border-left: 6px solid var(--hol-bd);
    border-radius: 14px; padding: 12px 16px;
}
.holiday-item.off { background: #fee2e2; border-color: #fecaca; border-left-color: #ef4444; }
.holiday-item .h-name { font-weight: 700; font-size: 1.2rem; color: var(--hol-fg); }
.holiday-item.off .h-name { color: #991b1b; }
.holiday-item .h-desc { font-size: 1.02rem; color: #4b5563; }
.holiday-item .h-off {
    font-size: .88rem; font-weight: 700; color: #fff; background: #ef4444;
    padding: 3px 12px; border-radius: 999px; white-space: nowrap; align-self: center;
}

/* ---------- Đánh giá chung ---------- */
.scorebox { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.bigscore { font-size: 3.9rem; font-weight: 800; line-height: 1; }
.scoretxt { flex: 1; min-width: 200px; }
.scoretxt .rating { font-size: 1.55rem; font-weight: 700; }
.scoretxt .ratingtext { font-size: 1.08rem; color: var(--muted); margin-top: 4px; }
.stars { color: #f59e0b; font-size: 1.55rem; letter-spacing: 3px; margin-top: 6px; }
.badge { text-align: center; padding: 12px 18px; border-radius: 15px; font-weight: 700; font-size: 1.2rem; line-height: 1.3; }
.badge small { font-weight: 600; font-size: .92rem; }
.badge.hd  { background: var(--good-bg); color: var(--good-fg); border: 2px solid var(--good-bd); }
.badge.hac { background: var(--bad-bg);  color: var(--bad-fg);  border: 2px solid var(--bad-bd); }

/* ---------- Bảng key/value ---------- */
table.kv { width: 100%; border-collapse: collapse; }
table.kv th {
    text-align: left; vertical-align: top; width: 215px; padding: 11px 14px 11px 0;
    color: var(--muted); font-weight: 600; font-size: 1.05rem; border-bottom: 1px dashed #eef0f4;
}
table.kv td { padding: 11px 0; font-size: 1.14rem; border-bottom: 1px dashed #eef0f4; }
@media (max-width: 620px) {
    table.kv th, table.kv td { display: block; width: auto; }
    table.kv th { border: 0; padding-bottom: 0; }
    table.kv td { padding-top: 2px; padding-bottom: 12px; }
}

/* ---------- Điểm từng việc ---------- */
ul.viec { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; }
@media (max-width: 620px) { ul.viec { grid-template-columns: 1fr; } }
ul.viec li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed #eef0f4; }
.vtxt { font-size: 1.1rem; }
.vscore { font-size: .95rem; font-weight: 700; color: #fff; background: #9ca3af; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.vscore.s1,.vscore.s2,.vscore.s3 { background: #ef4444; }
.vscore.s4,.vscore.s5,.vscore.s6 { background: #f59e0b; }
.vscore.s7,.vscore.s8 { background: #10b981; }
.vscore.s9,.vscore.s10 { background: #059669; }

/* ---------- Sao tốt / xấu ---------- */
.tag-h { font-size: 1.18rem; margin: 16px 0 9px; }
.tag-h:first-of-type { margin-top: 0; }
.txt-good { color: #15803d; } .txt-bad { color: #b91c1c; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 1.02rem; padding: 5px 14px; border-radius: 999px; border: 1px solid transparent; }
.tag.tot { background: var(--good-bg); color: var(--good-fg); border-color: var(--good-bd); }
.tag.xau { background: var(--bad-bg);  color: var(--bad-fg);  border-color: var(--bad-bd); }
.muted { color: #9ca3af; font-style: italic; font-size: 1.05rem; }

/* ---------- Trang danh sách ngày lễ theo năm ---------- */
.le-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.le-toolbar .year-box { text-align: center; min-width: 0; }
.le-toolbar .year { font-size: 1.55rem; font-weight: 800; line-height: 1.2; }
.le-toolbar .year-sub { font-size: .98rem; color: var(--muted); }
.le-toolbar .btn.solid { white-space: nowrap; font-size: 1.05rem; padding: 10px 16px; }

.le-subbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.le-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.year-jump { display: flex; align-items: center; gap: 8px; }
.year-jump label { font-size: .95rem; color: var(--muted); }
.year-jump input {
    width: 6.5rem; padding: 9px 12px; border-radius: 11px; border: 1px solid var(--line);
    font-size: 1.05rem; font-family: inherit; color: var(--ink);
}
.year-jump button {
    padding: 9px 16px; border-radius: 11px; border: 0; cursor: pointer;
    background: var(--brand-2); color: #fff; font-weight: 700; font-size: 1.05rem; font-family: inherit;
}
.year-jump button:hover { background: var(--brand); }

/* Bảng 3 cột: Ngày (gộp Dương lịch + Thứ + Âm lịch) · Tên ngày lễ · Trạng thái */
table.le-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.le-table th, table.le-table td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 1.06rem; vertical-align: top; }
table.le-table thead th { background: #fef3c7; color: #92400e; font-weight: 700; font-size: 1.06rem; }
table.le-table thead th.col-status { text-align: center; }
table.le-table tbody tr:hover { background: #fafafa; }
table.le-table .col-date { width: 8.5rem; }
table.le-table .col-status { width: 9.5rem; text-align: center; }

/* Cột Ngày (đã gộp Dương lịch + Thứ + Âm lịch) — chữ LỚN */
.le-date { display: flex; flex-direction: column; gap: 2px; }
.le-date .d-solar { font-size: 1.45rem; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.le-date .d-dow { font-size: 1.05rem; color: #4b5563; }
.le-date .d-lunar { font-size: 1rem; color: var(--hol-fg); font-weight: 700; }
.le-date .d-today {
    font-size: .88rem; font-weight: 800; color: #fff; background: #b91c1c;
    border-radius: 999px; padding: 2px 10px; align-self: flex-start; margin-top: 4px;
}

/* Cột Tên ngày lễ (được mở rộng tối đa) — chữ LỚN */
table.le-table .col-name { width: auto; }
table.le-table .d-name { font-size: 1.3rem; font-weight: 700; line-height: 1.35; }
table.le-table .d-name .pill { margin-left: 8px; vertical-align: 3px; }
table.le-table .d-desc { font-size: 1.05rem; color: var(--muted); margin-top: 4px; }

/* Dòng phân tách theo tháng */
table.le-table tr.month-row td {
    background: #f3f4f6; color: #374151; font-weight: 800; font-size: 1rem;
    letter-spacing: .03em; padding: 9px 14px; border-bottom: 1px solid var(--line);
}
table.le-table tr.month-row .m-count { color: var(--muted); font-weight: 600; }
tr.row-off td { background: #fff7f7; }

.pill { display: inline-block; font-size: .9rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; white-space: nowrap; }
.pill.duong { background: #e0f2fe; color: #075985; }
.pill.am { background: var(--hol-bg); color: var(--hol-fg); }
.pill.off { background: #fee2e2; color: #991b1b; }
.pill.work { background: #f3f4f6; color: #6b7280; }

.le-note { margin-top: 16px; font-size: 1rem; color: #4b5563; line-height: 1.8; }
.le-note code { background: #eef0f4; padding: 2px 7px; border-radius: 6px; }
.le-scroll { overflow-x: auto; }

/* ---------- ĐIỆN THOẠI: bảng chuyển thành dạng THẺ nhưng GIỮ CHỮ LỚN ---------- */
@media (max-width: 660px) {
    .le-scroll { overflow-x: visible; }
    table.le-table { display: block; table-layout: auto; }
    table.le-table thead { display: none; }
    table.le-table tbody { display: block; }

    /* Dòng tiêu đề tháng */
    table.le-table tr.month-row { display: block; margin: 16px 0 8px; }
    table.le-table tr.month-row td {
        display: block; border: 0; border-radius: 12px;
        background: #fef3c7; color: #92400e;
        font-size: 1.05rem; font-weight: 800; letter-spacing: .02em; padding: 9px 14px;
    }
    table.le-table tr.month-row .m-count { color: #a16207; }

    /* Mỗi ngày lễ là một thẻ */
    table.le-table tr:not(.month-row) {
        display: block; border: 1px solid var(--line); border-left: 6px solid var(--hol-bd);
        border-radius: 14px; padding: 13px 15px; margin-bottom: 10px; background: #fff;
    }
    table.le-table tr.row-off { border-left-color: #ef4444; background: #fff7f7; }
    table.le-table tr:not(.month-row) td { display: block; width: auto; border: 0; padding: 0; text-align: left; }

    /* Cột Ngày -> gộp 1 hàng ngang, chữ lớn */
    .le-date { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 6px; }
    .le-date .d-solar { font-size: 1.5rem; }
    .le-date .d-dow { font-size: 1.06rem; }
    .le-date .d-lunar { font-size: 1.02rem; }
    .le-date .d-today { font-size: .85rem; margin-top: 0; }

    /* Tên ngày lễ trải hết chiều rộng, chữ lớn */
    table.le-table .d-name { font-size: 1.3rem; }
    table.le-table .d-name .pill { margin-left: 0; vertical-align: 0; margin-top: 5px; display: inline-block; }
    table.le-table .d-desc { font-size: 1.02rem; }

    .col-status { margin-top: 10px; }
    .col-status .pill { font-size: .95rem; padding: 4px 14px; }

    /* Thanh công cụ + số liệu giữ chữ lớn */
    .le-toolbar { gap: 8px; }
    .le-toolbar .year { font-size: 1.4rem; }
    .le-toolbar .year-sub { font-size: .95rem; }
    .le-toolbar .btn.solid { padding: 10px 12px; font-size: 1rem; }
    .year-jump input { width: 6rem; font-size: 1rem; }
    .year-jump button { font-size: 1rem; }
    .le-stats { gap: 8px; }
}
@media (max-width: 400px) {
    .le-subbar { flex-direction: column; align-items: stretch; }
    .le-date .d-solar { font-size: 1.4rem; }
}

/* ---------- Footer ---------- */
.foot { text-align: center; font-size: 1rem; color: #9ca3af; padding: 16px 0 30px; }
.foot code { background: #eef0f4; padding: 2px 7px; border-radius: 6px; }



/* =========================================================================
   CẢI TIẾN: Tabs, Today overlay, Q-badge, Month vertical view, Date picker
   ========================================================================= */

/* ---------- Tabs ---------- */
.tabs {
    display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 2px solid var(--line);
    padding-bottom: 2px; flex-wrap: wrap;
}
.tab-btn {
    display: inline-block; padding: 10px 18px; border-radius: 10px 10px 0 0;
    border: 1px solid var(--line); border-bottom: 0;
    background: #f3f4f6; color: var(--muted); font-weight: 700; font-size: 1.05rem;
    margin-bottom: -2px;
}
.tab-btn.active {
    background: #fff; color: var(--brand); border-color: var(--brand);
    border-bottom: 2px solid #fff;
    margin-bottom: 0; padding-bottom: 12px;
}
.tab-btn:hover { background: #eef0f4; }
.tab-content { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Date picker (dd/mm/yyyy) ---------- */
.dateform input[type=text] {
    padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
    font-size: 1.1rem; color: var(--ink); font-family: inherit; min-width: 150px;
}

/* ---------- Today layer mờ (req 0) ---------- */
.cal-cell.today, .month-day-item.today {
    position: relative;
}
.cal-cell.today::before, .month-day-item.today::before {
    content: '';
    position: absolute; inset: 0;
    background: rgba(59, 130, 246, 0.16);
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
}
.cal-cell.today > *, .month-day-item.today > * {
    position: relative; z-index: 2;
}

/* ---------- Q-badge: màu sắc phân biệt tính chất (req 3) ---------- */
.q-badge {
    display: inline-block; font-size: .88rem; font-weight: 700;
    padding: 2px 8px; border-radius: 6px; margin: 1px 2px; white-space: nowrap;
}
.q-badge.q-good { background: var(--good-bg); color: var(--good-fg); border: 1px solid var(--good-bd); }
.q-badge.q-bad  { background: var(--bad-bg);  color: var(--bad-fg);  border: 1px solid var(--bad-bd); }
.q-badge.q-neutral { background: #f3f4f6; color: #374151; border: 1px solid var(--line); }

/* ---------- Month tab: vertical day list ---------- */
.monthview { display: flex; flex-direction: column; gap: 14px; }
.month-header { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; background:#fff; border:1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.month-nav { display: flex; align-items: center; gap: 10px; }
.month-title { font-size: 1.25rem; font-weight: 800; color: var(--brand); }
.month-filter {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 10px 16px; margin-bottom: 4px;
}
.filter-title { font-size: .95rem; font-weight: 700; color: var(--muted); margin-right: 6px; }
.filter-btn {
    display: inline-block; padding: 6px 12px; border-radius: 8px; font-size: .92rem; font-weight: 700;
    border: 1px solid var(--line); background: #f3f4f6; color: var(--muted);
}
.filter-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.filter-btn.stat-excellent.active { background: var(--good-bd); border-color: var(--good-bd); }
.filter-btn.stat-verygood.active { background: #22c55e; border-color: #22c55e; }
.filter-btn.stat-good.active { background: var(--mid-bd); border-color: var(--mid-bd); }
.filter-btn.stat-mid.active { background: var(--mid-bd); border-color: var(--mid-bd); }
.filter-btn.stat-bad.active { background: var(--bad-bd); border-color: var(--bad-bd); }

.month-vertical { display: flex; flex-direction: column; gap: 8px; }
.month-day-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 12px; border-radius: 10px; border: 2px solid var(--line);
    background: #fff; font-size: 1rem; transition: all .15s;
}
.month-day-item:hover { border-color: #cbd5e1; box-shadow: 0 2px 6px rgba(0,0,0,.06); transform: translateY(-1px); }
.month-day-item.sel { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(180,83,9,.25); }
.month-day-item.holiday { box-shadow: inset 0 -5px 0 var(--hol-bd); }

.mdi-date { display: flex; flex-direction: column; gap: 1px; min-width: 78px; }
.mdi-dd { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.mdi-mm, .mdi-yyyy { font-size: .82rem; color: var(--muted); font-weight: 700; }
.mdi-lunar { font-size: .8rem; color: var(--muted); font-weight: 800; margin-top: 4px; white-space: nowrap; }
.mdi-score { display: flex; flex-direction: column; gap: 2px; min-width: 86px; align-items: flex-end; }
.mdi-score-val { font-size: 1.15rem; font-weight: 800; }
.mdi-score-txt { font-size: .78rem; font-weight: 700; white-space: nowrap; }
.mdi-hol { font-size: .8rem; font-weight: 800; color: var(--hol-fg); background: var(--hol-bg); padding: 2px 8px; border-radius: 6px; white-space: nowrap; }

/* Màu quality trong ô ngày dong */
.month-day-item.good { background: var(--good-bg); border-color: var(--good-bd); color: var(--good-fg); }
.month-day-item.mid  { background: var(--mid-bg);  border-color: var(--mid-bd); color: var(--mid-fg); }
.month-day-item.bad  { background: var(--bad-bg);  border-color: var(--bad-bd); color: var(--bad-fg); }
.month-day-item.good .midi-score-val,
.month-day-item.good .midi-score-txt,
.month-day-item.mid .midi-score-val,
.month-day-item.mid .midi-score-txt,
.month-day-item.bad .midi-score-val,
.month-day-item.bad .midi-score-txt { color: inherit; }

.month-holidays-note {
    margin-top: 8px; padding: 10px 14px; background: #fef3c7; border-radius: 10px;
    border: 1px solid #f59e0b; font-size: .95rem;
}
.hol-chip {
    display: inline-block; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line);
    background: #fff; margin: 2px 4px 2px 0; font-size: .9rem;
}
.hol-chip.off { border-color: #ef4444; color: #991b1b; background: #fff7f7; }

/* ---------- Scorebox tweaks ---------- */
.scorebox { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.bigscore { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.scoretxt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rating { font-size: 1.25rem; font-weight: 800; }
.ratingtext { font-size: 1rem; color: var(--muted); }
.stars { font-size: 1.3rem; line-height: 1; }
.badge { display: inline-block; padding: 6px 14px; border-radius: 10px; font-size: 1rem; font-weight: 800; text-align: center; min-width: 120px; }
.badge.hd { background: #d1fae5; color: #065f46; border: 1px solid #10b981; }
.badge.hac { background: #fecaca; color: #991b1b; border: 1px solid #ef4444; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
    .tabs { gap: 4px; }
    .tab-btn { padding: 8px 12px; font-size: 1rem; }
    .dateform { flex-direction: column; align-items: stretch; }
    .dateform label { margin-bottom: 4px; }
    .dateform input[type=text] { min-width: auto; flex: 1; }
    .dateform button, .dateform .btn.ghost { flex: 0 0 auto; width: auto; }
    .month-header { flex-direction: column; align-items: stretch; gap: 10px; }
    .month-day-item { padding: 7px 10px; font-size: .95rem; }
    .mdi-dd { font-size: 1.3rem; }
    .mdi-score { min-width: 70px; }
}
