/* WAT Customer Job Tracking System */
:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --dark: #111827;
  --text: #101828;
  --muted: #667085;
  --line: #d9e1ec;
  --orange: #ff7a1a;
  --blue: #2563eb;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --cyan: #0891b2;
  --shadow: 0 20px 55px rgba(16,24,40,.12);
  --shadow2: 0 10px 30px rgba(16,24,40,.08);
  --radius: 26px;
  --sidebar: 280px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, "Noto Sans Thai", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(255,122,26,.15), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(37,99,235,.10), transparent 30%),
    linear-gradient(135deg, #eef2f7, #e6edf6);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

.app {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background: rgba(255,255,255,.78);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  overflow: auto;
}
.brand {
  background: #111827;
  color: #fff;
  border-radius: 24px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.brand-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.logo {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--orange), #ffb020);
  color: #111827;
  font-size: 26px;
}
.brand strong { display: block; }
.brand span { display: block; color: #cbd5e1; font-size: 12px; margin-top: 4px; line-height: 1.4; }
.nav-title {
  color: #98a2b3;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-size: 11px;
  margin: 20px 12px 8px;
}
.nav { display: grid; gap: 5px; }
.nav a {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 12px 13px;
  border-radius: 17px;
  color: #344054;
  font-weight: 800;
  font-size: 14px;
  border: 1px solid transparent;
}
.nav a:hover,
.nav a.active {
  background: #fff;
  border-color: var(--line);
  box-shadow: var(--shadow2);
}
.nav-ico {
  width: 30px;
  height: 30px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #edf2f8;
}
.main {
  min-width: 0;
  padding: 18px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 26px;
  background: rgba(255,255,255,.76);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: var(--shadow2);
  margin-bottom: 18px;
}
.title {
  display: flex;
  gap: 12px;
  align-items: center;
}
.title-icon {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #111827;
  color: #fff;
  font-size: 24px;
}
.title h1 { margin: 0; font-size: 24px; letter-spacing: -.5px; }
.title p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(16,24,40,.05);
}
.btn:hover { box-shadow: var(--shadow2); transform: translateY(-1px); }
.btn.primary { background: #111827; color: #fff; border-color: #111827; }
.btn.orange { background: linear-gradient(135deg, var(--orange), #ffb020); color: #111827; border-color: #fed7aa; }
.btn.red { background: var(--red); color: #fff; border-color: var(--red); }
.btn.green { background: var(--green); color: #fff; border-color: var(--green); }
.btn.small { min-height: 32px; padding: 6px 9px; border-radius: 11px; font-size: 12px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: 1fr 360px; align-items: start; }
.card {
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(16px);
}
.card.pad { padding: 20px; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 12px;
}
.card-head h2,
.card-head h3 { margin: 0; letter-spacing: -.45px; }
.card-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.card-body { padding: 12px 20px 20px; }
.kpi { min-height: 145px; padding: 18px; }
.kpi-label { color: var(--muted); font-size: 13px; font-weight: 900; }
.kpi-value { margin-top: 12px; font-size: 36px; line-height: 1; font-weight: 950; }
.kpi-note { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.45; }

.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
  align-items: stretch;
}
.hero-main {
  min-height: 340px;
  padding: 30px;
  background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,255,255,.76));
}
.eyebrow {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  font-size: 12px;
  font-weight: 950;
  margin-bottom: 16px;
}
.hero h2,
.hero h1 { margin: 0; font-size: clamp(34px, 5vw, 60px); letter-spacing: -2px; line-height: .98; }
.mark { display: inline-block; background: linear-gradient(120deg, #ffedd5, #fed7aa); border-radius: .18em; padding: 0 .15em; }
.lead { color: #475467; line-height: 1.85; font-size: 15px; max-width: 720px; }
.meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 24px; }
.meta {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px;
}
.meta span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; margin-bottom: 6px; }
.meta strong { display: block; color: var(--dark); font-size: 15px; line-height: 1.35; }

.command {
  background: #111827;
  color: #fff;
  padding: 24px;
  min-height: 340px;
}
.command-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.command-head span { display: block; color: #cbd5e1; font-size: 13px; margin-bottom: 4px; }
.command-head strong { display: block; font-size: 26px; letter-spacing: -.6px; }
.command-icon {
  width: 82px;
  height: 82px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--orange), #ffb020);
  color: #111827;
  font-size: 39px;
}
.progress-box { margin: 20px 0; }
.progress-head { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 900; margin-bottom: 8px; }
.command .progress-head { color: #cbd5e1; }
.progress-head strong { color: var(--dark); }
.command .progress-head strong { color: #fff; }
.track { height: 12px; border-radius: 999px; background: #e4e7ec; overflow: hidden; }
.command .track { background: rgba(255,255,255,.14); }
.fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--orange), #ffb020); }
.fill.green { background: linear-gradient(90deg, #86efac, var(--green)); }
.fill.blue { background: linear-gradient(90deg, #60a5fa, var(--blue)); }
.fill.red { background: linear-gradient(90deg, #fda4af, var(--red)); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.stat { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 18px; padding: 12px 8px; text-align: center; }
.stat strong { display: block; font-size: 24px; }
.stat span { display: block; margin-top: 3px; color: #cbd5e1; font-size: 11px; font-weight: 900; }

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: 24px;
  background: rgba(255,255,255,.76);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: var(--shadow2);
  margin-bottom: 18px;
}
.search {
  flex: 1;
  min-width: min(100%, 420px);
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.search input { border: 0; outline: 0; flex: 1; min-width: 0; font-size: 14px; color: var(--text); }
.input, .select, textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  outline: 0;
  font-size: 14px;
}
.input.full, .select.full, textarea.full { width: 100%; }
textarea { min-height: 100px; resize: vertical; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
table { width: 100%; min-width: 920px; border-collapse: collapse; }
th, td { padding: 14px 15px; text-align: left; border-bottom: 1px solid #eef2f6; vertical-align: middle; font-size: 14px; }
th { background: #f8fafc; color: #667085; text-transform: uppercase; letter-spacing: .55px; font-size: 12px; }
tr:hover td { background: #fff7ed; }
tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.green { background: #ecfdf3; color: #067647; border-color: #abefc6; }
.badge.amber { background: #fffaeb; color: #b54708; border-color: #fedf89; }
.badge.blue { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.badge.cyan { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.badge.red { background: #fef3f2; color: #b42318; border-color: #fecdca; }
.badge.gray { background: #f2f4f7; color: #475467; border-color: #e4e7ec; }
.badge.dark { background: #111827; color: #fff; border-color: #111827; }

.code { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: #111827; color: #fff; font-size: 12px; font-weight: 950; white-space: nowrap; }
.person { display: flex; gap: 10px; align-items: center; }
.avatar { width: 42px; height: 42px; border-radius: 15px; display: grid; place-items: center; background: #111827; color: #fff; font-weight: 950; }
.main-text { font-weight: 950; color: #111827; }
.sub-text { font-size: 12px; color: var(--muted); margin-top: 3px; }

.list { display: grid; gap: 13px; }
.item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 15px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(16,24,40,.045);
}
.item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--blue); }
.item.done::before { background: var(--green); }
.item.working::before, .item.installing::before { background: var(--amber); }
.item.waiting::before, .item.shipping::before, .item.ordered::before { background: var(--blue); }
.item.arrived::before { background: var(--cyan); }
.item.problem::before { background: var(--red); }
.item-row { display: grid; grid-template-columns: 54px 1fr auto; gap: 13px; align-items: center; }
.item-icon { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; background: #f8fafc; border: 1px solid var(--line); font-size: 24px; }
.item h3 { margin: 0 0 5px; font-size: 17px; }
.item p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 999px; background: #f8fafc; border: 1px solid var(--line); color: #475467; font-size: 12px; font-weight: 850; }

.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.step { min-height: 52px; display: grid; place-items: center; text-align: center; padding: 8px 6px; border: 1px solid var(--line); border-radius: 15px; background: #f8fafc; color: #667085; font-size: 11px; font-weight: 950; line-height: 1.25; }
.step.done { background: #ecfdf3; color: #067647; border-color: #abefc6; }
.step.current { background: #fff7ed; color: #c2410c; border-color: #fed7aa; box-shadow: 0 0 0 4px rgba(255,122,26,.12); }
.step.problem { background: #fef3f2; color: #b42318; border-color: #fecdca; }

.tabs { display: flex; gap: 7px; flex-wrap: wrap; padding: 8px; border-radius: 21px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow2); margin-bottom: 18px; }
.tab { border: 1px solid transparent; background: transparent; border-radius: 14px; padding: 9px 11px; font-weight: 950; color: #475467; cursor: pointer; }
.tab.active, .tab:hover { background: #111827; color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.timeline { position: relative; display: grid; gap: 13px; }
.timeline::before { content: ""; position: absolute; left: 23px; top: 12px; bottom: 12px; width: 2px; background: linear-gradient(to bottom, var(--orange), #d0d5dd); }
.time-item { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: start; position: relative; }
.time-dot { width: 48px; height: 48px; border-radius: 17px; background: #111827; color: #fff; display: grid; place-items: center; border: 4px solid #fff; z-index: 1; }
.time-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 13px; box-shadow: 0 8px 20px rgba(16,24,40,.05); }
.time-card strong { display: block; margin-bottom: 4px; }
.time-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.time-date { color: var(--muted); font-size: 12px; font-weight: 950; white-space: nowrap; margin-top: 12px; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field label { display: block; color: #475467; font-size: 12px; font-weight: 950; margin-bottom: 7px; }
.field.full { grid-column: 1 / -1; }
.flash { margin-bottom: 16px; padding: 12px 14px; border-radius: 16px; background: #ecfdf3; color: #067647; border: 1px solid #abefc6; font-weight: 850; }
.error { margin-bottom: 16px; padding: 12px 14px; border-radius: 16px; background: #fef3f2; color: #b42318; border: 1px solid #fecdca; font-weight: 850; }

.public-page { width: min(1160px, calc(100% - 28px)); margin: 0 auto; padding: 20px 0 42px; }
.public-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px; border-radius: 999px; background: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.9); box-shadow: var(--shadow2); margin-bottom: 18px; }
.public-layout { display: grid; grid-template-columns: 1fr 350px; gap: 18px; align-items: start; }
.side-sticky { position: sticky; top: 18px; }
.summary { display: grid; gap: 10px; }
.summary-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 12px; border-radius: 17px; background: #fff; border: 1px solid var(--line); }
.summary-row span { color: var(--muted); font-size: 13px; font-weight: 850; }
.summary-row strong { color: #111827; font-size: 18px; }
.note { margin-top: 12px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 18px; padding: 14px; line-height: 1.65; font-size: 13px; }
.login-wrap { width: min(460px, calc(100% - 28px)); margin: 9vh auto; }
.center { text-align: center; }
.hide { display: none !important; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero, .grid-main, .public-layout { grid-template-columns: 1fr; }
  .side-sticky { position: static; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .topbar, .public-top { align-items: flex-start; flex-direction: column; border-radius: 24px; }
  .actions { justify-content: flex-start; }
  .meta-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .main { padding: 12px; }
  .grid-2, .grid-3, .grid-4, .meta-grid, .stat-grid, .form-grid { grid-template-columns: 1fr; }
  .item-row { grid-template-columns: 46px 1fr; }
  .item-icon { width: 44px; height: 44px; border-radius: 15px; font-size: 21px; }
  .item-status { grid-column: 1 / -1; justify-self: start; margin-left: 59px; }
  .steps { grid-template-columns: 1fr; }
  .time-item { grid-template-columns: 46px 1fr; }
  .time-date { grid-column: 2; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search { min-width: 0; width: 100%; }
}
@media (max-width: 520px) {
  .btn { width: 100%; }
  .actions .btn, .public-top .btn { width: auto; }
  .item-status { margin-left: 0; }
}
