*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    font-family:Arial, sans-serif;
    background:#f3f7fc;
    color:#111;
    font-size:14px;
}

a{
    text-decoration:none;
}

/* HEADER PC */
.topbar{
    background:#fff;
    border-bottom:1px solid #ddd;
    padding:12px 20px;
}

.topbar-inner{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
}

.brand{
    font-size:18px;
    white-space:nowrap;
}

.menu{
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:nowrap;
}

.menu a{
    padding:10px 20px;
    border-radius:999px;
    background:#eee;
    color:#222;
    white-space:nowrap;
}

.menu a.active,
.menu a:hover{
    background:#2563eb;
    color:#fff;
}

.menu a.logout{
    background:#dc2626;
    color:#fff;
}

/* CONTAINER */
.container{
    padding:18px;
}

/* THỐNG KÊ */
.grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:18px;
}

.stat{
    background:#fff;
    padding:16px 18px;
    border-radius:12px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    min-height:74px;
}

.stat b{
    color:#dc2626;
    font-size:24px;
    white-space:nowrap;
}

/* NÚT XUẤT EXCEL */
.stat a,
a[href*="export_excel"]{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:#16a34a !important;
    color:#fff !important;
    padding:10px 16px;
    border-radius:8px;
    font-size:14px;
    white-space:nowrap;
}

.stat a:hover,
a[href*="export_excel"]:hover{
    background:#15803d !important;
}

/* CARD */
.card{
    background:#fff;
    border:1px solid #ddd;
    border-radius:12px;
    padding:16px;
    margin-bottom:18px;
}

/* HÀNG TÌM KIẾM + NÚT */
.top-actions{
    display:grid;
    grid-template-columns:360px 190px 130px 180px 190px;
    gap:10px;
    align-items:center;
    margin-bottom:16px;
}

.top-actions input{
    max-width:360px;
}

/* INPUT */
input,
select,
textarea{
    padding:10px 12px;
    border:1px solid #ccc;
    border-radius:8px;
    font-family:Arial, sans-serif;
    font-size:14px;
    width:100%;
    background:#fff;
}

textarea{
    min-height:90px;
}

/* BUTTON */
button,
.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:10px 14px;
    border-radius:8px;
    border:none;
    cursor:pointer;
    color:#fff;
    font-size:14px;
    line-height:1.2;
    white-space:nowrap;
    transition:.15s ease;
    background: green;
    margin-bottom: 10px;
        margin-top: 10px;
}

button:hover,
.btn:hover{
    opacity:.9;
}

.top-actions button{
    background:#2563eb;
    color:#fff;
}

.btn.green{
    background:#16a34a;
}

.btn.gray{
    background:#6b7280;
}

.btn.red{
    background:#dc2626;
}

.btn.orange{
    background:#f97316;
}

.btn.purple{
    background:#7c3aed;
}

.btn.blue{
    background:#2563eb;
}

.btn.blue:hover{
    background:#1d4ed8;
}

.btn.contract{
    background:#0f766e !important;
    color:#fff !important;
}

.btn.contract:hover{
    background:#0d5f59 !important;
}

/* TABLE WRAP CUỘN NGANG + DỌC */
.table-wrap{
    width:100%;
    max-height:600px;
    overflow:auto;
    border:1px solid #ddd;
    border-radius:10px;
    background:#fff;
}

/* TABLE */
table{
    width:100%;
    min-width:1980px;
    border-collapse:separate;
    border-spacing:0;
    background:#fff;
    font-size:14px;
}

th,
td{
    padding:10px 12px;
    border-right:1px solid #d9e2ef;
    border-bottom:1px solid #d9e2ef;
    text-align:center;
    vertical-align:middle;
}

th:first-child,
td:first-child{
    border-left:0;
}

th{
    position:sticky;
    top:0;
    z-index:5;
    background:#eaf2ff;
    font-size:15px;
    white-space:nowrap;
    color:#111827;
}

td{
    line-height:1.35;
}

tbody tr:nth-child(odd){
    background:#f8fafc;
}

tbody tr:nth-child(even){
    background:#ffffff;
}

tbody tr:hover{
    background:#eef6ff;
}

tr.overdue-row{
    background:#fff1f1 !important;
}

/* BADGE */
.badge{
    display:inline-block;
    padding:6px 10px;
    border-radius:999px;
    font-size:13px;
    line-height:1.2;
    white-space:nowrap;
}

.badge.unpaid{
    background:#fed7aa;
    color:#7c2d12;
}

.badge.paid{
    background:#dcfce7;
    color:#15803d;
}

.badge.soon{
    background:#fff7ed;
    color:#c2410c;
}

.badge.overdue{
    background:#dc2626;
    color:#fff;
    padding:6px 10px;
}

/* CỘT THAO TÁC */
.action-col{
    min-width:300px;
    white-space:nowrap;
}

.action-col .btn{
    display:inline-flex;
    margin:2px;
    padding:7px 10px;
    font-size:13px;
}

/* FORM */
.form-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:16px;
}

.field label{
    display:block;
    margin-bottom:6px;
}

/* FOOTER */
.footer{
    text-align:center;
    padding:18px;
    color:#666;
}
.login-container{
    max-width:420px;
    margin:60px auto;
    background:#fff;
    padding:30px;
    border-radius:18px;
    box-shadow:0 10px 30px rgba(15,23,42,.08);
}

.login-container h2{
    text-align:center;
    margin-bottom:22px;
}

.login-form .field{
    margin-bottom:16px;
}

.login-form button{
    width:100%;
    margin-top:18px;
    background:#16a34a;
}

.login-extra{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    margin:10px 0 18px;
}

.remember-wrap{
    display:flex;
    align-items:center;
    gap:7px;
    font-size:14px;
}

.remember-wrap input{
    width:auto;
}

.forgot-link{
    color:#2563eb;
    font-size:14px;
}

.btn-back-home{
    background:#dc2626 !important;
    color:#fff !important;
    border:none;
    border-radius:10px;
    padding:10px 18px;
    font-size:15px;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}

.btn-back-home:hover{
    background:#b91c1c !important;
}