/* ============================================================
   COMPONENTS — buttons, cards, kanban, table, badges, forms
   Matches Bear Valley Electric brand from OpsWeb.html
============================================================ */

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary, .btn-red   { background: var(--red); color: #fff; }
.btn-primary:hover,
.btn-red:hover           { background: #aa0000; }
.btn-yellow              { background: var(--yellow); color: var(--black); }
.btn-yellow:hover        { background: #e6c200; }
.btn-outline             { background: transparent; color: var(--red); border: 2px solid var(--red); }
.btn-outline:hover       { background: var(--red); color: #fff; }
.btn-gray                { background: #6c757d; color: #fff; }
.btn-gray:hover          { background: #5a6268; }
.btn-ok, .btn-success    { background: var(--ok); color: #fff; }
.btn-sm                  { padding: 5px 10px; font-size: .65rem; }
.btn-full                { width: 100%; justify-content: center; }

/* ---- STAT / METRIC CARDS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }

.stat-card {
  background: var(--card);
  border-radius: 12px;
  border-top: 3px solid var(--red);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.stat-card.ac-yellow { border-top-color: var(--yellow); }
.stat-card.ac-ok     { border-top-color: var(--ok); }
.stat-card.ac-blue   { border-top-color: var(--blue); }

.stat-label {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #666;
}
.stat-value { font-size: 1.75rem; font-weight: 900; color: var(--black); line-height: 1; }
.stat-sub   { font-size: .7rem; color: #888; display: flex; align-items: center; gap: 4px; }
.stat-dot   { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ---- CARD (generic content block) ---- */
.card {
  background: var(--card);
  border-radius: 12px;
  border-top: 3px solid var(--red);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.card-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--red);
  margin-bottom: 12px;
}

/* ---- SECTION HEADER ---- */
.section-hd {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--red);
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---- KANBAN ---- */
.kanban {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 8px;
}

.kanban-col {
  background: #f0f0f0;
  border-radius: 12px;
  padding: 10px;
  min-width: 200px;
  flex-shrink: 0;
  min-height: 120px;
}
.kanban-col.highlight { outline: 2px solid var(--red); outline-offset: -2px; }

.kanban-col-header {
  background: #fff;
  border: 2px solid var(--red);
  border-radius: 8px;
  padding: 9px 13px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kanban-col.highlight .kanban-col-header {
  background: var(--red);
}
.kanban-col-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--black);
}
.kanban-col.highlight .kanban-col-title { color: #fff; }
.kanban-count {
  font-size: .72rem;
  font-weight: 700;
  color: var(--black);
}
.kanban-col.highlight .kanban-count { color: var(--yellow); }

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 60px;
}

/* ---- CANDIDATE CARD ---- */
.candidate-card {
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  transition: transform .12s, box-shadow .12s;
}
.candidate-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,.14);
  border-left: 3px solid var(--red);
  padding-left: 7px;
}
.candidate-name { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 3px; }
.candidate-role { font-size: .66rem; color: #666; font-weight: 700; margin-bottom: 6px; }
.candidate-meta { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 6px; }

.score-bar-wrap { background: var(--border); border-radius: 99px; height: 4px; margin-top: 5px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 99px; background: var(--ok); }

/* ---- BADGES / TAGS ---- */
.badge, .tag {
  padding: 3px 9px;
  border-radius: 4px;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  display: inline-block;
}
.tag-new, .badge-blue     { background: #e3f2fd; color: #1565c0; }
.tag-warm, .badge-warn    { background: #fff3e0; color: #e65100; }
.tag-hot,  .badge-err     { background: #ffebee; color: #c62828; }
.tag-source, .badge-info  { background: #e8f7ed; color: #1d7a3f; }
.tag-pass, .badge-ok      { background: #e8f5e9; color: #2e7d32; }
.tag-offer                { background: #f3e5f5; color: #6a1b9a; }
.tag-hired                { background: #e8f5e9; color: #2e7d32; }
.badge-gray               { background: #f0f0f0; color: #555; }

.days-ago { font-size: .62rem; color: #888; font-weight: 700; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 3px 9px;
  border-radius: 4px;
}

/* ---- TABLE ---- */
.table-wrap {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.search-bar {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fafafa;
}
.search-input {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 7px 11px;
  font-size: .85rem;
  font-family: inherit;
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
.search-input:focus { border-color: var(--red); }

.tbl { width: 100%; border-collapse: collapse; font-size: .82rem; }
.tbl th {
  background: var(--red);
  color: #fff;
  padding: 9px 12px;
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
.tbl tbody tr:nth-child(even) td { background: var(--row-alt); }
.tbl tbody tr:hover td { background: #fff9e0; cursor: pointer; }
.tbl tr.clickable:hover td { background: #fff9e0; cursor: pointer; }

/* ---- CHECKLIST ---- */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
}
.checklist-item:last-child { border-bottom: none; }
.check {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2.5px solid #ccc;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: .7rem;
  transition: all .2s;
}
.check.done    { background: var(--ok);   border-color: var(--ok);   color: #fff; }
.check.pending { background: #fff; }
.check.overdue { background: #fff; border-color: var(--red); }
.checklist-label         { flex: 1; }
.checklist-label.done    { color: #999; text-decoration: line-through; }
.checklist-label.overdue { color: var(--red); font-weight: 900; }
.checklist-due           { font-size: .65rem; color: #888; font-weight: 700; white-space: nowrap; }
.checklist-due.overdue   { color: var(--red); font-weight: 900; }

/* ---- PROGRESS BAR ---- */
.progress-bar-wrap {
  background: var(--border);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--red);
  transition: width .4s;
}

/* ---- MODAL ---- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 16px; }
.overlay.hide { display: none; }
.modal { background: #fff; border-radius: 14px; max-width: 580px; width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,.3); }
.modal-hdr { background: var(--red); color: #fff; padding: 14px 18px; border-radius: 14px 14px 0 0; display: flex; justify-content: space-between; align-items: center; }
.modal-hdr h3 { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.modal-close { background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; line-height: 1; }
.modal-body { padding: 18px; }
.modal-footer { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ---- FORM FIELDS ---- */
.fg { margin-bottom: 13px; }
.fg label { display: block; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: #666; margin-bottom: 3px; }
.fc { width: 100%; padding: 8px 11px; border: 2px solid var(--border); border-radius: 6px; font-family: inherit; font-size: .85rem; outline: none; transition: border-color .15s; background: #fff; }
.fc:focus { border-color: var(--red); }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* ---- PANEL INTERNALS ---- */
.panel-header {
  background: var(--red);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.panel-header .panel-name { font-size: .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #fff; }
.panel-header .panel-sub  { font-size: .65rem; color: rgba(255,255,255,.8); margin-top: 2px; text-transform: uppercase; letter-spacing: 1px; }
.panel-close { cursor: pointer; font-size: 1.4rem; color: #fff; background: none; border: none; line-height: 1; }

.panel-body          { padding: 18px; flex: 1; overflow-y: auto; }
.panel-section       { margin-bottom: 20px; }
.panel-section-title {
  font-size: .68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--red); margin-bottom: 8px;
  padding-bottom: 5px; border-bottom: 2px solid var(--border);
}

.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: .82rem;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: #888; font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; }

.stage-select {
  width: 100%; padding: 8px 10px; font-size: .82rem; font-weight: 700;
  border: 2px solid var(--border); border-radius: 6px;
  background: #fff; cursor: pointer; font-family: inherit; outline: none;
}
.stage-select:focus { border-color: var(--red); }

.score-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: .82rem;
}
.score-row:last-child { border-bottom: none; }
.score-val      { font-weight: 700; }
.score-val.high { color: var(--ok); }
.score-val.mid  { color: var(--warn); }
.score-val.low  { color: var(--red); }

.email-log { background: var(--row-alt); border-radius: 6px; padding: 12px; font-size: .75rem; color: #666; }
.email-entry { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.email-entry:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.email-subject { font-weight: 700; color: var(--black); margin-bottom: 2px; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; }

.note-area {
  width: 100%; border: 2px solid var(--border); border-radius: 6px;
  padding: 10px; font-size: .85rem; min-height: 80px; resize: vertical;
  font-family: inherit; background: #fff; outline: none;
}
.note-area:focus { border-color: var(--red); }

.vetting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: .82rem;
}
.vetting-row:last-child { border-bottom: none; }
.vetting-status { font-size: .65rem; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; }
.vs-pass    { background: #e8f5e9; color: #2e7d32; }
.vs-pending { background: #fff3e0; color: #e65100; }
.vs-fail    { background: #ffebee; color: #c62828; }
.vs-na      { background: #f0f0f0; color: #555; }

/* ---- TASK ITEMS ---- */
.task-list { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.task-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.task-item:last-child { border-bottom: none; }
.task-item:hover      { background: var(--row-alt); }
.task-check-box {
  width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid #ccc;
  flex-shrink: 0; margin-top: 1px; cursor: pointer; transition: border-color .15s;
}
.task-check-box:hover { border-color: var(--red); }
.task-body     { flex: 1; }
.task-text     { font-size: .82rem; font-weight: 700; color: var(--black); line-height: 1.4; }
.task-meta     { font-size: .68rem; color: #888; margin-top: 3px; display: flex; gap: 12px; font-weight: 700; }
.task-due-red  { color: var(--red); font-weight: 900; }
.task-due-warn { color: var(--warn); font-weight: 900; }
.task-priority { font-size: .62rem; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; align-self: flex-start; margin-top: 2px; }

/* ---- SOURCE CARD ---- */
.sourcing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.source-card {
  background: var(--card); border-radius: 12px; border-top: 3px solid var(--red);
  box-shadow: var(--shadow); padding: 14px;
}
.source-platform { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; display: flex; align-items: center; gap: 7px; }
.source-stats    { display: flex; gap: 16px; margin-top: 10px; }
.source-stat     { text-align: center; }
.source-stat-val { font-size: 1.1rem; font-weight: 700; }
.source-stat-lbl { font-size: .6rem; color: #888; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.source-bar-wrap { background: var(--border); border-radius: 99px; height: 5px; margin-top: 10px; overflow: hidden; }
.source-bar-fill { height: 100%; border-radius: 99px; }
.live-dot        { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ---- ORIENTATION CARD ---- */
.orientation-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.orientation-card {
  background: var(--card); border-radius: 12px; border-top: 3px solid var(--red);
  box-shadow: var(--shadow); padding: 18px;
}
.orientation-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.orientation-name   { font-weight: 700; font-size: .88rem; text-transform: uppercase; letter-spacing: 1px; }
.orientation-role   { font-size: .68rem; color: #888; margin-top: 2px; font-weight: 700; }

/* ---- SPINNER ---- */
.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid rgba(204,0,0,.25); border-top-color: var(--red); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box { text-align: center; padding: 48px; color: #888; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: .72rem; }

/* ---- UTILITIES ---- */
.flex-row     { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.text-red  { color: var(--red); }
.text-ok   { color: var(--ok); }
.text-warn { color: var(--warn); }
.hidden    { display: none !important; }
.w-100     { width: 100%; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
