/* ============================================================
   medtech-v4  |  เว็บไซต์กลุ่มงานเทคนิคการแพทย์ฯ รพ.ศรีสะเกษ
   ธีม: ชมพูบลัช (blush pink) + กระจกฝ้า (glassmorphism)
   ============================================================ */

:root {
  /* ชมพูกุหลาบหม่น (Primary) — ใช้ชื่อ green-* เดิมเพื่อ retheme ทั้งระบบ */
  --green-900: #884c52;   /* กุหลาบเข้ม (หัวข้อ/ตัวอักษรเน้น) */
  --green-700: #b06b72;   /* primary เข้ม (hover) */
  --green-600: #cd8e94;   /* primary */
  --green-500: #e0a8ad;   /* primary อ่อน */
  --green-100: #f7e2e4;   /* อ่อนมาก */
  --green-50:  #fdf4f3;   /* เกือบขาวอมชมพู */

  /* เทาอมชมพู (Neutral) */
  --gray-900: #4a3a3c;
  --gray-700: #6b585b;
  --gray-600: #847073;
  --gray-500: #9c888b;
  --gray-400: #bcaaad;
  --gray-300: #dac9cc;
  --gray-200: #ece0e1;
  --gray-100: #f6ecec;
  --gray-50:  #fbf3f2;

  /* กุหลาบเข้ม (Secondary / accent) */
  --maroon-900: #7a3b44;
  --maroon-700: #9c525b;
  --maroon-600: #b56770;
  --maroon-500: #c97f88;
  --maroon-100: #f7e2e4;

  /* ขาว / สถานะ */
  --white: #ffffff;
  --danger: #d96a6a;
  --warning: #d99a6a;
  --info: #6a8fd9;

  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 2px 10px rgba(176,107,114,.12);
  --shadow-md: 0 10px 26px rgba(176,107,114,.16);
  --shadow-lg: 0 18px 44px rgba(176,107,114,.20);
  --max: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Sarabun', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--gray-900);
  background: linear-gradient(165deg, #fbeae6 0%, #f6dfe1 45%, #f2e3ea 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* sticky footer: ดันแถบลิขสิทธิ์ให้อยู่ล่างสุดเสมอแม้เนื้อหาน้อย */
  display: flex;
  flex-direction: column;
}

a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- Header / Navbar ---------- */
.site-header {
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,.55);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.navbar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gray-900);
  font-weight: 700;
  min-width: 0;       /* ยอมให้ชื่อหน่วยงานยุบ/ตัดบรรทัด แทนการดันเมนูตกลงล่าง */
  flex: 0 1 auto;
}
.brand .brand-text { min-width: 0; }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
}
.brand .logo img {
  width: 100%; height: 100%;
  object-fit: contain;
}
.brand .brand-text small {
  display: block;
  font-weight: 400;
  color: var(--gray-500);
  font-size: .78rem;
}
.brand .brand-text b { font-size: 1.05rem; line-height: 1.2; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  list-style: none;
  flex-wrap: nowrap;        /* เมนูเรียงอยู่แถวบนเดียวกัน ไม่ตกลงล่าง */
}
.nav-links > li { flex: 0 0 auto; }
/* แถบผู้ใช้ที่ล็อกอิน (ชื่อ + จัดการผู้ใช้ + ออกจากระบบ) อยู่ในบรรทัดเดียว */
#userBadge { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--gray-700);
  font-weight: 500;
  transition: all .15s;
}
.nav-links a:hover { background: var(--green-50); color: var(--green-700); text-decoration: none; }
.nav-links a.active { background: var(--green-600); color: #fff; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 1.2rem;
  cursor: pointer;
}

#userBadge { display: flex; align-items: center; gap: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--green-600); color: #fff; }
.btn-primary:hover { background: var(--green-700); }
.btn-outline { background: #fff; color: var(--green-700); border-color: var(--green-600); }
.btn-outline:hover { background: var(--green-50); }
.btn-ghost { background: var(--gray-100); color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-200); }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-block { width: 100%; }

