:root {
  --bg: #F4F7FA;
  --surface: #FFFFFF;
  --text: #17222D;
  --accent: #0E6BB8;
  --accent-dark: #08457A;
  --neutral: #8A99A8;
  --error: #C0392B;
  --success: #2E8B57;
  --warning: #E6A817;
  --border: #DCE4EC;
  --shadow: 0 2px 10px rgba(23, 34, 45, 0.07);
  --shadow-hover: 0 8px 24px rgba(23, 34, 45, 0.13);
  --radius: 12px;
  --ease-in: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.0, 0.0, 0.2, 1);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
}

h1 { font-size: 48px; font-weight: 700; }
h2 { font-size: 28px; font-weight: 600; }
h3 { font-size: 20px; font-weight: 600; }

p { margin: 0 0 1em; }

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

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 18px;
  height: 64px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 20px; color: var(--text);
}
.brand img { width: 40px; height: 40px; }
.nav { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  padding: 8px 12px; border-radius: 8px; color: var(--text);
  font-size: 15px; transition: background 180ms var(--ease-in), color 180ms var(--ease-in);
}
.nav a:hover { background: var(--bg); color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.role-switch { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--neutral); }
.role-switch select {
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 13px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background 180ms var(--ease-in), color 180ms var(--ease-in),
              box-shadow 180ms var(--ease-in), transform 180ms var(--ease-in);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); box-shadow: var(--shadow-hover); }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #9c2d21; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, #EAF1F7 0%, var(--bg) 100%); }
