/* A&J California Builders PM - Styles */
:root {
  --bronze: #C49A6C;
  --dark-brown: #5C3317;
  --cream: #FFF8F0;
  --white: #FFFFFF;
  --light-gray: #F5F0EB;
  --mid-gray: #E0D5C8;
  --text: #333333;
  --text-light: #666666;
  --success: #4CAF50;
  --warning: #FF9800;
  --danger: #E53935;
  --blue: #2196F3;
  --tag-commercial: #3B82F6;
  --tag-residential: #22C55E;
  --tag-gc: #C49A6C;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
}

/* Header */
.app-header {
  background: var(--dark-brown);
  color: var(--cream);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header .logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header .logo h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--bronze);
}

.app-header .logo span {
  font-size: 12px;
  color: var(--mid-gray);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-nav button {
  background: none;
  border: 1px solid var(--bronze);
  color: var(--bronze);
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.header-nav button:hover {
  background: var(--bronze);
  color: var(--dark-brown);
}

.header-nav button.active {
  background: var(--bronze);
  color: var(--dark-brown);
  font-weight: 600;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user span {
  font-size: 14px;
  color: var(--mid-gray);
}

.btn-logout {
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--mid-gray);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.btn-logout:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* Login Page */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(135deg, var(--dark-brown) 0%, #3a1f0d 100%);
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.login-card h1 {
  color: var(--dark-brown);
  font-size: 24px;
  margin-bottom: 4px;
  text-align: center;
}

.login-card .subtitle {
  color: var(--text-light);
  font-size: 14px;
  text-align: center;
  margin-bottom: 32px;
}

.login-card .license {
  color: var(--bronze);
  font-size: 12px;
  text-align: center;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--dark-brown);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--mid-gray);
  border-radius: 8px;
  font-size: 15px;
  font-family: Arial, sans-serif;
  transition: border-color 0.2s;
  background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--bronze);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: Arial, sans-serif;
}

.btn-primary {
  background: var(--bronze);
  color: var(--white);
  width: 100%;
}

.btn-primary:hover {
  background: #b38a5c;
}

.btn-secondary {
  background: var(--light-gray);
  color: var(--dark-brown);
}

.btn-secondary:hover {
  background: var(--mid-gray);
}

.btn-add {
  background: var(--bronze);
  color: var(--white);
  gap: 8px;
}

.btn-add:hover {
  background: #b38a5c;
}

.login-error {
  background: #FFF0F0;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  text-align: center;
}

/* Main content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.dash-card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid var(--mid-gray);
}

.dash-card h3 {
  font-size: 15px;
  color: var(--dark-brown);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-card .card-icon {
  font-size: 18px;
}

.schedule-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--light-gray);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.schedule-item:last-child {
  border-bottom: none;
}

.schedule-item .schedule-info h4 {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}

.schedule-item .schedule-info p {
  font-size: 12px;
  color: var(--text-light);
}

.schedule-item .schedule-date {
  font-size: 12px;
  color: var(--bronze);
  font-weight: 600;
  white-space: nowrap;
}

.budget-bar-wrapper {
  margin-bottom: 14px;
}

.budget-bar-wrapper:last-child {
  margin-bottom: 0;
}

.budget-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}

.budget-bar-label span:first-child {
  color: var(--text);
  font-weight: 600;
}

.budget-bar-label span:last-child {
  color: var(--text-light);
}

.budget-bar {
  height: 8px;
  background: var(--light-gray);
  border-radius: 4px;
  overflow: hidden;
}

.budget-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.empty-state {
  text-align: center;
  padding: 20px;
  color: var(--text-light);
  font-size: 14px;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-active {
  background: #E8F5E9;
  color: #2E7D32;
}

.status-bidding {
  background: #FFF3E0;
  color: #E65100;
}

.status-complete {
  background: #E3F2FD;
  color: #1565C0;
}

/* Project List */
.project-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.division-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.division-tag {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.division-tag.all {
  background: var(--light-gray);
  color: var(--text);
}

.division-tag.all.active {
  background: var(--dark-brown);
  color: var(--cream);
}

.division-tag.commercial {
  background: #EBF5FF;
  color: var(--tag-commercial);
}

.division-tag.commercial.active {
  background: var(--tag-commercial);
  color: var(--white);
}

.division-tag.residential {
  background: #ECFDF5;
  color: var(--tag-residential);
}

.division-tag.residential.active {
  background: var(--tag-residential);
  color: var(--white);
}

.division-tag.gc {
  background: #FDF8F0;
  color: var(--tag-gc);
}

.division-tag.gc.active {
  background: var(--tag-gc);
  color: var(--white);
}

.sort-select {
  padding: 6px 12px;
  border: 2px solid var(--mid-gray);
  border-radius: 8px;
  font-size: 13px;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
}

.sort-select:focus {
  outline: none;
  border-color: var(--bronze);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

/* Project Card */
.project-card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid var(--mid-gray);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.project-card-header h3 {
  font-size: 16px;
  color: var(--dark-brown);
  margin-bottom: 4px;
}

.project-card-header .division-label {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.division-label.commercial {
  background: #EBF5FF;
  color: var(--tag-commercial);
}

.division-label.residential {
  background: #ECFDF5;
  color: var(--tag-residential);
}

.division-label.gc {
  background: #FDF8F0;
  color: var(--tag-gc);
}

.project-card .project-type {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.project-card .project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.project-card .project-phase {
  font-size: 13px;
  color: var(--text-light);
}

.project-card .project-budget {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark-brown);
}

.progress-bar {
  height: 6px;
  background: var(--light-gray);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--bronze);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.project-card .project-address {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 8px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.modal {
  background: var(--white);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal h2 {
  font-size: 20px;
  color: var(--dark-brown);
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Section header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 22px;
  color: var(--dark-brown);
}

/* Page title */
.page-title {
  font-size: 26px;
  color: var(--dark-brown);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 20px;
}

/* Attention items */
.attention-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--light-gray);
}

.attention-item:last-child {
  border-bottom: none;
}

.attention-item h4 {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}

.attention-item p {
  font-size: 12px;
  color: var(--text-light);
}

/* Status counts */
.status-counts {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.status-count {
  text-align: center;
}

.status-count .count {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark-brown);
}

.status-count .label {
  font-size: 12px;
  color: var(--text-light);
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-light);
  font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  .app-header {
    padding: 0 16px;
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .app-header .logo h1 {
    font-size: 16px;
  }

  .header-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-bottom: 4px;
  }

  .header-nav button {
    padding: 4px 12px;
    font-size: 13px;
  }

  .main-content {
    padding: 16px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .project-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .login-card {
    padding: 32px 24px;
  }

  .modal {
    padding: 24px;
    margin: 12px;
  }
}

/* ============================================================
   PROJECT DETAIL PAGE
   ============================================================ */

.back-btn {
  background: none;
  border: none;
  color: var(--bronze);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0 16px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.back-btn:hover { color: var(--dark-brown); }

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
}

.detail-job-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--bronze);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.detail-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 10px;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.job-type-badge {
  background: var(--light-gray);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid var(--mid-gray);
}

.detail-address {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}

.detail-header-right {
  flex-shrink: 0;
}

.btn-edit {
  background: var(--bronze);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-edit:hover { background: var(--dark-brown); }

.edit-actions { display: flex; gap: 8px; }

.btn-save {
  background: var(--dark-brown);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-save:hover { background: #3d2010; }
.btn-save:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-cancel {
  background: white;
  color: var(--text);
  border: 1px solid var(--mid-gray);
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.btn-cancel:hover { background: var(--light-gray); }

/* Tabs */
.detail-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--mid-gray);
  margin-bottom: 24px;
  overflow-x: auto;
}

.detail-tab {
  background: none;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}

.detail-tab:hover { color: var(--bronze); }

.detail-tab.active {
  color: var(--dark-brown);
  border-bottom-color: var(--bronze);
}

/* Detail Grid */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.detail-card {
  background: white;
  border-radius: 10px;
  border: 1px solid var(--mid-gray);
  padding: 20px;
}

.detail-card-wide {
  grid-column: 1 / -1;
}

.detail-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark-brown);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--light-gray);
}

/* Field rows */
.field-group { display: flex; flex-direction: column; gap: 10px; }

.field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 28px;
}

.field-label {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 110px;
}

.field-value {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  text-align: right;
}

.field-value.highlight {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark-brown);
}