/* ---------- Cards ---------- */
.card {
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-pad { padding: 20px; }

/* ---------- Page header band ---------- */
.page-band {
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  color: #fff;
  padding: 38px 0;
}
.page-band h1 { font-size: 1.8rem; margin-bottom: 4px; }
.page-band p { opacity: .9; }
.page-band .breadcrumb { font-size: .85rem; opacity: .85; margin-bottom: 8px; }
.page-band .breadcrumb a { color: #fff; text-decoration: underline; }

section.pad { padding: 36px 0; }

.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.35rem; color: var(--gray-900);
  margin-bottom: 18px;
}
.section-title::before {
  content: "";
  width: 5px; height: 26px;
  background: var(--green-600);
  border-radius: 4px;
}

/* ---------- Grid helpers ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------- Stat cards ---------- */
.stat {
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.6);
  border-left: 4px solid var(--green-600);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat .label { color: var(--gray-500); font-size: .9rem; }
.stat .value { font-size: 2rem; font-weight: 700; color: var(--gray-900); line-height: 1.1; margin-top: 4px; }
.stat .sub { font-size: .82rem; color: var(--gray-500); margin-top: 4px; }
.stat.green { border-left-color: var(--green-600); }
.stat.gray  { border-left-color: var(--gray-400); }
.stat.warn  { border-left-color: var(--warning); }
.stat.danger{ border-left-color: var(--danger); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
}
.badge-green { background: var(--green-100); color: var(--green-900); }
.badge-gray  { background: var(--gray-200); color: var(--gray-700); }
.badge-warn  { background: #fef3c7; color: #92400e; }
.badge-danger{ background: #fee2e2; color: #991b1b; }
.badge-info  { background: #dbeafe; color: #1e40af; }
.badge-maroon{ background: var(--maroon-100); color: var(--maroon-900); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--gray-200); }
table.data {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255,255,255,.6);
  min-width: 560px;
}
table.data thead th {
  background: var(--green-700);
  color: #fff;
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  font-size: .92rem;
  white-space: nowrap;
}
table.data tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--gray-100);
  font-size: .92rem;
}
table.data tbody tr:nth-child(even) { background: var(--gray-50); }
table.data tbody tr:hover { background: var(--green-50); }

