:root {
  --bg-body: #0d1117;
  --bg-card: #161b22;
  --bg-elevated: #1f242c;
  --bg-input: #0d1117;
  --border: #30363d;
  --border-muted: #21262d;
  --text-main: #e6edf3;
  --text-muted: #8b949e;
  --primary: #2f81f7;
  --primary-hover: #388bfd;
  --success: #238636;
  --success-hover: #2ea043;
  --danger: #da3633;
  --danger-hover: #f85149;
  --warning: #d29922;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

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

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}
a:hover {
  text-decoration: underline;
}

.navbar {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-main);
  cursor: pointer;
}
.brand:hover {
  text-decoration: none;
  color: #fff;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2f81f7, #238636);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  background: var(--bg-elevated);
  text-decoration: none;
}

.announcement-bar {
  background: rgba(47, 129, 247, 0.12);
  border-bottom: 1px solid rgba(47, 129, 247, 0.3);
  color: #79c0ff;
  padding: 8px 24px;
  font-size: 13px;
  text-align: center;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

.card-header {
  padding: 12px 16px;
  background-color: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

.card-body {
  padding: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--border);
  background-color: var(--bg-elevated);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover {
  background-color: #30363d;
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--success);
  border-color: rgba(240, 246, 252, 0.1);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--success-hover);
}

.btn-blue {
  background-color: var(--primary);
  border-color: rgba(240, 246, 252, 0.1);
  color: #fff;
}
.btn-blue:hover {
  background-color: var(--primary-hover);
}

.btn-danger {
  background-color: rgba(218, 54, 51, 0.15);
  border-color: rgba(218, 54, 51, 0.4);
  color: #ff7b72;
}
.btn-danger:hover {
  background-color: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.input, .select, .textarea {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(47, 129, 247, 0.25);
}

.textarea-code {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  min-height: 360px;
  resize: vertical;
  tab-size: 4;
}

.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-main);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.badge-public {
  color: #3fb950;
  border-color: rgba(63, 185, 80, 0.4);
  background: rgba(63, 185, 80, 0.1);
}
.badge-private {
  color: #d29922;
  border-color: rgba(210, 153, 34, 0.4);
  background: rgba(210, 153, 34, 0.1);
}
.badge-admin {
  color: #a371f7;
  border-color: rgba(163, 113, 247, 0.4);
  background: rgba(163, 113, 247, 0.1);
}
.badge-danger {
  color: #ff7b72;
  border-color: rgba(255, 123, 114, 0.4);
  background: rgba(255, 123, 114, 0.1);
}

.grid-2 {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
}
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}
.stat-title {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
}
.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
}
.tab-item {
  padding: 10px 16px;
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-item:hover {
  color: var(--text-main);
}
.tab-item.active {
  color: var(--text-main);
  border-bottom-color: #f78166;
  font-weight: 600;
}

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-muted);
}
.table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  background: var(--bg-elevated);
}
.table tr:last-child td {
  border-bottom: none;
}
.table tr:hover td {
  background-color: rgba(177, 186, 196, 0.04);
}

.code-viewer {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  overflow-x: auto;
  background: #0d1117;
  padding: 12px 0;
}
.code-line {
  display: flex;
  padding: 0 16px;
}
.code-line:hover {
  background: rgba(110, 118, 129, 0.1);
}
.line-num {
  width: 48px;
  flex-shrink: 0;
  color: #6e7681;
  text-align: right;
  padding-right: 16px;
  user-select: none;
}
.line-content {
  white-space: pre;
  word-break: normal;
}

.diff-add {
  background-color: rgba(46, 160, 67, 0.18);
  color: #7ee787;
}
.diff-del {
  background-color: rgba(248, 81, 73, 0.18);
  color: #ffa198;
}
.diff-hunk {
  background-color: rgba(56, 139, 253, 0.15);
  color: #79c0ff;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(1, 4, 9, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}
.modal-body {
  padding: 18px;
  overflow-y: auto;
}
.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-main);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 200;
  font-weight: 500;
}
.toast-error {
  border-color: var(--danger);
  color: #ff7b72;
}
.toast-success {
  border-color: var(--success);
  color: #56d364;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.flex-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.text-muted {
  color: var(--text-muted);
}
.mono {
  font-family: var(--font-mono);
}
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }

/* Work Status Dashboard Charts & Pills */
.member-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.member-pill:hover {
  border-color: var(--primary);
  color: var(--text-main);
}
.member-pill.active {
  background: rgba(47, 129, 247, 0.18);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f81f7, #8957e5);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.chart-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 960px) {
  .chart-grid-2 {
    grid-template-columns: 1fr;
  }
}

.bar-chart-wrap {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 180px;
  padding: 20px 8px 28px 8px;
  border-bottom: 1px solid var(--border-muted);
  position: relative;
  overflow-x: auto;
}
.bar-col {
  flex: 1;
  min-width: 14px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  cursor: pointer;
}
.bar-col:hover .bar-fill {
  filter: brightness(1.25);
}
.bar-fill {
  width: 100%;
  max-width: 22px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #388bfd 0%, #238636 100%);
  transition: height 0.25s ease;
  min-height: 2px;
}
.bar-fill.zero {
  background: #21262d;
  height: 3px !important;
}
.bar-val {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 3px;
  font-family: var(--font-mono);
}
.bar-label {
  position: absolute;
  bottom: -22px;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: var(--font-mono);
}

.progress-track {
  width: 100%;
  height: 10px;
  background: #21262d;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}
.progress-fill-blue {
  background: linear-gradient(90deg, #2f81f7, #58a6ff);
  height: 100%;
}
.progress-fill-green {
  background: #2ea043;
  height: 100%;
}
.progress-fill-red {
  background: #f85149;
  height: 100%;
}

.heat-grid {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.heat-cell {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: #161b22;
  border: 1px solid rgba(240,246,252,0.05);
}
.heat-l1 { background: #0e4429; }
.heat-l2 { background: #006d32; }
.heat-l3 { background: #26a641; }
.heat-l4 { background: #39d353; }
