:root {
    --ink: #2b2b2b;
    --border: #d9d9d9;
    --header-blue: #dce9f5;
    --cat-yellow: #fdf1cf;
    --cat-green: #e4f0e0;
    --done: #3a8a3a;
    --inprogress: #b8860b;
    --late: #c0392b;
    --todo: #8a8a8a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--ink);
    background: #f7f7f7;
}

.topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}
.topbar-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.brand { font-weight: 700; font-size: 1.1rem; }
.nav-link {
    margin-left: 16px;
    text-decoration: none;
    color: #2b5797;
    font-size: 0.9rem;
}
.user-name { font-size: 0.85rem; color: #666; margin-right: 4px; }

.container { max-width: 900px; margin: 30px auto; padding: 0 20px 60px; }

.board-title {
    text-align: center;
    font-size: 1.3rem;
    letter-spacing: 0.5px;
    margin-bottom: 18px;
}

.hint { color: #666; font-size: 0.9rem; margin-bottom: 12px; }

.goal-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 0 0 1px var(--border);
}
.goal-table th {
    background: var(--header-blue);
    text-align: left;
    padding: 10px 14px;
    font-size: 0.9rem;
}
.goal-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    vertical-align: middle;
}
.col-stt { width: 50px; text-align: center; }
.col-status { width: 160px; }

.category-row td {
    font-weight: 700;
    background: #fff;
    padding-top: 14px;
}

/* Màu dải theo nhóm - luân phiên vàng/xanh giống bảng gốc */
.item-row:nth-of-type(4n+1),
.item-row:nth-of-type(4n+2) { }

tbody tr.item-row { background: var(--cat-yellow); }
tbody tr.item-row.status-done,
tbody tr.item-row.status-inprogress,
tbody tr.item-row.status-late,
tbody tr.item-row.status-todo { }

/* Áp màu nhóm bằng cách tô theo category-row liền trước qua CSS không khả thi thuần CSS,
   nên màu nhóm được set trực tiếp qua thuộc tính style ở view nếu muốn tách vàng/xanh triệt để.
   Mặc định dưới đây tô nhẹ toàn bộ theo trạng thái để dễ nhìn tiến độ. */

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
}
.status-done .status-badge { background: var(--done); }
.status-inprogress .status-badge { background: var(--inprogress); }
.status-late .status-badge { background: var(--late); }
.status-todo .status-badge { background: var(--todo); }

.admin-table select {
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.empty-row { text-align: center; color: #888; padding: 30px; }

.month-filter {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
}
.month-filter select {
    margin-left: 6px;
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}
.month-filter button {
    padding: 5px 14px;
    border: none;
    border-radius: 4px;
    background: #2b5797;
    color: #fff;
    cursor: pointer;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.section-sub {
    margin-top: 28px;
    font-size: 1rem;
}

.create-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.create-form select,
.create-form input[type="text"] {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.9rem;
}
.create-form input[type="text"] { flex: 1; min-width: 240px; }
.create-form button {
    padding: 7px 16px;
    border: none;
    border-radius: 4px;
    background: #2b8a3e;
    color: #fff;
    cursor: pointer;
}

.btn-delete {
    padding: 4px 10px;
    border: 1px solid var(--late);
    color: var(--late);
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}
.btn-delete:hover { background: var(--late); color: #fff; }

.col-updated {
    font-size: 0.82rem;
    color: #666;
    white-space: nowrap;
}

.fs-table .col-updated-fs {
    width: 190px;
    font-size: 0.78em;
    color: #777;
    white-space: nowrap;
}
.fs-table .updated-by {
    color: #999;
    font-size: 0.95em;
}

/* ================= FULL-SCREEN DASHBOARD (trang chính) ================= */
html, body.fullscreen-page {
    height: 100%;
    margin: 0;
    background: #eef1f5;
}

.topbar-overlay {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
}

.fullscreen-main {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    min-height: calc(100vh - 49px); /* trừ chiều cao topbar */
}

.fs-board {
    height: 100%;
    min-height: calc(100vh - 49px);
    padding: 24px 32px 32px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.fs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.fs-title {
    margin: 0;
    font-size: clamp(1.4rem, 2.4vw, 2.1rem);
    letter-spacing: 0.5px;
    color: #1f2a37;
}

.fs-filter {
    margin: 0;
}

.fs-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 1.1rem;
}

.fs-table-wrap {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.fs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(0.95rem, 1.3vw, 1.25rem);
}
.fs-table th {
    background: var(--header-blue);
    text-align: left;
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 1;
}
.fs-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.fs-table .col-stt { width: 70px; text-align: center; }
.fs-table .col-status { width: 220px; }
.fs-table .category-row td {
    font-weight: 700;
    font-size: clamp(1rem, 1.5vw, 1.4rem);
    background: #fff;
    padding-top: 22px;
}
.fs-table tbody tr.item-row { background: var(--cat-yellow); }
.fs-table .status-badge {
    padding: 5px 16px;
    font-size: clamp(0.8rem, 1vw, 1rem);
}

.fs-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.live-indicator {
    font-size: 0.8rem;
    color: #999;
}
.live-indicator.live-ok { color: var(--done); }
.live-indicator.live-bad { color: var(--late); }

@media (max-width: 640px) {
    .fs-board { padding: 16px; }
}
