:root {
  --ink: #1c1c1e;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f6f6f4;
  --card: #ffffff;
  --red: #c8102e;
  --red-dark: #a50d26;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --green: #166534;
  --green-bg: #dcfce7;
  --gray-bg: #f1f2f5;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: #232323; color: #fff; padding: 12px 20px;
  border-bottom: 4px solid var(--red);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  background: var(--red); color: #fff; font-weight: 700; font-size: 22px;
  padding: 6px 10px; border-radius: 6px; letter-spacing: 1px;
}
.brand-name { font-size: 18px; font-weight: 700; }
.brand-sub { font-size: 12px; color: #c9c9c9; }
.session-box { font-size: 13px; text-align: right; }
.session-box button { margin-left: 8px; }
.container { max-width: 1180px; margin: 0 auto; padding: 18px 14px 40px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; margin-bottom: 14px;
}
.card h2 { margin: 0 0 10px; font-size: 16px; }
.card h3 { margin: 14px 0 8px; font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
button {
  font: inherit; font-size: 13px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 6px; padding: 6px 12px;
}
button:hover { background: var(--gray-bg); }
button.primary { background: var(--red); border-color: var(--red); color: #fff; }
button.primary:hover { background: var(--red-dark); }
button.dark { background: #232323; color: #fff; border-color: #232323; }
button:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea {
  font: inherit; font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 6px; width: 100%;
  background: #fff; color: var(--ink);
}
label { display: block; font-size: 12px; font-weight: 700; margin: 10px 0 4px; color: #374151; }
.form-card { max-width: 430px; margin: 40px auto; }
.error { background: #fee2e2; color: #991b1b; border-radius: 6px; padding: 8px 10px; font-size: 13px; margin-top: 10px; }
.notice { background: var(--amber-bg); color: var(--amber); border-radius: 6px; padding: 8px 10px; font-size: 13px; margin-top: 10px; }
.ok { background: var(--green-bg); color: var(--green); border-radius: 6px; padding: 8px 10px; font-size: 13px; margin-top: 10px; }

.strip { border-left: 5px solid var(--red); }
.strip .item { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.strip .item:last-child { border-bottom: none; }
.days { font-weight: 700; color: var(--red); }

.band { display: flex; flex-wrap: wrap; gap: 10px; }
.day-chip {
  background: var(--gray-bg); border-radius: 8px; padding: 8px 12px; font-size: 13px;
  min-width: 150px;
}
.day-chip .count { font-size: 18px; font-weight: 700; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.toolbar input[type="search"] { flex: 1 1 260px; width: auto; }
.toolbar select { width: auto; }

.opp { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; background: #fff; }
.opp-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.opp-title { font-size: 16px; font-weight: 700; }
.opp-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.chip {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px;
  border-radius: 999px; background: var(--gray-bg); color: #374151; margin-right: 6px;
}
.chip.red { background: #fee2e2; color: #991b1b; }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.green { background: var(--green-bg); color: var(--green); }
.opp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 18px; margin: 10px 0; font-size: 13px; }
.opp-grid .k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.opp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.waiting { font-size: 13px; color: var(--amber); font-weight: 700; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: #232323; color: #fff; text-align: left; padding: 8px; }
td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: top; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.kv { font-size: 13px; }
.kv div { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.kv .k { color: var(--muted); }
.alert-row { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
textarea.email-body { width: 100%; min-height: 210px; font-family: monospace; font-size: 12px; }
dialog { border: 1px solid var(--line); border-radius: 10px; max-width: 560px; width: 92vw; }
dialog::backdrop { background: rgba(0,0,0,.4); }

/* CAPGEMS tracker */
.cg-edit { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 10px; }
.cg-edit select, .cg-edit input { width: 100%; }
.cg-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.cg-item input[type="checkbox"] { width: auto; }
.cg-done { color: var(--muted); text-decoration: line-through; }
.cg-x { border: none; background: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 0 4px; }
.cg-scroll { overflow-x: auto; }
.cg-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.cg-table th, .cg-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; white-space: nowrap; }
.cg-jobname { font-weight: 600; }
.cg-pay { cursor: pointer; border: 1px solid var(--line); min-width: 58px; }
