@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

/* Global Reset & Base Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: linear-gradient(to bottom, #f9fafb, #e9eff6);
  color: #222;
  padding: 0 2rem;
}

/* Metrics Section Container */
.metrics-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

/* Headings */
h1, h2, h3, h4 {
  color: #104fc2;
  margin-bottom: 1rem;
  font-weight: 600;
}

h1 { font-size: 2.2rem; }
h2 {
  font-size: 1.8rem;
  border-bottom: 2px solid #104fc2;
  padding-bottom: 0.25rem;
  margin-bottom: 1.25rem;
  margin-top: 2rem;
}
h3 { font-size: 1.5rem; }

h1, h2, h3, h4 {
  letter-spacing: -0.3px;
  line-height: 1.3;
}

/* Form Styling */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
  color: #333;
}

input[type="text"],
input[type="email"],
input[type="number"],
select {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
  outline: none;
  border-color: #104fc2;
  box-shadow: 0 0 0 3px rgba(16, 79, 194, 0.2);
}

/* Buttons */
button {
  background-color: #104fc2;
  color: white;
  border: none;
  padding: 10px 16px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: #083b9a;
  box-shadow: 0 3px 8px rgba(16, 79, 194, 0.25);
}

.button-secondary {
  background-color: transparent;
  border: 2px solid #104fc2;
  color: #104fc2;
}

.button-secondary:hover {
  background-color: #e6f0ff;
}

