/* ============================================================
   Goals To Results Portal CSS
   - Top-level tabs: GTR gold scheme
   - Subtabs: blue scheme (generic baseline)
   - Third-level (tables, buttons, cards): unchanged
   ============================================================ */

/* Global reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, sans-serif;
}

body {
  background: #f7f9fb;
  color: #222;
  line-height: 1.4;
  padding: 20px;
}

/* Header */
header {
  margin-bottom: 20px;
}
header h1 {
  margin-bottom: 8px;
}
#project-selector-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Top-level tabs with GTR gold styling */
nav#tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
nav#tabs button {
  padding: 8px 16px;
  background: #fef9e7; /* light gold base */
  border: 1px solid #c9a227; /* sharp gold border */
  border-radius: 6px;
  color: #444;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
nav#tabs button:hover {
  background: #fbe8b0; /* hover gold */
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
nav#tabs button.active {
  background: #c9a227; /* solid gold active */
  color: #fff;
  font-weight: 600;
  border-color: #c9a227;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
nav#tabs button.disabled {
  background: #fdf6e3;
  color: #999;
  cursor: not-allowed;
  border: 1px solid #e0d8b0;
}

/* Generic subtabs baseline (blue scheme) */
nav.subtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  border-bottom: 1px solid #ccc;
}
nav.subtabs button {
  padding: 6px 14px;
  border: 1px solid #ccc;
  border-bottom: none;
  background: #eaeaea;
  cursor: pointer;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  transition: background 0.2s ease;
}
nav.subtabs button:hover {
  background: #ddd;
}
nav.subtabs button.active {
  background: #4a90e2;
  color: #fff;
  font-weight: 600;
  border-color: #4a90e2;
  border-bottom: 1px solid #fff;
}
nav.subtabs button.disabled {
  background: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

/* Notes subtabs (kept scoped for folder-style overrides) */
nav#notes-subtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  border-bottom: 1px solid #ccc;
}
nav#notes-subtabs button {
  padding: 6px 14px;
  border: 1px solid #ccc;
  border-bottom: none;
  background: #eaeaea;
  cursor: pointer;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  transition: background 0.2s ease;
}
nav#notes-subtabs button:hover {
  background: #ddd;
}
nav#notes-subtabs button.active {
  background: #4a90e2;
  color: #fff;
  font-weight: 600;
  border-color: #4a90e2;
  border-bottom: 1px solid #fff;
}
nav#notes-subtabs button.disabled {
  background: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

/* Cards */
.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 12px;
}
.card.stat { flex: 1; text-align: center; }
.card.loader { text-align: center; font-style: italic; }

/* Rows */
.row { display: flex; align-items: center; }
.spacer { flex: 1; }

/* Muted text */
.muted { color: #666; font-size: 0.9em; }

/* Inputs */
input, textarea, select {
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 3px;
}
button {
  padding: 6px 12px;
  border-radius: 3px;
}

/* Zebra striping for lists */
#contactsResults .card:nth-child(even),
#tasksList .card:nth-child(even),
#notesContent .card:nth-child(even) {
  background: #f9f9f9;
}

/* Notes History Table */
.notes-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  background: #fff;
  border: 1px solid #ddd;
}
.notes-table th, .notes-table td {
  padding: 8px 10px;
  border: 1px solid #ddd;
  text-align: left;
}
.notes-table th {
  background: #f0f0f0;
  font-weight: 600;
}
.notes-table tr:nth-child(even) { background: #fafafa; }

/* Default button style inside notes-table (baseline) */
.notes-table button {
  padding: 4px 8px;
  font-size: 0.9em;
  border-radius: 3px;
  cursor: pointer;
}

/* Scoped overrides so variants win inside notes-table */
.notes-table button.btn-primary {
  background: #2979ff;
  color: #fff;
  border: none;
}
.notes-table button.btn-primary:hover { background: #1c5fd6; }

.notes-table button.btn-danger {
  background: #e53935;
  color: #fff;
  border: none;
}
.notes-table button.btn-danger:hover { background: #c62828; }

.notes-table button.btn-secondary {
  background: #999;
  color: #fff;
  border: none;
}
.notes-table button.btn-secondary:hover { background: #777; }

.contact-result {
  cursor: pointer;
}

/* Status messages */
.status {
  margin-top: 8px;
  font-size: 0.9em;
}
.status.info { color: #4a90e2; }
.status.success { color: #2d8a34; }
.status.error { color: #c0392b; }

/* ============================================================
   Button Variants (global, for reuse outside notes-table)
   ============================================================ */
.btn-primary {
  background: #2979ff;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
}
.btn-primary:hover { background: #1c5fd6; }

.btn-danger {
  background: #e53935;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
}
.btn-danger:hover { background: #c62828; }

.btn-secondary {
  background: #999;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
}
.btn-secondary:hover { background: #777; }

/* === Contact Form Enhancements === */

/* Space between each field row */
.notes-row {
  margin-bottom: 16px;
}

/* Label styling with colon */
.notes-label {
  display: block;
  font-weight: bold;
  margin-bottom: 6px; /* space between label and field */
  position: relative;
}

.notes-label::after {
  content: ":";
  margin-left: 2px;
}

/* Input and select styling */
.form-control {
  width: 100%;
  max-width: 480px; /* optional cap for readability */
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font: inherit;
  box-sizing: border-box;
}

/* Collapsible section styling */
.notes-section {
  margin-bottom: 20px;
  border: 1px solid #ddd;
  padding: 12px;
  border-radius: 4px;
  background: #fafafa;
}

.notes-section summary {
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 8px;
}

.notes-link {
  color: #2979ff;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9em;
}
.notes-link:hover {
  text-decoration: none;
}

.notes-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.notes-modal-card {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  width: 360px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
}

/* Sort arrow buttons for table headers */
.sort-btn {
  background: none;
  border: none;
  font-size: 0.8em;
  color: #666;
  padding: 0 2px;
  cursor: pointer;
  line-height: 1;
}

.sort-btn:hover {
  color: #000;
  text-decoration: underline;
}

/* Right-align numeric/currency columns */
.notes-table td.amount,
.notes-table th.amount {
  text-align: right;
}
