/* ============================================================================
   DNHue-Widgets.css — CSS DÙNG CHUNG cho widget Danh sách + Thống kê DN
   Đặt file này trong SKIN (cùng chỗ với DNHue-Core.js), nạp bằng <link>.
   ============================================================================ */

/* ── Dùng chung 2 widget: badge trạng thái ─────────────────────────────── */
.dsdn-badge, .tkdn-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700
}

.tt1 {
    background: #dcfce7;
    color: #15803d
}

.tt2 {
    background: #fee2e2;
    color: #b91c1c
}

.tt3 {
    background: #fef9c3;
    color: #a16207
}

.tt0 {
    background: #f3f4f6;
    color: #6b7280
}

/* ============================== WIDGET: DANH SÁCH DOANH NGHIỆP ========= */
.dsdn-wrap {
    font-family: inherit;
    color: #222
}

    .dsdn-wrap *, .dsdn-wrap *::before, .dsdn-wrap *::after {
        box-sizing: border-box
    }

.dsdn-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap
}

.dsdn-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0
}

.dsdn-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
}

    .dsdn-filters select {
        border: 1px solid #d1d5db;
        border-radius: 6px;
        padding: 6px 10px;
        font-size: 13px;
        outline: none;
        background: #fff;
        color: #374151;
        cursor: pointer
    }

        .dsdn-filters select:focus {
            border-color: #0056b3;
            box-shadow: 0 0 0 2px rgba(0,86,179,.1)
        }

    .dsdn-filters input {
        border: 1px solid #d1d5db;
        border-radius: 6px;
        padding: 6px 10px;
        font-size: 13px;
        width: 220px;
        outline: none
    }

        .dsdn-filters input:focus {
            border-color: #0056b3;
            box-shadow: 0 0 0 2px rgba(0,86,179,.1)
        }

.dsdn-info-count {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px
}

.dsdn-tbl-wrap {
    overflow-x: auto;
    border: 1px solid #dde3ee;
    border-radius: 8px
}

.dsdn-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 700px
}

    .dsdn-tbl thead th {
        background: #f1f5f9;
        padding: 10px 13px;
        text-align: left;
        font-weight: 600;
        color: #374151;
        border-bottom: 2px solid #dde3ee;
        white-space: nowrap;
        position: sticky;
        top: 0;
        z-index: 1
    }

    .dsdn-tbl tbody tr {
        border-bottom: 1px solid #f3f3f3;
        cursor: pointer;
        transition: background .12s
    }

        .dsdn-tbl tbody tr:hover {
            background: #eff6ff
        }

    .dsdn-tbl td {
        padding: 9px 13px;
        vertical-align: top;
        line-height: 1.5
    }

.dsdn-stt {
    width: 34px;
    color: #aaa;
    font-size: 12px;
    text-align: center
}

.dsdn-ten {
    font-weight: 600;
    color: #0056b3
}

.dsdn-pg {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    font-size: 12px;
    color: #666
}

.dsdn-pg-btns {
    display: flex;
    gap: 3px;
    flex-wrap: wrap
}

    .dsdn-pg-btns button {
        padding: 4px 9px;
        border: 1px solid #d1d5db;
        background: #fff;
        border-radius: 4px;
        cursor: pointer;
        font-size: 12px;
        color: #374151
    }

        .dsdn-pg-btns button:hover:not(:disabled) {
            background: #0056b3;
            color: #fff;
            border-color: #0056b3
        }

        .dsdn-pg-btns button.cur {
            background: #0056b3;
            color: #fff;
            border-color: #0056b3;
            pointer-events: none
        }

        .dsdn-pg-btns button:disabled {
            opacity: .4;
            cursor: default
        }

.dsdn-spin {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 13px
}

    .dsdn-spin::after {
        content: '';
        display: block;
        width: 28px;
        height: 28px;
        margin: 12px auto 0;
        border: 3px solid #e5e7eb;
        border-top-color: #0056b3;
        border-radius: 50%;
        animation: dsdnspin .7s linear infinite
    }

@keyframes dsdnspin {
    to {
        transform: rotate(360deg)
    }
}

.dsdn-empty {
    text-align: center;
    padding: 40px;
    color: #999
}

