* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f4f5f7;
  color: #1a1a1a;
  padding-bottom: 40px;
}
header {
  background: #2f6fed;
  color: #fff;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
header h1 {
  margin: 0;
  font-size: 18px;
}
nav {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
nav a {
  color: #fff;
  text-decoration: none;
  background: rgba(255,255,255,0.18);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
}
nav a.active {
  background: rgba(255,255,255,0.4);
  font-weight: 600;
}
main {
  padding: 14px;
  max-width: 900px;
  margin: 0 auto;
}
.card {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
}
select, input[type=text], input[type=password] {
  width: 100%;
  padding: 10px;
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid #ccc;
  margin-bottom: 12px;
}
button {
  background: #2f6fed;
  color: #fff;
  border: none;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
button.secondary {
  background: #6b7280;
}
button.danger {
  background: #e0403f;
}
button:disabled {
  background: #b7c3e6;
  cursor: not-allowed;
}
.day-block {
  margin-bottom: 14px;
}
.day-title {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 14px;
  color: #2f6fed;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  border: 1px solid #d0d5dd;
  background: #fff;
  border-radius: 20px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.chip.selected {
  background: #2f6fed;
  border-color: #2f6fed;
  color: #fff;
}
.banner {
  background: #fff4e5;
  border: 1px solid #f0b429;
  color: #7a4a00;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 14px;
}
.banner.error {
  background: #fdecea;
  border-color: #e0403f;
  color: #7a1a17;
}
.banner.success {
  background: #eafaf0;
  border-color: #2fa84f;
  color: #114a22;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  border: 1px solid #e2e5ea;
  padding: 8px 6px;
  text-align: center;
}
th {
  background: #eef2ff;
}
td.empty {
  color: #b0202a;
  font-style: italic;
  background: #fff5f5;
}
.table-wrap {
  overflow-x: auto;
}
.missing-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.missing-list li {
  background: #fff5f5;
  border: 1px solid #f3b3b3;
  color: #7a1a17;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 13px;
}
.confirm-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge.done {
  background: #eafaf0;
  color: #114a22;
  border: 1px solid #2fa84f;
}
.badge.pending {
  background: #f2f2f2;
  color: #555;
  border: 1px solid #ccc;
}
.shift-config-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.shift-config-row span {
  width: 60px;
  font-weight: 600;
  font-size: 13px;
}
small.hint {
  color: #6b7280;
  display: block;
  margin-top: -6px;
  margin-bottom: 12px;
}
textarea {
  width: 100%;
  padding: 10px;
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid #ccc;
  margin-bottom: 12px;
  font-family: inherit;
  resize: vertical;
}

/* Schedule table: per-cell action menu + override highlighting */
td.mine {
  position: relative;
  padding-top: 16px;
}
.cell-menu-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(47,111,237,0.12);
  color: #2f6fed;
  border: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  padding: 0;
  cursor: pointer;
}
.pending-badge {
  display: block;
  font-size: 10px;
  color: #b7791f;
  margin-top: 2px;
}
td.override-red {
  background: #fdecea !important;
}
td.swap-pair {
  background: #eef0ff !important;
}
td.swap-requester {
  box-shadow: inset 0 0 0 2px #e0403f;
}
.cell-tag {
  display: block;
  font-size: 10px;
  margin-top: 2px;
  color: #b7791f;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline dotted;
}

/* Notification banners on Lịch tổng hợp */
.notif-card {
  background: #fff8e6;
  border: 1px solid #f0b429;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  font-size: 14px;
}
.notif-card.action-needed {
  background: #eaf1ff;
  border-color: #2f6fed;
}
.notif-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.notif-actions button {
  flex: 1;
  padding: 8px;
  font-size: 13px;
}

/* Request modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  max-width: 360px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box h3 {
  margin: 0 0 12px;
  font-size: 16px;
}
.modal-option {
  width: 100%;
  text-align: left;
  background: #f4f5f7;
  color: #1a1a1a;
  border: 1px solid #e2e5ea;
  margin-bottom: 8px;
  font-weight: 500;
}
.modal-option:hover {
  background: #eef2ff;
}

/* Admin request queue */
.request-item {
  border: 1px solid #e2e5ea;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 13px;
}
.request-item .req-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.request-item .req-note {
  color: #555;
  margin: 4px 0;
}
.request-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.request-actions button {
  flex: 1;
  padding: 7px;
  font-size: 13px;
}
.status-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 6px;
}
.status-tag.pending { background: #fff4e5; color: #7a4a00; }
.status-tag.approved { background: #eafaf0; color: #114a22; }
.status-tag.rejected { background: #fdecea; color: #7a1a17; }
