/* Nút */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 500; line-height: 1.3; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #9b2424; border-color: #9b2424; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--bg); color: var(--text); }

/* Thẻ, tiêu đề trang, breadcrumb */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.page-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 6px 0 18px; }
.page-title h1 { font-size: 22px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .current { color: var(--text); }
.empty-state { text-align: center; padding: 44px 20px; }
.empty-state h2 { font-size: 18px; margin: 10px 0 4px; }
.empty-icon { display: inline-flex; padding: 14px; border-radius: 50%; background: #e0ecff; color: var(--primary-dark); }

/* Biểu mẫu */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(31, 111, 235, .25); border-color: var(--primary); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.err-msg { display: block; color: var(--danger); font-size: 12.5px; margin-top: 4px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 16px; align-items: end; }
.filter-grid .field { margin-bottom: 4px; }
.filter-actions { display: flex; gap: 8px; }
.filter-card { padding-bottom: 14px; }

/* Bảng */
.table-wrap { overflow-x: auto; }
.table { min-width: 560px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: #f8fafc; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); white-space: nowrap; }
.table tr:hover td { background: #fafbfd; }
.table .num { text-align: right; }
.w-stt { width: 56px; }
.w-actions { width: 140px; }
.cell-actions { white-space: nowrap; }
.empty-row { text-align: center; color: var(--muted); padding: 28px 0 !important; }

/* Nhãn trạng thái */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef0f4; color: var(--muted); }
.badge-ok { background: #dcf5ea; color: var(--success); }
.badge-warn { background: #fff1d6; color: var(--warning); }
.badge-danger { background: #fde2e2; color: var(--danger); }
.badge-info { background: #d7f3f3; color: var(--info); }

/* Thông báo */
.alert { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-success { background: #e8f7ef; color: #0d5e43; border-color: #bfe8d3; }
.alert-error { background: #fdecec; color: #8f1d1d; border-color: #f6c6c6; }
.alert-warning { background: #fff6e0; color: #7a4f10; border-color: #f4dcab; }
.alert-info { background: #e6f1ff; color: #174a9c; border-color: #c4dcff; }
.alert-close { border: 0; background: transparent; font-size: 20px; line-height: 1; color: inherit; opacity: .6; }
.alert-close:hover { opacity: 1; }

/* Phân trang */
.pagination { display: flex; gap: 6px; justify-content: flex-end; margin-top: 14px; }
.pagination a, .pagination .current { min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Hộp thoại xác nhận */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(16, 24, 40, .5); }
.modal-dialog { position: relative; background: #fff; border-radius: var(--radius); padding: 22px; width: min(420px, 92vw); box-shadow: 0 10px 40px rgba(16, 24, 40, .25); }
.modal-dialog h3 { margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Lối tắt ở Tổng quan */
.group-title { margin: 22px 0 10px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.shortcut-card { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); font-weight: 600; }
.shortcut-card:hover { border-color: var(--primary); color: var(--primary); }

/* Trang đăng nhập */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #14213d, #1f6feb); padding: 16px; font-family: var(--font); }
.login-card { width: min(400px, 100%); background: #fff; border-radius: 14px; padding: 32px 28px; box-shadow: 0 16px 48px rgba(0, 0, 0, .25); display: flow-root; }
.login-card h1 { font-size: 20px; }
.login-card .muted { margin-bottom: 12px; font-style: italic;}
.login-logo { width: 65px; height: 65px; object-fit: contain; float: left; margin-right: 12px;}

/* Chuông thông báo */
.notif { position: relative; }
.notif-btn { position: relative; }
.notif-count { position: absolute; top: 2px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 380px; max-width: 92vw; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 36px rgba(16, 24, 40, .18); z-index: 60; overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.link-btn { border: 0; background: transparent; color: var(--primary); font-size: 12.5px; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.notif-list { max-height: 400px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.notif-item:hover { background: #f5f8ff; }
.notif-item.unread { background: #f0f6ff; }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: transparent; }
.notif-item.unread .notif-dot { background: var(--info); }
.notif-item.unread.type-success .notif-dot { background: var(--success); }
.notif-item.unread.type-warning .notif-dot { background: var(--warning); }
.notif-item.unread.type-danger .notif-dot { background: var(--danger); }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-item.read .notif-body b { font-weight: 500; }
.notif-msg { color: var(--muted); font-size: 13px; }
.notif-body small { color: var(--muted); font-size: 12px; }
.notif-empty { padding: 28px 14px; text-align: center; color: var(--muted); }
.notif-foot { display: block; padding: 11px 14px; text-align: center; font-weight: 600; color: var(--primary); background: #f8fafc; }
.notif-foot:hover { background: #eef3fb; }
.notif-link.unread { font-weight: 700; }
