:root {
  --primary: #0b5ed7;
  --primary-dark: #084298;
  --primary-soft: #e8f1fb;
  --accent: #19a7ce;
  --ink: #0a2540;
  --muted: #5b6b80;
  --line: #d6e2f1;
  --bg: #f6faff;
  --card: #ffffff;
  --ok: #198754;
  --warn: #c77d0a;
  --bad: #c0392b;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(11, 94, 215, 0.10);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.section { padding: 64px 0; }
.section.alt { background: var(--primary-soft); }
.section-title { text-align: center; margin-bottom: 36px; }
.section-title h2 { font-size: 2rem; }
.section-title p { color: var(--muted); max-width: 620px; margin: 0 auto; }

/* Header */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--primary-dark); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center; color: #fff; font-size: 1.1rem;
}
.nav { display: flex; gap: 22px; align-items: center; }
.nav a { color: var(--ink); font-weight: 500; font-size: .95rem; }
.nav a:hover { color: var(--primary); }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 1.2rem; cursor: pointer; }

/* Buttons */
.btn {
  display: inline-block; border: 0; cursor: pointer;
  background: var(--primary); color: #fff; font: inherit; font-weight: 600;
  padding: 11px 22px; border-radius: 999px; transition: .15s;
}
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.small { padding: 6px 14px; font-size: .85rem; }
.btn.danger { background: var(--bad); }

/* Hero */
.hero {
  background: linear-gradient(135deg, #0a3d91 0%, #0b5ed7 55%, #19a7ce 100%);
  color: #fff; padding: 88px 0 96px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px;
  border-radius: 50%; background: rgba(255,255,255,.08);
}
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
.hero p { font-size: 1.1rem; opacity: .92; max-width: 540px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero .btn { background: #fff; color: var(--primary-dark); }
.hero .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.hero-card {
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--radius); padding: 24px;
}
.hero-card ul { list-style: none; margin: 0; padding: 0; }
.hero-card li { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.2); display: flex; gap: 10px; }
.hero-card li:last-child { border: 0; }

/* Cards / grid */
.grid { display: grid; gap: 20px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card h3 { font-size: 1.1rem; color: var(--primary-dark); }
.card p { color: var(--muted); margin: 0 0 12px; font-size: .95rem; }
.tag {
  display: inline-block; background: var(--primary-soft); color: var(--primary-dark);
  border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 600;
}
.price-row { display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed var(--line); padding-top: 10px; font-size: .92rem; }
.price { font-weight: 700; color: var(--primary); }
.filters { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.chip {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); font: inherit;
  padding: 7px 18px; border-radius: 999px; cursor: pointer; font-weight: 500;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Doctor / steps */
.doctor { display: grid; grid-template-columns: 280px 1fr; gap: 36px; align-items: center; }
.avatar {
  aspect-ratio: 1; border-radius: var(--radius);
  background: linear-gradient(160deg, var(--primary-soft), #bcd7f5);
  display: grid; place-items: center; font-size: 5rem;
}
.steps { counter-reset: s; }
.step { position: relative; padding-top: 52px; }
.step::before {
  counter-increment: s; content: counter(s);
  position: absolute; top: 14px; left: 22px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700;
}

/* Forms */
form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1.5px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11,94,215,.15); }
.notice { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #e6f6ee; color: #14633d; display: none; }
.notice.show { display: block; }

details.faq { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
details.faq summary { cursor: pointer; font-weight: 600; }
details.faq p { margin: 10px 0 0; color: var(--muted); }

footer { background: #0a2540; color: #c8d6e8; padding: 36px 0; font-size: .92rem; }
footer a { color: #8fc1ff; }
footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }

/* Staff app */
.staff-top { background: var(--primary-dark); color: #fff; }
.staff-top .container { display: flex; justify-content: space-between; align-items: center; height: 60px; }
.staff-top a { color: #cfe3ff; font-size: .9rem; }
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--line); margin: 24px 0; flex-wrap: wrap; }
.tab {
  background: none; border: 0; font: inherit; font-weight: 600; color: var(--muted);
  padding: 10px 18px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tab.active { color: var(--primary); border-color: var(--primary); }
.panel { display: none; }
.panel.active { display: block; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat .num { font-size: 2.1rem; font-weight: 800; color: var(--primary); line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: .88rem; }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; }
.badge { padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge.wait { background: #fff4de; color: var(--warn); }
.badge.doing { background: var(--primary-soft); color: var(--primary-dark); }
.badge.done { background: #e1f5ea; color: var(--ok); }
.badge.cancel { background: #fde8e6; color: var(--bad); }
.inline-form { display: grid; grid-template-columns: 1.2fr 1.4fr .7fr .9fr auto; gap: 10px; align-items: end; margin-bottom: 16px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; }
.num-in { width: 110px; padding: 4px 8px; }
.money { font-weight: 700; color: var(--primary-dark); white-space: nowrap; }
.hist { background: var(--primary-soft); border-radius: 10px; padding: 10px 14px; font-size: .88rem; }
.inline-form label { margin: 0 0 4px; }
.check-group { margin-bottom: 20px; }
.check-group h3 { display: flex; justify-content: space-between; font-size: 1rem; }
.check-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check-item input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.check-item.done span { text-decoration: line-through; color: var(--muted); }
.progress { height: 10px; background: var(--primary-soft); border-radius: 99px; overflow: hidden; margin: 8px 0 20px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); width: 0; transition: width .3s; }
.chart { width: 100%; height: 220px; }
.muted { color: var(--muted); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pin-gate { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #0a3d91, #19a7ce); padding: 16px; }
.pin-box { background: #fff; padding: 32px; border-radius: 18px; width: min(360px, 100%); text-align: center; }
.hidden { display: none !important; }

@media (max-width: 820px) {
  .hero .container, .doctor, .two-col { grid-template-columns: 1fr; }
  .avatar { max-width: 200px; }
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 16px; border-bottom: 1px solid var(--line); align-items: flex-start; }
  .nav.open { display: flex; }
  .inline-form, form .row { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
}
