/* =============================
   โรงพยาบาลบ้านผือ - Webboard CSS
   ============================= */

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

body {
  font-family: 'Sarabun', 'Segoe UI', sans-serif;
  background: #f4f6f5;
  color: #1a1a1a;
  font-size: 14px;
}

a { text-decoration: none; color: inherit; }

.wb {
  padding: 1.5rem 1rem;
  max-width: 980px;
  margin: 0 auto;
}

/* ---- TOPBAR ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.30rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 15px;
  padding: 12px 18px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #00CC00;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #fff;
}
.topbar-left h2 { font-size: 18px; font-weight: 600; color: #1a1a1a; }
.sub-title { font-size: 12px; color: #777; margin-top: 1px; }
.btn-new {
  display: inline-flex; align-items: center; gap: 8px;
  background: #00CC00; color: #fff;
  border: none; border-radius: 8px;
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.btn-new:hover { background: #00CC00; }

/* ---- LAYOUT ---- */
.layout {
  display: grid;
  grid-template-columns: 200px minmax(0,1fr);
  gap: 14px;
  align-items: start;
}

/* ---- SIDEBAR ---- */
.sidebar { display: flex; flex-direction: column; gap: 10px; }

.notice {
  background: #FFF9E6;
  border: 1px solid #FFD966;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: #7A5200;
  line-height: 1.6;
}

.sbox {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}
.sbox-head {
  padding: 10px 14px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 12px;
  font-weight: 600;
  color: #555;
}

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
}
.cat-item:last-child { border-bottom: none; }
.cat-item:hover { background: #f5fff5; }
.cat-item.active { background: #eaffea; }
.cat-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #333;
}
.cat-item.active .cat-left { color: #006600; font-weight: 600; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cat-num {
  font-size: 11px;
  background: #f0f0f0;
  color: #777;
  padding: 2px 7px;
  border-radius: 20px;
}
.cat-item.active .cat-num { background: #99E899; color: #005500; }

.faq-text { font-size: 12px; color: #555; }

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid #f0f0f0;
}
.stat-row:last-child { border-bottom: none; }
.stat-label { font-size: 12px; color: #666; }
.stat-val { font-size: 13px; font-weight: 600; color: #1a1a1a; }

/* ---- MAIN ---- */
.main { display: flex; flex-direction: column; gap: 8px; }

.searchbar { display: flex; gap: 6px; }
.searchbar input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.searchbar input:focus { border-color: #00CC00; }
.searchbar button {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  background: #f5f5f5;
  cursor: pointer;
}
.searchbar button:hover { background: #e8f5e8; }

.filters { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  border: 1px solid #ddd;
  background: #fff;
  color: #666;
  cursor: pointer;
  transition: all 0.12s;
}
.chip:hover { border-color: #00CC00; color: #006600; }
.chip.active { background: #eaffea; color: #006600; border-color: #00CC00; font-weight: 500; }

/* ---- CARD ---- */
.card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 13px 15px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover { border-color: #00CC00; box-shadow: 0 2px 8px rgba(0,204,0,0.08); }

.card-top { display: flex; align-items: flex-start; gap: 10px; }

.av {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  flex-shrink: 0;
}
.av-green  { background: #eaffea; color: #006600; }
.av-blue   { background: #E6F1FB; color: #0C447C; }
.av-coral  { background: #FAECE7; color: #712B13; }
.av-amber  { background: #FAEEDA; color: #633806; }
.av-purple { background: #EEEDFE; color: #3C3489; }
.av-teal   { background: #E1F5EE; color: #085041; }
.av-pink   { background: #FBEAF0; color: #72243E; }

.card-body { flex: 1; min-width: 0; }

.card-tags {
  display: flex; align-items: center;
  gap: 5px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.unread-dot {
  width: 7px; height: 7px;
  border-radius: 50%; background: #00CC00;
  flex-shrink: 0;
}
.tag {
  font-size: 10px; padding: 2px 7px;
  border-radius: 20px; font-weight: 600;
}
.tag-new     { background: #eaffea; color: #006600; }
.tag-hot     { background: #FAECE7; color: #712B13; }
.tag-answered{ background: #E6F1FB; color: #0C447C; }
.tag-urgent  { background: #FCEBEB; color: #791F1F; }

.cat-tag {
  font-size: 10px; padding: 2px 7px;
  border-radius: 20px; font-weight: 500;
}

.card-title {
  font-size: 13px; font-weight: 600;
  color: #1a1a1a; margin-bottom: 3px;
  line-height: 1.5;
}
.card-sub {
  font-size: 12px; color: #888;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-meta {
  display: flex; align-items: center;
  gap: 12px; margin-top: 8px; flex-wrap: wrap;
}
.meta-item { font-size: 11px; color: #999; }
.doctor-badge { color: #00AA00; font-weight: 500; }

.card-right {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 6px; flex-shrink: 0;
}
.del-btn {
  background: none; border: none; cursor: pointer;
  color: #bbb; padding: 4px; border-radius: 5px;
  font-size: 14px; transition: all 0.12s;
}
.del-btn:hover { background: #FCEBEB; color: #A32D2D; }
.by-name { font-size: 11px; color: #aaa; }

/* ---- FOOTER ---- */
.footer {
  display: flex; justify-content: space-between;
  align-items: center; margin-top: 10px;
}
.footer-info { font-size: 11px; color: #999; }
.pages { display: flex; gap: 3px; }
.pg {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 12px;
  border: 1px solid #ddd; cursor: pointer;
  color: #666; background: #fff;
  transition: all 0.12s;
}
.pg:hover { border-color: #00CC00; color: #006600; }
.pg.on { background: #00CC00; color: #fff; border-color: #00CC00; }

/* ---- RESPONSIVE ---- */
@media (max-width: 680px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
}
