/* GoDensityHos — โทน windows-classic น้ำเงิน ตามแนว GoCard/pharmGO */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Sarabun', 'Leelawadee UI', sans-serif;
  font-size: 13px; color: #22313f; background: #eef2f6;
}

/* ── top bar ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(90deg, #1a5276, #003366);
  color: #fff; padding: 8px 14px; box-shadow: 0 2px 4px rgba(0,0,0,.25);
  position: sticky; top: 0; z-index: 50; flex-wrap: wrap;
}
.topbar .brand { font-weight: 700; font-size: 14px; }
.topbar nav { display: flex; align-items: center; gap: 12px; }
.topbar nav a { color: #dceaf5; text-decoration: none; font-weight: 600; }
.topbar nav a:hover { color: #fff; text-decoration: underline; }
.topbar .who { color: #bcd6ea; font-size: 12px; }
.page { padding: 8px 10px; }

/* ── buttons ── */
.btn {
  display: inline-block; padding: 4px 14px; font-family: inherit; font-size: 12.5px;
  border: 1px solid #7a8ba0; border-radius: 4px; cursor: pointer;
  background: linear-gradient(#fdfefe, #dfe8ef); color: #22313f;
}
.btn:hover { background: linear-gradient(#ffffff, #cfdde9); }
.btn:active { background: #cfdde9; }
.btn-primary { background: linear-gradient(#3d7cad, #1a5276); border-color: #12405e; color: #fff; font-weight: 600; }
.btn-primary:hover { background: linear-gradient(#4a8cbf, #1f6291); }
.btn-success { background: linear-gradient(#2eb886, #148f54); border-color: #0e6e40; color: #fff; font-weight: 600; }
.btn-success:hover { background: linear-gradient(#37c993, #17a260); }
.btn-sm { padding: 2px 10px; font-size: 12px; }

/* ── VB-style frame + form grid ── */
fieldset.vb-frame {
  border: 1px solid #9fb2c4; border-radius: 4px; background: #f7fafc;
  padding: 8px 12px; margin: 0 0 8px;
}
fieldset.vb-frame legend { color: #1a5276; font-weight: 700; font-size: 12.5px; padding: 0 6px; }
.field-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.field-grid label { color: #33556e; }
input[type=text], input[type=date], input[type=number], input[type=password], select {
  font-family: inherit; font-size: 12.5px; padding: 3px 6px;
  border: 1px solid #9fb2c4; border-radius: 3px; background: #fff; color: #22313f;
}
input:focus, select:focus { outline: 2px solid #7fb3d8; outline-offset: 0; }

/* ── data table (ตารางข้อมูลทุกจอ) ── */
.tbl-scroll { overflow-x: auto; background: #fff; border: 1px solid #9fb2c4; border-radius: 4px; }
.data-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.data-table th {
  background: linear-gradient(#eaf1f7, #d7e3ee); color: #1a5276; font-weight: 700;
  text-align: left; padding: 6px 10px; border-bottom: 2px solid #9fb2c4;
  border-right: 1px solid #d7e3ee; white-space: nowrap;
  position: sticky; top: 0;
}
.data-table td { padding: 5px 10px; border-bottom: 1px solid #e3eaf1; border-right: 1px solid #eef2f6; vertical-align: middle; }
.data-table tbody tr:nth-child(even) { background: #f4f8fb; }
.data-table tbody tr:hover { background: #eaf3fa; }

/* ── status line + misc ── */
.findpt-status {
  background: #fffbe8; border: 1px solid #e3d38f; border-radius: 3px;
  color: #6b5d1f; padding: 3px 10px; font-size: 12px; margin-bottom: 4px;
}
.empty-row { text-align: center; color: #8a97a8; padding: 12px !important; }

/* ── ปฏิทิน พ.ศ. (goglink-ui.js) ── */
.thdate-disp {
  font-family: inherit; font-size: 12.5px; padding: 3px 6px;
  border: 1px solid #9fb2c4; border-radius: 3px; background: #fff; color: #22313f;
  width: 110px;
}
.thdate-disp:focus { outline: 2px solid #7fb3d8; outline-offset: 0; }
.thdate-pop {
  position: fixed; z-index: 9500; background: #fff;
  border: 1px solid #9fb2c4; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 20, 40, .3); padding: 8px;
  font-size: 13px;
}
.thdate-head { display: flex; gap: 4px; align-items: center; margin-bottom: 5px; }
.thdate-head select { font-size: 12.5px; padding: 1px 3px; }
.thdate-head button {
  width: 26px; height: 24px; padding: 0; cursor: pointer; border-radius: 4px;
  background: linear-gradient(#fdfefe, #dfe8ef); border: 1px solid #7a8ba0; font-size: 12px;
}
.thdate-grid { display: grid; grid-template-columns: repeat(7, 32px); gap: 1px; text-align: center; }
.thdate-grid .dow { font-size: 10.5px; color: #6b7d92; padding: 2px 0; font-weight: 700; }
.thdate-grid .day { padding: 4px 0; cursor: pointer; border-radius: 4px; }
.thdate-grid .day:hover { background: #3d7cad; color: #fff; }
.thdate-grid .day.other { color: #b8c4cf; }
.thdate-grid .day.today { outline: 1.5px solid #1a5276; font-weight: 700; }
.thdate-grid .day.sel { background: #1a5276; color: #fff; font-weight: 700; }
.thdate-foot { display: flex; gap: 4px; margin-top: 6px; }
.thdate-foot button {
  flex: 1; font-family: inherit; font-size: 12px; padding: 3px 6px; cursor: pointer;
  background: linear-gradient(#fdfefe, #dfe8ef); border: 1px solid #7a8ba0; border-radius: 4px;
}

/* ── selfilter (ช่องค้นหาเจ้าหน้าที่ — แบบ HimGo) ── */
.selfilter-pop {
  position: fixed; z-index: 9700; min-width: 260px; max-width: 480px;
  background: #fff; border: 1px solid #9fb2c4; border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 20, 40, .25); overflow: hidden;
}
.selfilter-list { overflow-y: auto; max-height: 300px; padding: 4px; }
.selfilter-item {
  padding: 5px 10px; font-size: 13px; cursor: pointer; border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: baseline; gap: 8px;
}
.selfilter-item:hover, .selfilter-item.hi { background: #1a5276; color: #fff; }
.selfilter-item:hover small, .selfilter-item.hi small { color: #bcd6ea !important; }
.selfilter-empty { padding: 10px; font-size: 12px; color: #8a97a8; text-align: center; }

/* ── glkModal (แทน prompt/confirm) ── */
.glk-modal-bg {
  position: fixed; inset: 0; z-index: 9600; background: rgba(10, 30, 50, .45);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 14vh;
}
.glk-modal {
  background: #fff; border-radius: 10px; padding: 18px 22px; min-width: 320px; max-width: 440px;
  box-shadow: 0 16px 48px rgba(0, 20, 40, .4);
}
.glk-m-title { font-size: 14.5px; font-weight: 700; color: #1a5276; margin-bottom: 10px; line-height: 1.5; }
.glk-m-input {
  width: 100%; box-sizing: border-box; font-family: inherit; font-size: 14px; padding: 7px 10px;
  border: 1px solid #9fb2c4; border-radius: 5px; margin-bottom: 12px;
}
.glk-m-input:focus { outline: 2px solid #7fb3d8; }
.glk-m-btns { display: flex; gap: 8px; justify-content: flex-end; }
.glk-m-btns .btn { padding: 5px 18px; font-size: 13px; }

/* ── login ── */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a5276, #0d3350 60%, #062338);
}
.login-card {
  width: 340px; background: #fff; border-radius: 10px; padding: 26px 30px;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
.login-head { text-align: center; margin-bottom: 14px; }
.login-head .logo { font-size: 38px; }
.login-head h1 { margin: 4px 0 2px; font-size: 22px; color: #1a5276; }
.login-head .sub { font-size: 12.5px; color: #6b7d92; line-height: 1.5; }
.login-card label { display: block; margin: 10px 0 3px; font-weight: 600; color: #33556e; }
.login-card input { width: 100%; padding: 7px 9px; font-size: 14px; }
.login-err {
  background: #fde7e3; border: 1px solid #e2a59a; color: #b03a2e;
  border-radius: 4px; padding: 6px 10px; font-size: 12.5px; margin-bottom: 6px;
}
.login-foot { margin-top: 16px; text-align: center; font-size: 11px; color: #9aa8b8; }
