:root {
  --orange: #FF6623;
  --orange-light: #FF9900;
  --orange-soft: #FFF1E8;
  --text: #2b2b2b;
  --text-muted: #8a8a8a;
  --bg: #f4f4f6;
  --surface: #ffffff;
  --border: #ececec;
  --border-strong: #ddd;
  --green: #1e8e3e;
  --green-soft: #e9f7ee;
  --red: #d1362f;
  --red-soft: #fbeceb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.03), 0 6px 16px rgba(20, 20, 20, 0.05);
}

* { box-sizing: border-box; }

body {
  font-family: Arial, "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

header {
  background: var(--surface);
  border-bottom: 3px solid var(--orange);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 {
  font-size: 16px;
  margin: 0;
  color: var(--text);
  font-weight: bold;
}

header nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 24px;
  font-weight: bold;
  font-size: 13px;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

header nav a.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

header .header-right {
  display: flex;
  align-items: center;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 28px;
  padding-left: 20px;
  border-left: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}

.user-badge .user-email { color: var(--text); font-weight: bold; }

.user-badge button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: bold;
  font-size: 12.5px;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-decoration: underline;
}

.user-badge button:hover { color: var(--orange); background: none; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  margin: 0;
}

.notif-badge {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  font-size: 10.5px;
  font-weight: bold;
  border-radius: 10px;
  padding: 1px 6px;
  margin-left: 5px;
  vertical-align: middle;
}

main {
  max-width: 760px;
  margin: 32px auto;
  padding: 0 20px 60px;
}

main.wide { max-width: 920px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-bottom: 20px;
}

.card-title { margin: 0 0 4px; font-size: 17px; }
.card-subtitle { margin: 0 0 24px; color: var(--text-muted); font-size: 13px; }

/* ---- form layout ---- */

.section {
  padding-top: 22px;
  margin-top: 22px;
  border-top: 1px solid var(--border);
}

.section:first-of-type { padding-top: 0; margin-top: 0; border-top: none; }

.section-label {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--orange);
  margin: 0 0 14px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field.full { grid-column: 1 / -1; }

label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 12.5px;
  color: var(--text);
}

label.optional::after {
  content: " (optional)";
  font-weight: normal;
  color: var(--text-muted);
}

input[type="text"], input[type="number"], input[type="url"], input[type="date"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 13.5px;
  background: var(--surface);
  color: var(--text);
}

input[type="date"] {
  color-scheme: light;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.5) sepia(1) saturate(4) hue-rotate(-10deg);
  cursor: pointer;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}

textarea { min-height: 64px; resize: vertical; }

.delivery-panel {
  background: var(--orange-soft);
  border: 1px solid #ffd9c2;
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 10px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.checkbox-row label { margin: 0; font-weight: normal; font-size: 13px; }
.checkbox-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--orange); }

/* pill-style multi-select checkboxes */

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.pill input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.pill span {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: bold;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.pill input:checked + span {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.pill input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--orange-soft);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 14px;
}

.toggle-row label { margin: 0; font-weight: normal; font-size: 13px; }

.hint { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; }

.error-box {
  background: var(--red-soft);
  border: 1px solid #f3c6c3;
  color: var(--red);
  padding: 11px 15px;
  border-radius: 8px;
  margin-top: 18px;
  font-size: 13px;
}

.error-box ul { margin: 6px 0 0 18px; padding: 0; }

.success-box {
  background: var(--green-soft);
  border: 1px solid #bfe6cc;
  color: var(--green);
  padding: 11px 15px;
  border-radius: 8px;
  margin-top: 18px;
  font-size: 13px;
}

.success-box a { color: var(--green); font-weight: bold; }

.form-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

button {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 11px 26px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 13.5px;
  cursor: pointer;
}