.field-link {
  font-size: 13px;
  color: var(--bronze);
  font-weight: 600;
  text-decoration: none;
}

.field-link:hover { text-decoration: underline; }

.field-input {
  flex: 1;
  border: 1px solid var(--mid-gray);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 13px;
  background: white;
  color: var(--text);
  text-align: right;
}

.field-input:focus {
  outline: none;
  border-color: var(--bronze);
}

.field-select { text-align: left; }

.field-textarea {
  width: 100%;
  border: 1px solid var(--mid-gray);
  border-radius: 6px;
  padding: 10px;
  font-size: 13px;
  font-family: Arial, sans-serif;
  resize: vertical;
  color: var(--text);
}

.field-textarea:focus {
  outline: none;
  border-color: var(--bronze);
}

.notes-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}

/* Checklist */
.checklist-header { margin-bottom: 20px; }

.checklist-phases { display: flex; flex-direction: column; gap: 20px; }

.checklist-phase {
  background: white;
  border-radius: 10px;
  border: 1px solid var(--mid-gray);
  overflow: hidden;
}

.phase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--light-gray);
  border-bottom: 1px solid var(--mid-gray);
}

.phase-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--dark-brown);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.phase-count {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--light-gray);
  cursor: pointer;
  transition: background 0.1s;
}

.checklist-item:last-child { border-bottom: none; }

.checklist-item:hover { background: var(--cream); }

.checklist-item.completed { opacity: 0.65; }

.check-box {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--mid-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  color: white;
  transition: all 0.15s;
}

.check-box.checked {
  background: var(--bronze);
  border-color: var(--bronze);
}

