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

:root{
  --brand: rgb(134,202,237);
  --brand-dark: rgb(65, 160, 210);
  --ink: #0f172a;
  --muted: #64748b;
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #e5eaf2;
  --shadow: 0 10px 30px rgba(0,0,0,0.12);
  --shadow-sm: 0 6px 18px rgba(0,0,0,0.08);
}

body { 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
  background: var(--bg);
  color: var(--ink);
}

/* --- Home (Main Menu) like your example index.html --- */
body.home {
  background: linear-gradient(135deg, rgba(134,202,237,0.95) 0%, rgba(65,160,210,0.95) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container { max-width: 900px; width: 92%; margin: 0 auto; }

.header { text-align: center; color: white; margin-bottom: 44px; }
.header h1 { font-size: 44px; margin-bottom: 10px; letter-spacing: .3px; }
.header p { font-size: 16px; opacity: 0.95; font-weight: 600; }

.menu-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
  gap: 22px; 
}

.menu-card { 
  background: white; 
  padding: 34px 26px; 
  border-radius: 14px; 
  text-align: center; 
  cursor: pointer; 
  transition: all 0.25s; 
  box-shadow: 0 10px 30px rgba(0,0,0,0.20); 
  text-decoration: none; 
  color: inherit; 
  border: 1px solid rgba(255,255,255,.10);
}

.menu-card:hover { 
  transform: translateY(-6px); 
  box-shadow: 0 16px 42px rgba(0,0,0,0.28); 
}

.menu-card .icon { font-size: 44px; margin-bottom: 14px; }
.menu-card h2 { color: #1f2937; margin-bottom: 8px; font-size: 22px; }
.menu-card p { color: #64748b; font-size: 13px; font-weight: 600; }

.card-1 .icon { color: #22c55e; }
.card-2 .icon { color: rgb(65,160,210); }
.card-3 .icon { color: #f59e0b; }

.hr-lite{
  height:1px; border:none; background: rgba(255,255,255,.22); margin: 20px 0 16px;
}
.admin-title{
  color: rgba(255,255,255,.92);
  text-align:center;
  font-size: 14px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 800;
  margin: 8px 0 18px;
}

/* --- Navbar (for internal pages) like manage.html --- */
.navbar { 
  background: linear-gradient(135deg, rgba(134,202,237,0.98) 0%, rgba(65,160,210,0.98) 100%); 
  color: white; 
  padding: 14px 26px; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  box-shadow: 0 2px 12px rgba(0,0,0,0.12); 
}

.navbar h1 { font-size: 20px; letter-spacing: .2px; }

.navbar .user-info { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
}

.badge { 
  background: rgba(255,255,255,0.22); 
  padding: 6px 14px; 
  border-radius: 999px; 
  font-size: 13px; 
  font-weight: 700;
}
/*
.btn { 
  background: rgba(255,255,255,0.18); 
  color: white; 
  border: 1px solid rgba(255,255,255,0.55); 
  padding: 8px 16px; 
  border-radius: 10px; 
  cursor: pointer; 
  text-decoration: none; 
  font-weight: 700;
  transition: .2s ease;
}
.btn:hover { background: rgba(255,255,255,0.26); transform: translateY(-1px); }

.btn-primary { 
  background: rgb(65,160,210); 
  color: white; 
  width: 100%; 
  border: none;
}
.btn-primary:hover { filter: brightness(0.95); }

.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
*/
/* --- Login --- */
#loginScreen{
  min-height: 100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 26px;
  background: radial-gradient(900px 500px at 20% 10%, rgba(134,202,237,.25), transparent 60%),
              radial-gradient(900px 500px at 90% 10%, rgba(65,160,210,.18), transparent 60%),
              var(--bg);
}

.login-box { 
  max-width: 420px; 
  width: 100%;
  background: white; 
  padding: 38px; 
  border-radius: 14px; 
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}

.login-box h2 { 
  margin-bottom: 12px; 
  color: #111827; 
  text-align: center; 
}

/* --- Layout for internal pages --- */
.page-container { 
  max-width: 1200px; 
  margin: 26px auto; 
  padding: 0 20px; 
}

.content-area { 
  background: white; 
  padding: 26px; 
  border-radius: 14px; 
  box-shadow: 0 2px 12px rgba(0,0,0,0.06); 
  margin-top: 18px; 
  border: 1px solid var(--line);
}

.form-card { 
  background: #f9fbff; 
  padding: 22px; 
  border-radius: 12px; 
  margin-bottom: 18px; 
  border: 1px solid #eaf0ff;
}

.form-card h3 { margin-bottom: 14px; color: #111827; }

/* Forms */
.form-group { margin-bottom: 16px; }

label { display: block; margin-bottom: 8px; color: #475569; font-weight: 700; }

input, select, textarea { 
  width: 100%; 
  padding: 12px; 
  border: 1px solid #dbe3f3; 
  border-radius: 10px; 
  font-size: 14px; 
}
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(134,202,237,.95); box-shadow: 0 0 0 4px rgba(134,202,237,.25); }

/* Info box */
.info-box { 
  background: #e9f7ff; 
  color: #0b4b62; 
  padding: 16px; 
  border-radius: 12px; 
  border-left: 5px solid rgb(65,160,210); 
  font-weight: 650;
}

/* Table */
table { width: 100%; border-collapse: collapse; margin-top: 16px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #eef2f7; font-size: 14px; }
th { background: #f8fafc; font-weight: 800; color: #334155; }

/* Status pill */
.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 12px;
  border: 1px solid #e2e8f0; color: #334155; background: #f8fafc;
}
.pill.ok{ background: rgba(34,197,94,.10); border-color: rgba(34,197,94,.25); color:#166534; }
.pill.warn{ background: rgba(245,158,11,.10); border-color: rgba(245,158,11,.25); color:#92400e; }
.pill.bad{ background: rgba(239,68,68,.10); border-color: rgba(239,68,68,.25); color:#991b1b; }

th.sortable{ cursor:pointer; user-select:none; }
th.sortable:hover{ text-decoration: underline; }
.sort-ind{ font-weight:900; opacity:.75; }

/* Toggle */
.switch{
  position: relative;
  display:inline-block;
  width: 46px;
  height: 26px;
}
.switch input{ display:none; }
.slider{
  position:absolute; cursor:pointer; inset:0;
  background:#e2e8f0;
  border:1px solid #dbe3f3;
  transition:.15s;
  border-radius:999px;
}
.slider:before{
  position:absolute; content:"";
  height: 20px; width: 20px;
  left: 3px; top: 2px;
  background:white;
  transition:.15s;
  border-radius:999px;
  box-shadow: 0 6px 14px rgba(2,6,23,.18);
}
.switch input:checked + .slider{
  background: rgba(134,202,237,.90);
  border-color: rgba(134,202,237,.90);
}
.switch input:checked + .slider:before{
  transform: translateX(20px);
}

/* Modal */
/* ปิดไว้: ทุกหน้าใช้ Bootstrap modal แล้ว และ max-width: 520px ที่นี่จะไปทับ
   .modal-dialog ของ Bootstrap ทำให้ modal-lg / modal-xl ไม่ทำงาน
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
}
.modal-content {
  background: white;
  padding: 26px;
  border-radius: 12px;
  max-width: 520px;
  margin: 90px auto;
}
*/


/* choice tiles */
.choice-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 12px;
}
.choice-tile{
  background:#fff;
  border:1px solid #e6edf7;
  border-radius: 14px;
  padding: 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  cursor:pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,0.06);
  transition: .16s ease;
  user-select:none;
}
#points_groups .choice-tile{
    display:block;
}
#spray_out_groups .group-checkbox{
  position:absolute;
  top:.3em;
  left:.3em;
  width:initial;
}
.choice-tile:hover{ transform: translateY(-2px); box-shadow: 0 12px 26px rgba(0,0,0,0.10); }
.choice-tile .left{ display:flex; flex-direction:column; gap:6px; }
.choice-tile .title{ font-weight: 900; color:#0f172a; }
.choice-tile .sub{ font-size:12px; color:#64748b; font-weight:700; }
.choice-tile .check{
  width: 25px; height: 25px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  display:grid; place-items:center;
  color: transparent;
  font-weight: 900;
}
.choice-tile.selected{
  border-color: rgba(134,202,237,.95);
  box-shadow: 0 14px 34px rgba(0,0,0,0.12);
}
.choice-tile.selected .check{
  border-color: rgba(134,202,237,.95);
  background: rgba(134,202,237,.95);
  color: white;
}
.choice-tile.compact{ padding: 12px 14px; }

/* status colors for spray_out */
.status-green{
  background: rgba(34, 197, 94, .12) !important;
  border-color: rgba(34, 197, 94, .35) !important;
}
.status-red{
  background: rgba(239, 68, 68, .12) !important;
  border-color: rgba(239, 68, 68, .35) !important;
}

.text-green{ color: #166534 !important; font-weight: 900; }
.text-red{ color: #991b1b !important; font-weight: 900; }

.group-zones{
  margin-top: 10px;
  padding-left: 10px;
  border-left: 3px solid rgba(148, 163, 184, .35);
}

.zone-item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px;
  border-radius: 10px;
}

.zone-item:hover{ background: rgba(148, 163, 184, .10); }

.zone-item input[type="checkbox"]{
  width: 18px;
  height: 18px;
}

.collapse-toggle{
  user-select: none;
}

.collapse-toggle .sub{
  opacity: .9;
}
  #spray_out_booths .choice-tile{
position:relative;
  }
   #spray_out_booths .choice-tile .check{
        position: absolute;
    right: .3em;
   }
   