:root {
    --app-font: "Segoe UI", Arial, sans-serif;
    --app-primary: #0d6efd;
    --app-success: #198754;
    --app-warning: #ffc107;
    --app-danger: #dc3545;
    --app-info: #0dcaf0;
    --app-text: #343a40;
    --app-muted: #6c757d;
    --app-border: #dee2e6;
    --app-bg: #f4f6f9;
    --app-card-bg: #ffffff;
    --app-font-xs: 12px;
    --app-font-sm: 13px;
    --app-font-md: 14px;
    --app-font-lg: 16px;
    --app-font-title: 20px;
    --app-radius: 6px;
    --app-control-height: 36px;
}
.app-btn {
    min-height: var(--app-control-height);
    padding: 7px 14px;
    border-radius: var(--app-radius);
    font-family: var(--app-font);
    font-size: var(--app-font-md);
    font-weight: 600;
    border: 1px solid transparent;
}

.app-btn-primary {
    color: #fff;
    background: var(--app-primary);
    border-color: var(--app-primary);
}

.app-btn-success {
    color: #fff;
    background: var(--app-success);
    border-color: var(--app-success);
}

.app-btn-danger {
    color: #fff;
    background: var(--app-danger);
    border-color: var(--app-danger);
}
.app-card {
    background: var(--app-card-bg);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.app-card-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--app-border);
    font-size: var(--app-font-lg);
    font-weight: 600;
}

.app-card-body {
    padding: 16px;
}
.app-control {
    width: 100%;
    min-height: var(--app-control-height);
    padding: 6px 10px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    font-family: var(--app-font);
    font-size: var(--app-font-md);
}

    .app-control:focus {
        border-color: var(--app-primary);
        box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
        outline: none;
    }
.app-table {
    width: 100%;
    font-family: var(--app-font);
    font-size: var(--app-font-sm);
    border-collapse: separate;
    border-spacing: 0;
}

    .app-table thead th {
        background: #f8f9fa;
        color: var(--app-text);
        font-weight: 600;
        border-bottom: 2px solid var(--app-border);
        padding: 9px 10px;
    }

    .app-table tbody td {
        padding: 8px 10px;
        border-bottom: 1px solid var(--app-border);
    }

.app-page {
    color: var(--app-text);
    font-family: var(--app-font);
    font-size: var(--app-font-md);
}

.app-page-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.app-page-title {
    color: var(--app-text);
    font-size: var(--app-font-title);
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.app-page-subtitle {
    color: var(--app-muted);
    font-size: var(--app-font-sm);
    margin-top: 4px;
}

.app-toolbar-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.app-tabs {
    align-items: center;
    border-bottom: 1px solid var(--app-border);
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
}

.app-tab {
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: var(--app-radius) var(--app-radius) 0 0;
    color: var(--app-muted);
    font-family: var(--app-font);
    font-size: var(--app-font-md);
    font-weight: 600;
    min-height: var(--app-control-height);
    padding: 8px 14px;
    text-decoration: none;
}

.app-tab:hover {
    background: #f8f9fa;
    color: var(--app-text);
    text-decoration: none;
}

.app-tab.active {
    background: var(--app-card-bg);
    border-color: var(--app-border);
    color: var(--app-primary);
    margin-bottom: -1px;
}

.app-toolbar-card,
.app-table-card {
    margin-bottom: 14px;
}

.app-card {
    overflow: hidden;
}

.app-card > .card-body {
    padding: 16px;
}

.app-card .form-label {
    color: var(--app-text);
    font-size: var(--app-font-sm);
    font-weight: 600;
    margin-bottom: 4px;
}

.app-table thead th {
    vertical-align: middle;
}

.app-table tbody td {
    vertical-align: middle;
}

.app-table tfoot td,
.app-table tfoot th {
    background: #f8f9fa;
    border-bottom: 1px solid var(--app-border);
    font-weight: 600;
    padding: 8px 10px;
    vertical-align: middle;
}

.app-table tbody tr:hover td {
    background: #f8f9fa;
}

.app-table-wrap {
    background: var(--app-card-bg);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    overflow: auto;
}

.app-table-toolbar {
    background: #eaf8ff;
    border-bottom: 1px solid var(--app-border);
    padding: 14px 14px 12px;
}

.app-table-title {
    color: #0b3768;
    font-size: var(--app-font-md);
    font-weight: 800;
}

.app-table-subtitle {
    color: var(--app-muted);
    font-size: var(--app-font-sm);
}

.app-center {
    text-align: center;
}

.app-num {
    text-align: right;
    white-space: nowrap;
}

.app-text-wrap {
    overflow-wrap: anywhere;
    white-space: normal;
}

.nowrap {
    white-space: nowrap;
}

/* =========================================================
   Standard filter + action toolbar layout
   Dùng cho các trang có bố cục:
   [Bộ lọc] -> [Nhóm nút bên trái | Thông tin tổng bên phải]
   ========================================================= */
.app-filter-card {
    margin-bottom: 12px;
}

.app-filter-card .app-card-body {
    padding: 14px;
}

.app-filter-row {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.app-filter-item {
    flex: 1 1 160px;
    min-width: 150px;
}

.app-filter-item-wide {
    flex: 2.5 1 320px;
    min-width: 260px;
}

.app-filter-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 8px;
}

.app-action-bar {
    align-items: center;
    background: var(--app-card-bg);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
    min-height: 54px;
    padding: 10px 14px;
}

.app-action-left,
.app-action-right {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.app-action-right {
    color: var(--app-muted);
    font-size: var(--app-font-xs);
    justify-content: flex-end;
    margin-left: auto;
}

.app-action-summary {
    color: var(--app-muted);
    font-size: var(--app-font-xs);
    white-space: nowrap;
}

.app-action-summary strong {
    color: var(--app-text);
    font-weight: 700;
}

@media (max-width: 768px) {
    .app-filter-row {
        align-items: stretch;
    }

    .app-filter-item,
    .app-filter-item-wide {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .app-filter-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .app-filter-actions .app-btn,
    .app-filter-actions .btn {
        width: 100%;
    }

    .app-action-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .app-action-left,
    .app-action-right {
        width: 100%;
    }

    .app-action-right {
        justify-content: flex-start;
        margin-left: 0;
    }
}

@media (max-width: 520px) {
    .app-filter-actions {
        grid-template-columns: 1fr;
    }
}

/* Viền mỏng phân cách giữa các cột bảng */
.app-table thead th:not(:last-child),
.app-table tbody td:not(:last-child),
.app-table tfoot th:not(:last-child),
.app-table tfoot td:not(:last-child) {
    border-right: 1px solid var(--app-border);
}