/* Tabs */
.tab-container {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.tab-button {
  padding: 0.6rem 1.2rem;
  border: none;
  background-color: #e9ecef;
  color: #222;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.tab-button:hover {
  background-color: #dbe4f0;
}

.tab-button.active {
  background-color: #fff;
  color: #104fc2;
  box-shadow: 0 0 0 2px #104fc2;
  border-bottom: 3px solid #104fc2;
}

.tab-content {
  display: none;
  padding: 1rem 0;
}

.tab-content.active {
  display: block;
}

/* Cards */


.client-card {
  border-left-color: #104fc2;
  margin-bottom: 2rem;
}

.calculator-box {
  border-left-color: #2a9d8f;
  margin-bottom: 2rem;
}

.bill-card {
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.client-card:hover {
  background-color: #eef4fb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Modal Styling */
.modal-content {
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 8px;
  padding: 2rem;
  transition: all 0.2s ease-in-out;
}

/* Canvas Aesthetic (Charts) */
canvas {
  background-color: transparent;
  border-radius: 8px;
  padding: 1rem;
}

/* Responsive Utilities */
@media (max-width: 768px) {
  .tab-container {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .modal-content {
    padding: 1rem;
  }
}
/* Layout Container */
.container {
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

header, .site-header {
  margin-top: 1rem;
  margin-bottom: 2rem;
}

/* Headings Extended */
h2, h3, h4 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

/* Result Display Section */
#results {
  margin-top: 2rem;
}

#results table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  max-width: 100%;
  table-layout: auto;
}

#results td {
  border: 1px solid #ccc;
  padding: 6px;
  font-size: 14px;
}

/* Job Cards */
.job-card-section {
  margin-top: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid #eee;
}

/* === General Badge Styling (used alongside status-badge for label tags) === */
.badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 4px;
  margin-left: 0.25rem;
  color: #fff;
}

.inhouse { background-color: #28a745; }
.subbed { background-color: #6c757d; }

.job-number {
  font-weight: normal;
  font-size: 0.85rem;
  color: #777;
  margin-left: 0.5rem;
}

.material-status {
  font-weight: bold;
}
.material-status.green {
  color: green;
}
.material-status.red {
  color: red;
}

/* Bill Cards */
.bill-list-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.bill-card {
  background: #fff;
  padding: 1rem;
  border-left: 4px solid #104fc2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  border-radius: 6px;
}

/* Urgency-based styling for bill cards */
.bill-card.urgent {
  border-left: 4px solid #e53935;
}

.bill-card.soon {
  border-left: 4px solid #fbc02d;
}

.bill-card .due-text {
  color: #d32f2f;
  font-weight: 600;
}

.bill-name {
  font-weight: bold;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.bill-meta {
  font-size: 0.9rem;
  color: #555;
}

/* Utility Section Styling */
fieldset {
  border: 1px solid #ccc;
  padding: 20px;
  margin-bottom: 30px;
  border-radius: 8px;
  background-color: #f0f4f8;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

legend {
  font-weight: bold;
  padding: 0 10px;
  color: #104fc2;
  font-size: 1.1rem;
  border-bottom: 2px solid #104fc2;
  margin-bottom: 10px;
}

/* Card Wrapper Padding */
.card-wrapper {
  padding-left: 1rem;
  padding-right: 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

/* Responsive Spacing */
@media (max-width: 600px) {
  body {
    padding: 1rem;
  }

  .container {
    padding: 1rem;
  }

  h2, h3, h4 {
    font-size: 1.2rem;
  }

  .calculator-box,
  form,
  fieldset {
    padding: 1rem;
  }

  .tab-button {
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
  }

  .bill-meta,
  .bill-amount {
    font-size: 0.95rem;
  }

  .form-group label,
  .form-group input,
  .form-group select {
    font-size: 1rem;
  }

  .form-group {
    flex-direction: column;
  }

  input,
  select,
  button {
    width: 100%;
  }

  .sortable-list li {
    font-size: 0.95rem;
  }
}
/* Utility: Hide tab content */
.tab-hidden {
  display: none !important;
}

/* === Job Section Grouping === */
.job-section-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #104fc2;
  margin: 2rem 0 0.5rem;
  border-bottom: 2px solid #104fc2;
  padding-bottom: 0.25rem;
}

.job-group {
  background-color: #f7f9fc;
  border-radius: 8px;
  padding: 0;
  margin-bottom: 2rem;
}

/* === Job Status Badges === */
.status-badge {
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 20px;
  padding: 4px 10px;
  display: inline-block;
  color: black;
}

.status-inprogress { background-color: #ff9800; }
.status-notstarted {
  background-color: #d0d4db;
}
.status-completed { background-color: #28a745; }
.status-closed {
  background-color: #bbbfc7;
}

/* === Highlight Key Metrics === */
.metric-box {
  background: #f0f6ff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #104fc2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* === Job Card Base Style === */
.job-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.75rem;
  margin: 0 auto 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  max-width: none;
}

/* === Job Card Hover Enhancement === */
.job-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease-in-out;
}

/* === Global Icon Margin === */
i {
  margin-right: 0.25rem;
}

/* === Mobile Optimization for Jobs === */
@media (max-width: 600px) {
  .metric-box {
    display: block;
    margin-bottom: 0.5rem;
  }

  .job-card {
    padding: 0.75rem;
  }
}
/* Remove top margin from first h2 in tab content */
.tab-content h2:first-child {
  margin-top: 0;
}
/* Remove excess top spacing from first .job-section-title inside .jobs-tab */
.jobs-tab .job-section-title {
  margin-top: 1rem;
}

.jobs-tab .job-section-title:first-of-type {
  margin-top: 0;
}


/* === Job Projections Styling === */
.job-projection-card {
  background: #ffffff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.job-projection-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #104fc2;
  margin-bottom: 0.5rem;
}

.job-projection-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.job-projection-metric {
  flex: 1;
  min-width: 120px;
  background: #f5f9ff;
  padding: 0.5rem;
  border-radius: 4px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
  color: #104fc2;
}

@media (max-width: 600px) {
  .job-projection-metrics {
    flex-direction: column;
  }
}
/* === Site Logo Styling === */
.site-logo {
  text-align: center;
  margin-bottom: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #e0e6ed;
}

@media (min-width: 768px) {
  .site-logo {
    padding: 2rem 0;
  }
}

/* Month header style for bill lists */
.month-heading {
  font-size: 1.25rem;
  background-color: #e8f0fe;
  padding: 0.75rem 1.25rem;
  border-left: 4px solid #104fc2;
  border-radius: 6px;
  margin: 2rem 0 1rem;
  color: #104fc2;
  font-weight: 600;
}
/* === Pie Chart Styling === */
.chart-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
  background-color: transparent;
  border-radius: 12px;
  box-shadow: none;
}

canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.chart-title {
  font-size: 1.5rem;
  color: #104fc2;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* === Cash Target Projection Styling === */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.stat-box {
  background: #f0f6ff;
  border-left: 4px solid #104fc2;
  padding: 1rem;
  border-radius: 6px;
  font-size: 1.05rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-box.target {
  border-left-color: #28a745;
  background-color: #e8f9f0;
  font-weight: 600;
}

/* === Job Card Header Styling === */
.project-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #111;
}

.project-meta {
  color: #666;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.job-card hr {
  border: none;
  border-top: 1px solid #e0e6ed;
  margin: 0.75rem 0;
}

/* === Finance Row Styling === */
.finance-row {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  background-color: #f0f6ff;
  margin-bottom: 0.5rem;
}

.finance-row.total {
  background-color: #e6f0ff;
  font-weight: 600;
}

/* === Status and Material Badge Styling === */
.badge-status {
  background-color: #e0e6f8;
  color: #104fc2;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.5rem;
}

.badge-paid {
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.badge-paid.green {
  background-color: #e8f9f0;
  color: #2e7d32;
}

.badge-paid.red {
  background-color: #fdecea;
  color: #c62828;
}
.rolodex-card {
  background: #fff;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  margin-bottom: 1rem;
  border-left: 4px solid #104fc2;
  position: relative;
}

.rolodex-meta {
  margin: 0.35rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #444;
}

.rolodex-search {
  padding-left: 2rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  height: 42px;
  background-image: url('search-icon.svg'); /* Replace with actual path or font-awesome icon */
  background-position: 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1rem;
}

.edit-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #104fc2;
  background: #e6f0ff;
  border-radius: 50%;
  padding: 0.4rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.edit-button:hover {
  background-color: #d0e6ff;
}
.section-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: #104fc2;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.subsection-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.warranty-box {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  background-color: #f9f9f9;
}

.total-label {
  font-weight: bold;
  font-size: 1.05rem;
  background-color: #eef3fd;
  color: #104fc2;
  padding: 6px;
}

.total-value {
  font-weight: bold;
  font-size: 1.05rem;
  background-color: #eef3fd;
  color: #104fc2;
  text-align: right;
  padding: 6px;
}
.margin-summary {
  background-color: #f8faff;
  border: 1px solid #d0e2ff;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid #e0e6ed;
}

.margin-label {
  color: #104fc2;
  font-weight: 600;
  font-size: 0.95rem;
}

.margin-value {
  font-weight: 600;
  color: #333;
}

.margin-value.high {
  color: #2e7d32;
}

.margin-value.low {
  color: #f57c00;
}

.margin-summary i {
  vertical-align: middle;
  margin-right: 0.4rem;
  color: #104fc2;
}