/* =========================================================
   Minotti & Sawyer — base stylesheet
   No framework dependency. Reset + layout + components.
   ========================================================= */

/* ----- Reset -------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.5;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  background: #f5f6f8;
  color: #1a1a2e;
  min-height: 100vh;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ----- Navigation --------------------------------------- */
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #1a1a2e;
  color: #e2e8f0;
  padding: 0 1.5rem;
  height: 3.25rem;
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

.nav-brand:hover {
  text-decoration: none;
  color: #93c5fd;
}

.nav-links {
  flex: 1;
  display: flex;
  gap: 1rem;
}

.nav-links a {
  color: #cbd5e1;
  font-size: 0.9rem;
}

.nav-links a:hover {
  color: #ffffff;
  text-decoration: none;
}

.nav-user {
  font-size: 0.85rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.nav-logout {
  flex-shrink: 0;
}

/* ----- Layout ------------------------------------------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
}

/* ----- Cards -------------------------------------------- */
.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}

/* ----- Definition list ---------------------------------- */
.dl {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.35rem 0.75rem;
}

.dl dt {
  font-weight: 600;
  color: #64748b;
  font-size: 0.875rem;
  padding-top: 0.1rem;
}

.dl dd {
  color: #1e293b;
  font-size: 0.9rem;
  word-break: break-word;
}

/* ----- Tables ------------------------------------------- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 1rem;
}

.table th {
  background: #f8fafc;
  text-align: left;
  padding: 0.6rem 0.875rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

.table td {
  padding: 0.65rem 0.875rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background: #f8fafc;
}

/* ----- Badges ------------------------------------------- */
.badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-pending {
  background: #f1f5f9;
  color: #475569;
}

.badge-validated {
  background: #dcfce7;
  color: #15803d;
}

.badge-archived {
  background: #fff7ed;
  color: #c2410c;
}

/* ----- Buttons ------------------------------------------ */
.btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  line-height: 1.4;
  transition: background 0.1s, border-color 0.1s;
  text-decoration: none;
}

.btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  text-decoration: none;
  color: #111827;
}

.btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

.btn-sm {
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
}

/* ----- Flash messages ----------------------------------- */
.flash {
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.flash-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.flash-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.flash-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

/* ----- Forms -------------------------------------------- */
.form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.875rem;
}

.form input[type="text"],
.form input[type="email"],
.form input[type="url"],
.form input[type="number"],
.form select,
.form textarea {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.9rem;
  color: #1e293b;
  background: #ffffff;
  width: 100%;
  max-width: 480px;
  transition: border-color 0.15s;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form textarea {
  resize: vertical;
  min-height: 6rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

/* ----- Auth box ----------------------------------------- */
.auth-box {
  max-width: 420px;
  margin: 4rem auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 2rem 2.25rem;
  text-align: center;
}

.auth-box h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 0.5rem;
}

.auth-box h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 0.5rem;
}

.auth-box p {
  color: #64748b;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.auth-box hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 1.25rem 0;
}