.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; padding: 56px 20px; }
.hero-text h1 { font-size: 44px; }
.hero-text p { font-size: 18px; color: #33465a; }
.hero-media img { border-radius: var(--radius); box-shadow: var(--shadow-hover); width: 100%; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; }
.badge img { width: 16px; height: 16px; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-alt { background: var(--surface); }
.section-head { max-width: 640px; margin-bottom: 32px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.about-grid img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.feature-list li { display: flex; gap: 12px; align-items: flex-start; }
.feature-list img { width: 24px; height: 24px; flex: none; margin-top: 2px; }

/* ---------- Cards grid (catalog) ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
  transition: transform 180ms var(--ease-in), box-shadow 180ms var(--ease-in);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card .card-icon { width: 44px; height: 44px; margin-bottom: 12px; }
.card h3 { margin-bottom: 6px; }
.card .price { font-family: ui-monospace, 'SF Mono', 'Consolas', 'Menlo', monospace; color: var(--accent-dark); font-weight: 600; }
.card .meta { color: var(--neutral); font-size: 13px; }

/* ---------- Lead form ---------- */
.lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.lead-grid > img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; font-family: inherit; color: var(--text); background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 107, 184, 0.15);
}
.field.invalid input, .field.invalid textarea { border-color: var(--error); }
.field .err { color: var(--error); font-size: 13px; margin-top: 4px; display: none; }
.field.invalid .err { display: block; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: #33465a; }
.consent input { margin-top: 3px; }
.form-note { font-size: 13px; color: var(--neutral); }
.form-msg { margin-top: 12px; padding: 12px; border-radius: 8px; font-size: 14px; display: none; }
.form-msg.ok { display: block; background: #e7f5ec; color: var(--success); border: 1px solid #bfe6cd; }
.form-msg.err { display: block; background: #fbeaea; color: var(--error); border: 1px solid #f0c6c0; }
.form-msg.warn { display: block; background: #fdf3dc; color: #8a6a13; border: 1px solid #f2dfae; }

/* ---------- Contacts ---------- */
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.contact-card { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.contact-card img { width: 26px; height: 26px; flex: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--accent-dark); color: #e8f0f7; padding: 28px 0; margin-top: 40px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; }

/* ---------- Employee area ---------- */
.employee-area { min-height: 70vh; padding: 40px 20px; }
.offline-badge { display: none; background: var(--warning); color: #4a3a00; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.offline-badge.show { display: inline-block; }

.login-card { max-width: 400px; margin: 40px auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.login-card h3 { text-align: center; }
.login-hint { font-size: 13px; color: var(--neutral); text-align: center; }

.panel { display: grid; grid-template-columns: 220px 1fr; gap: 24px; max-width: 1120px; margin: 0 auto; }
.panel-sidebar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); align-self: start; }
.panel-sidebar .who { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.panel-sidebar .who b { display: block; }
.panel-sidebar .who span { font-size: 12px; color: var(--neutral); }
.tab-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 12px; border: none; background: transparent; border-radius: 8px; font-size: 15px; color: var(--text); cursor: pointer; transition: background 180ms var(--ease-in); }
.tab-btn img { width: 20px; height: 20px; }
.tab-btn:hover { background: var(--bg); }
.tab-btn.active { background: var(--accent); color: #fff; }
.tab-btn.active img { filter: brightness(0) invert(1); }
.tab-btn.hidden-tab { display: none; }

.panel-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); min-height: 400px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.panel-head h3 { margin: 0; }

/* stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--bg); border-radius: var(--radius); padding: 18px; }
.stat .num { font-size: 30px; font-weight: 700; color: var(--accent-dark); font-family: ui-monospace, 'SF Mono', 'Consolas', 'Menlo', monospace; }
.stat .lbl { font-size: 13px; color: var(--neutral); }

/* progress bars */
.progress-row { margin-bottom: 16px; }
.progress-row .pr-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.progress-track { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width 450ms var(--ease-in); }

/* tables / lists */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input, .toolbar select { padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; }
.toolbar input { flex: 1; min-width: 160px; }

.list { display: grid; gap: 12px; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 600; }
.list-item .li-sub { font-size: 13px; color: var(--neutral); }
.list-item .li-date { font-family: ui-monospace, 'SF Mono', 'Consolas', 'Menlo', monospace; font-size: 12px; color: var(--neutral); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.new { background: #e7f0fa; color: var(--accent); }
.pill.progress { background: #fdf3dc; color: #8a6a13; }
.pill.done { background: #e7f5ec; color: var(--success); }
.pill.active { background: #e7f5ec; color: var(--success); }
.pill.paused { background: #eef1f4; color: var(--neutral); }

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

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(23,34,45,0.5); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius); padding: 24px; width: 100%; max-width: 520px; box-shadow: var(--shadow-hover); }
.modal h3 { margin-top: 0; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* notify settings */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: var(--neutral); border-radius: 999px; transition: background 200ms var(--ease-in); }
.switch .slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 200ms var(--ease-in); }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.log { background: var(--bg); border-radius: 8px; padding: 14px; max-height: 220px; overflow: auto; font-size: 13px; font-family: ui-monospace, 'SF Mono', 'Consolas', 'Menlo', monospace; }
.log div { padding: 3px 0; border-bottom: 1px dashed var(--border); }

/* photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.photo-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.photo-card img { width: 100%; height: 130px; object-fit: cover; }
.photo-card .pc-cap { padding: 10px; font-size: 13px; }
.photo-card .pc-meta { padding: 0 10px 10px; font-size: 11px; color: var(--neutral); font-family: ui-monospace, 'SF Mono', 'Consolas', 'Menlo', monospace; }

/* chart */
.chart-wrap { background: var(--bg); border-radius: 10px; padding: 16px; margin-top: 8px; }
.chart-wrap canvas { width: 100%; height: 220px; display: block; }

/* ---------- Motion: keyframes + transitions (brand.md: 180–450 ms, cubic-bezier) ---------- */
@keyframes ngco-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes ngco-rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ngco-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 450ms var(--ease-in), transform 450ms var(--ease-in); }
.reveal.in { opacity: 1; transform: none; animation: ngco-rise-in 450ms var(--ease-out) both; }

/* Soft entrance for inline feedback, modal and dashboard counters */
.form-msg.ok, .form-msg.err, .form-msg.warn { animation: ngco-fade-in 240ms var(--ease-out) both; }
.modal-backdrop.open .modal { animation: ngco-modal-in 240ms var(--ease-out) both; }
.stat .num { animation: ngco-fade-in 300ms var(--ease-out) both; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  h1 { font-size: 34px; }
  .hero-inner, .about-grid, .lead-grid { grid-template-columns: 1fr; }
  .panel { grid-template-columns: 1fr; }
  .panel-sidebar { display: flex; flex-wrap: wrap; gap: 4px; }
  .panel-sidebar .who { width: 100%; }
  .tab-btn { width: auto; }
}
@media (max-width: 375px) {
  h1 { font-size: 30px; }
  .header-inner { height: auto; padding: 10px 0; }
  .nav { order: 3; width: 100%; justify-content: space-between; }
  .card, .form-card { padding: 16px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

