* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: #1f2937;
  background: #f3f4f6;
}

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  background: #fff; padding: 32px; border-radius: 12px; width: 320px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 14px;
}
.login-card h1 { margin: 0 0 8px; font-size: 20px; text-align: center; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #6b7280; }
.login-card input {
  padding: 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px;
}
.login-card button {
  margin-top: 8px; padding: 10px; border: 0; border-radius: 8px;
  background: #2563eb; color: #fff; font-size: 15px; cursor: pointer;
}
.login-card button:hover { background: #1d4ed8; }
.error { color: #dc2626; font-size: 13px; margin: 0; text-align: center; }

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: #fff; border-bottom: 1px solid #e5e7eb;
}
.topbar h1 { margin: 0; font-size: 18px; }
.topbar .sub { font-size: 13px; color: #6b7280; margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.group-filter { font-size: 13px; color: #6b7280; display: flex; align-items: center; gap: 6px; }
.group-filter select { padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; }
.updated { font-size: 12px; color: #6b7280; }
.logout { font-size: 13px; color: #2563eb; text-decoration: none; }
.logout:hover { text-decoration: underline; }

main { padding: 24px; }
.status { color: #6b7280; font-size: 14px; margin-bottom: 12px; }

/* Bảng theo từng nhóm */
.board { margin-bottom: 28px; }
.board:last-child { margin-bottom: 0; }
.board-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; }
.board-title { margin: 0; font-size: 16px; font-weight: 600; color: #111827; }
.board-total { font-size: 13px; color: #6b7280; }
.board-empty {
  color: #6b7280; font-size: 14px; background: #fff; border-radius: 10px;
  padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.table-wrap { overflow-x: auto; background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 10px 14px; text-align: center; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
th { background: #f8fafc; font-weight: 600; color: #374151; position: sticky; top: 0; }
.col-name { text-align: left; font-weight: 500; }
th:first-child { text-align: left; }
.col-total { font-weight: 700; background: #f8fafc; }
td.zero { color: #d1d5db; }
tbody tr:hover { background: #f9fafb; }
tbody tr.row-unassigned { background: #fff7ed; }
tbody tr.row-unassigned:hover { background: #ffedd5; }
tbody tr.row-unassigned .col-name { color: #c2410c; font-style: italic; }
tfoot td { font-weight: 700; background: #eef2ff; border-top: 2px solid #c7d2fe; }

td.clickable { cursor: pointer; color: #2563eb; }
td.clickable:hover { background: #eff6ff; text-decoration: underline; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.modal-box {
  position: relative; background: #fff; border-radius: 12px; width: min(560px, 92vw);
  max-height: 80vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid #e5e7eb;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-sub { font-size: 13px; color: #6b7280; margin-top: 2px; }
.modal-close {
  border: 0; background: transparent; font-size: 24px; line-height: 1;
  color: #9ca3af; cursor: pointer; padding: 0 4px;
}
.modal-close:hover { color: #374151; }
.modal-body { padding: 8px 20px 20px; overflow-y: auto; }
.modal-empty { color: #6b7280; font-size: 14px; padding: 12px 0; }

.ticket-list { list-style: none; margin: 0; padding: 0; }
.ticket-list li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px;
}
.ticket-list li:last-child { border-bottom: 0; }
.ticket-num { color: #2563eb; text-decoration: none; font-weight: 600; white-space: nowrap; }
.ticket-num:hover { text-decoration: underline; }
.ticket-order { color: #6b7280; white-space: nowrap; }
.ticket-title { color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
