/* team.cfcthai.com — Chelsea Thai theme v2 (อ้างอิงชุดสี cfcthai.com) */
:root {
  --blue: #034694;
  --blue-dark: #022e63;
  --blue-light: #e8f0fa;
  --gold: #d4af37;
  --green: #1e9e4a;
  --red: #d43a3a;
  --amber: #e8a10c;
  --ink: #1a2433;
  --muted: #64748b;
  --line: #dde5ef;
  --bg: #f2f5fa;
  --card: #ffffff;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(2, 46, 99, .05), 0 6px 20px rgba(2, 46, 99, .07);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Sarabun', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}
h1, h2, h3, h4, .page-title, .card h3, .stat .value, .brand { font-family: 'Kanit', 'Noto Sans Thai', sans-serif; }

.container { max-width: 1080px; margin: 0 auto; padding: 16px 14px 84px; }
@media (min-width: 768px) { .container { padding: 24px 20px 40px; } }

/* ===== Topbar ===== */
.topbar {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
}
.topbar .brand {
  font-weight: 800; font-size: 17px; color: #fff; text-decoration: none;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.topbar .brand small { font-weight: 500; opacity: .75; font-size: 11px; display: block; line-height: 1; }
.topnav { display: none; margin-left: auto; gap: 2px; }
.topnav a {
  color: #dce8f7; text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 8px 12px; border-radius: 8px;
}
.topnav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.topnav a.active { background: rgba(255,255,255,.18); color: #fff; }
.topbar .user-chip {
  margin-left: auto; color: #dce8f7; font-size: 13px; text-decoration: none; white-space: nowrap;
}
@media (min-width: 768px) {
  .topnav { display: flex; }
  .topbar .user-chip { margin-left: 8px; }
}

/* ===== Bottom nav (มือถือ) ===== */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav a {
  flex: 1; text-align: center; text-decoration: none; color: var(--muted);
  font-size: 11px; font-weight: 600; line-height: 1.2; padding: 4px 2px; border-radius: 10px;
}
.bottomnav a .ic { display: block; font-size: 20px; }
.bottomnav a.active { color: var(--blue); background: var(--blue-light); }
@media (min-width: 768px) { .bottomnav { display: none; } }

/* ===== Cards & layout ===== */
.card {
  background: var(--card); border: 1px solid #eef2f8; border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 10px; font-size: 16px; }
h2.page-title { font-size: 21px; font-weight: 800; margin: 6px 0 16px; }
h3 { font-size: 17px; margin: 18px 0 10px; }
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* stat cards */
.stat {
  background: var(--card); border: 1px solid #eef2f8; border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stat .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 24px; font-weight: 800; color: var(--blue); margin-top: 2px; }
.stat .value.money { color: var(--green); }
.stat .sub { font-size: 12px; color: var(--muted); }

/* ===== Forms ===== */
label { display: block; margin: 10px 0 4px; }
label.small { font-size: 13px; color: var(--muted); font-weight: 600; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
button, .btn {
  display: inline-block; width: 100%; margin-top: 10px; padding: 12px 16px;
  background: var(--blue); color: #fff; border: 0; border-radius: 12px;
  font: inherit; font-weight: 700; cursor: pointer; text-align: center; text-decoration: none; transition: background .15s, transform .1s;
}
button:hover, .btn:hover { background: var(--blue-dark); }
button:active, .btn:active { transform: translateY(1px); }
button.secondary, .btn.secondary { background: #fff; color: var(--blue); border: 1.5px solid var(--blue); }
button.secondary:hover, .btn.secondary:hover { background: var(--blue-light); }
button.danger, .btn.danger { background: var(--red); }
button.inline, .btn.inline { width: auto; padding: 8px 14px; font-size: 14px; margin-top: 0; }

/* ===== Badges / messages ===== */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; vertical-align: middle;
}
.badge-open { background: #e3f5ea; color: var(--green); }
.badge-completed { background: var(--blue-light); color: var(--blue); }
.badge-canceled { background: #fbe7e7; color: var(--red); }
.badge-paid { background: #e3f5ea; color: var(--green); }
.badge-pending { background: #fdf2dd; color: var(--amber); }
.badge-pos { background: var(--blue-light); color: var(--blue); }
.msg-error { background: #fbe7e7; color: var(--red); border: 1px solid #f3c1c1; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.msg-success { background: #e3f5ea; color: var(--green); border: 1px solid #bfe6cd; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.small { font-size: 13px; color: var(--muted); }

/* ===== Avatar ===== */
.avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  background: var(--blue-light); color: var(--blue);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; flex-shrink: 0; border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px var(--line);
}
.avatar.lg { width: 84px; height: 84px; font-size: 30px; }
.row { display: flex; align-items: center; gap: 12px; }
.row .grow { flex: 1; min-width: 0; }

/* ===== ตาราง ===== */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 2px solid var(--line); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
@media (max-width: 480px) { table.tbl { font-size: 13px; } .tbl th, .tbl td { padding: 8px 7px; } }
.card > table.tbl, .card > .tbl-scroll { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ===== แผนผังสนาม ===== */
.pitch-wrap { position: relative; }
.pitch {
  position: relative;
  background: linear-gradient(180deg, #2f9e52 0%, #268a45 50%, #2f9e52 100%);
  border: 3px solid #fff; border-radius: 12px;
  box-shadow: var(--shadow);
  width: 100%; aspect-ratio: 68 / 92;
  max-width: 460px; margin: 0 auto;
  display: flex; flex-direction: column-reverse;
  padding: 6% 3%;
  overflow: hidden;
}
.pitch::before {
  content: ''; position: absolute; left: 3%; right: 3%; top: 50%;
  border-top: 2px solid rgba(255,255,255,.65);
}
.pitch::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 26%; aspect-ratio: 1; border: 2px solid rgba(255,255,255,.65);
  border-radius: 50%; transform: translate(-50%, -50%);
}
.pitch-row { flex: 1; display: flex; align-items: center; justify-content: space-evenly; position: relative; z-index: 2; }
.slot {
  width: 64px; max-width: 22%;
  text-align: center; cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.slot .disc {
  width: 46px; height: 46px; margin: 0 auto; border-radius: 50%;
  background: #fff; color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
  border: 2.5px solid var(--blue);
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  overflow: hidden;
}
.slot.gk .disc { background: var(--gold); color: #4a3a00; border-color: #b8962e; }
.slot.empty .disc { background: rgba(255,255,255,.35); color: #fff; border-style: dashed; border-color: #fff; }
.slot.selected .disc { outline: 3px solid var(--amber); outline-offset: 2px; }
.slot .nm {
  margin-top: 3px; font-size: 11px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* ม้านั่งสำรอง */
.bench { display: flex; flex-wrap: wrap; gap: 8px; }
.bench .chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; user-select: none;
}
.bench .chip.selected { border-color: var(--amber); outline: 2px solid var(--amber); }
.bench .chip .pos { font-size: 11px; color: var(--blue); font-weight: 800; }

/* ไทม์ไลน์โน้ตโค้ช */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line); margin-left: 8px; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before {
  content: ''; position: absolute; left: -7px; top: 3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--blue); border: 2.5px solid #fff; box-shadow: 0 0 0 1.5px var(--blue);
}
.timeline .t-date { font-size: 12px; color: var(--muted); font-weight: 600; }
.timeline .t-body { margin-top: 2px; }

/* utility */
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.right { text-align: right; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }
