﻿/* ── Tokens ─────────────────────────────────────── */
:root {
    --nd-navy: #1e3a5f;
    --nd-navy-h: #162d4a;
    --nd-navy-bg: #eef4fb;
    --nd-border: #c8d6ea;
    --nd-surface: #ffffff;
    --nd-page-bg: #f0f4fa;
    --nd-text: #1e3a5f;
    --nd-muted: #6b88a8;
    --nd-radius: 8px;
}

/* ── Card ───────────────────────────────────────── */
.nd-card {
    background: var(--nd-surface);
    border: 1px solid var(--nd-border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}

/* ── Header ─────────────────────────────────────── */
.nd-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--nd-border);
}

.nd-header-icon {
    width: 36px;
    height: 36px;
    background: var(--nd-navy);
    border-radius: var(--nd-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}

.nd-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--nd-navy);
}

.nd-subtitle {
    font-size: 12px;
    color: var(--nd-muted);
    margin-top: 2px;
}

/* ── Filter grid ─────────────────────────────────── */
.nd-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    align-items: end;
}

.nd-label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--nd-muted);
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-bottom: 4px;
}

.nd-select {
    width: 100%;
    height: 36px;
    border: 1px solid var(--nd-border);
    border-radius: var(--nd-radius);
    padding: 0 8px;
    font-size: 13px;
    color: var(--nd-text);
    background: #f8fafd;
}

    .nd-select:focus {
        border-color: #2563a8;
        background: #fff;
        outline: none;
    }

    .nd-select:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

/* ── Buttons ─────────────────────────────────────── */
.nd-btn {
    height: 36px;
    padding: 0 14px;
    border-radius: var(--nd-radius);
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s;
}

.nd-btn-navy {
    background: var(--nd-navy);
    color: #fff;
}

    .nd-btn-navy:hover {
        background: var(--nd-navy-h);
    }

.nd-btn-success {
    background: #0f6e56;
    color: #fff;
}

    .nd-btn-success:hover {
        background: #0b5a45;
    }

.nd-btn-outline {
    background: #fff;
    color: var(--nd-navy);
    border: 1px solid var(--nd-border);
}

    .nd-btn-outline:hover {
        background: var(--nd-navy-bg);
    }

/* ── Actions bar ─────────────────────────────────── */
.nd-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px solid var(--nd-border);
    margin-top: 6px;
}

/* ── Alert ───────────────────────────────────────── */
.nd-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--nd-radius);
    font-size: 13px;
    margin-top: 12px;
    border: 1px solid transparent;
}

    .nd-alert.alert-success {
        background: #d4edda;
        color: #0a5c2e;
        border-color: #b2dfca;
    }

    .nd-alert.alert-danger {
        background: #f8d7da;
        color: #7c1d24;
        border-color: #f1b4b8;
    }

    .nd-alert.alert-warning {
        background: #fff3cd;
        color: #7c4f00;
        border-color: #fde5a0;
    }

.nd-alert-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    line-height: 1;
    opacity: .6;
    padding: 0;
}

/* ── Table ───────────────────────────────────────── */
.nd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .nd-table thead tr {
        background: var(--nd-navy);
    }

    .nd-table thead th {
        color: #cce0f5;
        font-weight: 500;
        padding: 9px 6px;
        text-align: center;
        font-size: 12px;
        border: none;
        white-space: nowrap;
    }

        .nd-table thead th:first-child {
            border-radius: 6px 0 0 0;
        }

        .nd-table thead th:last-child {
            border-radius: 0 6px 0 0;
        }

    .nd-table tbody tr:nth-child(even) {
        background: #f5f9ff;
    }

    .nd-table tbody tr:hover {
        background: #eaf2fb;
    }

    .nd-table tbody td {
        padding: 5px 6px;
        border-bottom: 1px solid #e4edf8;
        text-align: center;
        color: var(--nd-text);
    }

.nd-td-center {
    text-align: center;
}

.nd-td-name {
    text-align: left;
    font-weight: 500;
}

.nd-muted {
    color: var(--nd-muted);
    font-size: 12px;
}

/* ── Score inputs ─────────────────────────────────── */
.nd-input-score {
    width: 58px;
    height: 28px;
    text-align: center;
    font-size: 13px;
    border: 1px solid var(--nd-border);
    border-radius: 5px;
    padding: 0 4px;
    background: #f8fafd;
}

    .nd-input-score:focus {
        border-color: #2563a8;
        background: #fff;
        outline: none;
    }

.nd-select-sm {
    width: 64px;
    height: 36px;
    font-size: 10px;
    border-radius: 5px;
    padding: 0 6px;
    background: #f8fafd;
}

.nd-input-text {
    width: 100%;
    height: 28px;
    font-size: 13px;
    border-radius: 5px;
    padding: 0 6px;
    background: #f8fafd;
    min-width: 120px;
}

/* ── TB badge ─────────────────────────────────────── */
.nd-tb-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    background: var(--nd-navy-bg);
    color: var(--nd-navy);
}

.nd-tb-badge--dat {
    background: #dcfce7;
    color: #166534;
}

.nd-tb-badge--chuadat {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 767px) {
    .nd-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .nd-input-score {
        width: 48px;
    }
}

@media (max-width: 480px) {
    .nd-filter-grid {
        grid-template-columns: 1fr;
    }
}