button:hover { background: #e5551a; }

/* ---- dashboard ---- */

.summary-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-pill {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
}

.stat-pill .stat-value { font-size: 22px; font-weight: bold; line-height: 1; }
.stat-pill .stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px; }
.stat-pill.ready .stat-value { color: var(--green); }
.stat-pill.flagged .stat-value { color: var(--red); }
.stat-pill.progress .stat-value { color: var(--orange); }

.charts-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.chart-card {
  flex: 1;
  margin-bottom: 0;
  padding: 20px 24px;
}

.chart-title { font-size: 14px; margin-bottom: 14px; }

.chart-body {
  display: flex;
  align-items: center;
  gap: 20px;
}

.pie-chart {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.pie-chart circle { cursor: pointer; transition: opacity 0.12s; }
.pie-chart circle:hover { opacity: 0.8; }

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
}

.legend-item { display: flex; align-items: center; gap: 7px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend-label { color: var(--text); }
.legend-count { color: var(--text-muted); margin-left: auto; padding-left: 10px; }

.chart-empty { padding: 10px 0; text-align: left; }

.chart-tooltip {
  position: fixed;
  z-index: 50;
  background: var(--text);
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
}

.page-btn {
  min-width: 30px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: bold;
  cursor: pointer;
}

.page-btn:hover:not([disabled]) { border-color: var(--orange-light); color: var(--orange); }

.page-btn.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.page-btn[disabled] { opacity: 0.4; cursor: default; }

.page-ellipsis { color: var(--text-muted); padding: 0 2px; font-size: 12.5px; }

.dashboard-note {
  font-size: 12px;
  color: var(--text-muted);
  margin: -10px 0 16px;
}

.type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.type-tab {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: bold;
  cursor: pointer;
}

.type-tab:hover { border-color: var(--orange-light); color: var(--text); }

.type-tab.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.type-tab .count { opacity: 0.75; margin-left: 3px; }

.job-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.job-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
}

.job-card.flagged { border-left: 3px solid var(--red); }
.job-card.ready { border-left: 3px solid var(--green); }
.job-card.progress { border-left: 3px solid var(--orange); }

.job-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.job-title { font-size: 14.5px; font-weight: bold; }
.job-title .job-id { color: var(--text-muted); font-weight: normal; margin-right: 6px; }
.job-partner { color: var(--text-muted); font-size: 12.5px; }

.badge {
  flex-shrink: 0;
  display: inline-block;
  padding: 4px 11px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
}

.badge.ready { background: var(--green-soft); color: var(--green); }
.badge.flagged { background: var(--red-soft); color: var(--red); }
.badge.progress { background: var(--orange-soft); color: var(--orange); }

.job-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.job-meta span:not(:last-child)::after { content: " \00b7 "; }

.job-progress {
  margin-top: 14px;
}

.progress-track {
  height: 6px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--orange);
  transition: width 0.3s ease;
}

.progress-fill.ready { background: var(--green); }
.progress-fill.flagged { background: var(--red); width: 100% !important; }

.progress-caption {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 6px;
}

.progress-caption .stage-name { font-weight: bold; color: var(--text); }

.flag-reason {
  color: var(--red);
  font-size: 12.5px;
  margin-top: 8px;
  background: var(--red-soft);
  border-radius: 6px;
  padding: 6px 10px;
}

.job-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

.file-count { font-size: 12.5px; color: var(--text-muted); }
.file-count strong { color: var(--text); }

.material-dots { display: flex; gap: 5px; }

.material-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: bold;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}

.material-dot.on {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.notif-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
}

.notif-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: bold;
}

.notif-icon.ready { background: var(--green-soft); color: var(--green); }
.notif-icon.flagged { background: var(--red-soft); color: var(--red); }

.notif-title { font-size: 13.5px; font-weight: bold; }
.notif-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notif-time { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; margin-left: auto; }
.notif-reason { font-size: 12px; color: var(--red); margin-top: 4px; }

.empty-state {
  color: var(--text-muted);
  font-size: 13px;
  padding: 40px 0;
  text-align: center;
}
