:root {
  --bg: #f3efe6;
  --bg-panel: #fffcf7;
  --ink: #1c1a16;
  --muted: #6e675c;
  --line: #d9d0c0;
  --accent: #0f5c4c;
  --accent-soft: #d8ebe4;
  --warn: #8a4b12;
  --danger: #8b2e2e;
  --shadow: 0 12px 32px rgba(28, 26, 22, 0.06);
  --radius: 12px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 10% -10%, #e7f2ee 0%, transparent 55%),
    radial-gradient(700px 360px at 100% 0%, #f6e8d4 0%, transparent 50%),
    var(--bg);
  padding: 28px 24px 48px;
}

.nav {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.nav a:hover { color: var(--ink); background: rgba(255,255,255,0.5); }

.nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: #b7d5cb;
}

.mono { font-family: var(--mono); }

.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--mono);
}

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hint {
  margin: 0 0 20px;
  color: var(--muted);
  max-width: 62ch;
}

.hint strong { color: var(--ink); font-weight: 550; }

.assign-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.assign-bar label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.assign-bar input,
.assign-bar select,
#search {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 140px;
}

.selected-info {
  min-width: 180px;
  margin-right: 8px;
}

.selected-info .label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.muted { color: var(--muted); font-size: 13px; }

.btn {
  font: inherit;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 9px 14px;
  cursor: pointer;
  background: #fff;
  color: var(--ink);
}

.btn:hover { border-color: #b9ae9a; }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover { filter: brightness(1.05); }

.btn.ghost { background: transparent; }

.btn.danger {
  color: var(--danger);
  border-color: #e2c4c4;
  background: #fff7f7;
}

.toast {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
}

.toast.error {
  background: #f8e8e8;
  color: var(--danger);
}

.grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 14px;
}

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

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 8px;
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.badge {
  font-family: var(--mono);
  font-size: 12px;
  background: #efe8db;
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 8px;
}

#search {
  margin: 0 14px 10px;
  width: calc(100% - 28px);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0 8px 12px;
  overflow: auto;
  flex: 1;
}

.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}

.list li:hover { background: #f6f1e7; }

.list li.active {
  background: var(--accent-soft);
  border-color: #b7d5cb;
}

.list li.assigned {
  opacity: 0.55;
}

.person {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.person .name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person .meta {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}

.tag {
  font-size: 11px;
  font-family: var(--mono);
  padding: 2px 7px;
  border-radius: 999px;
  background: #efe8db;
  color: var(--muted);
  white-space: nowrap;
}

.tag.be { background: #e4eef8; color: #1f4e79; }
.tag.ml { background: #efe4f6; color: #5a2d82; }

.roster li {
  cursor: default;
}

.roster .actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.sync-bar .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

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

.stat {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.stat .label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat strong {
  font-size: 22px;
  font-family: var(--mono);
  font-weight: 500;
}

.sync-grid {
  grid-template-columns: 1.6fr 0.9fr;
}

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

.table-wrap {
  overflow: auto;
  padding: 0 8px 12px;
  flex: 1;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 8px 8px;
  border-bottom: 1px solid #eee6d8;
  vertical-align: top;
}

.data-table th {
  position: sticky;
  top: 0;
  background: var(--bg-panel);
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
}

.data-table td.mono,
.data-table .mono {
  font-family: var(--mono);
  font-size: 12px;
}

.panel-hint {
  margin: 0 14px 8px;
  font-size: 12px;
  color: var(--muted);
}

.skip-list .skip-item {
  display: block;
  cursor: default;
  padding: 0;
  border: 1px solid transparent;
}

.skip-list .skip-item:hover {
  background: transparent;
}

.skip-list .skip-item.open {
  background: #f6f1e7;
  border-color: #e2d7c3;
}

.skip-summary {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 10px;
  border-radius: 8px;
}

.skip-summary:hover {
  background: #f6f1e7;
}

.skip-title {
  font-weight: 500;
  flex: 1;
  min-width: 0;
}

.skip-tag {
  background: #f3e2d2;
  color: var(--warn);
}

.skip-detail {
  padding: 0 10px 12px 10px;
  display: grid;
  gap: 6px;
}

.skip-detail p {
  margin: 0;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.4;
}

.skip-meta,
.skip-code {
  color: var(--muted) !important;
  font-size: 12px !important;
}

.skip-tip {
  color: var(--accent) !important;
}

.progress-wrap {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.progress-track {
  height: 8px;
  background: #efe8db;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0f5c4c, #2a9b7c);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.sync-grid-3 {
  display: grid;
  grid-template-columns: 0.85fr 1.4fr 0.95fr;
  gap: 14px;
}

@media (max-width: 1100px) {
  .sync-grid-3 { grid-template-columns: 1fr; }
}

.order-list .order-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: grab;
  border: 1px solid transparent;
}

.order-list .order-item.dragging {
  opacity: 0.45;
}

.order-list .order-item.drag-over {
  border-color: #b7d5cb;
  background: var(--accent-soft);
}

.drag-handle {
  font-family: var(--mono);
  color: var(--muted);
  letter-spacing: -2px;
  user-select: none;
}

.team-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}

.team-tabs .tab {
  font: inherit;
  font-weight: 500;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}

.team-tabs .tab.active {
  background: var(--accent-soft);
  border-color: #b7d5cb;
  color: var(--accent);
}
