:root {
  --bg: #F2F6F9;
  --surface: #FFFFFF;
  --text: #0F1D29;
  --accent: #1B8CC4;
  --accent-dark: #0A4A6B;
  --neutral: #7C8FA0;
  --danger: #C0392B;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(15, 29, 41, 0.08);
  --font: Inter, Manrope, "Segoe UI", Roboto, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: 44px; font-weight: 700; }
h2 { font-size: 30px; font-weight: 700; }
h3 { font-size: 20px; font-weight: 600; }

.hidden { display: none !important; }
.muted { color: var(--neutral); }
.small { font-size: 13px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px; color: var(--accent); font-weight: 600; margin: 0 0 8px; }
.section { padding: 56px 24px; max-width: 1120px; margin: 0 auto; }
.section-sub { color: var(--neutral); margin-top: -8px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 10px; border: 0;
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: transform 0.2s cubic-bezier(0.33, 1, 0.68, 1), box-shadow 0.2s, background-color 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(27, 140, 196, 0.28); }
.btn-ghost { background: transparent; color: var(--accent-dark); border: 1px solid var(--neutral); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------- Шапка витрины ---------- */
.site-header {
  display: flex; align-items: center; gap: 20px; padding: 14px 24px;
  background: var(--surface); border-bottom: 1px solid var(--bg);
  position: sticky; top: 0; z-index: 20; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); font-size: 20px; }