.checklist-item-content {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.checklist-item-text {
  font-size: 13px;
  color: var(--text);
}

.checklist-item.completed .checklist-item-text {
  text-decoration: line-through;
}

.checklist-item-party {
  font-size: 11px;
  color: var(--text-light);
  background: var(--light-gray);
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

.completed-date {
  font-size: 11px;
  color: var(--text-light);
  flex-shrink: 0;
}

.checklist-progress { padding: 4px 0; }

.btn-link {
  background: none;
  border: none;
  color: var(--bronze);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0 0 0;
}

.btn-link:hover { color: var(--dark-brown); }

/* Compliance */
.compliance-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
}

.compliance-badge.compliant {
  background: #E8F5E9;
  color: #2E7D32;
}

.compliance-badge.missing {
  background: #FFEBEE;
  color: #C62828;
}

/* Contacts */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.contact-card {
  background: white;
  border: 1px solid var(--mid-gray);
  border-radius: 10px;
  padding: 16px;
}

.contact-role {
  font-size: 11px;
  font-weight: 700;
  color: var(--bronze);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.contact-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 4px;
}

.contact-company {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.contact-info {
  font-size: 13px;
  color: var(--text);
  margin-top: 4px;
}

/* Misc */
.coming-soon-note {
  font-size: 12px;
  color: var(--text-light);
  font-style: italic;
  padding: 8px 0;
}

.project-card.clickable {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.project-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(92,51,23,0.12);
}

@media (max-width: 768px) {
  .detail-header { flex-direction: column; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-card-wide { grid-column: 1; }
  .detail-tabs { gap: 0; }
  .detail-tab { padding: 10px 14px; font-size: 13px; }
}

/* ============================================================
   NEW PROJECT FORM — STEP-BY-STEP
   ============================================================ */

.new-project-modal {
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 20px;
  color: var(--dark-brown);
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover { color: var(--text); }

.step-indicators {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--mid-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
  background: white;
}

.step-dot.active {
  background: var(--bronze);
  border-color: var(--bronze);
  color: white;
}

.step-line {
  height: 2px;
  width: 60px;
  background: var(--mid-gray);
}

.step-content { padding: 0 4px; }

.step-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 6px;
}

.step-subtitle {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.job-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.job-type-card {
  border: 2px solid var(--mid-gray);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
  background: white;
}

.job-type-card:hover {
  border-color: var(--bronze);
  background: var(--cream);
}

.job-type-card.selected {
  border-color: var(--bronze);
  background: #FEF6EC;
}

.job-type-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.job-type-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 4px;
}

.job-type-desc {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.4;
}

.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--light-gray);
}

.btn-primary-bronze {
  background: var(--bronze);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary-bronze:hover { background: var(--dark-brown); }
.btn-primary-bronze:disabled { opacity: 0.5; cursor: not-allowed; }

.form-input {
  width: 100%;
  border: 1px solid var(--mid-gray);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text);
  background: white;
  font-family: Arial, sans-serif;
}

.form-input:focus {
  outline: none;
  border-color: var(--bronze);
}

.form-textarea { resize: vertical; min-height: 80px; }

.form-error {
  background: #FFEBEE;
  color: #C62828;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}

.project-summary-box {
  background: var(--light-gray);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text);
}

.summary-row span { color: var(--text-light); }

/* Email Bid Button */
.btn-bid-email {
  background: #1a73e8;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 8px;
}

.btn-bid-email:hover { background: #1557b0; }

@media (max-width: 600px) {
  .job-type-grid { grid-template-columns: 1fr; }
  .new-project-modal { margin: 12px; }
}
/* ═══════════════════════════════════════════════════
   YELLOW SHEET & BID GENERATOR — A&J PM SYSTEM
═══════════════════════════════════════════════════ */

/* ── SHARED MODAL ──────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #888;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.modal-close:hover { color: #333; }

/* ═══════════════════════════════════════════════════
   YELLOW SHEET
═══════════════════════════════════════════════════ */
.ys-modal {
  background: #FFFDE7;
  border: 2px solid #F9A825;
  border-radius: 10px;
  width: 100%;
  max-width: 920px;
  margin: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}

.ys-header {
  background: #F57F17;
  border-radius: 8px 8px 0 0;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ys-header .modal-close { color: #fff3c4; }
.ys-header .modal-close:hover { color: #fff; }
.ys-title { font-size: 20px; font-weight: 800; color: #fff; }
.ys-subtitle { font-size: 13px; color: #fff3c4; margin-top: 2px; }

.ys-body { padding: 20px 24px 28px; }

.ys-section {
  background: #FFFDF0;
  border: 1px solid #F9A825;
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.ys-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #E65100;
  text-transform: uppercase;
  border-bottom: 1px solid #FFCC02;
  padding-bottom: 8px;
  margin-bottom: 14px;
}

/* Labor Table */
.ys-labor-header, .ys-labor-row {
  display: grid;
  grid-template-columns: 1fr 60px 60px 60px 80px 100px 32px;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.ys-labor-header {
  font-size: 11px;
  font-weight: 700;
  color: #5C3317;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.ys-lh-desc { } .ys-lh-num { text-align: center; } .ys-lh-total { text-align: right; } .ys-lh-rm { }

.ys-input-desc {
  border: 1px solid #F9A825;
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 13px;
  background: white;
  width: 100%;
}
.ys-input-num {
  border: 1px solid #F9A825;
  border-radius: 5px;
  padding: 6px 4px;
  font-size: 13px;
  text-align: center;
  background: white;
  width: 100%;
}
.ys-calc-cell {
  font-size: 13px;
  text-align: center;
  color: #5C3317;
  font-weight: 500;
}
.ys-calc-cell.bold { font-weight: 700; }

.ys-rm-btn {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}
.ys-rm-btn:hover { color: #E53935; }

.ys-add-btn {
  background: none;
  border: 1px dashed #F9A825;
  color: #E65100;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 8px;
}
.ys-add-btn:hover { background: #FFF8C4; }

.ys-labor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #FFCC02;
}
.ys-labor-totals { font-size: 13px; color: #5C3317; }

/* Material Rows */
.ys-mat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.ys-checkbox { width: 18px; height: 18px; cursor: pointer; accent-color: #F57F17; flex-shrink: 0; }
.ys-checkbox-spacer { width: 18px; flex-shrink: 0; }
.ys-mat-label { font-size: 13px; font-weight: 600; color: #5C3317; width: 120px; flex-shrink: 0; }
.ys-mat-prefix { font-size: 12px; color: #666; white-space: nowrap; }
.ys-input-sm {
  border: 1px solid #F9A825;
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 13px;
  background: white;
  width: 120px;
}
.ys-input-sm:disabled { background: #f5f5f5; color: #bbb; }
.ys-input-xs {
  border: 1px solid #F9A825;
  border-radius: 5px;
  padding: 6px 6px;
  font-size: 13px;
  background: white;
  width: 60px;
}
.ys-input-xs:disabled { background: #f5f5f5; color: #bbb; }
.ys-mat-result {
  margin-left: auto;
  font-size: 14px;
  font-weight: 700;
  color: #5C3317;
  min-width: 90px;
  text-align: right;
}
.ys-input-equip-note {
  border: 1px solid #F9A825;
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 13px;
  background: white;
  flex: 1;
  min-width: 160px;
}
.ys-input-equip-note:disabled { background: #f5f5f5; color: #bbb; }

/* Scope Toggles */
.ys-scope-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ys-scope-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: white;
  border: 1px solid #F9A825;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
}
.ys-scope-label-input {
  border: none;
  background: transparent;
  font-size: 13px;
  color: #5C3317;
  font-weight: 600;
  width: 90px;
}

/* GC Trades */
.ys-trade-header {
  display: grid;
  grid-template-columns: 1fr 80px 120px 100px 32px;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #5C3317;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.ys-trade-row {
  display: grid;
  grid-template-columns: 1fr 24px 120px 100px 32px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.ys-input-trade {
  border: 1px solid #F9A825;
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 13px;
  background: white;
  width: 100%;
}
.ys-input-trade-amt {
  border: 1px solid #F9A825;
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 13px;
  background: white;
  width: 120px;
}
.ys-trade-val {
  font-size: 13px;
  font-weight: 700;
  color: #5C3317;
  text-align: right;
}

/* Totals */
.ys-totals-section {
  background: #FFF8C4;
  border: 2px solid #F9A825;
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.ys-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #FFECB3;
  font-size: 14px;
  color: #333;
}
.ys-total-row:last-child { border-bottom: none; }
.ys-total-val { font-size: 15px; font-weight: 700; color: #5C3317; }
.ys-total-row.auto-total { background: #FFECB3; border-radius: 4px; padding: 8px 10px; margin: 4px -10px; }
.ys-total-row.final-total {
  background: #E65100;
  border-radius: 6px;
  padding: 12px 14px;
  margin: 8px -10px 0;
  border: none;
}
.ys-total-row.final-total span { color: #fff; font-size: 15px; font-weight: 700; }
.ys-final-val { font-size: 22px !important; font-weight: 800 !important; color: #fff !important; }

.ys-ohp-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ys-input-pct {
  border: 1px solid #F9A825;
  border-radius: 5px;
  padding: 4px 6px;
  font-size: 13px;
  text-align: center;
  background: white;
  width: 55px;
}
.ys-override-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ys-input-override {
  border: 1px solid #F9A825;
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 13px;
  background: white;
  width: 150px;
}
.ys-override-note {
  font-size: 12px;
  color: #E65100;
  margin-top: 8px;
  font-style: italic;
}

/* Actions */
.ys-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}
.btn-confirm-total {
  background: #5C3317;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-confirm-total:hover { background: #7a4520; }


/* ═══════════════════════════════════════════════════
   BID GENERATOR
═══════════════════════════════════════════════════ */
.bid-modal {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 680px;
  margin: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}

.bid-header {
  background: #5C3317;
  border-radius: 8px 8px 0 0;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bid-header .modal-close { color: #c9a87c; }
.bid-header .modal-close:hover { color: #fff; }
.bid-title { font-size: 20px; font-weight: 800; color: #C49A6C; }
.bid-subtitle { font-size: 13px; color: #d4b896; margin-top: 2px; }

/* Steps */
.bid-steps {
  display: flex;
  padding: 16px 24px;
  gap: 0;
  border-bottom: 1px solid #e8e0d8;
  background: #FFF8F0;
}
.bid-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  position: relative;
}
.bid-step:not(:last-child)::after {
  content: '→';
  position: absolute;
  right: 0;
  color: #C49A6C;
  font-size: 16px;
}
.bid-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8e0d8;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.bid-step.active .bid-step-dot { background: #C49A6C; color: #fff; }
.bid-step.done .bid-step-dot { background: #5C3317; color: #C49A6C; }
.bid-step-label { font-size: 12px; color: #999; }
.bid-step.active .bid-step-label { color: #5C3317; font-weight: 600; }
.bid-step.done .bid-step-label { color: #5C3317; }

.bid-body { padding: 24px; }
.bid-step-content { display: flex; flex-direction: column; gap: 16px; }

.bid-step-intro { font-size: 14px; color: #555; line-height: 1.6; }

.bid-total-display {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #555;
}
.bid-total-num {
  font-size: 22px;
  font-weight: 800;
  color: #5C3317;
}

.btn-yellow {
  background: #F57F17;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  align-self: flex-start;
}
.btn-yellow:hover { background: #E65100; }

.btn-primary-bid {
  background: #5C3317;
  color: #C49A6C;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.2s;
}
.btn-primary-bid:hover { background: #7a4520; }

.btn-secondary {
  background: none;
  border: 1px solid #C49A6C;
  color: #5C3317;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
}
.btn-secondary:hover { background: #FFF8F0; }

.btn-print {
  background: #1565C0;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
}
.btn-print:hover { background: #0D47A1; }

.btn-send {
  background: #C49A6C;
  color: #5C3317;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn-send:hover { background: #B8882A; color: #fff; }
.btn-send:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-reopen-ys {
  background: #FFF8C4;
  border: 1px solid #F9A825;
  color: #E65100;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-reopen-ys:hover { background: #FFF3C4; }

/* Bid Fields */
.bid-field-group { display: flex; flex-direction: column; gap: 6px; }
.bid-label { font-size: 12px; font-weight: 700; color: #5C3317; text-transform: uppercase; letter-spacing: 0.5px; }
.bid-field-note { font-size: 12px; color: #888; font-style: italic; }
.bid-input {
  border: 1px solid #C49A6C;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  background: white;
  max-width: 200px;
}
.bid-textarea {
  border: 1px solid #C49A6C;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  background: white;
  resize: vertical;
  font-family: Arial, sans-serif;
  line-height: 1.6;
}
.bid-total-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.bid-total-display-lg {
  font-size: 28px;
  font-weight: 800;
  color: #5C3317;
}
.bid-scope-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.bid-scope-bullet { color: #C49A6C; font-size: 16px; flex-shrink: 0; }
.bid-scope-input {
  flex: 1;
  border: 1px solid #C49A6C;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  background: white;
}

/* Preview */
.bid-preview-box {
  background: #FFF8F0;
  border: 2px solid #C49A6C;
  border-radius: 8px;
  padding: 20px;
}
.bid-preview-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: #5C3317;
  border-bottom: 1px solid #C49A6C;
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.bid-preview-to { font-size: 13px; color: #555; line-height: 1.7; margin-bottom: 14px; }
.bid-preview-total {
  font-size: 32px;
  font-weight: 800;
  color: #B8882A;
  margin-bottom: 14px;
}
.bid-preview-scope { font-size: 13px; color: #333; }
.bid-preview-scope ul { padding-left: 20px; margin-top: 6px; }
.bid-preview-scope li { line-height: 1.8; }

.bid-send-to { font-size: 14px; color: #333; font-weight: 500; }
.bid-warn { color: #E53935; font-style: italic; font-size: 13px; }

.bid-nav { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Sent */
.bid-sent {
  text-align: center;
  padding: 20px 0;
  align-items: center;
}
.bid-sent-icon {
  width: 64px; height: 64px;
  background: #4CAF50;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
  margin: 0 auto 16px;
}
.bid-sent h3 { font-size: 20px; color: #5C3317; margin-bottom: 10px; }
.bid-sent p { font-size: 14px; color: #555; line-height: 1.6; max-width: 400px; }
.bid-sent-meta { font-size: 12px; color: #888; font-style: italic; margin-top: 4px; }
.btn-bid { background: #C49A6C; color: #5C3317; border: none; border-radius: 8px; padding: 10px 20px; font-size: 14px; font-weight: 700; cursor: pointer; margin-right: 10px; } .btn-bid:hover { background: #B8882A; color: #fff; }

/* ── BIDS TAB ─────────────────────────────────────────────── */
.bids-tab { padding: 8px 0; }
.bids-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.bids-intro { color: var(--text-light); font-size: 14px; }
.bids-empty { text-align: center; padding: 60px 20px; color: var(--text-light); }
.bids-empty-icon { font-size: 48px; margin-bottom: 16px; }
.bids-empty p { margin-bottom: 20px; font-size: 15px; }
.bids-list { display: flex; flex-direction: column; gap: 16px; }
.bid-record { background: white; border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.bid-record-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.bid-record-version { font-weight: 700; font-size: 16px; color: var(--dark-brown); }
.bid-record-total { font-size: 22px; font-weight: 800; color: var(--bronze); }
.bid-record-meta { display: flex; gap: 20px; font-size: 13px; color: var(--text-light); margin-bottom: 10px; flex-wrap: wrap; }
.bid-record-scope { font-size: 13px; color: var(--text); border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.bid-record-scope ul { padding-left: 18px; margin-top: 6px; }
.bid-record-scope li { line-height: 1.8; }

/* ── CONTACTS TAB ─────────────────────────────────────────── */
.contacts-tab { padding: 8px 0; }
.gc-highlight-banner { background: #FBF5E6; border: 2px solid var(--bronze); border-radius: 8px; padding: 14px 20px; margin-bottom: 24px; display: flex; align-items: center; gap: 16px; }
.gc-highlight-label { font-size: 12px; font-weight: 700; color: var(--bronze); text-transform: uppercase; letter-spacing: 1px; white-space: nowrap; }
.gc-highlight-info { font-size: 14px; color: var(--text); }
.gc-email { color: var(--bronze); margin-left: 8px; }
.gc-warn { color: #e67e22; margin-left: 8px; font-size: 13px; }
.contacts-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.contacts-section-title { font-size: 16px; font-weight: 700; color: var(--dark-brown); }
.btn-add-contact { background: var(--bronze); color: white; border: none; border-radius: 6px; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-add-contact:hover { background: var(--dark-brown); }
.contacts-empty { text-align: center; padding: 40px 20px; color: var(--text-light); }
.contacts-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.contact-card { background: white; border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.contact-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.contact-role-badge { font-size: 11px; font-weight: 700; color: var(--bronze); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.contact-name { font-size: 15px; font-weight: 700; color: var(--dark-brown); }
.contact-company { font-size: 13px; color: var(--text-light); margin-top: 2px; }
.contact-remove-btn { background: none; border: none; color: #ccc; cursor: pointer; font-size: 16px; padding: 0 4px; }
.contact-remove-btn:hover { color: #e74c3c; }
.contact-details { display: flex; flex-direction: column; gap: 4px; }
.contact-detail-link { font-size: 13px; color: var(--bronze); text-decoration: none; }
.contact-detail-link:hover { text-decoration: underline; }
.contact-detail { font-size: 13px; color: var(--text-light); }
.contact-modal { background: white; border-radius: 12px; width: 480px; max-width: 95vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.contact-modal-lg { width: 620px; }
.contact-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.contact-modal-header h3 { font-size: 18px; font-weight: 700; color: var(--dark-brown); }
.contact-modal-body { padding: 24px; }
.contact-field-group { margin-bottom: 16px; }
.contact-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.contact-input { width: 100%; padding: 8px 12px; border: 1.5px solid #C49A6C; border-radius: 6px; font-size: 14px; color: var(--text); background: #FFFDF9; }
.contact-input:focus { outline: none; border-color: var(--bronze); }
.contact-select { width: 100%; padding: 8px 12px; border: 1.5px solid #C49A6C; border-radius: 6px; font-size: 14px; color: var(--text); background: #FFFDF9; }
.contact-textarea { width: 100%; padding: 8px 12px; border: 1.5px solid #C49A6C; border-radius: 6px; font-size: 14px; color: var(--text); background: #FFFDF9; resize: vertical; }
.contact-search-input { width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: 8px; font-size: 14px; }
.contact-search-input:focus { outline: none; border-color: var(--bronze); }
.contact-search-results { border: 1px solid var(--border); border-radius: 8px; margin-top: 8px; overflow: hidden; }
.contact-search-result { padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--border); }
.contact-search-result:last-child { border-bottom: none; }
.contact-search-result:hover { background: #FBF5E6; }
.contact-search-result.selected { background: #FBF5E6; border-left: 3px solid var(--bronze); }
.csr-name { font-size: 14px; font-weight: 600; color: var(--dark-brown); }
.csr-meta { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.contact-not-found { font-size: 13px; color: var(--text-light); margin-top: 8px; }
.contact-selected-preview { background: #f0f9f0; border: 1px solid #27ae60; border-radius: 6px; padding: 10px 14px; font-size: 13px; color: #27ae60; margin-top: 12px; }
.contact-modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; align-items: center; }
.btn-link { background: none; border: none; color: var(--bronze); font-size: 13px; cursor: pointer; text-decoration: underline; padding: 0; }
.contact-searching { font-size: 13px; color: var(--text-light); margin-top: 8px; }
.contact-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.contact-field-full { grid-column: 1 / -1; }

/* ── ADDRESS BOOK ─────────────────────────────────────────── */
.address-book { padding: 32px; max-width: 1200px; margin: 0 auto; }
.ab-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.ab-title { font-size: 28px; font-weight: 800; color: var(--dark-brown); margin-bottom: 4px; }
.ab-subtitle { font-size: 14px; color: var(--text-light); }
.ab-filters { display: flex; gap: 12px; margin-bottom: 24px; }
.ab-search { flex: 1; padding: 10px 16px; border: 1.5px solid #C49A6C; border-radius: 8px; font-size: 14px; background: #FFFDF9; }
.ab-search:focus { outline: none; border-color: var(--dark-brown); }
.ab-filter-select { padding: 10px 16px; border: 1.5px solid #C49A6C; border-radius: 8px; font-size: 14px; background: #FFFDF9; min-width: 160px; }
.ab-loading { text-align: center; padding: 60px; color: var(--text-light); }
.ab-empty { text-align: center; padding: 60px 20px; color: var(--text-light); }
.ab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ab-card { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 18px; transition: box-shadow 0.2s; }
.ab-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.ab-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ab-role-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.ab-card-actions { display: flex; gap: 6px; }
.ab-edit-btn { background: none; border: none; cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 4px; }
.ab-edit-btn:hover { background: #f0f0f0; }
.ab-delete-btn { background: none; border: none; cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 4px; }
.ab-delete-btn:hover { background: #fee; }
.ab-name { font-size: 17px; font-weight: 700; color: var(--dark-brown); margin-bottom: 2px; }
.ab-company { font-size: 13px; color: var(--text-light); margin-bottom: 4px; }
.ab-trades { font-size: 12px; color: var(--bronze); margin-bottom: 8px; }
.ab-contact-details { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.ab-detail-link { font-size: 13px; color: var(--bronze); text-decoration: none; }
.ab-detail-link:hover { text-decoration: underline; }
.ab-detail { font-size: 13px; color: var(--text-light); }
.ab-notes { font-size: 12px; color: var(--text-light); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-style: italic; }

/* ── Sub Compliance Tracker ─────────────────────────────── */
.sub-compliance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1200px;
}
.sub-compliance-table th {
  padding: 8px 6px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #5C3317;
  white-space: nowrap;
  background: #FFF8F0;
  border-bottom: 2px solid #C49A6C;
}
.sub-compliance-table td {
  padding: 6px 6px;
  vertical-align: middle;
  border-bottom: 1px solid #f0e8df;
}
.sub-compliance-table tr:nth-child(even) td {
  background: #FDFAF6;
}
.sub-compliance-table tr:hover td {
  background: #FFF3E0;
}
.compliance-status-green  { background: #27ae60; color: #fff; padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.compliance-status-yellow { background: #f39c12; color: #fff; padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.compliance-status-red    { background: #e74c3c; color: #fff; padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.compliance-cell-edit {
  width: 100%;
  font-size: 12px;
  border: 1px solid #B8882A;
  border-radius: 3px;
  padding: 2px 4px;
}

/* ── FINANCIALS TAB ───────────────────────────────────────── */
.fin-tab { padding: 8px 0; }
.fin-loading { text-align: center; padding: 40px; color: var(--text-light); }
.fin-nav { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 2px solid var(--border); padding-bottom: 0; }
.fin-nav-btn { background: none; border: none; padding: 10px 18px; font-size: 14px; color: var(--text-light); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; font-weight: 500; }
.fin-nav-btn:hover { color: var(--dark-brown); }
.fin-nav-btn.active { color: var(--bronze); border-bottom: 2px solid var(--bronze); font-weight: 700; }
.fin-section { padding: 8px 0; }
.fin-summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.fin-summary-card { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
.fin-card-title { font-size: 11px; font-weight: 700; color: var(--bronze); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.fin-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 13px; color: var(--text); border-bottom: 1px solid #f5f0eb; }
.fin-row:last-child { border-bottom: none; }
.fin-row.fin-total { border-top: 2px solid var(--border); margin-top: 4px; padding-top: 10px; font-weight: 700; }
.fin-val { font-weight: 600; color: var(--dark-brown); }
.fin-val.positive { color: #27ae60; }
.fin-val.warning { color: #e67e22; }
.fin-val.danger { color: #e74c3c; }
.fin-val.highlight { color: var(--bronze); font-size: 15px; }
.fin-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.fin-section-total { font-size: 13px; font-weight: 600; color: var(--text); }
.fin-section-total.positive { color: #27ae60; }
.fin-section-total.warning { color: #e67e22; }
.fin-empty { padding: 40px; text-align: center; color: var(--text-light); font-size: 14px; }
.fin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fin-table th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid var(--border); }
.fin-table td { padding: 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.fin-table tr:hover td { background: #faf8f5; }
.fin-td-bold { font-weight: 600; color: var(--dark-brown); }
.fin-td-amt { font-weight: 700; color: var(--dark-brown); }
.fin-td-scope { max-width: 200px; color: var(--text-light); }
.fin-td-actions { display: flex; gap: 4px; white-space: nowrap; }
.fin-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; border: none; cursor: default; }
.fin-badge.paid { background: #EAF3DE; color: #3B6D11; }
.fin-badge.unpaid { background: #FAEEDA; color: #854F0B; cursor: pointer; }
.fin-badge.unpaid:hover { background: #C49A6C; color: white; }
.fin-badge.unpaid-warn { background: #FCEBEB; color: #A32D2D; }
.fin-badge.danger { background: #FCEBEB; color: #A32D2D; }

/* ── CO GENERATOR ─────────────────────────────────────────── */
.co-preview-modal { background: white; border-radius: 12px; width: 560px; max-width: 95vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.co-preview-body { padding: 24px; }
.co-preview-box { background: #faf8f5; border: 1px solid var(--border); border-radius: 8px; padding: 20px; margin-bottom: 20px; }
.co-prev-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.co-prev-header strong { font-size: 15px; color: var(--dark-brown); }
.co-prev-header span { font-size: 13px; color: var(--bronze); font-weight: 700; }
.co-prev-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.co-prev-row.total { font-weight: 700; color: var(--dark-brown); border-top: 2px solid var(--border); border-bottom: 2px solid var(--border); margin-top: 4px; }
.co-prev-row.new-contract { font-weight: 800; color: var(--bronze); font-size: 14px; }
.co-prev-desc { font-size: 13px; color: var(--text); padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 8px; line-height: 1.6; }
.co-prev-amounts { margin-top: 8px; }
.co-preview-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* ── Schedule Tab ─────────────────────────────────────────── */
.schedule-tab { padding: 0; }
.schedule-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.schedule-nav { display: flex; align-items: center; gap: 12px; }
.schedule-nav-btn { background: none; border: 1px solid #C49A6C; color: #5C3317; border-radius: 6px; width: 32px; height: 32px; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.schedule-nav-btn:hover { background: #C49A6C; color: white; }
.schedule-month-label { font-size: 18px; font-weight: 700; color: #5C3317; min-width: 160px; text-align: center; }
.schedule-actions { display: flex; align-items: center; gap: 12px; }
.schedule-note-count { font-size: 13px; color: #888; }
.schedule-print-btn { background: #5C3317; color: white; border: none; border-radius: 6px; padding: 7px 16px; font-size: 13px; cursor: pointer; font-weight: 600; }
.schedule-print-btn:hover { background: #7a4520; }
.schedule-card { background: white; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); overflow: hidden; }
.schedule-calendar { width: 100%; border-collapse: collapse; table-layout: fixed; }
.schedule-calendar thead th { background: #5C3317; color: white; padding: 10px 4px; text-align: center; font-size: 12px; font-weight: 700; }
.schedule-day-empty { background: #fafafa; border: 1px solid #f0e8df; height: 90px; }
.schedule-day { border: 1px solid #f0e8df; vertical-align: top; padding: 6px; height: 90px; cursor: pointer; transition: background 0.15s; }
.schedule-day:hover { background: #FFF3E0; }
.schedule-day-weekend { background: #FDFAF6; }
.schedule-day-weekend:hover { background: #FFF3E0; }
.schedule-day-today { background: #FFF8F0; border: 2px solid #B8882A !important; }
.schedule-day-has-note { background: #f0f9f0; }
.schedule-day-has-note:hover { background: #e0f0e0; }
.schedule-day-num { font-size: 12px; font-weight: 700; color: #5C3317; margin-bottom: 4px; }
.schedule-day-today .schedule-day-num { color: #B8882A; }
.schedule-day-note { font-size: 11px; color: #333; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.schedule-modal { background: white; border-radius: 10px; padding: 0; width: 480px; max-width: 95vw; box-shadow: 0 8px 32px rgba(0,0,0,0.18); }
.schedule-modal-header { background: #5C3317; color: white; padding: 14px 20px; border-radius: 10px 10px 0 0; display: flex; justify-content: space-between; align-items: center; }
.schedule-modal-header h3 { margin: 0; font-size: 15px; }
.schedule-modal-body { padding: 20px; }
.schedule-note-input { width: 100%; box-sizing: border-box; border: 1px solid #C49A6C; border-radius: 6px; padding: 10px; font-size: 14px; font-family: inherit; resize: vertical; }
.schedule-note-input:focus { outline: none; border-color: #B8882A; }
.schedule-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; align-items: center; }
.btn-delete { background: none; border: 1px solid #e74c3c; color: #e74c3c; border-radius: 6px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.btn-delete:hover { background: #e74c3c; color: white; }
.master-calendar-wrap { padding: 0; }
.master-calendar-grid { width: 100%; border-collapse: collapse; table-layout: fixed; background: white; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.master-calendar-grid thead th { background: #5C3317; color: white; padding: 10px 4px; text-align: center; font-size: 12px; font-weight: 700; }
.master-day-empty { border: 1px solid #f0e8df; background: #fafafa; height: 100px; }
.master-day { border: 1px solid #f0e8df; vertical-align: top; padding: 5px; height: 100px; }
.master-day-weekend { background: #FDFAF6; }
.master-day-today { border: 2px solid #B8882A !important; background: #FFF8F0; }
.master-day-num { font-size: 12px; font-weight: 700; color: #5C3317; margin-bottom: 3px; }
.master-project-chip { font-size: 10px; border-radius: 4px; padding: 2px 5px; margin-bottom: 2px; color: white; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }

/* ── Master Calendar Toolbar ─────────────────────────────── */
.master-cal-container { padding: 0; }
.master-cal-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 10px; }
.master-cal-today-btn { background: white; border: 1px solid #C49A6C; color: #5C3317; border-radius: 6px; padding: 5px 12px; font-size: 12px; cursor: pointer; font-weight: 600; }
.master-cal-today-btn:hover { background: #FFF8F0; }
.master-cal-view-btn { background: white; border: 1px solid #C49A6C; color: #5C3317; border-radius: 6px; padding: 5px 12px; font-size: 12px; cursor: pointer; font-weight: 600; }
.master-cal-view-btn:hover { background: #FFF8F0; }
.master-cal-view-btn.active { background: #5C3317; color: white; border-color: #5C3317; }
.master-day-other { background: #f9f9f9; opacity: 0.5; }
.dash-card-full { grid-column: 1 / -1; }

/* ── Delete Project Button ───────────────────────────────── */
.btn-delete-project { background: none; border: 1px solid #e74c3c; color: #e74c3c; border-radius: 6px; padding: 7px 14px; font-size: 13px; cursor: pointer; font-weight: 600; }
.btn-delete-project:hover { background: #e74c3c; color: white; }
