/* ==================== ISSUE GROUPS (Vấn đề theo trạng thái) ==================== */
.issue-groups {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: stretch;
}
.issue-group {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.issue-group-header {
  flex-shrink: 0;
}
.issue-group-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}
.issue-group-list::-webkit-scrollbar {
  width: 6px;
}
.issue-group-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
}
@media (max-width: 900px) {
  .issue-groups { flex-direction: column; }
  .issue-group { flex: 1 1 auto; }
}
.issue-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--badge-info-bg);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}
.issue-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
}
.issue-group-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
}
.issue-group-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.issue-item {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}
.issue-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.issue-item-done { opacity: 0.85; }
.issue-item-done .issue-item-title { text-decoration: line-through; color: var(--muted); }
.issue-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
}
.issue-item-main {
  flex: 1;
  min-width: 0;
}
.issue-item-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  word-break: break-word;
  margin-bottom: 2px;
}
.issue-item-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.issue-item-desc {
  font-size: 13px;
  color: var(--ink);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.issue-item-badges {
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.issue-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 0 14px 10px 14px;
}
.issue-item:hover .issue-item-actions {
  opacity: 1;
  pointer-events: auto;
}
.issue-item-actions button {
  padding: 5px 10px;
  font-size: 12px;
  min-height: auto;
}
.issue-item-body {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink);
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.issue-item-body .issue-subblock {
  margin: 0;
}
.issue-item-body .step-mark {
  cursor: pointer;
}
.issue-item-body .step-mark.done { color: var(--ok); }
.issue-item-current { font-size: 12px; }
.issue-item-note { font-size: 12px; }

.issue-status-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.issue-status-filter {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: all 0.15s ease;
}
.issue-status-filter:hover {
  border-color: var(--accent);
}
.issue-status-filter.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
/* Modal xuất báo cáo */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(2px);
  padding: 24px;
}
.modal-overlay.is-hidden { display: none; }
.modal-overlay .modal-dialog {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  animation: modalSlide 0.2s ease;
  max-width: 720px;
  width: 100%;
}
@keyframes modalSlide {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 640px) {
  .modal-overlay .modal-dialog { width: 94vw !important; margin: 16px; }
}

/* ==================== STICKY NOTES (Ghi Chú) ==================== */
.sticky-notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin: 14px 0 8px;
}

.sticky-note {
  position: relative;
  background: #fef9c3;
  border: 1px solid #d97706;
  border-radius: 4px;
  padding: 16px 18px 20px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  font-family: 'Caveat', 'Comic Sans MS', 'Chalkboard SE', 'Marker Felt', cursive, var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: #78350f;
  box-shadow: 0 6px 10px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, z-index 0.2s ease;
  cursor: pointer;
  break-inside: avoid;
}

.sticky-note::before {
  content: '';
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 15px;
  background: #c2410c;
  border-radius: 50%;
  border: 3px solid #fef9c3;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  z-index: 2;
}

.sticky-note::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 15px solid #b45309;
  border-right: 15px solid transparent;
  pointer-events: none;
}

.sticky-note:hover {
  z-index: 20;
  transform: rotate(2deg) scale(1.03);
  box-shadow: 0 16px 32px rgba(0,0,0,0.16), 0 4px 8px rgba(0,0,0,0.10);
}

.sticky-note-title {
  font-weight: 700;
  font-size: 20px;
  margin: 0 0 8px 0;
  color: #78350f;
  word-break: break-word;
  letter-spacing: 0.2px;
}

.sticky-note-link {
  display: inline-block;
  font-size: 12px;
  color: #a16207;
  text-decoration: underline;
  margin-bottom: 6px;
  word-break: break-all;
}

.sticky-note-img-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #a16207;
  font-weight: 700;
  margin-bottom: 6px;
}

.sticky-note-image {
  margin: 8px 0;
  border-radius: 4px;
  border: 1px solid #d97706;
  overflow: hidden;
  background: #fff;
}
.sticky-note-image img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.sticky-note-body {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  margin-bottom: 8px;
  font-size: 15px;
  font-family: var(--font-body);
  color: #78350f;
}

.sticky-note-meta {
  font-size: 11px;
  color: #a16207;
  font-style: italic;
  margin-top: auto;
  margin-bottom: 4px;
}

.sticky-note-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sticky-note:hover .sticky-note-actions {
  opacity: 1;
  pointer-events: auto;
}

.sticky-note-actions button {
  flex: 1;
  padding: 6px 4px;
  font-size: 12px;
  font-family: inherit;
  border-radius: 4px;
  border: 1px solid #d97706;
  background: #fff;
  color: #78350f;
  cursor: pointer;
}
.sticky-note-actions button:hover {
  background: #fef3c7;
  border-color: #b45309;
}
.sticky-note-actions button.danger {
  color: #c2410c;
  border-color: #fca5a5;
  background: #fff1f2;
}
.sticky-note-actions button.danger:hover {
  background: #fecaca;
  border-color: #f87171;
}

/* Scattered rotations for authentic sticky-note wall look */
.sticky-note:nth-child(3n+1) { transform: rotate(-1.5deg); }
.sticky-note:nth-child(3n+2) { transform: rotate(1.2deg); }
.sticky-note:nth-child(3n+3) { transform: rotate(-0.8deg); }

/* Empty states within sticky grid */
.sticky-notes-grid .empty {
  grid-column: 1 / -1;
  background: #fef9c3;
  border: 1px dashed #d97706;
  color: #78350f;
  font-family: 'Caveat', cursive, var(--font-body);
  font-size: 15px;
}

/* ==================== ISSUE SUMMARY CARD ==================== */
.issue-summary-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 16px;
  box-shadow: var(--shadow-hover);
  height: fit-content;
}
.issue-summary-card .summary-card-title {
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 14px 0;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.issue-summary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.issue-summary-stat {
  background: var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
  border: 1px solid var(--border);
}
.issue-summary-stat .stat-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}
.issue-summary-stat .stat-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.issue-summary-chart {
  height: 200px;
  position: relative;
  margin-bottom: 12px;
}
.issue-summary-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  font-size: 12px;
  margin-bottom: 12px;
}
.issue-summary-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.issue-summary-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.issue-summary-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 8px;
  justify-content: center;
}
.issue-summary-actions button {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px;
}

@media (max-width: 768px) {
  .sticky-notes-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
  .sticky-note {
    transform: none !important;
    min-height: 170px;
    font-size: 14px;
    padding: 12px 14px 14px;
  }
  .sticky-note:hover { transform: none !important; }
  .sticky-note-title { font-size: 17px; }
  .sticky-note-body { font-size: 13px; }
}

/* Calendar action row (nút Thêm sự kiện / Xuất / Nhập dời xuống dưới ngày tháng) */
.calendar-action-row {
  gap: 8px;
}
.calendar-action-row .btn {
  padding: 6px 12px;
  font-size: 13px;
}
