/* Help Desk 32BitZ — bảng Kanban kiểu Trello.
   Thẻ sáng trên nền bảng màu, cột cuộn ngang, mọi thứ vẫn đọc được trên điện thoại. */

:root {
    --hd-board: #0d47a1;
    --hd-board-2: #1565c0;
    --hd-surface: rgba(255, 255, 255, .16);
    --hd-surface-solid: #f1f4f9;
    --hd-card: #ffffff;
    --hd-ink: #11213a;
    --hd-muted: #5b6b85;
    --hd-line: #dfe5ee;
    --hd-accent: #2f7cf6;
    --hd-danger: #e5484d;
    --hd-ok: #1f9d55;
    --hd-radius: 12px;
    --hd-shadow: 0 1px 2px rgba(9, 30, 66, .22), 0 0 0 1px rgba(9, 30, 66, .04);
}

* { box-sizing: border-box; }

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

body {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    color: var(--hd-ink);
    background: linear-gradient(160deg, var(--hd-board), var(--hd-board-2) 60%, #0b3c8c);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

[hidden] { display: none !important; }

/* ------------------------------------------------------------------ header */

.hd-header {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 10px 20px;
    background: rgba(0, 0, 0, .28);
    backdrop-filter: blur(6px);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 30;
}

.hd-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: .3px;
    text-decoration: none;
    font-size: 17px;
}

.hd-brand .hd-logo {
    background: #fff;
    border-radius: 8px;
    padding: 5px 9px;
    display: grid;
    place-items: center;
}

.hd-brand .hd-logo img { display: block; height: 24px; width: auto; }

.hd-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: auto;
}

.hd-nav a, .hd-nav button {
    color: #fff;
    text-decoration: none;
    font: inherit;
    font-size: 14px;
    padding: 7px 12px;
    border-radius: 8px;
    border: 0;
    background: rgba(255, 255, 255, .14);
    cursor: pointer;
}

.hd-nav a:hover, .hd-nav button:hover { background: rgba(255, 255, 255, .26); }

.hd-nav a.is-active { background: #fff; color: var(--hd-board); font-weight: 600; }

.hd-who {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: rgba(255, 255, 255, .92);
}

.hd-role {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
    padding: 3px 8px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .2);
}

/* ------------------------------------------------------------------ layout */

.hd-main { padding: 22px 20px 40px; }

.hd-title {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    color: #fff;
    margin: 0 0 18px;
}

.hd-title h1 { margin: 0; font-size: 23px; font-weight: 700; }

.hd-title .hd-sub { color: rgba(255, 255, 255, .78); font-size: 14px; }

.hd-flash {
    margin: 0 0 16px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    border-left: 4px solid var(--hd-ok);
}

.hd-flash.is-error { border-left-color: var(--hd-danger); }

/* ------------------------------------------------------------------ nút */

