/* Menu: Thêm & Quản lý Dữ liệu */
.data-actions {
    display: flex;
    gap: 10px;
}
.data-card {
    overflow: hidden;
    padding: 16px 18px;
}
.data-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    gap: 14px;
}
.data-search-wrap {
    position: relative;
    flex: 1;
    max-width: 340px;
}
.data-search-ic {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-2);
    display: inline-flex;
}
.data-search-ic svg {
    width: 16px;
    height: 16px;
}
.data-search {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    font-size: 13.5px;
    outline: none;
    background: #f8fafc;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
.data-search:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px var(--accent-ring);
}
.data-count {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}
.data-count b {
    color: var(--ink);
}

/* cột "ngày chưa ĐN" */
.soNgay-hi {
    color: #dc2626;
    font-weight: 600;
}
.soNgay-mid {
    color: #b45309;
    font-weight: 600;
}

/* nút xóa trong bảng dữ liệu */
.data-card .dc-icon-btn.danger {
    color: #cbd5e1;
}

/* ----- modal nhập Excel ----- */
.dropzone {
    display: block;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
    transition:
        border-color 0.15s,
        background 0.15s;
}
.dropzone:hover {
    border-color: var(--accent);
    background: #f1f6ff;
}
.dropzone-ic {
    color: var(--muted-2);
    display: inline-flex;
}
.dropzone-ic svg {
    width: 32px;
    height: 32px;
}
.dropzone-title {
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
    color: var(--ink);
}
.dropzone-sub {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 4px;
}
.file-chip {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 11px 14px;
    background: #fff;
}
.file-chip-ic {
    color: #15803d;
    display: inline-flex;
}
.file-chip-ic svg {
    width: 22px;
    height: 22px;
}
.file-chip-info {
    flex: 1;
    min-width: 0;
}
.file-chip-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-chip-size {
    font-size: 12px;
    color: var(--muted-2);
}
.file-chip .dc-icon-btn {
    color: var(--muted-2);
}

/* ----- modal Google Sheet ----- */
.sheet-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.5;
}
.sheet-hint-ic {
    color: var(--muted-2);
    flex: none;
    margin-top: 1px;
    display: inline-flex;
}
.sheet-hint-ic svg {
    width: 15px;
    height: 15px;
}

/* ===== Trang Thêm dữ liệu (4 bảng theo tháng) ===== */
.dd-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.dd-tab {
    border: 0;
    background: transparent;
    padding: 10px 16px;
    font: inherit;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.dd-tab.active {
    color: #2f7df6;
    border-bottom-color: #2f7df6;
}
/* thanh công cụ: tháng / năm / tìm kiếm / nút — dùng chung cho mọi tab nên đặt phía trên tabs */
.dd-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
}
.dd-toolbar .data-search-wrap {
    flex: 1;
}
.dd-toolbar-right {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ô chọn tháng / năm — bỏ mũi tên, dạng pill */
.dd-sel {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 9px 16px;
    min-width: 104px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    text-align: center;
    text-align-last: center;
    text-indent: 0;
    outline: none;
    transition:
        border-color 0.15s,
        box-shadow 0.15s,
        background 0.15s;
}
.dd-sel:hover {
    border-color: #cbd5e1;
}
.dd-sel:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px var(--accent-ring);
}

/* khung bảng cố định — cuộn trong khung, giữ tổng số & phân trang luôn hiển thị */
.dd-table-wrap {
    max-height: calc(100vh - 300px);
    overflow: auto;
    border: 1px solid var(--line-2);
    border-radius: 10px;
}
.dd-table-wrap .dc-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* chân bảng: trái = tổng + số dòng/trang, phải = phân trang */
.dd-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.dd-foot-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.dd-total {
    color: #475569;
    font-size: 13.5px;
}
.dd-limit {
    width: auto;
    padding: 8px 12px;
}

/* bảng dữ liệu gọn hơn — thu nhỏ khoảng cách dòng (chỉ trong trang này) */
.dd-table-wrap .dc-table thead th {
    padding: 8px 14px;
}
.dd-table-wrap .dc-table tbody td {
    padding: 6px 14px;
    font-size: 13px;
}

/* nút icon trên thanh công cụ (thêm / xóa) — chỉ icon, tooltip khi hover */
.dd-iconbtn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition:
        background 0.15s,
        color 0.15s,
        border-color 0.15s,
        filter 0.15s;
}
.dd-iconbtn svg {
    width: 18px;
    height: 18px;
}
.dd-iconbtn.primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 16px var(--accent-shadow);
}
.dd-iconbtn.primary:hover {
    filter: brightness(1.06);
}
.dd-iconbtn.danger {
    background: #fff;
    color: #dc2626;
    border-color: #fecaca;
}
.dd-iconbtn.danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}
/* tooltip hiển thị khi hover, đặt phía dưới nút */
.dd-iconbtn[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-3px);
    background: #1e293b;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    padding: 6px 9px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.15s,
        transform 0.15s;
    z-index: 20;
}
.dd-iconbtn[data-tip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* phân trang số: 1 … 4 5 6 … cuối */
.dd-pager {
    display: flex;
    gap: 4px;
    align-items: center;
}
.dd-pg {
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
        background 0.12s,
        color 0.12s,
        border-color 0.12s;
}
.dd-pg:hover:not(:disabled):not(.active) {
    background: #f6f8fa;
    border-color: #cbd5e1;
}
.dd-pg.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    cursor: default;
}
.dd-pg:disabled {
    opacity: 0.4;
    cursor: default;
}
.dd-pg-arrow {
    font-size: 16px;
}
.dd-pg-gap {
    padding: 0 4px;
    color: var(--muted-2);
}

/* modal import */
.dd-modal-period {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.dd-section {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}
.dd-section-head {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dd-section-no {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eff4ff;
    color: #2f7df6;
    font-size: 13px;
}
.dd-locked {
    color: #059669;
    font-weight: 600;
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dd-locked .dd-iconbtn {
    margin-left: auto;
}
.dd-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    color: #475569;
}
/* ô nhập tên sheet/tab — nằm dưới ô link/file của mỗi nguồn */
.dd-sheet-name {
    margin-top: 8px;
    font-size: 13px;
}
.dd-prog {
    margin-top: 8px;
    height: 8px;
    background: #eef2f7;
    border-radius: 999px;
    overflow: hidden;
}
.dd-prog-bar {
    height: 100%;
    background: #2f7df6;
    width: 0;
    transition: width 0.3s ease;
}
.dd-prog.ok .dd-prog-bar {
    background: #059669;
}
.dd-prog.err .dd-prog-bar {
    background: #dc2626;
}
.dd-prog-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}
