/* Портал дегустаций — фирменный стиль (brand.md) */
:root {
  --bg: #F5F7F2;
  --surface: #FFFFFF;
  --text: #1B2A22;
  --accent: #2E9E5B;
  --accent-dark: #16623A;
  --neutral: #7C867E;
  --warn: #E9A13B;
  --danger: #D64545;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(27, 42, 34, 0.08);
  --font: Inter, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.5px; margin: 0 0 0.5em; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }
.muted { color: var(--neutral); }
.hidden { display: none !important; }

/* Topbar */
.topbar { background: var(--surface); border-bottom: 1px solid #e8ece6; position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1160px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand-sub { color: var(--neutral); font-weight: 400; font-size: 13px; }
.nav { display: flex; gap: 14px; margin-left: auto; }
.nav a { color: var(--text); padding: 6px 2px; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--accent); border-color: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.role-chip { background: #e7f3ec; color: var(--accent-dark); padding: 4px 10px; border-radius: 999px; font-size: 13px; }

/* Buttons */
.btn { font-family: inherit; font-size: 15px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; font-weight: 600; transition: transform .2s cubic-bezier(.4,0,.2,1), background .2s, box-shadow .2s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline { background: transparent; color: var(--accent-dark); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--neutral); }
.btn-danger { background: var(--danger); color: #fff; }

/* Layout */
main { min-height: 70vh; }
.view { max-width: 1160px; margin: 0 auto; padding: 20px; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: center; padding: 24px 0; }
.hero-img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; height: auto; }
.hero h1 { font-size: 40px; }
.lead { font-size: 18px; color: var(--neutral); max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow); }
.stat-num { display: block; font-size: 34px; font-weight: 700; color: var(--accent-dark); font-variant-numeric: tabular-nums; }
.stat-label { color: var(--neutral); font-size: 14px; }

/* Sections */
.section { margin: 40px 0; }
.section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; }
.section-grid.reverse > img { order: 0; }
.about-img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; height: auto; }
.checklist { padding-left: 20px; }
.checklist li { margin: 6px 0; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-icon { width: 34px; height: 34px; margin-bottom: 10px; }
.card h3 { font-size: 17px; }

/* Lead form */
.lead-box { background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); max-width: 640px; }
label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 14px; color: var(--text); }
input, textarea, select { font-family: inherit; font-size: 15px; width: 100%; padding: 10px 12px; border: 1px solid #d5ddd3; border-radius: 10px; background: #fff; color: var(--text); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.consent { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.consent input { width: auto; }
.form-actions { display: flex; align-items: center; gap: 14px; }
.form-status { font-size: 14px; }
.form-status.ok { color: var(--accent-dark); }
.form-status.err { color: var(--danger); }
textarea { resize: vertical; }

/* Panel */
.panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.role-switch { display: flex; align-items: center; gap: 8px; }
.role-switch select { width: auto; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid #d5ddd3; margin: 16px 0; }
.tab { display: flex; align-items: center; gap: 7px; background: transparent; border: none; padding: 10px 14px; font-family: inherit; font-size: 14px; color: var(--text); cursor: pointer; border-bottom: 3px solid transparent; }
.tab img { width: 18px; height: 18px; }
.tab.active { border-bottom-color: var(--accent); color: var(--accent-dark); font-weight: 700; }
.panel-body { padding: 8px 0 40px; }
.tabpane { display: none; }
.tabpane.active { display: block; animation: fadeUp .3s cubic-bezier(.2,0,0,1); }
.pane-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.pane-toolbar input[type=search] { width: auto; min-width: 220px; }

/* Table */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #eef1ec; vertical-align: top; font-size: 14px; word-break: break-word; }
.table th { background: #f1f5ef; color: var(--text); font-weight: 700; }
.table tr:last-child td { border-bottom: none; }

/* Badges */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.new { background: #e7f3ec; color: var(--accent-dark); }
.badge.work { background: #fdf1df; color: #a0640a; }
.badge.done { background: #e9edf4; color: #3d4a66; }
.badge.draft { background: #eceef2; color: var(--neutral); }
.badge.planned { background: #e7f3ec; color: var(--accent-dark); }
.badge.active { background: #fdf1df; color: #a0640a; }
.badge.finished { background: #e9edf4; color: #3d4a66; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kb-col { background: #eef2ec; border-radius: var(--radius); padding: 12px; min-height: 220px; }
.kb-col h3 { font-size: 14px; color: var(--neutral); text-transform: none; }
.kb-card { background: var(--surface); border-radius: 10px; padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow); cursor: grab; }
.kb-card.urgent { border-left: 4px solid var(--danger); }
.kb-card.vip { border-left: 4px solid var(--warn); }
.kb-card:active { cursor: grabbing; }
.kb-card.dragging { opacity: .5; }
.kb-title { font-weight: 700; font-size: 14px; }
.kb-meta { font-size: 12px; color: var(--neutral); margin-top: 4px; }

/* Charts / schedule */
.schedule-grid, .reports-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-wrap { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.chart-wrap canvas { width: 100%; height: auto; }

/* Notifications */
.switch { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-weight: 500; }
.switch input { width: auto; }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* Documents */
.doc-list { list-style: none; padding: 0; }
.doc-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef1ec; flex-wrap: wrap; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 14px; }
.photo-grid img { border-radius: 8px; height: 100px; object-fit: cover; width: 100%; }
.photo-grid figure { margin: 0; }
.photo-grid figcaption { font-size: 12px; color: var(--neutral); }

/* References */
.ref-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ref-list { list-style: none; padding: 0; }
.ref-list li { padding: 6px 0; border-bottom: 1px solid #eef1ec; font-size: 14px; }

/* Guest */
.guest-box { max-width: 560px; margin: 40px auto; background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
#guest-questions .q { margin-bottom: 18px; }
.q-options label { font-weight: 400; display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.q-options input { width: auto; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(27,42,34,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-box { background: var(--surface); border-radius: var(--radius); padding: 24px; max-width: 560px; width: 100%; max-height: 88vh; overflow: auto; }
.modal-box label { margin-bottom: 10px; }

/* Footer */
.footer { background: var(--accent-dark); color: #fff; margin-top: 40px; }
.footer-inner { max-width: 1160px; margin: 0 auto; padding: 22px 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer-inner > div { display: flex; align-items: center; gap: 10px; }
.footer-contacts { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 13px; opacity: .85; }

/* Animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card, .stat, .kb-card { transition: transform .2s cubic-bezier(.4,0,.2,1), box-shadow .2s; }
.card:hover, .stat:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(27,42,34,.12); }

/* Responsive */
@media (max-width: 900px) {
  .hero, .section-grid, .schedule-grid, .reports-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .kanban { grid-template-columns: 1fr 1fr; }
  .ref-grid { grid-template-columns: 1fr; }
  h1 { font-size: 26px; }
  .hero h1 { font-size: 30px; }
}
@media (max-width: 540px) {
  .cards, .kanban { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .table th, .table td { white-space: normal; }
}

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