/**
 * STYLESHEET CHO PHÂN HỆ QUẢN LÝ CREATIVE & REALTIME DASHBOARD
 * Màu thương hiệu: biến --brand-primary trong app.css
 */

/* Main Navigation Switcher */
.main-nav {
  display: flex;
  gap: 8px;
  background: #FFFFFF;
  border-bottom: 2px solid #F1F5F9;
  padding: 8px 24px;
  margin-bottom: 20px;
}
.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: #64748B;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.nav-tab:hover {
  background: #F8FAFC;
  color: #0F172A;
}
.nav-tab.active {
  background: #FEE2E2;
  color: #DC2626;
}
.badge-live {
  font-size: 10px;
  font-weight: 700;
  background: #DC2626;
  color: #FFFFFF;
  padding: 2px 6px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

/* Realtime Badge */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.live-pill.disconnected {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FECACA;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}
.live-pill.disconnected .live-dot {
  background: #DC2626;
  animation: none;
}
@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Week Selector Toolbar */
.week-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #FFFFFF;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
}
.week-select-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.week-select-group select {
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
}

/* Editor Chips */
.editor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}
.editor-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #E2E8F0;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.editor-chip:hover {
  background: #E2E8F0;
}
.editor-chip.active {
  background: #DC2626;
  color: #FFFFFF;
  border-color: #DC2626;
}
.editor-chip .count {
  font-size: 11px;
  background: rgba(0, 0, 0, 0.08);
  padding: 1px 6px;
  border-radius: 10px;
}
.editor-chip.active .count {
  background: rgba(255, 255, 255, 0.25);
}

/* Analytics Row (Editors + Games) */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .analytics-grid { grid-template-columns: 1fr; }
}

.stat-item {
  margin-bottom: 12px;
}
.stat-item:last-child { margin-bottom: 0; }
.stat-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.stat-bar-bg {
  height: 8px;
  background: #F1F5F9;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.stat-bar-fill {
  height: 100%;
  background: #DC2626;
  border-radius: 4px;
  transition: width 0.3s ease;
}
.stat-bar-fill.green {
  background: #10B981;
}

/* Table Task Styles */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
}
.badge-done { background: #ECFDF5; color: #047857; }
.badge-doing { background: #FEF3C7; color: #B45309; }
.badge-todo { background: #F1F5F9; color: #64748B; }

.game-title {
  font-weight: 600;
  color: #0F172A;
}
.task-desc {
  max-width: 380px;
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.path-box {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 260px;
}
.path-text {
  font-family: Consolas, monospace;
  font-size: 11px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  padding: 2px 6px;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
  cursor: pointer;
}
.path-text:hover {
  background: #EFF6FF;
  border-color: #93C5FD;
}
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 14px;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.btn-icon:hover { opacity: 1; }

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}
.modal-overlay[hidden] {
  display: none;
}
.modal-dialog {
  background: #FFFFFF;
  border-radius: 12px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #E2E8F0;
}
.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.modal-body {
  padding: 20px;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid #E2E8F0;
  background: #F8FAFC;
  border-radius: 0 0 12px 12px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.form-group {
  margin-bottom: 12px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  box-sizing: border-box;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  background: #FFFFFF;
}
.form-group textarea {
  resize: vertical;
  min-height: 60px;
}
