/* ============================================================
   X10 Brand — Visual Identity
   อ้างอิง: 2506 Brand Masterbook (The X10)
     สีหลัก  Classic Blue  #0f4c83
     สีรอง   Orange        #f68a39
     สีพื้น   ขาว
     ฟอนต์    Prompt (จากรายการฟอนต์แบรนด์ที่มีบน Google Fonts)
   แก่นแบรนด์: "เราไม่ได้สร้าง Resort แต่เราสร้างรอยยิ้ม"
   DNA: Friendly · Funny · Family · From the Heart
   Key message: คุ้ม · สนุก · เป็นกันเอง

   ไฟล์นี้โหลดหลัง Tailwind CDN จึงใช้ทับ utility สีฟ้าเดิมได้
   ============================================================ */

:root {
  /* ── สีหลัก Classic Blue ── */
  --x10-blue-900: #072a4e;
  --x10-blue-800: #0a3763;
  --x10-blue-700: #0f4c83;   /* สีหลักของแบรนด์ */
  --x10-blue-600: #145c9d;
  --x10-blue-500: #1b6bb0;
  --x10-blue-100: #e3edf7;
  --x10-blue-50:  #f2f7fc;

  /* ── สีรอง Orange (ใช้เน้นจุดสำคัญ ปุ่มหลักของพนักงาน รอยยิ้ม) ── */
  --x10-orange-700: #c96a1f;
  --x10-orange-600: #e0752a;
  --x10-orange-500: #f68a39;  /* สีรองของแบรนด์ */
  --x10-orange-100: #fdeee1;
  --x10-orange-50:  #fef7f1;

  /* ── ใช้งานทั่วไป ── */
  --brand:      var(--x10-blue-700);
  --brand-dark: var(--x10-blue-800);
  --brand-soft: var(--x10-blue-100);
  --accent:     var(--x10-orange-500);
  --accent-dark:var(--x10-orange-600);
  --page-bg:    #f4f7fb;
  --ink:        #16283c;
  --ink-soft:   #5a6b7d;
  --line:       #e2e9f1;

  --radius-card: 16px;
  --radius-btn: 10px;
  --shadow-card: 0 1px 3px rgba(15, 76, 131, .08), 0 8px 24px -16px rgba(15, 76, 131, .18);
  --shadow-lift: 0 10px 28px -14px rgba(15, 76, 131, .35);
}