/* ---------- Blood group stock ---------- */
.blood-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; }
.blood-card {
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.blood-card .group {
  font-size: 1.8rem; font-weight: 800; color: var(--green-700);
}
.blood-card .bags { font-size: 1.4rem; font-weight: 700; color: var(--gray-900); }
.blood-card .unit { color: var(--gray-500); font-size: .82rem; }
.bar { height: 8px; background: var(--gray-200); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.bar > span { display: block; height: 100%; background: var(--green-500); border-radius: 999px; }
.bar.low > span { background: var(--warning); }
.bar.critical > span { background: var(--danger); }

/* ---------- News ---------- */
.news-card { display: flex; flex-direction: column; height: 100%; }
.news-card .thumb {
  height: 160px;
  background: linear-gradient(135deg, var(--green-100), var(--gray-100));
  display: grid; place-items: center;
  font-size: 2.4rem; color: var(--green-600);
}
/* แสดงรูปเต็มตามต้นฉบับ (ไม่ครอบตัด) จัดกึ่งกลางทั้งแนวตั้ง/แนวนอน */
.news-card .thumb img {
  width: 100%; height: 100%;
  object-fit: contain; object-position: center;
}
.news-card .body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.news-del, .news-edit {
  margin-left: 8px;
  border: none; border-radius: 999px;
  padding: 2px 10px; font: inherit; font-size: .78rem; font-weight: 600;
  cursor: pointer;
}
.news-del  { background: var(--maroon-100); color: var(--maroon-900); }
.news-del:hover  { background: #f6cdd4; }
.news-edit { background: var(--green-100); color: var(--green-900); }
.news-edit:hover { background: #f0ccd0; }

/* รายการจัดการข่าว (manage-news) */
.manage-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px; margin-bottom: 12px;
}
.manage-thumb {
  flex: 0 0 84px; width: 84px; height: 84px;
  border-radius: var(--radius-sm); overflow: hidden;
  background: linear-gradient(135deg, var(--green-100), var(--gray-100));
  display: grid; place-items: center; font-size: 2rem;
}
.manage-thumb img { width: 100%; height: 100%; object-fit: cover; }
.manage-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.manage-info p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.manage-actions { display: flex; flex-direction: column; gap: 8px; flex: 0 0 auto; }
@media (max-width: 600px) {
  .manage-row { flex-wrap: wrap; }
  .manage-actions { flex-direction: row; width: 100%; }
}

/* รายการข่าวแบบคอลัมน์เดียว (การ์ดแนวนอน) */
.news-list { display: flex; flex-direction: column; gap: 26px; max-width: 760px; margin: 0 auto; }
.news-list .news-card { flex-direction: column; }
.news-list .news-card .thumb {
  width: 100%; height: auto; min-height: 180px; font-size: 4.5rem;
  background: var(--gray-100);
}
/* รูปเต็มความกว้าง สูงตามสัดส่วนต้นฉบับ (แสดงครบทั้งภาพ ไม่ครอบตัด ไม่มีขอบว่าง) */
.news-list .news-card .thumb img {
  width: 100%; height: auto; max-height: none;
}
.news-card .meta { color: var(--gray-500); font-size: .82rem; }
.news-card h3 { font-size: 1.05rem; color: var(--gray-900); }
.news-card p { color: var(--gray-600); font-size: .92rem; }
/* ตัดข้อความข่าวให้พอดี 4 บรรทัด แล้วกดอ่านเพิ่มเติมเพื่อขยาย */
.news-card .news-summary {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
}
.news-card .news-summary.expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* ===== กล่องพิมพ์ข้อความแบบมีรูปแบบ (Rich Text) ===== */
.rte {
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.rte-toolbar {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 6px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}
.rte-toolbar button {
  min-width: 34px; height: 30px; padding: 0 8px;
  border: 1px solid var(--gray-300); background: #fff;
  border-radius: 6px; cursor: pointer;
  font-size: .9rem; line-height: 1; color: var(--gray-700);
}
.rte-toolbar button:hover { background: var(--gray-200); }
.rte-area {
  min-height: 150px; padding: 12px 14px;
  outline: none; line-height: 1.7;
  word-break: break-word;
}
.rte-area:focus { box-shadow: inset 0 0 0 2px var(--green-100); }
.rte-area.is-empty::before {
  content: attr(data-placeholder);
  color: var(--gray-400);
}
/* การแสดงผลรายการ/ย่อหน้าในข้อความที่จัดรูปแบบ */
.rte-area ul, .news-summary ul, .news-rich ul { padding-left: 1.5em; list-style: disc; margin: .3em 0; }
.rte-area ol, .news-summary ol, .news-rich ol { padding-left: 1.5em; list-style: decimal; margin: .3em 0; }
.rte-area p,  .news-summary p,  .news-rich p  { margin: 0 0 .5em; }
.news-more {
  align-self: flex-start;
  background: none; border: none; padding: 0;
  color: var(--maroon-700); font: inherit; font-size: .85rem; font-weight: 600;
  cursor: pointer;
}
.news-more:hover { text-decoration: underline; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; font-size: .92rem; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .95rem;
  background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px var(--green-100);
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  margin-bottom: 14px;
}
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: var(--green-100); color: var(--green-900); border: 1px solid var(--green-500); }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--green-700) 0%, var(--green-600) 100%);
  color: #fff;
  padding: 56px 0;
}
/* รูปภาพพื้นหลัง Hero แบบจางๆ ซ้อนหลังข้อความ */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../images/hero-lab.jpg") center/cover no-repeat;
  opacity: .18;
  z-index: 0;
}
/* ไล่เฉดทับรูปเล็กน้อย ช่วยให้ตัวอักษรอ่านง่ายขึ้น */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,.10), rgba(0,0,0,0) 60%);
  z-index: 0;
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.hero h1 { font-size: 2.4rem; line-height: 1.3; margin-bottom: 6px; max-width: 20ch; text-wrap: balance; }
.hero p { font-size: 1.1rem; opacity: .95; max-width: 56ch; text-wrap: balance; }
.hero .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.hero .hero-art {
  position: absolute;
  right: 24px; bottom: 12px;
  font-size: 5rem; line-height: 1; opacity: .35;
  pointer-events: none;
}

