:root {
  --bg: #f7f8f6;
  --surface: #ffffff;
  --border: #e2e5e0;
  --text: #1a2420;
  --text-muted: #5c6863;
  --brand: #0f7a5c;
  --brand-dark: #0b5f47;
  --brand-light: #e3f4ec;
  --amber: #b7791f;
  --amber-light: #fdf3dd;
  --red: #c0392b;
  --red-light: #fdecea;
  --blue: #2563eb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 25, 0.06), 0 4px 16px rgba(20, 30, 25, 0.05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.narrow { max-width: 720px; }

/* Nav */
.nav {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: 1100px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}
.nav-links a { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 12px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: var(--surface);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn-outline:hover { border-color: var(--brand); }
.btn-danger { border-color: var(--red); color: var(--red); background: var(--surface); }
.btn-danger:hover { background: var(--red-light); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Forms */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text-muted); }
input, textarea, select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand-light); border-color: var(--brand); }
.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; }
.help-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--brand-light);
  color: var(--brand-dark);
}
.badge-amber { background: var(--amber-light); color: var(--amber); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-gray { background: #eef0ee; color: var(--text-muted); }
.badge-blue { background: #eaf1fe; color: var(--blue); }

/* Status pill per deal state */
.status-pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: capitalize; }
.status-requested { background: #eaf1fe; color: var(--blue); }
.status-accepted { background: var(--brand-light); color: var(--brand-dark); }
.status-in_progress { background: var(--amber-light); color: var(--amber); }
.status-delivered { background: #f1eafd; color: #6b32c2; }
.status-work_accepted { background: var(--brand-light); color: var(--brand-dark); }
.status-payment_sent { background: var(--amber-light); color: var(--amber); }
.status-payment_confirmed { background: var(--brand-light); color: var(--brand-dark); }
.status-closed { background: #eef0ee; color: var(--text-muted); }
.status-rejected, .status-cancelled { background: var(--red-light); color: var(--red); }

.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: var(--red-light); color: var(--red); border: 1px solid #f3c9c3; }
.alert-warn { background: var(--amber-light); color: var(--amber); border: 1px solid #f0dfb0; }
.alert-ok { background: var(--brand-light); color: var(--brand-dark); border: 1px solid #bfe6d4; }

/* Layout helpers */
.section { padding: 56px 0; }
.section-tight { padding: 32px 0; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap { display: flex; gap: 12px; align-items: center; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }

/* Hero */
.hero { padding: 80px 0 60px; text-align: center; }
.hero h1 { font-size: 42px; line-height: 1.15; margin-bottom: 16px; }
.hero p { font-size: 18px; color: var(--text-muted); max-width: 620px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
.step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; margin-bottom: 10px;
}

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.02em; }

/* Listing card */
.listing-card {
  display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface);
}
.listing-image {
  width: 100%; height: 140px; object-fit: cover; border-radius: 8px; background: #eef0ee;
}
.price-tag { font-size: 20px; font-weight: 700; color: var(--brand-dark); }

/* Avatar */
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--brand-light); }
.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 88px; height: 88px; }

/* SLA bar */
.sla-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sla-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.sla-dot-met { background: var(--brand); }
.sla-dot-overdue { background: var(--red); }
.sla-dot-on_track { background: var(--amber); }
.sla-dot-not_started { background: var(--text-muted); }

/* Timeline */
.timeline { border-left: 2px solid var(--border); padding-left: 16px; margin-left: 6px; }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before {
  content: ""; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand);
}

/* Chat */
.chat-window { max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: #fbfbfa; }
.chat-msg { max-width: 75%; margin-bottom: 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.chat-msg.mine { margin-left: auto; background: var(--brand-light); border-color: #bfe6d4; }
.chat-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }

/* Notification bell */
.bell-wrap { position: relative; }
.bell-count {
  position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 5px; min-width: 16px; text-align: center;
}

footer { border-top: 1px solid var(--border); padding: 32px 0; margin-top: 60px; color: var(--text-muted); font-size: 13px; }
footer a { color: var(--text-muted); }

.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #eef0ee; font-size: 12px; margin-right: 4px; margin-bottom: 4px; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 20, 18, 0.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal { background: var(--surface); border-radius: var(--radius); padding: 28px; max-width: 480px; box-shadow: var(--shadow); }

.stars { color: #d69e2e; letter-spacing: 1px; }
