/* Brand palette — MHHC navy + accent */
:root {
  --bg:         #f4f6f9;
  --panel:      #ffffff;
  --text:       #1e293b;
  --muted:      #64748b;
  --border:     #e2e8f0;
  --brand:      #0b3d5c;
  --brand-ink:  #062a42;
  --accent:     #1d8ef9;
  --ok:         #15803d;
  --warn:       #b45309;
  --err:        #b91c1c;
  --excluded:   #f1f5f9;
  --pto:        #fef3c7;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

header {
  background: var(--brand);
  color: #fff;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand h1 { margin: 0; font-size: 1.25rem; }
.brand .tag { font-size: 0.85rem; opacity: 0.8; }
.header-actions { display: flex; gap: 0.5rem; align-items: center; }

.sync-badge {
  background: rgba(255,255,255,0.15);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
}
.sync-badge.stale { background: #b45309; }
.sync-badge.ok    { background: #15803d; }

main {
  max-width: 1100px;
  margin: 1.5rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.panel h2 { margin-top: 0; font-size: 1.05rem; color: var(--brand-ink); }
.panel.excluded { background: #fafaf9; }
.hint { color: var(--muted); font-size: 0.88rem; margin: 0 0 0.75rem; }

/* Tech cards */
.tech-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: #fff;
}
.tech-card.inactive { background: var(--excluded); opacity: 0.85; }
.tech-card.terminated { border-left: 4px solid var(--err); }
.tech-card.pto { border-left: 4px solid var(--warn); background: var(--pto); }
.tech-card.full-pto { border-left: 4px solid var(--err); }
.tech-card.active    { border-left: 4px solid var(--ok); }

.tech-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.tech-name { font-weight: 600; font-size: 1rem; color: var(--brand-ink); }
.tech-sub  { font-size: 0.85rem; color: var(--muted); margin-top: 0.15rem; }
.tech-badges { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
}
.badge.active       { background: #dcfce7; color: #14532d; }
.badge.inactive     { background: #e2e8f0; color: #334155; }
.badge.not-in-dir   { background: #fee2e2; color: #7f1d1d; }
.badge.pto          { background: #fde68a; color: #78350f; }
.badge.match        { background: #dbeafe; color: #1e40af; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
}
.grid-targets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.83rem;
  color: var(--muted);
}
label.inline { flex-direction: row; align-items: center; gap: 0.5rem; }
label small { color: var(--muted); font-size: 0.75rem; font-weight: normal; }

input, select, textarea {
  font: inherit;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
textarea { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.82rem; width: 100%; }

.tech-actions { margin-top: 0.75rem; display: flex; gap: 0.5rem; justify-content: flex-end; }

.btn-primary, .btn-secondary, .btn-danger {
  font: inherit;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: #1676d6; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--brand-ink); border-color: var(--border); }
.btn-secondary:hover { background: #f1f5f9; }
.btn-danger { background: #fee2e2; color: var(--err); border-color: #fecaca; font-size: 0.82rem; padding: 0.35rem 0.7rem; }
.btn-danger:hover { background: #fecaca; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 61, 92, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal.wide { max-width: 640px; }
.modal h2 { margin-top: 0; color: var(--brand-ink); }
.modal input[type="password"], .modal input[type="text"] { width: 100%; margin-bottom: 0.75rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }

.error { color: var(--err); font-size: 0.85rem; margin: 0.5rem 0 0; }

.dir-results {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 0.5rem;
}
.dir-item {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.dir-item:last-child { border-bottom: none; }
.dir-item:hover { background: #f1f5f9; }
.dir-item .sub { color: var(--muted); font-size: 0.8rem; }
.dir-item.already { opacity: 0.45; cursor: not-allowed; }

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-ink);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 200;
  font-size: 0.88rem;
}
.toast[hidden] { display: none; }
.toast.error { background: var(--err); }
.toast.ok    { background: var(--ok); }

/* Excluded list */
.excluded-row {
  padding: 0.45rem 0;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.excluded-row:last-child { border-bottom: none; }
.excluded-row .reason { color: var(--muted); font-size: 0.85rem; }