/* quick links */
.quicklinks { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; }
.quicklink {
  background: rgba(255,255,255,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.6); border-radius: var(--radius);
  padding: 22px; text-align: center; box-shadow: var(--shadow);
  transition: all .15s; color: var(--gray-800);
}
.quicklink:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); text-decoration: none; border-color: var(--green-300, #86efac); }
.quicklink .ico { font-size: 2.2rem; margin-bottom: 8px; }
.quicklink b { display: block; color: var(--gray-900); }
.quicklink small { color: var(--gray-500); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 32px 0 18px;
  margin-top: auto;   /* ดันลงล่างสุดเมื่อเนื้อหาสั้น */
}
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.site-footer h4 { color: #fff; margin-bottom: 10px; font-size: 1rem; }
.site-footer a { color: var(--gray-300); }
.site-footer a:hover { color: var(--green-500); }
.site-footer .copyright {
  border-top: 1px solid var(--gray-700);
  margin-top: 22px; padding-top: 14px;
  text-align: center; color: var(--gray-400); font-size: .85rem;
}

/* ---------- Auth-only helpers ---------- */
.auth-only { display: none; }
.muted { color: var(--gray-500); }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.hint-box {
  background: var(--green-50);
  border: 1px dashed var(--green-500);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: .85rem;
  color: var(--green-900);
}

/* ---------- Blood bank summary (pivot) ---------- */
.bb-section {
  background: linear-gradient(135deg, var(--green-700) 0%, var(--green-600) 100%);
  padding: 40px 20px;
}
.bb-card {
  max-width: 1000px;
  margin: 0 auto;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.65);
  border-top: 5px solid var(--maroon-600);
  border-radius: 22px;
  padding: 34px 30px;
  box-shadow: var(--shadow-lg);
}
.bb-card h1 {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  text-align: center;
  color: var(--maroon-700);
  font-size: 1.7rem;
  line-height: 1.3;
}
.bb-sub { text-align: center; color: var(--gray-500); margin: 6px 0 22px; }

.bb-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 620px;
  background: rgba(255,255,255,.65);
}
.bb-table th, .bb-table td {
  padding: 14px 16px;
  text-align: center;
  font-size: .98rem;
}
.bb-table thead th { color: #3a3550; font-weight: 700; }
.bb-table thead th.bb-rowhead {
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  color: #fff;
  text-align: left;
  font-size: 1rem;
}
.bb-table tbody td { border-bottom: 1px solid #eef0f6; color: var(--gray-800, #1f2937); }
.bb-table tbody td:first-child { text-align: left; font-weight: 500; }
.bb-table tbody tr:last-child td { border-bottom: none; }
.bb-avail td { font-weight: 700; }
.bb-avail .bb-avail-head { background: #cdeccf; color: var(--maroon-700); font-weight: 700; }

.bb-foot { text-align: center; color: var(--gray-500); margin-top: 18px; }
.bb-center { text-align: center; }
.bb-btn {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px;
  padding: 12px 28px;
  border: none; border-radius: 999px;
  font-family: inherit; font-size: .98rem; font-weight: 700;
  color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  box-shadow: 0 6px 16px rgba(176,107,114,.35);
  transition: all .15s;
}
.bb-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }

/* ---------- Calendar (ปฏิทินออกหน่วย) ---------- */
.cal-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.cal-title { font-size: 1.25rem; color: var(--green-700); text-align: center; flex: 1; }

.cal-scroll { overflow-x: auto; }
.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  min-width: 680px;
}
.cal-dow {
  text-align: center; font-weight: 700; color: var(--gray-600);
  padding: 8px 0; font-size: .9rem;
}
.cal-cell {
  min-height: 104px;
  min-width: 0;            /* ไม่ให้ช่องขยายตามความยาวข้อความ */
  border: 1px solid rgba(255,255,255,.6);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px;
  display: flex; flex-direction: column; gap: 4px;
}
.cal-cell.empty { background: var(--gray-50); border-style: dashed; }
.cal-cell.editable { cursor: pointer; }
.cal-cell.editable:hover { background: var(--green-50); border-color: var(--green-500); }
.cal-cell.today { border-color: var(--green-600); box-shadow: inset 0 0 0 2px var(--green-100); }
.cal-date { font-size: .82rem; font-weight: 700; color: var(--gray-700); }
.cal-cell.today .cal-date {
  background: var(--green-600); color: #fff;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
}
.cal-ev {
  display: block; width: 100%; text-align: left;
  border: none; cursor: pointer;
  font: inherit; font-size: .72rem; line-height: 1.3;
  padding: 3px 6px; border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-ev.ok   { background: var(--green-100); color: var(--green-900); }
.cal-ev.wait { background: #fef3c7; color: #92400e; }
.cal-ev:hover { filter: brightness(.96); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero h1 { font-size: 1.9rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .bb-card { padding: 22px 16px; }
  .bb-card h1 { font-size: 1.3rem; }
  .site-footer .cols { grid-template-columns: 1fr; }

  .nav-toggle { display: inline-block; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    margin-top: 12px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; border-radius: var(--radius-sm); }
  .navbar { flex-wrap: wrap; }
}