.hd-btn {
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    border: 0;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    background: var(--hd-accent);
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.hd-btn:hover { filter: brightness(1.08); }

.hd-btn.is-ghost { background: rgba(255, 255, 255, .18); color: #fff; }

.hd-btn.is-light { background: #eaeef5; color: var(--hd-ink); }

.hd-btn.is-ok { background: var(--hd-ok); }

.hd-btn.is-danger { background: var(--hd-danger); }

.hd-btn.is-small { padding: 5px 10px; font-size: 12.5px; }

/* ------------------------------------------------------------------ project */

.hd-projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.hd-project {
    background: var(--hd-card);
    border-radius: var(--hd-radius);
    box-shadow: var(--hd-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    min-height: 150px;
}

.hd-project:hover { transform: translateY(-2px); transition: transform .12s; }

.hd-project .hd-accent { height: 7px; background: var(--hd-accent); }

.hd-project .hd-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

.hd-project h3 { margin: 0; font-size: 16px; }

.hd-project p { margin: 0; color: var(--hd-muted); font-size: 13.5px; line-height: 1.45; }

.hd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }

.hd-chip {
    font-size: 11.5px;
    padding: 3px 9px;
    border-radius: 99px;
    background: #eef2f8;
    color: var(--hd-muted);
    white-space: nowrap;
}

.hd-chip.is-review { background: #fff4e0; color: #9a5b00; }

.hd-chip.is-done { background: #e6f6ec; color: #1f6b41; }

.hd-empty {
    background: rgba(255, 255, 255, .12);
    border: 1px dashed rgba(255, 255, 255, .45);
    color: #fff;
    border-radius: var(--hd-radius);
    padding: 26px;
    text-align: center;
    font-size: 14.5px;
}

/* ------------------------------------------------------------------ bảng Kanban */

.hd-board {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 14px;
}

.hd-column {
    flex: 0 0 290px;
    max-width: 290px;
    background: var(--hd-surface-solid);
    border-radius: var(--hd-radius);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-height: calc(100vh - 210px);
}

.hd-column.is-over { outline: 2px dashed var(--hd-accent); outline-offset: -3px; }

.hd-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 14px;
    padding: 2px 4px;
}

.hd-column-head .hd-count {
    font-weight: 600;
    font-size: 12px;
    color: var(--hd-muted);
    background: #e3e8f0;
    border-radius: 99px;
    padding: 2px 8px;
}

.hd-column-body { display: flex; flex-direction: column; gap: 9px; overflow-y: auto; min-height: 30px; }

.hd-card {
    background: var(--hd-card);
    border-radius: 9px;
    box-shadow: var(--hd-shadow);
    padding: 10px 11px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
}

.hd-card.is-dragging { opacity: .5; }

.hd-card .hd-card-title { font-size: 14px; font-weight: 600; line-height: 1.35; }

.hd-card .hd-card-desc {
    font-size: 12.5px;
    color: var(--hd-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hd-cover {
    margin: -10px -11px 0;
    display: block;
    width: calc(100% + 22px);
    max-height: 132px;
    object-fit: cover;
    border-radius: 9px 9px 0 0;
}

.hd-priority {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 700;
    color: #fff;
    padding: 2px 8px;
    border-radius: 99px;
}

.hd-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--hd-muted); }

.hd-due { padding: 2px 8px; border-radius: 6px; background: #eef2f8; }

.hd-due.is-overdue { background: #fde8e8; color: #b42318; font-weight: 600; }

.hd-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--hd-accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    flex: none;
}

.hd-attach { font-size: 12px; color: var(--hd-muted); }

.hd-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.hd-card-actions form { margin: 0; }

/* ------------------------------------------------------------------ hộp thoại */

.hd-dialog {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(9, 30, 66, .58);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 34px 16px;
    overflow-y: auto;
}

.hd-dialog-panel {
    background: #fff;
    border-radius: 14px;
    width: min(620px, 100%);
    padding: 20px 22px 22px;
    box-shadow: 0 18px 50px rgba(9, 30, 66, .38);
}

.hd-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.hd-dialog-head h2 { margin: 0; font-size: 18px; }

.hd-close {
    border: 0;
    background: #eef2f8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.hd-form { display: grid; gap: 13px; }

.hd-form label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--hd-muted); }

.hd-form input, .hd-form select, .hd-form textarea {
    font: inherit;
    font-size: 14px;
    color: var(--hd-ink);
    padding: 9px 11px;
    border: 1px solid var(--hd-line);
    border-radius: 8px;
    background: #fbfcfe;
    width: 100%;
}

.hd-form textarea { min-height: 96px; resize: vertical; }

.hd-form input:focus, .hd-form select:focus, .hd-form textarea:focus {
    outline: 2px solid rgba(47, 124, 246, .35);
    border-color: var(--hd-accent);
}

.hd-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

.hd-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-top: 4px; }

.hd-actions .hd-spacer { margin-left: auto; }

.hd-gallery { display: flex; flex-wrap: wrap; gap: 8px; }

.hd-gallery img { width: 92px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid var(--hd-line); }

.hd-filelist { display: grid; gap: 6px; font-size: 13px; }

.hd-filelist a { color: var(--hd-accent); }

/* ------------------------------------------------------------------ bảng dữ liệu */

.hd-panel {
    background: #fff;
    border-radius: var(--hd-radius);
    box-shadow: var(--hd-shadow);
    padding: 18px 20px;
    margin-bottom: 18px;
}

.hd-panel h2 { margin: 0 0 4px; font-size: 17px; }

.hd-panel .hd-hint { margin: 0 0 14px; color: var(--hd-muted); font-size: 13.5px; line-height: 1.5; }

.hd-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.hd-table th, .hd-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--hd-line); }

.hd-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--hd-muted); }

.hd-table tbody tr:last-child td { border-bottom: 0; }

.hd-table .hd-num { text-align: right; font-variant-numeric: tabular-nums; }

.hd-scroll { overflow-x: auto; }

/* ------------------------------------------------------------------ thống kê */

.hd-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }

.hd-kpi { background: #fff; border-radius: var(--hd-radius); box-shadow: var(--hd-shadow); padding: 16px 18px; }

.hd-kpi .hd-kpi-label { font-size: 12.5px; color: var(--hd-muted); text-transform: uppercase; letter-spacing: .5px; }

.hd-kpi .hd-kpi-value { font-size: 30px; font-weight: 700; line-height: 1.15; margin-top: 4px; }

.hd-chart { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding-top: 10px; }

.hd-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }

.hd-bar .hd-bar-fill { width: 100%; max-width: 46px; background: linear-gradient(180deg, #4f97ff, #2f7cf6); border-radius: 6px 6px 0 0; min-height: 3px; }

.hd-bar .hd-bar-label { font-size: 11.5px; color: var(--hd-muted); }

.hd-bar .hd-bar-value { font-size: 12px; font-weight: 700; }

.hd-range { display: flex; gap: 6px; }

.hd-range a { font-size: 13px; padding: 6px 12px; border-radius: 8px; background: #eef2f8; text-decoration: none; color: var(--hd-muted); }

.hd-range a.is-active { background: var(--hd-accent); color: #fff; font-weight: 600; }

/* ------------------------------------------------------------------ đăng nhập */

/* Nền có lưới mờ để trang không bị "phẳng" mà vẫn không tranh chỗ với khối đăng nhập. */
.hd-login-page {
    background:
        radial-gradient(1100px 620px at 15% -10%, rgba(255, 255, 255, .16), transparent 60%),
        linear-gradient(160deg, #0a2f74, var(--hd-board) 45%, #062a63);
}

.hd-login-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
}

.hd-login {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 20px;
}

.hd-login-card {
    width: min(880px, 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 26px 70px rgba(4, 20, 50, .45);
}

/* Cột thương hiệu */
.hd-login-brand {
    background: linear-gradient(165deg, #123a86, #0b2a63);
    color: #fff;
    padding: 34px 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hd-logo-plate {
    background: #fff;
    border-radius: 12px;
    padding: 13px 17px;
    align-self: flex-start;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}

.hd-logo-plate img { display: block; height: 72px; width: auto; }

.hd-login-brand h2 { margin: 8px 0 0; font-size: 26px; letter-spacing: .3px; }

.hd-login-brand p { margin: 0; color: rgba(255, 255, 255, .8); font-size: 14px; line-height: 1.55; }

.hd-login-features { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; }

.hd-login-features li {
    position: relative;
    padding-left: 25px;
    font-size: 13.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .92);
}

.hd-login-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: -1px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    color: #7ee2a8;
    font-size: 11px;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.hd-login-foot { margin-top: auto; padding-top: 18px; font-size: 12px; color: rgba(255, 255, 255, .55); }

/* Cột form */
.hd-login-form { padding: 38px 34px 32px; display: flex; flex-direction: column; justify-content: center; }

.hd-login-form h1 { margin: 0 0 4px; font-size: 23px; }

.hd-login-lead { margin: 0 0 20px; color: var(--hd-muted); font-size: 14px; line-height: 1.5; }

.hd-login-form .hd-btn { width: 100%; justify-content: center; margin-top: 6px; padding: 11px 14px; }

.hd-login-note {
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--hd-line);
    color: var(--hd-muted);
    font-size: 12.5px;
    line-height: 1.6;
}

.hd-login-note a { color: var(--hd-accent); }

@media (max-width: 760px) {
    .hd-login-card { grid-template-columns: 1fr; width: min(430px, 100%); }
    .hd-login-brand { padding: 24px 24px 22px; gap: 12px; }
    .hd-logo-plate { align-self: center; padding: 11px 15px; }
    .hd-logo-plate img { height: 58px; }
    .hd-login-brand h2 { text-align: center; margin-top: 2px; font-size: 22px; }
    .hd-login-brand p { text-align: center; }
    /* Trên điện thoại ưu tiên khung nhập; phần giới thiệu rút gọn. */
    .hd-login-features, .hd-login-foot { display: none; }
    .hd-login-form { padding: 26px 22px 24px; }
}

.hd-error {
    background: #fde8e8;
    color: #b42318;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13.5px;
    margin-bottom: 14px;
}

/* ------------------------------------------------------------------ điện thoại */

@media (max-width: 720px) {
    .hd-main { padding: 16px 12px 30px; }
    .hd-header { padding: 9px 12px; gap: 10px; }
    .hd-nav { width: 100%; margin-left: 0; }
    .hd-column { flex-basis: 84vw; max-width: 84vw; max-height: none; }
    .hd-grid-2 { grid-template-columns: 1fr; }
    .hd-chart { height: 150px; gap: 5px; }
}