.auth-box label {
  display: block;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.auth-box select {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.9rem;
  color: #1e293b;
  background: #ffffff;
  margin-bottom: 1rem;
}

.dev-notice {
  color: #b45309;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ----- Pagination --------------------------------------- */
.pagination {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.875rem;
}

.pagination a {
  color: #2563eb;
}

/* ----- Misc --------------------------------------------- */
.empty {
  color: #94a3b8;
  font-style: italic;
  font-size: 0.9rem;
  padding: 1rem 0;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #1a1a2e;
}

/* ----- Filters bar -------------------------------------- */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.filters-bar label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.filters-bar input[type="text"],
.filters-bar select {
  padding: 0.35rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background: #ffffff;
  color: #1e293b;
  height: 2rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.filters-bar input[type="text"] {
  min-width: 180px;
  max-width: 280px;
}

.filters-bar select {
  min-width: 160px;
}

.filters-bar input[type="text"]:focus,
.filters-bar select:focus {
  outline: 2px solid #2563eb;
  outline-offset: -1px;
  border-color: #2563eb;
}

.filters-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.filters-count {
  font-size: 0.8rem;
  color: #94a3b8;
  font-style: italic;
  align-self: flex-end;
  margin-left: auto;
}

/* ----- Source provenance label -------------------------- */
.source-label {
  font-size: 0.65rem;
  font-weight: 500;
  background: #e0e7ff;
  color: #3730a3;
  padding: 0.1rem 0.3rem;
  border-radius: 0.25rem;
  vertical-align: middle;
  letter-spacing: 0;
  text-transform: none;
}

.raw-status {
  font-size: 0.875rem;
  color: #475569;
}

/* ----- Resume upload ------------------------------------ */
.resume-upload-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.resume-upload-form input[type="file"] {
  font-size: 0.875rem;
}

.resume-note {
  font-size: 0.775rem;
  color: #94a3b8;
  font-style: italic;
}

.resume-sha {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: #64748b;
}

/* ----- Role / company status badges --------------------- */
.badge-draft  { background: #f1f5f9; color: #475569; }
.badge-open   { background: #dcfce7; color: #15803d; }
.badge-paused { background: #fef9c3; color: #92400e; }
.badge-closed { background: #fee2e2; color: #b91c1c; }
.badge-stage  { background: #eff6ff; color: #1d4ed8; }

/* ----- Field hint --------------------------------------- */
.field-hint {
  font-size: 0.775rem;
  color: #94a3b8;
  font-style: italic;
  font-weight: 400;
}

/* ----- User role badges --------------------------------- */
.badge-role-admin     { background: #dbeafe; color: #1e40af; }
.badge-role-partner   { background: #fef9c3; color: #854d0e; }
.badge-role-recruiter { background: #dcfce7; color: #166534; }
.badge-role-read_only { background: #f1f5f9; color: #475569; }
.badge-active   { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-unbound  { background: #fef3c7; color: #92400e; }

/* ----- Stage inline form -------------------------------- */
.stage-form select {
  padding: 0.2rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.85rem;
  background: #ffffff;
  color: #1e293b;
  cursor: pointer;
}

/* ----- Add-match form ----------------------------------- */
.add-match-form {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.add-match-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
}

.add-match-form select {
  padding: 0.4rem 0.65rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background: #ffffff;
  color: #1e293b;
  min-width: 240px;
}

/* ----- Conflict panel ----------------------------------- */
.conflict-panel {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.conflict-panel summary {
  font-weight: 600;
  color: #92400e;
  cursor: pointer;
}

.conflict-panel table {
  margin-top: 0.5rem;
  border-collapse: collapse;
  width: 100%;
}

.conflict-panel th, .conflict-panel td {
  padding: 0.3rem 0.5rem;
  border: 1px solid #fde68a;
  font-size: 0.85rem;
}

/* ----- Task actions cell -------------------------------- */
.task-actions {
  white-space: nowrap;
}

/* ----- Add-task form ------------------------------------ */
.add-task-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem 0.75rem;
  align-items: end;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.add-task-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
}

.add-task-form input[type="text"],
.add-task-form input[type="date"],
.add-task-form select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background: #ffffff;
  color: #1e293b;
  width: 100%;
}

/* ----- Log-activity form -------------------------------- */
.log-activity-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem 0.75rem;
  align-items: end;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.log-activity-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
}

.log-activity-form input[type="datetime-local"],
.log-activity-form select,
.log-activity-form textarea {
  padding: 0.4rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background: #ffffff;
  color: #1e293b;
  width: 100%;
}

.log-activity-form textarea {
  resize: vertical;
  min-height: 3.5rem;
}

/* ----- Today page owner heading ------------------------- */
.today-owner-heading {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.35rem;
  margin-top: 0.75rem;
}

/* ----- Contact / general 2-col form grid ---------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  padding: 0.4rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background: #ffffff;
  color: #1e293b;
  width: 100%;
}
