:root {
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --text: #21302A;
  --accent: #2E7D5B;
  --accent-dark: #1E5740;
  --sun: #F2A03D;
  --error: #C0392B;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(30, 87, 64, 0.08);
  --shadow-hover: 0 8px 24px rgba(30, 87, 64, 0.16);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.0, 0.0, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

html { scroll-padding-top: 88px; }
#catalog, #about, #lead, #contacts, .lead-card {
  scroll-margin-top: 88px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
}

img { max-width: 100%; display: block; }
canvas { max-width: 100%; }
#chart-shifts { display: block; width: 100%; max-width: 100%; height: auto; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.01em; margin: 0 0 12px; }
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 24px; line-height: 1.25; }
h3 { font-size: 20px; line-height: 1.3; }
a { color: var(--accent); text-decoration: none; }
p { margin: 0 0 12px; }
.muted { color: #5b6a60; }
.small { font-size: 14px; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid #e8e4da;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); font-size: 20px; }
.brand img { width: 32px; height: 32px; }
.site-nav { display: flex; gap: 16px; margin-left: auto; }
.site-nav a { color: var(--text); font-weight: 500; }
.site-nav a:hover { color: var(--accent); }
.header-actions { margin-left: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), background 200ms var(--ease);
}
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: #cfc9bc; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }

/* ---------- views ---------- */
.view { min-height: 60vh; }
.view-center { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.view[hidden], .tab-panel[hidden], [hidden] { display: none !important; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
  padding: 40px 20px;
  max-width: 1120px;
  margin: 0 auto;
}
.hero-copy h1 { font-size: 34px; }
.hero-copy p { font-size: 18px; color: #4a594f; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.hero-media img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- sections ---------- */
.section { max-width: 1120px; margin: 0 auto; padding: 40px 20px; }
.section-head { margin-bottom: 20px; }
.section-head p { color: #4a594f; }

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.shift-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
  animation: fadeUp 260ms var(--ease) both;
}
.shift-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.shift-card img { width: 100%; height: 150px; object-fit: cover; }
.shift-card .body { padding: 16px; }
.shift-card .meta { font-size: 14px; color: #4a594f; margin: 4px 0; }
.shift-card .price { font-weight: 700; color: var(--accent-dark); font-size: 18px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.badge-ok { background: #e3efe8; color: var(--accent-dark); }
.badge-no { background: #fbe9d5; color: #8a5a12; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tag { background: var(--bg); border: 1px solid #e2ddd0; border-radius: 8px; padding: 2px 8px; font-size: 13px; }

.highlights { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.highlight-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.highlight-card img { width: 100%; height: 180px; object-fit: cover; }
.highlight-card h3, .highlight-card p { padding: 0 16px; }
.highlight-card h3 { margin-top: 14px; }

.about { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
.about-media img { border-radius: var(--radius); box-shadow: var(--shadow); }
.about-list { list-style: none; padding: 0; }
.about-list li { display: flex; align-items: center; gap: 8px; margin: 8px 0; }

/* ---------- lead form ---------- */
.lead-section { display: flex; justify-content: center; }
.lead-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; max-width: 560px; width: 100%; }

/* dedicated booking screen (#lead / #/lead): only the form, no clipped catalog */
body.lead-focus #view-home > section:not(#lead) { display: none; }
body.lead-focus .lead-section { padding-top: 28px; }
body.lead-focus .lead-card { margin: 0 auto; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfc9bc;
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-error { display: block; color: var(--error); font-size: 13px; min-height: 16px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--error); }
.form-error-summary { background: #fbe9d5; color: #8a3a12; border: 1px solid #f0c9a8; border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 8px 0; }
.consent input { width: auto; margin-top: 3px; }
.consent.invalid span { color: var(--error); }
.success-note {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 12px; border-radius: 10px;
  background: #e3efe8; color: var(--accent-dark); font-weight: 600;
}

/* ---------- contacts ---------- */
.contact-row { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 12px; }
.contact-row span { display: flex; align-items: center; gap: 6px; }

/* ---------- auth ---------- */
.auth-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; width: 100%; max-width: 360px; text-align: center; }
.auth-card img { margin: 0 auto 8px; }
.auth-card .field { text-align: left; }
.login-error { color: var(--error); margin-bottom: 10px; font-size: 14px; }

/* ---------- admin ---------- */
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 20px; max-width: 1120px; margin: 0 auto; }
.admin-user { display: flex; align-items: center; gap: 12px; }
.demo-banner { background: #fbe9d5; color: #8a5a12; padding: 10px 20px; text-align: center; font-weight: 600; }
.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 20px; max-width: 1120px; margin: 0 auto 16px; border-bottom: 1px solid #e2ddd0; }
.tab { background: none; border: none; padding: 10px 16px; font: inherit; font-weight: 600; color: #4a594f; cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--accent-dark); border-bottom-color: var(--accent); }
.tab-panel { max-width: 1120px; margin: 0 auto; padding: 0 20px 40px; }

.panel-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; min-width: 0; overflow-wrap: anywhere; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-width: 0; }
.grid-2 > *, .status-bar > * { min-width: 0; }

.status-bars { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.status-bar { display: grid; grid-template-columns: 120px 1fr 60px; align-items: center; gap: 12px; }
.status-bar .track { background: #eeeade; border-radius: 999px; height: 12px; overflow: hidden; }
.status-bar .fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width 300ms var(--ease); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid #efebe0; display: flex; justify-content: space-between; gap: 8px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.toolbar input, .toolbar select { padding: 8px 12px; border: 1px solid #cfc9bc; border-radius: 8px; font: inherit; max-width: 100%; }
.toolbar label { font-size: 14px; font-weight: 600; }
.filter-info { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: #e3efe8; color: var(--accent-dark); font-size: 13px; font-weight: 600; }

/* kanban-like leads board */
.leads-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: start; min-width: 0; }
.leads-board.filtered { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
.lead-col { background: #efebe0; border-radius: 12px; padding: 10px; min-width: 0; }
.lead-col h4 { margin: 0 0 8px; font-size: 15px; }
.lead-item { background: var(--surface); border-radius: 10px; padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow); }
.lead-item.priority { border-left: 4px solid var(--sun); }
.lead-item .who { font-weight: 600; }
.lead-item .what { font-size: 13px; color: #4a594f; }
.lead-item .actions { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.lead-item .actions button { font-size: 13px; padding: 4px 8px; border-radius: 6px; border: 1px solid #cfc9bc; background: #fff; cursor: pointer; }
.lead-item .actions button:hover { border-color: var(--accent); color: var(--accent); }

.clients-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.client-card { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 14px; }
.client-card .row { display: flex; align-items: center; gap: 10px; }
.client-card .row img { width: 36px; height: 36px; }
.client-card .name { font-weight: 600; }
.client-card .contact { font-size: 14px; color: #4a594f; }
.client-card .client-actions { margin-top: 10px; display: flex; gap: 8px; }
.client-card .client-actions button { font-size: 13px; padding: 5px 10px; border-radius: 8px; border: 1px solid #cfc9bc; background: #fff; cursor: pointer; }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.inline-form input, .inline-form select { padding: 8px 12px; border: 1px solid #cfc9bc; border-radius: 8px; font: inherit; }

.toggle { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-weight: 500; }

/* ---------- footer ---------- */
.site-footer { background: var(--accent-dark); color: #fff; padding: 24px 20px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer .muted { color: #cfe0d6; }

/* ---------- animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.shift-card:nth-child(2) { animation-delay: 50ms; }
.shift-card:nth-child(3) { animation-delay: 100ms; }
.shift-card:nth-child(4) { animation-delay: 150ms; }
.shift-card:nth-child(5) { animation-delay: 200ms; }
.shift-card:nth-child(6) { animation-delay: 250ms; }

.badge { animation: fadeUp 180ms var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero, .about, .highlights, .grid-2 { grid-template-columns: 1fr; }
  .catalog-grid, .clients-list { grid-template-columns: repeat(2, 1fr); }
  .leads-board { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .site-nav { display: none; }
  .catalog-grid, .clients-list { grid-template-columns: 1fr; }
  .leads-board { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  h1 { font-size: 26px; }
}