.dsdn-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,.52);
    align-items: center;
    justify-content: center
}

    .dsdn-overlay.open {
        display: flex
    }

.dsdn-modal {
    background: #fff;
    border-radius: 10px;
    width: 93%;
    max-width: 760px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,.28);
    overflow: hidden
}

.dsdn-mhd {
    background: #0056b3;
    color: #fff;
    padding: 13px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-shrink: 0
}

.dsdn-mhd-ttl {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 2px
}

.dsdn-mhd-sub {
    font-size: 12px;
    opacity: .8
}

.dsdn-btn-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 21px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 4px;
    line-height: 1
}

    .dsdn-btn-close:hover {
        background: rgba(255,255,255,.2)
    }

.dsdn-mbody {
    flex: 1;
    overflow-y: auto;
    padding: 0
}

.dsdn-ct-head {
    padding: 14px 18px 10px
}

.dsdn-ct-name {
    font-size: 16px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 3px
}

.dsdn-ct-sub {
    font-size: 12px;
    color: #888
}

.dsdn-ct-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px
}

    .dsdn-ct-tbl tr:nth-child(odd) td:first-child {
        background: #f8fafc
    }

    .dsdn-ct-tbl td {
        padding: 8px 18px;
        border-bottom: 1px solid #f0f0f0;
        vertical-align: top;
        line-height: 1.5
    }

        .dsdn-ct-tbl td:first-child {
            width: 38%;
            color: #555;
            font-weight: 500;
            white-space: nowrap
        }

        .dsdn-ct-tbl td:last-child {
            color: #1a1a1a
        }

@media(max-width:600px) {
    .dsdn-tbl thead th:nth-child(4), .dsdn-tbl td:nth-child(4),
    .dsdn-tbl thead th:nth-child(5), .dsdn-tbl td:nth-child(5),
    .dsdn-tbl thead th:nth-child(7), .dsdn-tbl td:nth-child(7) {
        display: none
    }

    .dsdn-ct-tbl td:first-child {
        width: 44%
    }

    .dsdn-filters {
        width: 100%
    }

        .dsdn-filters select, .dsdn-filters input {
            flex: 1;
            min-width: 0
        }
}

/* ============================== WIDGET: THỐNG KÊ DOANH NGHIỆP ========== */
.tkdn-wrap {
    font-family: inherit;
    color: #222
}

    .tkdn-wrap *, .tkdn-wrap *::before, .tkdn-wrap *::after {
        box-sizing: border-box
    }

.tkdn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0
}

.tkdn-card {
    display: flex;
    gap: 12px;
    padding: 13px 15px;
    border: 1px solid #dde3ee;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: box-shadow .18s,border-color .18s;
    user-select: none
}

    .tkdn-card:hover {
        border-color: #0056b3;
        box-shadow: 0 2px 10px rgba(0,86,179,.14)
    }

    .tkdn-card img {
        width: 60px;
        height: 60px;
        object-fit: contain;
        flex-shrink: 0
    }

.tkdn-card-lbl {
    font-size: 12.5px;
    color: #555;
    line-height: 1.4;
    margin-bottom: 3px
}

.tkdn-card-num {
    font-size: 25px;
    font-weight: 700;
    line-height: 1
}

.tkdn-card[data-t="hoatdong"] .tkdn-card-num {
    color: #0056b3
}

.tkdn-card[data-t="moi"] .tkdn-card-num {
    color: #16a34a
}

.tkdn-card[data-t="giathe"] .tkdn-card-num {
    color: #dc2626
}

.tkdn-card[data-t="tamngung"] .tkdn-card-num {
    color: #d97706
}

.tkdn-xemthem {
    text-align: right;
    margin-top: 9px
}

    .tkdn-xemthem a {
        font-size: 13px;
        color: #0056b3;
        text-decoration: none
    }

        .tkdn-xemthem a:hover {
            text-decoration: underline
        }

.tkdn-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,.52);
    align-items: center;
    justify-content: center
}

    .tkdn-overlay.open {
        display: flex
    }

.tkdn-modal {
    background: #fff;
    border-radius: 10px;
    width: 93%;
    max-width: 880px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,.28);
    overflow: hidden
}

.tkdn-mhd {
    background: #0056b3;
    color: #fff;
    padding: 13px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-shrink: 0
}