/* ── ตัวอักษร ─────────────────────────────────────────────── */
* {
  font-family: 'Prompt', 'Noto Sans Thai', 'Noto Sans Myanmar',
               'Noto Sans Khmer', 'Noto Sans Lao', system-ui, sans-serif;
}
body { color: var(--ink); }
/* หน้าจอผู้ดูแล (พื้นเรียบ) — หน้าพนักงานใช้ .x10-bg-hero ด้านล่างแทน */
body.x10-bg-flat { background: var(--page-bg); }
/* หน้าพนักงาน/จอ QR — น้ำเงินแบรนด์ไล่ลงพื้นอ่อน */
body.x10-bg-hero {
  background: linear-gradient(170deg, var(--x10-blue-700) 0%, var(--x10-blue-900) 42%, var(--page-bg) 42%);
  min-height: 100vh;
}
body.x10-bg-solid {
  background: linear-gradient(150deg, var(--x10-blue-800), var(--x10-blue-700) 55%, #2f7cb8);
  min-height: 100vh;
}

/* ── โครงหลัก ─────────────────────────────────────────────── */
.sidebar {
  background: linear-gradient(180deg, var(--x10-blue-800) 0%, var(--x10-blue-900) 100%);
}
.nav-item.active { background: #fff; color: var(--x10-blue-700); }
.nav-item:hover  { background: rgba(255, 255, 255, .12); }

/* แถบหัวเรื่อง — ไล่จากน้ำเงินแบรนด์ไปหาส้มจาง ๆ ให้รู้สึกอบอุ่นแบบแบรนด์ */
.hero {
  background: linear-gradient(115deg, var(--x10-blue-700) 0%, var(--x10-blue-600) 62%, #2f7cb8 100%);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; right: -40px; top: -60px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 138, 57, .30) 0%, rgba(246, 138, 57, 0) 70%);
  pointer-events: none;
}

.card {
  background: #fff; border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); border: 1px solid rgba(226, 233, 241, .8);
}

/* ── ตาราง ────────────────────────────────────────────────── */
table.grid th { background: var(--x10-blue-700); }
table.grid tbody tr:hover { background: var(--x10-blue-50); }
table.grid td { border-bottom: 1px solid var(--line); }

/* ── ปุ่ม ─────────────────────────────────────────────────── */
.btn { border-radius: var(--radius-btn); }
.btn-p { background: var(--brand); }
.btn-p:hover { background: var(--brand-dark); }
/* ปุ่มเน้น (call to action ของพนักงาน) ใช้สีรองของแบรนด์ */
.btn-a { background: var(--accent); color: #fff; }
.btn-a:hover { background: var(--accent-dark); }

/* ── ช่องกรอก ─────────────────────────────────────────────── */
input, select, textarea { border-color: #d3dde8; border-radius: var(--radius-btn); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--x10-blue-100); border-color: var(--brand);
}

/* ── remap สีฟ้ามาตรฐานของ Tailwind → สีแบรนด์ ──────────────
   หน้าจอเดิมใช้ utility เช่น bg-blue-600 อยู่หลายจุด
   แทนที่จะแก้ทุกไฟล์ ใช้การทับค่าที่นี่ให้เป็นสีแบรนด์ทั้งระบบ  */
.bg-blue-600 { background-color: var(--x10-blue-700) !important; }
.bg-blue-700 { background-color: var(--x10-blue-800) !important; }
.bg-blue-500 { background-color: var(--x10-blue-600) !important; }
.bg-blue-100 { background-color: var(--x10-blue-100) !important; }
.bg-blue-50  { background-color: var(--x10-blue-50)  !important; }
.text-blue-600, .text-blue-700 { color: var(--x10-blue-700) !important; }
.text-blue-800, .text-blue-900 { color: var(--x10-blue-800) !important; }
.border-blue-400, .border-blue-500 { border-color: var(--x10-blue-600) !important; }
.hover\:bg-blue-100:hover { background-color: var(--x10-blue-100) !important; }
.from-blue-500 { --tw-gradient-from: var(--x10-blue-600) !important; }
.to-blue-600   { --tw-gradient-to:   var(--x10-blue-700) !important; }
.from-blue-600 { --tw-gradient-from: var(--x10-blue-700) !important; }
.to-blue-700   { --tw-gradient-to:   var(--x10-blue-800) !important; }

/* ── องค์ประกอบเฉพาะของแบรนด์ ─────────────────────────────── */
/* แถบทักทาย — ใช้กับหน้าพนักงาน ตาม ritual "Morning Smile" ของแบรนด์ */
.x10-greet {
  background: linear-gradient(100deg, var(--x10-orange-50), #fff 65%);
  border-left: 4px solid var(--accent);
  border-radius: 14px;
}
/* ป้ายเน้นสีรอง */
.pill-accent { background: var(--x10-orange-100); color: var(--x10-orange-700); }
/* เส้นคั่นแบบมีรอยยิ้ม */
.x10-smile-rule {
  height: 3px; border: 0; border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent), var(--brand));
  opacity: .5;
}

/* ── ปุ่มใหญ่หน้าลงเวลาพนักงาน ────────────────────────────── */
.big { border-radius: 20px; box-shadow: var(--shadow-lift); }
.big:active { transform: scale(.97); }

@media print {
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* ══ ตารางกะ — วางหน้าตาให้เหมือนเทมเพลตในชีต ═════════════════════════════
   หัว 2 ชั้น (แถบใหญ่ เวลางาน/หยุด/หมายเหตุ → โซน) · ซ้ายค้าง 2 คอลัมน์ (วัน/เวลา)
   ชื่อคนเรียงต่อกันในช่องเหมือนชีต แต่ทีละชื่อมีกรอบของตัวเอง จะได้แยกออกว่าใครเป็นใคร */
.rs-wrap { padding: 0; }
.rs-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12px; }
.rs-table th, .rs-table td { border-right: 1px solid #cbd5e1; border-bottom: 1px solid #cbd5e1; }

/* หัวตาราง */
.rs-table thead th { position: sticky; z-index: 3; text-align: center; }
.rs-table thead tr:first-child th { top: 0; }
.rs-table thead tr:nth-child(2) th { top: 30px; }
.rs-band { padding: 5px 8px; font-weight: 700; color: #fff; letter-spacing: .3px; }
.rs-band-work { background: #2f6df6; }
.rs-band-off  { background: #1e2fb8; }
.rs-band-note { background: #64748b; }
.rs-corner, .rs-corner2 {
  background: #3f3f46; color: #fff; font-weight: 700; padding: 4px 6px;
  left: 0; z-index: 5; box-shadow: 1px 0 0 #cbd5e1;
}
.rs-corner  { width: 92px; min-width: 92px; }
.rs-corner2 { left: 92px; width: 76px; min-width: 76px; }
.rs-zh { padding: 5px 6px; min-width: 132px; background: #f1f5f9; }
.rs-zarea { font-weight: 700; font-size: 12px; line-height: 1.25; }
.rs-zpre  { font-size: 11px; opacity: .8; line-height: 1.2; }
.rs-zn    { font-size: 10px; color: #94a3b8; font-weight: 500; }
.rs-zh-off  { background: #eef2ff; min-width: 108px; }
.rs-zh-note { background: #f1f5f9; min-width: 108px; }

/* คอลัมน์ซ้ายที่ค้างไว้ */
.rs-day, .rs-time { position: sticky; z-index: 2; background: #fff; }
.rs-day  { left: 0;  width: 92px; min-width: 92px; padding: 4px 6px; box-shadow: 1px 0 0 #cbd5e1; }
.rs-time { left: 92px; width: 76px; min-width: 76px; padding: 4px 6px; text-align: center;
           color: #475569; background: #f8fafc; box-shadow: 1px 0 0 #cbd5e1; }
.rs-dayline b { font-size: 16px; color: #0f172a; }
.rs-dayline span { font-size: 12px; color: #475569; }
.rs-dayen  { font-size: 10px; color: #94a3b8; line-height: 1.1; }
.rs-daysub { font-size: 10px; color: #94a3b8; margin-top: 2px; }
.rs-daysub b { color: #059669; }

/* ช่องใส่ชื่อ */
.rs-cell { padding: 3px; vertical-align: middle; text-align: center; background: #fff; }
.rs-offcell  { background: #f8fafc; }
.rs-notecell { background: #fcfcfd; }
.rs-na { background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 5px, #e7ecf2 5px, #e7ecf2 10px); }
.rs-dstart > td, .rs-dstart > th { border-top: 2px solid #94a3b8; }
.rs-wk    > td { background: #fffbeb; }
.rs-wk    > .rs-time { background: #fef3c7; }
.rs-today > td { background: #ecfdf5; }
.rs-today > .rs-day { background: #d1fae5; }

/* ชื่อคน — 1 ชื่อ = 1 กรอบ ต่อกันได้หลายชื่อในบรรทัดเดียวเหมือนในชีต */
.rs-chip {
  display: inline-flex; align-items: center; gap: 2px;
  margin: 1px; padding: 1px 5px; border-radius: 5px;
  font-size: 11.5px; line-height: 1.5; white-space: nowrap; vertical-align: middle;
  background: var(--bg, #f1f5f9); color: var(--fg, #334155);
  border: 1px solid var(--bd, #e2e8f0); border-left: 3px solid var(--bar, #94a3b8);
}
.rs-chip .rs-nm { font-weight: 600; }
.rs-chip .rs-x { color: #b4c0cd; font-size: 12px; line-height: 1; padding: 0 1px; }
.rs-chip .rs-x:hover { color: #dc2626; }
.rs-chip:hover { filter: brightness(.97); box-shadow: 0 1px 3px rgba(15,23,42,.14); }
.rs-dim { opacity: .2; filter: grayscale(1); }
.rs-hit { box-shadow: 0 0 0 2px #f59e0b; }

/* ปุ่มเพิ่มคน — โผล่ตอนชี้ที่ช่อง จะได้ไม่รกตา */
.rs-add {
  display: block; width: 100%; margin-top: 2px; border-radius: 5px;
  border: 1px dashed #cbd5e1; color: #94a3b8; font-size: 11px; line-height: 1.5;
  opacity: 0; transition: opacity .12s;
}
.rs-cell:hover .rs-add { opacity: 1; }
.rs-add:hover { border-color: #2f6df6; color: #2f6df6; background: #eff6ff; }

@media (max-width: 820px) {
  .rs-corner, .rs-day { width: 66px; min-width: 66px; }
  .rs-corner2 { left: 66px; }
  .rs-time { left: 66px; width: 62px; min-width: 62px; }
  .rs-zh { min-width: 112px; }
}

/* ป้ายชื่อ/สถานะที่วางติดกันหลายอัน (ทุกหน้า) — เว้นระยะ + เส้นขอบบาง ๆ ให้แยกออกจากกัน */
.pill { margin: 1px 1px; border: 1px solid rgba(15, 23, 42, .1); }

/* ชิปที่เลือกอยู่ (เช่น แท็กหมายเหตุทีม) */
.chip.on{background:#0f4c83;color:#fff;border-color:#0f4c83}
