:root {
  --indigo: #4f46e5; --indigo-600: #4338ca; --violet: #7c3aed; --purple: #9333ea; --pink: #ec4899;
  --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #9333ea 100%);
  --grad-soft: linear-gradient(135deg, #eef2ff, #f5f3ff);
  --navy: #0f172a; --navy-2: #111c33; --navy-3: #1e293b;
  --bg: #f1f5f9; --card: #ffffff; --fg: #0f172a; --muted: #64748b; --muted-2: #94a3b8; --line: #e2e8f0; --soft: #f8fafc;
  --ok: #059669; --ok-bg: #d1fae5; --warn: #b45309; --warn-bg: #fef3c7; --bad: #e11d48; --bad-bg: #ffe4e6;
  --info: #4338ca; --info-bg: #e0e7ff; --sky: #0284c7; --sky-bg: #e0f2fe;
  --r-xl: 28px; --r-lg: 20px; --r-md: 14px;
  --shadow: 0 1px 2px rgb(15 23 42 / .04), 0 8px 24px rgb(15 23 42 / .05);
  --shadow-lg: 0 18px 40px -12px rgb(79 70 229 / .45);
  --side: 264px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: "Kanit", system-ui, sans-serif; font-weight: 400; background: var(--bg); color: var(--fg); line-height: 1.55; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--indigo); text-decoration: none; }
:focus-visible { outline: 3px solid #a5b4fc; outline-offset: 2px; border-radius: 10px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ============ gate (login) ============ */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; background: #050816; }
.gate::before { content: ""; position: absolute; inset: -20%;
  background: radial-gradient(circle at 20% 15%, rgba(99,102,241,.55), transparent 32%), radial-gradient(circle at 80% 20%, rgba(168,85,247,.45), transparent 30%), radial-gradient(circle at 50% 95%, rgba(14,165,233,.35), transparent 38%);
  filter: blur(10px); animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(3%, -2%, 0) scale(1.06); } }
.gate-card { position: relative; width: min(440px, 100%); background: rgba(255,255,255,.96); border-radius: 32px; padding: 32px 28px; box-shadow: 0 30px 80px rgb(0 0 0 / .45); }
.gate-logo { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 24px; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 34px; box-shadow: var(--shadow-lg); overflow: hidden; }
.gate-logo img { width: 100%; height: 100%; object-fit: cover; }
.gate h1 { text-align: center; margin: 0; font-size: 30px; font-weight: 800; letter-spacing: .5px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate .sub { text-align: center; color: var(--muted); margin: 2px 0 22px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); border: 1px solid var(--line); border-radius: 16px; padding: 4px; margin-bottom: 18px; }
.seg button { border: 0; background: transparent; padding: 10px; border-radius: 12px; font-weight: 600; color: var(--muted); cursor: pointer; transition: .2s; min-height: 44px; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--indigo); box-shadow: var(--shadow); }
.gate-foot { text-align: center; color: var(--muted-2); font-size: 12px; margin-top: 16px; }
.linkish { border: 0; background: none; color: var(--indigo); font-weight: 600; cursor: pointer; padding: 8px 4px; min-height: 40px; }

/* ============ shell ============ */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--navy); color: #cbd5e1; display: flex; flex-direction: column; z-index: 40; transition: transform .25s ease; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px; background: #0b1222; color: #fff; }
.logo { width: 38px; height: 38px; border-radius: 12px; background: var(--grad); display: grid; place-items: center; color: #fff; flex: none; overflow: hidden; box-shadow: 0 6px 16px -6px rgb(124 58 237 / .8); }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-text { font-weight: 800; letter-spacing: .4px; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text b { color: #a5b4fc; font-weight: 800; }
.side-nav { flex: 1; overflow-y: auto; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; }
.side-nav .label { font-size: 11px; font-weight: 700; color: #64748b; letter-spacing: .5px; padding: 14px 14px 6px; border-top: 1px solid rgb(255 255 255 / .07); margin-top: 8px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; color: #cbd5e1; font-weight: 500; transition: background .2s, color .2s; min-height: 46px; }
.side-nav a i { width: 22px; text-align: center; font-size: 17px; color: #94a3b8; transition: color .2s; }
.side-nav a:hover { background: rgb(255 255 255 / .06); color: #fff; }
.side-nav a[aria-current="page"] { background: var(--grad); color: #fff; font-weight: 600; box-shadow: 0 10px 24px -10px rgb(124 58 237 / .9); }
.side-nav a[aria-current="page"] i { color: #fff; }
.side-nav .badge { margin-left: auto; background: var(--pink); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 8px; }
.side-foot { padding: 14px; background: #0b1222; }
.side-logout { width: 100%; border: 0; background: transparent; color: #fb7185; font-weight: 600; padding: 12px; border-radius: 12px; cursor: pointer; min-height: 44px; }
.side-logout:hover { background: rgb(251 113 133 / .1); }
.scrim { display: none; }

.main { margin-left: var(--side); min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: rgb(255 255 255 / .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-title { min-width: 0; flex: 1; }
.top-title h1 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.online { font-size: 11px; font-weight: 700; color: var(--ok); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.online .dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px #d1fae5; animation: pulse 2s infinite; }
.online .sep, .online .mono { color: var(--muted); font-weight: 500; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgb(16 185 129 / .1); } }
.top-user { display: flex; align-items: center; gap: 12px; text-align: right; }
.top-user .hello { font-size: 10px; font-weight: 700; color: var(--muted-2); letter-spacing: .6px; text-transform: uppercase; }
.top-user .who { font-weight: 700; font-size: 14px; line-height: 1.2; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-user .role { font-size: 11px; color: var(--indigo); font-weight: 600; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--grad-soft); border: 2px solid #fff; box-shadow: 0 0 0 2px #e0e7ff; display: grid; place-items: center; color: var(--indigo); font-weight: 700; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--fg); flex: none; }
main#app { padding: 26px 28px 40px; width: 100%; max-width: 1360px; margin: 0 auto; flex: 1; outline: none; }
.only-mobile { display: none; }
.bottom-nav { display: none; }

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); box-shadow: 20px 0 60px rgb(0 0 0 / .3); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgb(2 6 23 / .5); z-index: 35; }
  .main { margin-left: 0; }
  .only-mobile { display: grid; }
  .topbar { padding: 10px 16px; }
  .top-title h1 { font-size: 18px; }
  .top-user .hello, .top-user .role { display: none; }
  main#app { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgb(255 255 255 / .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a, .bottom-nav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: 11px; font-weight: 500; color: var(--muted); border-radius: 12px; min-height: 52px; cursor: pointer; }
  .bottom-nav i { font-size: 19px; }
  .bottom-nav [aria-current="page"] { color: var(--indigo); font-weight: 700; }
}
@media (max-width: 520px) { .top-user .who { display: none; } }

/* ============ building blocks ============ */
.card { background: var(--card); border: 1px solid #eef2f7; border-radius: var(--r-xl); padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.card.tight { padding: 18px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-h h2, .card-h h3 { margin: 0; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card-h h2::before { content: ""; width: 6px; height: 22px; border-radius: 9px; background: var(--bar, var(--indigo)); flex: none; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 1199px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .g2, .g3 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } .card { padding: 18px; border-radius: 22px; } }
@media (max-width: 420px) { .g4 { gap: 12px; } }
.mt { margin-top: 20px; } .mt-s { margin-top: 10px; } .mb { margin-bottom: 20px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); } .small { font-size: 14px; } .tiny { font-size: 12px; }
.strong { font-weight: 700; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: 24px; font-weight: 700; }
.page-head p { margin: 2px 0 0; color: var(--muted); }

/* hero */
.hero { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 28px; color: #fff; background: var(--grad); box-shadow: var(--shadow-lg); }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgb(255 255 255 / .1); }
.hero::before { content: ""; position: absolute; right: 80px; bottom: -90px; width: 200px; height: 200px; border-radius: 50%; background: rgb(255 255 255 / .07); }
.hero .label { opacity: .85; font-weight: 500; position: relative; z-index: 1; }
.hero .big { font-size: clamp(34px, 6vw, 52px); font-weight: 800; line-height: 1.05; margin: 6px 0 14px; letter-spacing: -.5px; position: relative; z-index: 1; }
.hero .split { display: flex; gap: 28px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .split b { display: block; font-size: 20px; }
.hero .split span { opacity: .8; font-size: 13px; }
.hero .actions { position: relative; z-index: 1; margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn.glass { background: rgb(255 255 255 / .16); border-color: rgb(255 255 255 / .25); color: #fff; }
.btn.glass:hover { background: rgb(255 255 255 / .26); border-color: rgb(255 255 255 / .4); }
.dark-card { background: linear-gradient(145deg, #1e293b, #020617); color: #fff; border: 0; position: relative; overflow: hidden; }
.dark-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; background: rgb(255 255 255 / .05); border-radius: 50%; filter: blur(10px); }
.dark-card .muted { color: #94a3b8; }
.stat-line { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgb(255 255 255 / .08); }
.stat-line:last-child { border-bottom: 0; }

/* KPI */
.kpi { position: relative; overflow: hidden; }
.kpi .ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 21px; margin-bottom: 14px; }
.kpi .v { font-size: 26px; font-weight: 800; line-height: 1.15; color: var(--fg); }
.kpi .t { color: var(--muted); font-weight: 500; font-size: 14px; }
.kpi .d { color: var(--muted-2); font-size: 12px; margin-top: 4px; }
.kpi::after { content: ""; position: absolute; right: -24px; bottom: -24px; width: 96px; height: 96px; border-radius: 50%; background: var(--tone); opacity: .07; }
.tone-emerald { --tone: #059669; } .tone-emerald .ic { background: #d1fae5; color: #059669; }
.tone-amber { --tone: #d97706; } .tone-amber .ic { background: #fef3c7; color: #d97706; }
.tone-indigo { --tone: #4f46e5; } .tone-indigo .ic { background: #e0e7ff; color: #4f46e5; }
.tone-purple { --tone: #9333ea; } .tone-purple .ic { background: #f3e8ff; color: #9333ea; }
.tone-sky { --tone: #0284c7; } .tone-sky .ic { background: #e0f2fe; color: #0284c7; }
.tone-rose { --tone: #e11d48; } .tone-rose .ic { background: #ffe4e6; color: #e11d48; }
@media (max-width: 420px) { .kpi .v { font-size: 20px; } .kpi .ic { width: 42px; height: 42px; font-size: 17px; margin-bottom: 10px; } }

/* rooms */
.room { display: flex; gap: 16px; align-items: center; cursor: pointer; transition: transform .2s, box-shadow .2s; text-align: left; width: 100%; font: inherit; }
.room:hover { transform: translateY(-3px); box-shadow: 0 16px 40px -18px rgb(79 70 229 / .45); }
.ring { --p: 0; width: 86px; height: 86px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--ring-c, #7c3aed) calc(var(--p) * 1%), #eef2ff 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #fff; }
.ring span { position: relative; font-weight: 800; font-size: 17px; line-height: 1.1; text-align: center; }
.ring small { display: block; font-size: 10px; color: var(--muted); font-weight: 500; }
.room .bal { font-size: 24px; font-weight: 800; line-height: 1.15; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1.4; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); } .chip.info { background: var(--info-bg); color: var(--info); }
.chip.sky { background: var(--sky-bg); color: var(--sky); } .chip.gray { background: #f1f5f9; color: var(--muted); }
.chip.purple { background: #f3e8ff; color: #7e22ce; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-weight: 600; cursor: pointer; transition: transform .15s, background .2s, box-shadow .2s, border-color .2s; color: var(--fg); white-space: nowrap; }
.btn:hover { border-color: #c7d2fe; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 10px 22px -10px rgb(79 70 229 / .8); }
.btn.primary:hover { box-shadow: 0 14px 28px -10px rgb(79 70 229 / .9); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.green { background: #059669; border-color: #059669; color: #fff; }
.btn.danger { color: var(--bad); border-color: #fecdd3; background: #fff1f2; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* forms */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field > span em { color: var(--bad); font-style: normal; }
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
input[type=text], input[type=number], input[type=password], input[type=date], input[type=url], input[type=email], input[type=tel], input[type=search], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 14px; border: 2px solid #e2e8f0; background: #fff; transition: border-color .2s, box-shadow .2s; font-size: 16px; }
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #818cf8; box-shadow: 0 0 0 4px #e0e7ff; }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: #fda4af; }
.err { color: var(--bad); font-size: 13px; margin-top: 5px; font-weight: 500; }
.form-sec { border-radius: 22px; padding: 22px; background: var(--soft); border: 1px solid var(--line); margin-bottom: 18px; }
.form-sec.green { background: #f0fdf4; border-color: #bbf7d0; }
.form-sec h3 { margin: 0 0 14px; font-size: 16px; display: flex; gap: 10px; align-items: center; color: var(--indigo); }
.form-sec.green h3 { color: #047857; }
@media (max-width: 599px) { .form-sec { padding: 16px; } }
.form-card { max-width: 920px; margin: 0 auto; position: relative; overflow: hidden; }
.form-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899); }
.form-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--grad-soft); color: var(--indigo); display: grid; place-items: center; font-size: 26px; margin: 8px auto 10px; }
.form-title { text-align: center; margin: 0; font-size: 24px; font-weight: 700; }
.form-sub { text-align: center; color: var(--muted); margin: 4px 0 22px; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--indigo); flex: none; }
.upload { border: 2px dashed #c7d2fe; border-radius: 18px; padding: 18px; text-align: center; background: #fff; cursor: pointer; transition: .2s; display: block; }
.upload:hover { border-color: var(--indigo); background: #f5f7ff; }
.upload img { max-height: 180px; max-width: 100%; border-radius: 12px; margin-top: 10px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .grow { flex: 1; min-width: 200px; }
.toolbar select { width: auto; min-width: 150px; }
@media (max-width: 599px) { .toolbar select { flex: 1; } }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.tabs > * { flex: none; }
.tab { min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 600; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tab[aria-pressed="true"], .tab[aria-current="page"] { background: var(--navy); color: #fff; border-color: var(--navy); }

/* lists */
.list > * + * { border-top: 1px solid #f1f5f9; }
.li { display: flex; gap: 14px; align-items: center; padding: 12px 0; }
.li .ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.li .body { flex: 1; min-width: 0; }
.in { color: var(--ok); font-weight: 700; } .out { color: var(--bad); font-weight: 700; }
.voided { opacity: .5; } .voided .title { text-decoration: line-through; }
.bar { height: 8px; border-radius: 99px; background: #eef2ff; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.empty { text-align: center; padding: 36px 12px; color: var(--muted); }
.empty i { font-size: 34px; color: #cbd5e1; display: block; margin-bottom: 8px; }
.announce { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 20px; margin-bottom: 14px; border: 1px solid; }
.announce > i { font-size: 20px; margin-top: 2px; }
.announce.info { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.announce.success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.announce.warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.announce.danger { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.announce b { display: block; }
.warn-banner { margin: 14px 28px 0; padding: 12px 16px; border-radius: 16px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
@media (max-width: 1023px) { .warn-banner { margin: 12px 16px 0; } }

/* tables */
.table-wrap { overflow: auto; border-radius: 20px; border: 1px solid var(--line); background: #fff; max-height: 72vh; -webkit-overflow-scrolling: touch; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
th, td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; white-space: nowrap; text-align: left; }
th { position: sticky; top: 0; background: #f8fafc; z-index: 2; font-size: 12px; color: var(--muted); font-weight: 700; }
td.r, th.r { text-align: right; } td.c, th.c { text-align: center; }
.sticky { position: sticky; left: 0; background: #fff; z-index: 1; box-shadow: 1px 0 0 var(--line); max-width: 46vw; }
th.sticky { z-index: 3; background: #f8fafc; }
.who-cell { display: flex; gap: 10px; align-items: center; min-width: 0; }
.mini-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; color: #fff; }
.pay { width: 42px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: inline-grid; place-items: center; font-size: 15px; color: #cbd5e1; }
.pay.paid { background: #d1fae5; border-color: #a7f3d0; color: #059669; }
.pay.exempt { background: #f1f5f9; color: #64748b; border-style: dashed; }
.pay.unpaid { color: #fb7185; background: #fff1f2; border-color: #ffe4e6; }
.editing .pay { cursor: pointer; transition: transform .1s; }
.editing .pay:hover { transform: scale(1.08); border-color: var(--indigo); }
.pay.busy { opacity: .4; }
tr.me td { background: #f5f3ff; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }

/* request cards + stepper */
.req { padding: 22px; }
.req-top { display: flex; gap: 14px; align-items: flex-start; }
.req-ic { width: 46px; height: 46px; border-radius: 15px; background: var(--grad-soft); color: var(--indigo); display: grid; place-items: center; font-size: 18px; flex: none; }
.req-amt { text-align: right; margin-left: auto; flex: none; }
.req-amt .v { font-size: 24px; font-weight: 800; color: #047857; line-height: 1.1; }
.req h3 { margin: 2px 0 6px; font-size: 18px; font-weight: 700; }
.item-chip { display: inline-flex; gap: 6px; align-items: center; background: #eef2ff; color: #3730a3; font-weight: 600; font-size: 13px; padding: 4px 10px; border-radius: 10px; max-width: 100%; }
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); margin: 22px 0 6px; position: relative; }
.stepper .s { text-align: center; position: relative; min-width: 0; }
.stepper .s::before { content: ""; position: absolute; top: 18px; left: -50%; width: 100%; height: 3px; background: #e2e8f0; z-index: 0; }
.stepper .s:first-child::before { display: none; }
.stepper .s.done::before, .stepper .s.now::before { background: linear-gradient(90deg, #6366f1, #a855f7); }
.stepper .s.rej::before { background: #fda4af; }
.stepper .dot { position: relative; z-index: 1; width: 38px; height: 38px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center; background: #fff; border: 3px solid #cbd5e1; color: #94a3b8; font-size: 14px; transition: .3s; }
.stepper .done .dot { background: var(--grad); border-color: transparent; color: #fff; }
.stepper .now .dot { border-color: #7c3aed; color: #7c3aed; box-shadow: 0 0 0 5px #ede9fe; }
.stepper .rej .dot { background: var(--bad); border-color: var(--bad); color: #fff; }
.stepper .lb { font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.25; }
.stepper .done .lb, .stepper .now .lb { color: var(--fg); }
.stepper .rej .lb { color: var(--bad); }
.stepper .at { font-size: 10px; color: var(--muted-2); }
.note-box { background: #eef2ff; color: #3730a3; border-radius: 16px; padding: 12px 16px; font-size: 14px; margin-top: 14px; }
.note-box.bad { background: #fff1f2; color: #9f1239; }
.admin-box { margin-top: 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; gap: 10px; grid-template-columns: 1.1fr 1fr 2fr auto; align-items: end; }
.admin-box .field { margin: 0; }
.detail-grid { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 14px; }
.detail-grid dt { color: var(--muted); } .detail-grid dd { margin: 0; overflow-wrap: anywhere; font-weight: 500; }
@media (max-width: 899px) { .admin-box { grid-template-columns: 1fr 1fr; } .admin-box .wide { grid-column: span 2; } }
@media (max-width: 599px) {
  .stepper .lb { font-size: 10px; } .stepper .dot { width: 30px; height: 30px; font-size: 12px; } .stepper .s::before { top: 14px; } .stepper .at { display: none; }
  .req { padding: 16px; } .req-top { flex-wrap: wrap; } .req-amt { width: 100%; text-align: left; padding-left: 60px; }
  .admin-box { grid-template-columns: 1fr; } .admin-box .wide { grid-column: auto; }
  .detail-grid { grid-template-columns: 1fr; gap: 2px; } .detail-grid dd { margin-bottom: 8px; }
}

/* team */
.member { padding: 0; overflow: hidden; text-align: center; }
.member .cover { height: 104px; background: var(--grad); position: relative; }
.member .pic { width: 104px; height: 104px; border-radius: 50%; margin: -56px auto 10px; border: 5px solid #fff; background: #eef2ff; display: grid; place-items: center; font-size: 34px; font-weight: 700; color: var(--indigo); overflow: hidden; position: relative; box-shadow: var(--shadow); }
.member .pic img { width: 100%; height: 100%; object-fit: cover; }
.member .inner { padding: 0 20px 22px; }
.member h3 { margin: 0 0 8px; font-size: 18px; }
.member .pos { display: inline-block; background: #eef2ff; color: #4338ca; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 14px; line-height: 1.35; }
.member .contact { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.member .edit { position: absolute; top: 12px; right: 12px; }

/* stars */
.stars { display: inline-flex; gap: 3px; color: #fbbf24; }
.stars .off { color: #e2e8f0; }
.star-pick { display: flex; gap: 6px; justify-content: center; margin: 6px 0 16px; }
.star-pick button { border: 0; background: none; font-size: 38px; color: #e2e8f0; cursor: pointer; transition: transform .15s, color .15s; padding: 2px; min-width: 44px; min-height: 44px; }
.star-pick button.on { color: #fbbf24; }
.star-pick button:hover { transform: scale(1.15); }

.chart-box { position: relative; height: 290px; }
@media (max-width: 599px) { .chart-box { height: 240px; } }

/* sweetalert */
.swal2-popup { font-family: "Kanit", sans-serif !important; border-radius: 28px !important; }
.swal2-html-container { text-align: left !important; margin: 12px 18px 0 !important; }
.swal2-confirm { background: linear-gradient(135deg, #4f46e5, #9333ea) !important; border-radius: 14px !important; }
.swal2-cancel, .swal2-deny { border-radius: 14px !important; }
.swal2-html-container .field { margin-bottom: 12px; }
.skeleton { border-radius: 24px; background: linear-gradient(90deg, #e2e8f0, #f1f5f9, #e2e8f0); background-size: 200% 100%; animation: sh 1.2s infinite; min-height: 140px; }
@keyframes sh { to { background-position: -200% 0; } }
.fade-in { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .sidebar, .topbar, .bottom-nav, .btn, .toolbar { display: none !important; } .main { margin: 0; } }
.admin-wrap { margin-top: 14px; }
.admin-wrap > summary { cursor: pointer; font-weight: 600; color: var(--indigo); font-size: 14px; min-height: 40px; display: flex; align-items: center; gap: 8px; list-style: none; }
.admin-wrap > summary::-webkit-details-marker { display: none; }
.admin-wrap > summary::after { content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 11px; transition: transform .2s; }
.admin-wrap[open] > summary::after { transform: rotate(180deg); }
.admin-wrap .admin-box { margin-top: 6px; }

/* request form lines (follows the paper form) */
.line-head, .line-row { display: grid; grid-template-columns: 160px 1fr 150px 44px; gap: 8px; align-items: center; }
.line-head { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; padding: 0 4px; }
.line-row { margin-bottom: 8px; }
.line-row input { min-width: 0; padding-left: 12px; padding-right: 10px; }
.line-row .icon-btn { width: 44px; height: 50px; color: var(--muted); }
@media (max-width: 699px) {
  .line-head { display: none; }
  .line-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px; }
  .line-row .l-detail { grid-column: 1 / -1; grid-row: 1; }
  .line-row .l-date { grid-row: 2; } .line-row .l-amount { grid-row: 2; } .line-row .icon-btn { grid-row: 2; }
}
.chip-check { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 6px 14px; min-height: 46px; }
.chip-check:has(input:checked) { border-color: #818cf8; background: #eef2ff; color: #3730a3; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.thumb { position: relative; width: 92px; height: 116px; border-radius: 14px; overflow: hidden; background: #eef2ff; display: grid; place-items: center; color: var(--indigo); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .icon-btn { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; font-size: 13px; }
