* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

#root {
  width: 100%;
  min-height: 100vh;
}

/* ===== LOGIN PAGE ===== */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 400px;
}

.login-box h1 {
  font-size: 28px;
  margin-bottom: 10px;
  color: #333;
  text-align: center;
}

.login-box .subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 30px;
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-box button {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.login-box button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.login-box button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error-message {
  color: #e74c3c;
  font-size: 14px;
  margin-bottom: 15px;
  padding: 10px;
  background: #fadbd8;
  border-radius: 5px;
  text-align: center;
}

/* ===== PUBLIC DASHBOARD ===== */
.public-dashboard {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 40px 20px;
}

.dashboard-header {
  max-width: 1200px;
  margin: 0 auto 40px;
  color: white;
  text-align: center;
}

.dashboard-header h1 {
  font-size: 42px;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.last-updated {
  font-size: 14px;
  opacity: 0.9;
}

.section {
  max-width: 1200px;
  margin: 0 auto 40px;
  background: white;
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.section-title {
  font-size: 24px;
  margin-bottom: 25px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #667eea;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
  background: white;
}

.project-card.sprint {
  border-left-color: #f39c12;
  background: #fffbf0;
}

.project-card.sprint:hover {
  box-shadow: 0 10px 25px rgba(243, 156, 18, 0.2);
}

.project-card.completed {
  border-left-color: #27ae60;
  background: #f0fdf4;
  opacity: 0.7;
}

.project-card.completed:hover {
  opacity: 0.85;
}

.project-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12px;
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
}

.project-key {
  background: #667eea;
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 11px;
}

.project-type {
  color: #666;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 600;
}

.project-card h3 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #333;
  font-weight: 600;
  line-height: 1.4;
}

.status {
  display: inline-block;
  padding: 4px 8px;
  background: #e3f2fd;
  color: #1976d2;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  width: fit-content;
}

.status-done {
  background: #e8f5e9;
  color: #388e3c;
}

.status-in\ progress {
  background: #fff3e0;
  color: #f57c00;
}

.status-to\ do {
  background: #fce4ec;
  color: #c2185b;
}

.loading {
  text-align: center;
  padding: 40px;
  color: white;
  font-size: 18px;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 16px;
}

/* ===== ADMIN DASHBOARD ===== */
.admin-dashboard {
  min-height: 100vh;
  background: #f5f7fa;
}

.admin-header {
  background: white;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1 {
  font-size: 28px;
  color: #333;
  margin-bottom: 5px;
}

.user-info {
  color: #666;
  font-size: 14px;
}

.logout-btn {
  padding: 10px 20px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.logout-btn:hover {
  background: #c0392b;
}

.admin-controls {
  max-width: 1200px;
  margin: 25px auto;
  padding: 0 20px;
}

.control-group {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sync-status {
  padding: 12px;
  background: white;
  border-radius: 5px;
  border-left: 4px solid #667eea;
  color: #333;
  font-size: 14px;
  margin-bottom: 15px;
}

.tabs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 10px;
  border-bottom: 1px solid #ddd;
}

.tab {
  padding: 15px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  color: #666;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  margin-bottom: -1px;
}

.tab.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

.admin-section {
  max-width: 1200px;
  margin: 25px auto;
  padding: 30px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.admin-section h2 {
  font-size: 20px;
  margin-bottom: 20px;
  color: #333;
}

.project-list.draggable {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-card.admin {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: grab;
  transition: all 0.2s;
}

.project-card.admin:hover {
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.project-card.admin.dragging {
  opacity: 0.5;
  background: #e8eaf6;
}

.drag-handle {
  color: #bbb;
  cursor: grab;
  font-size: 18px;
  user-select: none;
  flex-shrink: 0;
}

.project-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 15px;
}

.priority-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.project-card.admin h3 {
  margin: 5px 0;
  color: #333;
  font-size: 15px;
}

.external-link {
  color: #667eea;
  text-decoration: none;
  font-size: 20px;
  flex-shrink: 0;
  transition: color 0.2s;
}

.external-link:hover {
  color: #764ba2;
}

/* Hide / show controls (admin) */
.section-hint {
  color: #888;
  font-size: 13px;
  margin: -6px 0 14px;
}

.hide-toggle {
  background: none;
  border: 1px solid #d5d5e0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 6px 8px;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}

.hide-toggle:hover {
  background: #f0f0f6;
  border-color: #667eea;
}

.hide-toggle:disabled {
  opacity: 0.5;
  cursor: default;
}

.project-card.admin.is-hidden {
  opacity: 0.55;
}

.project-card.admin.is-hidden h3 {
  text-decoration: line-through;
}

.logs-table {
  overflow-x: auto;
}

.logs-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.logs-table th {
  background: #f5f7fa;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #e0e0e0;
}

.logs-table td {
  padding: 12px;
  border-bottom: 1px solid #e0e0e0;
  color: #666;
}

.logs-table tr:hover {
  background: #f8f8fc;
}

/* ===== SPRINT HIERARCHY (public) ===== */
.sprint-children {
  margin-left: 26px;
  padding-left: 14px;
  border-left: 2px solid #e6e6ef;
}

.sprint-issue {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #b9bfd6;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s, transform 0.2s;
}

.sprint-issue:hover {
  background: #fff;
  transform: translateX(3px);
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.15);
}

.sprint-issue-wrap.tg-epic    > .sprint-issue { border-left-color: #8e44ad; }
.sprint-issue-wrap.tg-story   > .sprint-issue { border-left-color: #27ae60; }
.sprint-issue-wrap.tg-task    > .sprint-issue { border-left-color: #2980b9; }
.sprint-issue-wrap.tg-subtask > .sprint-issue { border-left-color: #95a5a6; }

.sprint-issue-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #555;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 78px;
}

.sprint-issue-key {
  background: #667eea;
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.sprint-issue-summary {
  flex: 1;
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

/* Admin sprint-task list */
.sprint-task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.tg-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  background: #eef0f8;
  color: #444;
}

.tg-badge.tg-epic    { background: #f3e6fb; color: #8e44ad; }
.tg-badge.tg-story   { background: #e7f8ee; color: #1e8449; }
.tg-badge.tg-task    { background: #e6f0fb; color: #2471a3; }
.tg-badge.tg-subtask { background: #eef1f3; color: #6b7780; }

/* ===== SUBTASKS MERGED INTO PARENT CARD ===== */
.sprint-issue-wrap {
  margin-bottom: 10px;
}

.sprint-issue-wrap > .sprint-issue {
  margin-bottom: 0;
}

/* When a card has subtasks, square off the bottom so the bullet list joins it */
.sprint-issue-wrap:has(.subtask-list) > .sprint-issue {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.subtask-list {
  list-style: none;
  margin: 0;
  padding: 8px 16px 10px 40px;
  background: #f1f3f9;
  border-left: 4px solid #cfd6e6;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

/* Admin variant sits inside the card body, so give it its own spacing */
.project-card.admin .subtask-list {
  margin-top: 10px;
  border-radius: 8px;
  background: #eef1f8;
}

.subtask-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
  position: relative;
}

.subtask-item::before {
  content: '↳';
  color: #8a93ad;
  font-weight: 700;
  margin-right: 2px;
}

.subtask-summary {
  flex: 1;
  color: #333;
}

/* ===== SPRINT TASK UI OVERRIDES ===== */
/* Single column for both public and admin sprint task lists */
#sprint-list,
#admin-sprint-list,
#active-list,
#admin-nextup-list {
  display: block;
}

/* Type-colored backgrounds: green stories, blue tasks.
   Public cards (.sprint-issue) and admin rows (.sprint-task). */
.sprint-issue-wrap.tg-story   > .sprint-issue { background: #e7f7ee; }
.sprint-issue-wrap.tg-task    > .sprint-issue { background: #e6f0fb; }

.project-card.admin.sprint-task.tg-story { background: #e7f7ee; border-left-color: #27ae60; }
.project-card.admin.sprint-task.tg-task  { background: #e6f0fb; border-left-color: #2980b9; }

/* ===== SUPPORT TICKET METRICS ===== */
.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.support-stat {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 22px 16px;
  text-align: center;
  border-top: 4px solid #667eea;
}

.support-stat .support-value {
  font-size: 38px;
  font-weight: 700;
  color: #333;
  line-height: 1;
}

.support-stat .support-label {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #666;
}

.support-stat.highlight {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-top-color: #f39c12;
}

.support-stat.highlight .support-value,
.support-stat.highlight .support-label {
  color: #fff;
}

.support-updated {
  margin-top: 16px;
  font-size: 12px;
  color: #999;
  text-align: right;
}

/* Sprint date range next to the Current Sprint title */
.sprint-dates {
  margin-left: 12px;
  font-size: 15px;
  font-weight: 500;
  color: #888;
  white-space: nowrap;
}

/* ===== NEXT UP DROP ZONES (admin) ===== */
.dropzone {
  min-height: 70px;
  border-radius: 8px;
  transition: background 0.15s, box-shadow 0.15s;
}

.dropzone.drop-hover {
  background: rgba(102, 126, 234, 0.08);
  box-shadow: inset 0 0 0 2px #667eea;
}

.nextup-zone {
  padding: 8px;
  border: 2px dashed #cfd6e6;
  background: #fafbff;
}

.nextup-zone .empty-state {
  padding: 24px;
  color: #aab;
}

/* ===== ADD TASK FORM (admin) ===== */
.add-task-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.add-task-form input[type="text"] {
  flex: 1;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
}

.add-task-form select {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  background: #fff;
}

/* Manual task edit/delete buttons (mirror .hide-toggle sizing) */
.manual-edit,
.manual-delete {
  background: none;
  border: 1px solid #d5d5e0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 6px 8px;
  flex-shrink: 0;
  margin-left: 6px;
  transition: background 0.2s, border-color 0.2s;
}

.manual-edit:hover   { background: #eef0f8; border-color: #667eea; }
.manual-delete:hover { background: #fdeaea; border-color: #e74c3c; }

/* ===== TASK PRIORITY ===== */
/* Admin checkbox */
.priority-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  user-select: none;
}
.priority-check input { cursor: pointer; }

/* Admin card highlight when prioritized */
.project-card.admin.is-priority-task {
  box-shadow: inset 4px 0 0 #f1c40f;
  background: #fffdf3;
}

/* Public priority star + accent */
.priority-star {
  font-size: 14px;
  flex-shrink: 0;
}
.sprint-issue-wrap.is-priority-task > .sprint-issue {
  background: #fff8e1;
  border-left-color: #f1c40f;
  box-shadow: 0 0 0 1px #f6d365 inset;
}