.tkdn-mhd-ttl {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 2px
}

.tkdn-mhd-sub {
    font-size: 12px;
    opacity: .8
}

.tkdn-btn-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 21px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 4px;
    line-height: 1;
    margin-top: -2px
}

    .tkdn-btn-close:hover {
        background: rgba(255,255,255,.2)
    }

.tkdn-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0
}

.tkdn-v-ds {
    display: none
}

    .tkdn-v-ds.show {
        display: block
    }

.tkdn-v-ct {
    display: none;
    padding: 0 0 16px
}

    .tkdn-v-ct.show {
        display: block
    }

.tkdn-ct-back {
    background: none;
    border: none;
    color: #0056b3;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 13px 18px 6px;
    display: flex;
    align-items: center;
    gap: 5px
}

    .tkdn-ct-back:hover {
        text-decoration: underline
    }

.tkdn-ct-head {
    padding: 4px 18px 12px
}

.tkdn-ct-name {
    font-size: 16px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 3px
}

.tkdn-ct-sub {
    font-size: 12px;
    color: #888
}

.tkdn-ct-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 0 0 0
}

    .tkdn-ct-tbl tr:nth-child(odd) td:first-child {
        background: #f8fafc
    }

    .tkdn-ct-tbl td {
        padding: 8px 18px;
        border-bottom: 1px solid #f0f0f0;
        vertical-align: top;
        line-height: 1.5
    }

        .tkdn-ct-tbl td:first-child {
            width: 38%;
            color: #555;
            font-weight: 500;
            white-space: nowrap
        }

        .tkdn-ct-tbl td:last-child {
            color: #1a1a1a
        }

.tkdn-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px
}

    .tkdn-tbl thead th {
        background: #f1f5f9;
        padding: 9px 12px;
        text-align: left;
        font-weight: 600;
        color: #374151;
        border-bottom: 2px solid #dde3ee;
        position: sticky;
        top: 0;
        z-index: 1;
        white-space: nowrap
    }

    .tkdn-tbl tbody tr {
        border-bottom: 1px solid #f3f3f3;
        cursor: pointer
    }

        .tkdn-tbl tbody tr:hover {
            background: #eff6ff
        }

    .tkdn-tbl td {
        padding: 9px 12px;
        vertical-align: top;
        line-height: 1.5
    }

.tkdn-ten {
    font-weight: 600;
    color: #0056b3
}

.tkdn-stt {
    width: 34px;
    color: #aaa;
    font-size: 12px
}

.tkdn-pg {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
    flex-shrink: 0;
    font-size: 12px;
    color: #666
}

.tkdn-pg-btns {
    display: flex;
    gap: 3px
}

    .tkdn-pg-btns button {
        padding: 4px 9px;
        border: 1px solid #d1d5db;
        background: #fff;
        border-radius: 4px;
        cursor: pointer;
        font-size: 12px;
        color: #374151
    }

        .tkdn-pg-btns button:hover:not(:disabled) {
            background: #0056b3;
            color: #fff;
            border-color: #0056b3
        }

        .tkdn-pg-btns button.cur {
            background: #0056b3;
            color: #fff;
            border-color: #0056b3
        }

        .tkdn-pg-btns button:disabled {
            opacity: .4;
            cursor: default
        }

.tkdn-spin {
    text-align: center;
    padding: 36px;
    color: #888;
    font-size: 13px
}

    .tkdn-spin::after {
        content: '';
        display: block;
        width: 28px;
        height: 28px;
        margin: 12px auto 0;
        border: 3px solid #e5e7eb;
        border-top-color: #0056b3;
        border-radius: 50%;
        animation: tkdnspin .7s linear infinite
    }

@keyframes tkdnspin {
    to {
        transform: rotate(360deg)
    }
}

.tkdn-empty {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 13px
}

@media(max-width:600px) {
    .tkdn-grid {
        grid-template-columns: 1fr
    }

    .tkdn-tbl thead th:nth-child(3), .tkdn-tbl td:nth-child(3),
    .tkdn-tbl thead th:nth-child(4), .tkdn-tbl td:nth-child(4) {
        display: none
    }

    .tkdn-ct-tbl td:first-child {
        width: 44%
    }
}
