/* App shell — dashboard, forms, customers pages.
   theme.css defines design tokens and landing page styles.
   This file owns everything that isn't the landing page. */

/* ── Nav ── */
.app-nav {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--surface-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-brand:hover { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover, .nav-link.active {
  color: var(--fg);
  background: var(--surface);
}
.nav-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--accent-dark); }

/* ── Stats Bar ── */
.stats-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--surface-border);
}
.stats-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.stat-pill {
  display: flex;
  flex-direction: column;
  padding: 0 28px;
  min-width: 120px;
}
.stat-pill:first-child { padding-left: 0; }
.stat-pill-label {
  font-size: 11px;
  color: var(--fg-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.stat-pill-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--fg);
}
.stat-pill-value.accent { color: var(--accent); }
.stat-pill-divider {
  width: 1px;
  height: 36px;
  background: var(--surface-border);
}

/* ── Main Layout ── */
.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* ── Board Section ── */
.board-section {}
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section-tag {
  display: block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 6px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

/* ── Job Grid (today's cards) ── */
.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.job-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s;
}
.job-card:hover { border-color: var(--accent-dark); }
.job-card[data-status="completed"] { opacity: 0.65; }
.job-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.job-card-time {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-display);
}
.job-card-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}
.job-card-service {
  font-size: 13px;
  color: var(--fg-muted);
}
.job-card-addr {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.5;
}
.job-card-price {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}
.job-card-notes {
  font-size: 12px;
  color: var(--fg-muted);
  font-style: italic;
  border-top: 1px solid var(--surface-border);
  padding-top: 8px;
}
.job-card-footer {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

/* Status select in card */
.status-select {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-display);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--surface-border);
  background: var(--bg-alt);
  color: var(--fg);
  cursor: pointer;
}
.status-select.status-scheduled { color: var(--warm); border-color: rgba(212, 165, 116, 0.4); }
.status-select.status-in_progress { color: #7dd3fc; border-color: rgba(125, 211, 252, 0.4); }
.status-select.status-completed { color: var(--accent); border-color: rgba(184, 224, 96, 0.4); }
.status-select.status-cancelled { color: var(--fg-muted); }

/* ── Job Table ── */
.job-table-wrap { overflow-x: auto; }
.job-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.job-table th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--surface-border);
}
.job-table td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(42, 48, 36, 0.6);
  vertical-align: middle;
}
.job-table tr:hover td { background: rgba(255,255,255,0.02); }
.td-date { color: var(--fg-muted); font-size: 13px; white-space: nowrap; }
.td-muted { opacity: 0.6; }
.td-name { font-weight: 500; }
.td-addr { color: var(--fg-muted); font-size: 13px; max-width: 200px; }
.td-price { font-family: var(--font-display); font-weight: 600; }
.td-price.accent, .accent { color: var(--accent); }
.td-actions { display: flex; gap: 8px; align-items: center; white-space: nowrap; }

/* ── Badges ── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-display);
  padding: 3px 9px;
  border-radius: 100px;
  white-space: nowrap;
}
.badge-scheduled { background: rgba(212, 165, 116, 0.15); color: var(--warm); }
.badge-inprogress { background: rgba(125, 211, 252, 0.15); color: #7dd3fc; }
.badge-done { background: rgba(184, 224, 96, 0.15); color: var(--accent); }
.badge-cancelled { background: rgba(154, 150, 137, 0.15); color: var(--fg-muted); }

.service-badge {
  display: inline-block;
  font-size: 12px;
  color: var(--fg-muted);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  padding: 3px 8px;
  border-radius: 6px;
}

/* ── Action Links ── */
.action-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.action-link:hover { color: var(--fg); background: var(--surface-border); }

/* ── Buttons ── */
.btn-primary {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--accent-dark); }

.btn-outline {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent-dark);
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-outline:hover { background: rgba(184, 224, 96, 0.1); }

.btn-ghost {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid var(--surface-border);
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}
.btn-ghost:hover { color: var(--fg); border-color: var(--fg-muted); }

/* ── Empty State ── */
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--surface-border);
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.empty-icon { font-size: 28px; color: var(--fg-muted); }
.empty-state p { color: var(--fg-muted); font-size: 15px; }

/* ── Customer Grid ── */
.customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.customer-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.customer-card:hover {
  border-color: var(--accent-dark);
  transform: translateY(-2px);
}
.cust-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-dark), rgba(184,224,96,0.3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--bg);
  flex-shrink: 0;
}
.cust-info { flex: 1; min-width: 0; }
.cust-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 4px;
}
.cust-detail {
  font-size: 13px;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cust-addr {
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: 4px;
  opacity: 0.7;
}

/* ── Customer Profile ── */
.back-row { margin-bottom: 24px; }
.back-link { font-size: 13px; color: var(--fg-muted); text-decoration: none; }
.back-link:hover { color: var(--fg); }
.customer-profile {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  margin-bottom: 40px;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-dark), rgba(184,224,96,0.3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--bg);
  flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
}
.profile-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: var(--fg-muted); margin-bottom: 8px; }
.profile-notes { font-size: 14px; color: var(--fg-muted); font-style: italic; }
.customer-summary {
  display: flex;
  gap: 40px;
  padding: 20px 0 0;
}
.summary-stat { display: flex; flex-direction: column; gap: 4px; }
.summary-val { font-family: var(--font-display); font-size: 28px; font-weight: 700; }
.summary-label { font-size: 13px; color: var(--fg-muted); }

/* ── Form ── */
.form-main {
  min-height: 100vh;
  padding: 40px 24px 80px;
}
.form-wrap {
  max-width: 680px;
  margin: 0 auto;
}
.form-header { margin-bottom: 32px; }
.form-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin: 12px 0 8px;
}
.form-sub { color: var(--fg-muted); font-size: 15px; }
.form-error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #f87171;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 20px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group-full { grid-column: span 2; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-label {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--fg-muted);
  letter-spacing: 0.3px;
}
.req { color: var(--accent); }
.form-input, .form-select, .form-textarea {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--fg);
  padding: 12px 14px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color 0.2s;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-dark);
}
.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239a9689' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; }
.customer-input-wrap { display: flex; flex-direction: column; gap: 8px; }
.or-divider { font-size: 12px; color: var(--fg-muted); text-align: center; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-box {
  background: var(--bg-alt);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}
.modal-close {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.modal-close:hover { color: var(--fg); }
.modal-box .form-group { margin-bottom: 16px; }
.modal-box .form-actions { margin-top: 20px; }

/* ── Landing page nav override — add CTA button ── */
.landing-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .stats-bar-inner { gap: 16px; }
  .stat-pill { padding: 0 12px; min-width: auto; }
  .stat-pill-divider { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group-full { grid-column: span 1; }
  .form-row { grid-template-columns: 1fr; }
  .customer-profile { flex-direction: column; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .job-grid { grid-template-columns: 1fr; }
}