.brand-logo { width: 34px; height: 34px; }
.site-nav { display: flex; gap: 18px; margin-left: auto; }
.site-nav a { color: var(--text); font-weight: 500; }
.site-nav a:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 440px; overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,74,107,0.82) 0%, rgba(10,74,107,0.35) 55%, rgba(10,74,107,0.15) 100%); }
.hero-content { position: relative; z-index: 2; max-width: 1120px; margin: 0 auto; padding: 80px 24px; color: #fff; }
.hero-content .eyebrow { color: #fff; }
.hero-sub { max-width: 520px; font-size: 18px; margin: 0 0 24px; }

/* ---------- Каталог ---------- */
.filters { display: flex; gap: 12px; margin: 20px 0; flex-wrap: wrap; }
.filters input, .filters select {
  padding: 10px 14px; border: 1px solid var(--neutral); border-radius: 10px;
  font-family: inherit; font-size: 15px; background: var(--surface); color: var(--text);
}
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform 0.2s cubic-bezier(0.33, 1, 0.68, 1), box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(15, 29, 41, 0.14); }
.card img.thumb { width: 100%; height: 170px; object-fit: cover; }
.card-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .price { font-size: 20px; font-weight: 700; color: var(--accent-dark); }
.card .meta { color: var(--neutral); font-size: 14px; }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag { background: var(--bg); color: var(--accent-dark); padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }

/* ---------- О нас / resort ---------- */
.about-grid, .resort-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.about-img, .resort-img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; height: 320px; object-fit: cover; }
.features { list-style: none; padding: 0; display: grid; gap: 10px; }
.features li { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.features li img { width: 26px; height: 26px; }

/* ---------- Форма заявки ---------- */
.lead-card { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.lead-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lead-inner { position: relative; z-index: 2; padding: 40px; max-width: 560px; margin-left: auto; background: rgba(255,255,255,0.96); }
.lead-inner h2 { color: var(--text); }
label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
label input, label select {
  display: block; width: 100%; margin-top: 6px; padding: 11px 14px;
  border: 1px solid var(--neutral); border-radius: 10px; font-family: inherit; font-size: 15px; color: var(--text);
}
label input:focus, label select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(27,140,196,0.18); }
.req { color: var(--danger); }
.consent { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 14px; color: var(--text); }
.consent input { width: auto; margin-top: 2px; }
.form-status { min-height: 20px; font-weight: 600; }
.form-status.ok { color: var(--accent-dark); }
.form-status.err { color: var(--danger); }
.invalid { border-color: var(--danger) !important; }

/* ---------- Footer ---------- */
.site-footer { background: var(--accent-dark); color: #fff; padding: 40px 24px; }
.footer-grid { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.site-footer .muted { color: rgba(255,255,255,0.7); }
.site-footer a.muted { color: #fff; }
.footer-title { font-weight: 700; margin-bottom: 8px; }
.brand-name { font-weight: 700; font-size: 18px; margin: 0; }

/* ---------- Вход ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px; width: 100%; max-width: 400px; }
.login-logo { width: 48px; height: 48px; margin: 0 auto 16px; }
.login-card h1 { font-size: 22px; text-align: center; }
.demo-hint { margin-top: 16px; padding: 12px; background: var(--bg); border-radius: 10px; font-size: 13px; }
code { background: var(--bg); padding: 1px 6px; border-radius: 6px; }

/* ---------- Панель ---------- */
.panel { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--accent-dark); color: #fff; display: flex; flex-direction: column; padding: 20px 14px; }
.side-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 20px; }
.side-brand img { width: 30px; height: 30px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-nav button {
  display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px;
  background: transparent; border: 0; color: rgba(255,255,255,0.85); border-radius: 10px;
  font-family: inherit; font-size: 15px; cursor: pointer; transition: background-color 0.2s;
}
.side-nav button:hover { background: rgba(255,255,255,0.12); }
.side-nav button.active { background: var(--accent); color: #fff; }
.side-nav button img { width: 20px; height: 20px; filter: invert(1); }
.side-foot { border-top: 1px solid rgba(255,255,255,0.2); padding-top: 14px; }
.role-tag { display: block; margin-bottom: 10px; font-size: 13px; color: rgba(255,255,255,0.8); }
.side-foot .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.4); width: 100%; }

.main { padding: 24px; overflow-x: hidden; }
.main-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.role-switch { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.role-switch select { padding: 8px 10px; border: 1px solid var(--neutral); border-radius: 8px; font-family: inherit; }

/* ---------- Виджеты панели ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat .num { font-size: 30px; font-weight: 700; color: var(--accent-dark); }
.stat .lbl { color: var(--neutral); font-size: 14px; }

.panel-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input, .toolbar select {
  padding: 9px 12px; border: 1px solid var(--neutral); border-radius: 8px; font-family: inherit; font-size: 14px;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--bg); vertical-align: middle; }
th { color: var(--neutral); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
tr:hover td { background: var(--bg); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.new { background: #E3F2FD; color: #0A4A6B; }
.badge.progress { background: #FFF3E0; color: #A05A00; }
.badge.done { background: #E6F4EA; color: #1E7A3C; }
.badge.cancel { background: #FDECEA; color: #C0392B; }
.badge.vip { background: #0A4A6B; color: #fff; }
.badge.urgent { background: #C0392B; color: #fff; }

/* Канбан */
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kb-col { background: var(--bg); border-radius: var(--radius); padding: 12px; min-height: 120px; }
.kb-col h4 { margin: 0 0 10px; font-size: 14px; color: var(--accent-dark); text-transform: uppercase; letter-spacing: 0.04em; }
.kb-card {
  background: var(--surface); border-radius: 10px; padding: 12px; margin-bottom: 10px; cursor: grab;
  box-shadow: 0 2px 8px rgba(15,29,41,0.06); border-left: 4px solid var(--accent);
}
.kb-card.urgent { border-left-color: var(--danger); }
.kb-card.vip { border-left-color: var(--accent-dark); }
.kb-card:active { cursor: grabbing; }
.kb-card .kb-title { font-weight: 600; }
.kb-card .kb-meta { color: var(--neutral); font-size: 12px; }
.drop-hint { outline: 2px dashed var(--accent); outline-offset: -4px; }

/* Формы/модалки */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: block; }
.field input, .field select { width: 100%; padding: 10px 12px; border: 1px solid var(--neutral); border-radius: 8px; font-family: inherit; font-size: 14px; }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }

.empty { text-align: center; color: var(--neutral); padding: 40px; }
.empty img { width: 64px; height: 64px; margin: 0 auto 12px; opacity: 0.6; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.photo-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.photo-card img { width: 100%; height: 140px; object-fit: cover; }
.photo-card .pc-caption { padding: 10px; font-size: 13px; }

.journal { max-height: 240px; overflow-y: auto; font-size: 13px; }
.journal .entry { padding: 8px 10px; border-bottom: 1px solid var(--bg); }
.journal .entry .ts { color: var(--neutral); margin-right: 8px; }

canvas.chart { max-width: 100%; }

/* ---------- Модалка ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,29,41,0.5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(15,29,41,0.3); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; padding: 24px; }
.modal h3 { margin-top: 0; }
.modal-body { margin: 12px 0; }
.modal-body label { margin-bottom: 12px; }
.modal-body textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--neutral); border-radius: 8px; font-family: inherit; font-size: 14px; resize: vertical; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Анимации ---------- */
.fade-up { animation: fadeUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.pop { animation: pop 0.25s cubic-bezier(0.4, 0, 0.2, 1) both; }
@keyframes pop { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .about-grid, .resort-grid, .footer-grid { grid-template-columns: 1fr; }
  .panel { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { border-top: 0; padding-top: 0; }
}
@media (max-width: 600px) {
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
  .section { padding: 40px 16px; }
  .hero-content { padding: 48px 16px; }
  .site-nav { width: 100%; order: 3; justify-content: space-between; }
  .form-grid { grid-template-columns: 1fr; }
  .lead-inner { padding: 24px; }
}
