:root {
    --green: #087b39;
    --green-dark: #065f2e;
    --green-soft: #eef8f1;
    --border: #dce5df;
    --muted: #66756c;
    --danger: #b42318;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: #f5f8f6;
    color: #23322a;
    font: 14px "Segoe UI", Arial, sans-serif;
}
[hidden] { display: none !important; }

/* Nút và toast được dùng cho cả trang chi tiết. */
.btn {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 15px;
    border: 1px solid transparent;
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn:disabled { opacity: .52; cursor: not-allowed; }
.btn-success { border-color: var(--green); background: var(--green); color: #fff; }
.btn-success:hover:not(:disabled) { border-color: var(--green-dark); background: var(--green-dark); color: #fff; }
.btn-outline-secondary { border-color: #b9c6be; background: #fff; color: #405047; }
.btn-outline-secondary:hover:not(:disabled) { background: #f5f8f6; color: #23322a; }
.btn-outline-success { border-color: var(--green); background: #fff; color: var(--green); }
.btn-outline-success:hover:not(:disabled) { background: var(--green-soft); color: var(--green-dark); }

.toast {
    position: fixed;
    z-index: 12000;
    top: 20px;
    right: 20px;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 18px;
    border-radius: 7px;
    background: #17663a;
    color: #fff;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity .2s, transform .2s;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-error { background: var(--danger); }

/* Phần riêng của danh sách cân đối. Khung chung: /css/qlna-list-page.css */
#listPage .balance-filter-grid {
    grid-template-columns: minmax(220px, 1.15fr) minmax(300px, 1.35fr) minmax(180px, .75fr) auto;
}

#listPage .date-range {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 7px;
}

#listPage .date-range i { color: #89958e; font-style: normal; }
#listPage .qlna-list-filter-actions { white-space: nowrap; }
#listPage .qlna-list-filter-actions .qlna-list-btn { min-width: 92px; }
#listPage .qlna-list-bottom-actions #btnAddNew { min-width: 180px; }

#listPage .list-message {
    margin-bottom: 10px;
    padding: 9px 12px;
    border: 1px solid #b8d9c4;
    border-radius: 7px;
    background: #edf8f1;
    color: #17663a;
}

#listPage .list-message.error {
    border-color: #f0b8b3;
    background: #fff1f0;
    color: var(--danger);
}

#listPage .qlna-list-grid-panel.is-loading #balanceGrid { opacity: .62; }
#balanceGrid .k-grid-content tr:not(.kendo-empty-row) { cursor: pointer; }
#balanceGrid .cell-right { text-align: right !important; }
#balanceGrid .cell-stack strong { overflow: hidden; color: #26372e; text-overflow: ellipsis; }
#balanceGrid .cell-stack span { color: #7b8981; font-size: 10px; }

#balanceGrid .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 8px;
    border: 0;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}

#balanceGrid .badge::before {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

#balanceGrid .badge.drafting { background: #fff4df; color: #9d5d00; }
#balanceGrid .badge.cancelled { background: red; color: white; }
#balanceGrid .badge.approved { background: #e8f6ed; color: #087538; }

#balanceGrid .btn-action {
    display: inline-flex;
    width: 30px;
    min-width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #d5dae0;
    border-radius: 5px;
    background: #fff;
    color: #444c55;
    cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s;
}

#balanceGrid .btn-action:hover {
    border-color: var(--qlna-list-primary);
    background: var(--qlna-list-primary-soft);
    color: var(--qlna-list-primary);
}

@media (max-width: 1100px) {
    #listPage .balance-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #listPage .qlna-list-filter-actions { justify-content: flex-end; }
}

@media (max-width: 767px) {
    #listPage .balance-filter-grid { grid-template-columns: 1fr; }
    #listPage .qlna-list-filter-actions { justify-content: stretch; }
    #listPage .qlna-list-filter-actions .qlna-list-btn { min-width: 0; }
    #balanceGrid .badge { padding: 4px 6px; font-size: 10px; }
    #balanceGrid .btn-action { width: 28px; min-width: 28px; height: 28px; }
}
