:root {
  --bg: #eef4f2;
  --panel: #ffffff;
  --panel-2: #f6faf8;
  --text: #14231f;
  --muted: #687872;
  --line: #dce8e3;
  --primary: #117864;
  --primary-2: #0c6554;
  --primary-soft: #e8f5f1;
  --accent: #ff9f1c;
  --success: #158569;
  --success-soft: #e8f6f1;
  --warning: #d97706;
  --warning-soft: #fff6e5;
  --danger: #dc3f4f;
  --danger-soft: #fff0f2;
  --info: #278b80;
  --shadow: 0 18px 50px rgba(17, 72, 60, .10);
  --shadow-sm: 0 8px 24px rgba(17, 72, 60, .08);
  --radius: 18px;
  --radius-sm: 12px;
  --font: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans Thai", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: var(--font); color: var(--text); background: var(--bg); }
body { font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.xsmall { font-size: 11px; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.stack { display: flex; flex-direction: column; }
.w-full { width: 100%; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px;
  background: var(--panel-2); color: var(--muted); font-size: 12px; white-space: nowrap;
}
.pill.success { color: var(--success); background: var(--success-soft); }
.pill.warning { color: var(--warning); background: var(--warning-soft); }
.pill.danger { color: var(--danger); background: var(--danger-soft); }
.pill.primary { color: var(--primary); background: var(--primary-soft); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.btn {
  border: 0; border-radius: 11px; padding: 10px 16px; background: var(--panel-2); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 650;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease; min-height: 40px;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(20,40,80,.09); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--primary); color: white; }
.btn.primary:hover { background: var(--primary-2); }
.btn.success { background: var(--success); color: white; }
.btn.danger { background: var(--danger); color: white; }
.btn.warning { background: var(--warning); color: white; }
.btn.outline { background: transparent; border: 1px solid var(--line); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 32px; padding: 7px 10px; border-radius: 9px; font-size: 12px; }
.btn.lg { min-height: 50px; padding: 13px 22px; border-radius: 14px; font-size: 16px; }
.btn.icon { width: 40px; padding: 0; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: white; border-radius: 11px; padding: 10px 12px;
  min-height: 42px; outline: none; color: var(--text); transition: border .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: #83bcae; box-shadow: 0 0 0 4px rgba(17,120,100,.10); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 700; color: #4b5563; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card.pad { padding: 20px; }
.card-title { font-size: 16px; font-weight: 800; }
.card-subtitle { color: var(--muted); font-size: 12px; margin-top: 4px; }
.empty { text-align: center; color: var(--muted); padding: 30px 12px; }
.empty-icon { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 18px; background: var(--panel-2); display: grid; place-items: center; font-size: 24px; }
.avatar { width: 38px; height: 38px; border-radius: 13px; background: linear-gradient(135deg, #c6e4dc, #e8f5f1); color: var(--primary); display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; overflow: hidden; }
.avatar.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 12px; }
.avatar.lg { width: 58px; height: 58px; border-radius: 18px; font-size: 20px; }
.badge-count { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--danger); color: white; font-size: 11px; display: grid; place-items: center; font-weight: 800; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; background: #fafbfc; position: sticky; top: 0; }
td { font-size: 13px; }
tr:hover td { background: #fbfcff; }
.modal-backdrop { position: fixed; inset: 0; z-index: 2000; background: rgba(10,20,40,.46); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(3px); }
.modal { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: white; border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal.wide { width: min(920px, 100%); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: white; z-index: 2; }
.modal-title { font-size: 17px; font-weight: 800; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: white; }
.close-btn { border: 0; background: var(--panel-2); width: 34px; height: 34px; border-radius: 10px; font-size: 18px; }
.toast-stack { position: fixed; right: 20px; top: 20px; z-index: 5000; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast { background: #172033; color: white; border-radius: 13px; padding: 13px 15px; box-shadow: 0 18px 50px rgba(0,0,0,.22); display: flex; align-items: flex-start; gap: 10px; animation: toastIn .2s ease; }
.toast.success { background: #0b7f59; }
.toast.error { background: #b72d3b; }
.toast.warning { background: #a35b00; }
@keyframes toastIn { from { transform: translateY(-10px); opacity: 0; } }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #eef1f5 25%, #f8f9fb 40%, #eef1f5 60%); background-size: 300% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* Login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(420px,.85fr); background: #0d2a22; }
.login-hero { position: relative; overflow: hidden; padding: clamp(34px,5vw,80px); color: white; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; }
.login-hero::before { content:""; position: absolute; width: 560px; height: 560px; border-radius: 50%; background: radial-gradient(circle, rgba(40,153,132,.60), rgba(17,120,100,0)); right: -140px; top: -160px; }
.login-hero::after { content:""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px); background-size: 38px 38px; mask-image: linear-gradient(to bottom,black,transparent 85%); }
.login-brand, .login-copy, .login-features { position: relative; z-index: 1; }
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 850; letter-spacing: .04em; }
.brand-mark { width: 45px; height: 45px; border-radius: 15px; background: linear-gradient(135deg,#35a48d,#117864); box-shadow: 0 14px 32px rgba(17,120,100,.30); display: grid; place-items: center; color: white; font-weight: 900; }
.login-copy { max-width: 700px; margin: auto 0; }
.login-copy h1 { margin: 0 0 18px; font-size: clamp(34px,5.2vw,70px); line-height: 1.04; letter-spacing: -.04em; }
.login-copy p { margin: 0; font-size: clamp(15px,1.5vw,19px); color: rgba(255,255,255,.72); max-width: 610px; line-height: 1.75; }
.login-features { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.login-feature { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); border-radius: 16px; padding: 15px; backdrop-filter: blur(12px); }
.login-feature b { display: block; font-size: 13px; margin-bottom: 5px; }
.login-feature span { color: rgba(255,255,255,.58); font-size: 11px; line-height: 1.5; }
.login-panel { background: #f1f6f4; display: grid; place-items: center; padding: 30px; }
.login-card { width: min(450px,100%); background: white; border-radius: 24px; padding: 30px; box-shadow: var(--shadow); border: 1px solid #edf0f4; }
.login-card h2 { margin: 0 0 8px; font-size: 25px; }
.login-card .lead { color: var(--muted); margin-bottom: 24px; }
.login-card .field { margin-bottom: 14px; }
.quick-accounts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.quick-account { border: 1px solid var(--line); border-radius: 13px; padding: 11px; background: #fbfcfe; cursor: pointer; text-align: left; }
.quick-account:hover { border-color: #8bc4b6; background: var(--primary-soft); }
.quick-account b { display: block; font-size: 12px; }
.quick-account span { font-size: 11px; color: var(--muted); }
.login-foot { text-align: center; color: var(--muted); font-size: 11px; margin-top: 20px; line-height: 1.6; }

/* Admin */
.admin-app { display: grid; grid-template-columns: 244px minmax(0,1fr); min-height: 100vh; }
.admin-sidebar { background: #102d25; color: white; padding: 20px 14px; position: fixed; inset: 0 auto 0 0; width: 244px; overflow-y: auto; z-index: 30; }
.admin-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.admin-brand strong { font-size: 16px; letter-spacing: .02em; }
.admin-brand small { display:block; color:rgba(255,255,255,.48); margin-top:2px; font-size:10px; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-section { color: rgba(255,255,255,.34); font-size: 10px; font-weight: 800; letter-spacing: .1em; margin: 16px 10px 7px; }
.admin-nav button { width: 100%; color: rgba(255,255,255,.72); border: 0; background: transparent; border-radius: 11px; padding: 11px 12px; display: flex; align-items: center; gap: 10px; text-align: left; }
.admin-nav button:hover { color: white; background: rgba(255,255,255,.06); }
.admin-nav button.active { color: white; background: linear-gradient(90deg,rgba(29,112,93,.98),rgba(24,84,70,.96)); box-shadow: 0 10px 24px rgba(16,93,76,.22); }
.nav-icon { width: 23px; text-align:center; font-size: 16px; }
.admin-main { grid-column: 2; min-width: 0; }
.admin-topbar { height: 68px; padding: 0 26px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 25; backdrop-filter: blur(12px); }
.admin-content { padding: 24px 26px 42px; max-width: 1800px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-title { font-size: 25px; font-weight: 850; letter-spacing: -.02em; }
.page-desc { color: var(--muted); margin-top: 5px; }
.top-user { display: flex; align-items:center; gap:10px; }
.top-user .meta { line-height:1.25; text-align:right; }
.top-user b { display:block; font-size:12px; }
.top-user span { font-size:10px; color:var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; margin-bottom: 18px; }
.stat-card { background: white; border: 1px solid var(--line); border-radius: 17px; padding: 18px; box-shadow: var(--shadow-sm); position: relative; overflow:hidden; }
.stat-card::after { content:""; position:absolute; width:70px; height:70px; border-radius:50%; background: var(--primary-soft); right:-20px; top:-25px; }
.stat-label { color:var(--muted); font-size:12px; }
.stat-value { font-size:28px; font-weight:850; margin-top:8px; letter-spacing:-.03em; }
.stat-foot { color:var(--muted); font-size:11px; margin-top:8px; }
.dashboard-grid { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(320px,.75fr); gap:16px; }
.panel-head { padding:17px 18px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; }
.panel-body { padding:18px; }
.activity-list { display:flex; flex-direction:column; }
.activity-item { display:flex; gap:12px; padding:12px 0; border-bottom:1px dashed var(--line); }
.activity-item:last-child { border-bottom:0; }
.activity-main { min-width:0; flex:1; }
.activity-title { font-weight:750; font-size:13px; }
.activity-sub { color:var(--muted); font-size:11px; margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.search-box { display:flex; align-items:center; border:1px solid var(--line); background:white; border-radius:11px; padding:0 11px; min-width:270px; }
.search-box input { border:0; outline:0; padding:10px 8px; width:100%; background:transparent; }
.status-cell { display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:700; }
.status-cell::before { content:""; width:7px; height:7px; border-radius:50%; background:currentColor; }
.status-pending { color:var(--warning); }
.status-approved,.status-active,.status-signed,.status-normal { color:var(--success); }
.status-rejected,.status-closed { color:var(--danger); }
.notice-composer { display:grid; grid-template-columns:minmax(0,1fr) 330px; gap:16px; }
.preview-phone { width:300px; min-height:560px; border:10px solid #182135; border-radius:38px; background:#eef4f2; box-shadow:0 22px 60px rgba(0,0,0,.18); margin:auto; overflow:hidden; }
.preview-phone-top { height:27px; background:#182135; width:110px; border-radius:0 0 16px 16px; margin:auto; }
.preview-phone-screen { padding:12px; }
.chat-admin-layout { display:grid; grid-template-columns:330px minmax(0,1fr); height:670px; overflow:hidden; }
.chat-sidebar { border-right:1px solid var(--line); overflow-y:auto; }
.chat-conv { display:flex; gap:10px; padding:13px; border-bottom:1px solid var(--line); cursor:pointer; }
.chat-conv:hover,.chat-conv.active { background:#edf7f3; }
.chat-pane { display:flex; flex-direction:column; min-width:0; }
.chat-pane-head { padding:14px 16px; border-bottom:1px solid var(--line); font-weight:800; }
.chat-messages { flex:1; overflow-y:auto; padding:18px; background:#f2f7f5; }
.chat-composer { padding:12px; border-top:1px solid var(--line); display:flex; gap:8px; }

/* Mobile employee */
.mobile-body { background:#e7efec; min-height:100vh; }
.phone-app { width:min(100%,500px); min-height:100vh; margin:0 auto; background:#eef4f2; position:relative; box-shadow:0 0 50px rgba(20,40,70,.12); overflow-x:hidden; }
.mobile-header { position:sticky; top:0; z-index:30; background:linear-gradient(135deg,#126c5b,#1a8a73); color:white; padding:16px 17px 18px; }
.mobile-header-row { display:flex; align-items:center; justify-content:space-between; }
.mobile-user { display:flex; gap:10px; align-items:center; }
.mobile-user .avatar { background:rgba(255,255,255,.18); color:white; }
.mobile-user b { display:block; font-size:14px; }
.mobile-user span { display:block; color:rgba(255,255,255,.68); font-size:10px; margin-top:2px; }
.mobile-header-actions { display:flex; gap:8px; }
.header-circle { width:36px; height:36px; border-radius:12px; background:rgba(255,255,255,.12); color:white; border:0; display:grid; place-items:center; position:relative; }
.mobile-content { padding:14px 14px 92px; min-height:calc(100vh - 70px); }
.mobile-page { display:none; }
.mobile-page.active { display:block; animation:fadeIn .18s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(4px); } }
.mobile-bottom-nav { position:fixed; z-index:50; bottom:0; left:50%; transform:translateX(-50%); width:min(100%,500px); height:72px; background:rgba(255,255,255,.97); border-top:1px solid var(--line); display:grid; grid-template-columns:repeat(5,1fr); padding-bottom:max(5px,env(safe-area-inset-bottom)); backdrop-filter:blur(12px); }
.mobile-bottom-nav button { border:0; background:transparent; color:#7b8595; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; font-size:10px; position:relative; }
.mobile-bottom-nav button .mi { font-size:21px; line-height:1; }
.mobile-bottom-nav button.active { color:var(--primary); font-weight:800; }
.mobile-bottom-nav .nav-badge { position:absolute; top:8px; right:20%; }
.hero-card { background:linear-gradient(135deg,#102c63,#0c4ec5); color:white; border-radius:20px; padding:19px; box-shadow:0 16px 34px rgba(14,72,174,.25); position:relative; overflow:hidden; }
.hero-card::after { content:""; position:absolute; width:180px; height:180px; border:36px solid rgba(255,255,255,.05); border-radius:50%; right:-80px; top:-75px; }
.hero-label { color:rgba(255,255,255,.7); font-size:11px; }
.hero-time { font-size:23px; font-weight:850; margin:6px 0 12px; }
.hero-status { display:flex; align-items:center; gap:8px; font-size:11px; color:rgba(255,255,255,.78); }
.hero-status .dot { color:#37e1a1; }
.checkin-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:15px; }
.checkin-btn { border:0; border-radius:14px; min-height:53px; font-weight:800; background:white; color:#16499e; display:flex; align-items:center; justify-content:center; gap:8px; }
.checkin-btn.out { background:rgba(255,255,255,.13); color:white; border:1px solid rgba(255,255,255,.18); }
.mobile-section-title { display:flex; align-items:center; justify-content:space-between; margin:18px 2px 10px; }
.mobile-section-title b { font-size:15px; }
.mobile-section-title button { border:0; background:transparent; color:var(--primary); font-size:11px; }
.quick-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:9px; }
.quick-item { background:white; border:1px solid var(--line); border-radius:15px; padding:13px 5px 11px; display:flex; flex-direction:column; align-items:center; gap:7px; font-size:11px; color:#3a4658; box-shadow:0 4px 14px rgba(20,40,70,.04); }
.quick-icon { width:38px; height:38px; border-radius:13px; display:grid; place-items:center; background:var(--primary-soft); color:var(--primary); font-size:18px; }
.quick-item:nth-child(2) .quick-icon { background:#e9f8f2; color:var(--success); }
.quick-item:nth-child(3) .quick-icon { background:#fff4df; color:#d47b00; }
.quick-item:nth-child(4) .quick-icon { background:#f4eefe; color:#8656cc; }
.mobile-stats { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.mobile-stat { background:white; border:1px solid var(--line); border-radius:16px; padding:14px; }
.mobile-stat span { color:var(--muted); font-size:10px; }
.mobile-stat strong { display:block; font-size:20px; margin-top:5px; }
.notice-card { background:white; border:1px solid var(--line); border-radius:15px; padding:13px; display:flex; gap:10px; margin-bottom:9px; }
.notice-icon { width:36px; height:36px; border-radius:12px; background:var(--warning-soft); color:var(--warning); display:grid; place-items:center; flex:0 0 auto; }
.notice-main { min-width:0; flex:1; }
.notice-title { font-size:13px; font-weight:800; }
.notice-body { color:var(--muted); font-size:11px; line-height:1.55; margin-top:4px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.list-card { background:white; border:1px solid var(--line); border-radius:16px; overflow:hidden; }
.list-row { display:flex; align-items:center; gap:11px; padding:13px 14px; border-bottom:1px solid var(--line); }
.list-row:last-child { border-bottom:0; }
.list-row-main { flex:1; min-width:0; }
.list-row-title { font-size:13px; font-weight:750; display:flex; align-items:center; gap:6px; }
.list-row-sub { color:var(--muted); font-size:10px; margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.list-row-end { color:var(--muted); font-size:11px; text-align:right; }
.page-banner { background:linear-gradient(135deg,#163d82,#1264df); color:white; border-radius:18px; padding:18px; margin-bottom:12px; }
.page-banner h2 { margin:0; font-size:20px; }
.page-banner p { margin:6px 0 0; color:rgba(255,255,255,.7); font-size:11px; line-height:1.55; }
.attendance-state { background:white; border:1px solid var(--line); border-radius:18px; padding:18px; text-align:center; }
.face-ring { width:120px; height:120px; border-radius:50%; margin:6px auto 16px; background:conic-gradient(var(--primary) 0 82%,#e9eef6 82%); padding:5px; }
.face-ring-inner { width:100%; height:100%; border-radius:50%; background:#f1f6f4; display:grid; place-items:center; font-size:42px; }
.steps { display:flex; justify-content:center; gap:7px; flex-wrap:wrap; margin:12px 0; }
.step-chip { padding:7px 9px; border-radius:10px; background:#f1f4f8; color:var(--muted); font-size:10px; }
.step-chip.done { color:var(--success); background:var(--success-soft); }
.work-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.work-item { background:white; border:1px solid var(--line); border-radius:16px; padding:15px 6px; text-align:center; }
.work-item .wi { width:42px; height:42px; border-radius:14px; background:var(--primary-soft); display:grid; place-items:center; margin:0 auto 8px; font-size:20px; }
.work-item b { display:block; font-size:11px; }
.work-item span { color:var(--muted); font-size:9px; }
.message-layout { position:fixed; top:0; bottom:0; left:50%; transform:translateX(-50%); width:min(100%,500px); background:#eef4f2; z-index:80; display:flex; flex-direction:column; }
.message-topbar { height:60px; flex:0 0 auto; background:white; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; padding:0 13px; }
.message-topbar button { border:0; background:transparent; font-size:20px; width:38px; height:38px; }
.message-topbar .title { text-align:center; min-width:0; }
.message-topbar .title b { display:block; font-size:14px; }
.message-topbar .title span { display:block; color:var(--muted); font-size:9px; margin-top:2px; }
.message-scroll { flex:1; overflow-y:auto; padding:14px 12px; }
.message-bubble-row { display:flex; align-items:flex-end; gap:7px; margin:10px 0; }
.message-bubble-row.mine { flex-direction:row-reverse; }
.message-bubble { max-width:73%; background:white; border-radius:15px 15px 15px 4px; padding:10px 12px; box-shadow:0 3px 10px rgba(30,50,80,.06); font-size:13px; line-height:1.55; word-break:break-word; }
.mine .message-bubble { background:#aeea84; border-radius:15px 15px 4px 15px; }
.message-meta { color:#8992a2; font-size:8px; margin-top:4px; display:flex; justify-content:flex-end; gap:4px; }
.message-sender { color:#637087; font-size:9px; margin-bottom:3px; }
.voice-bubble { display:flex; align-items:center; gap:8px; min-width:115px; }
.voice-bars { display:flex; align-items:center; gap:2px; height:18px; }
.voice-bars i { display:block; width:2px; background:currentColor; border-radius:3px; }
.voice-bars i:nth-child(1){height:5px}.voice-bars i:nth-child(2){height:12px}.voice-bars i:nth-child(3){height:16px}.voice-bars i:nth-child(4){height:9px}.voice-bars i:nth-child(5){height:14px}
.message-compose { flex:0 0 auto; background:white; border-top:1px solid var(--line); padding:9px 10px max(9px,env(safe-area-inset-bottom)); display:flex; gap:7px; align-items:flex-end; }
.message-compose button { border:0; background:#f2f4f7; width:38px; height:38px; border-radius:12px; flex:0 0 auto; }
.message-compose textarea { flex:1; min-height:38px; max-height:92px; border:1px solid var(--line); border-radius:12px; padding:9px 10px; resize:none; outline:none; }
.message-compose .send { background:var(--primary); color:white; width:auto; padding:0 14px; font-weight:800; }
.chat-extra { background:white; border-top:1px solid var(--line); padding:15px; display:grid; grid-template-columns:repeat(4,1fr); gap:15px; }
.chat-extra button { border:0; background:transparent; display:flex; flex-direction:column; align-items:center; gap:6px; font-size:10px; color:var(--muted); }
.chat-extra .exicon { width:48px; height:48px; border-radius:16px; background:#f2f4f7; display:grid; place-items:center; font-size:20px; color:var(--text); }
.recording-bar { position:absolute; left:50%; bottom:90px; transform:translateX(-50%); background:rgba(17,30,50,.92); color:white; padding:12px 18px; border-radius:16px; min-width:210px; text-align:center; }
.call-screen { position:fixed; inset:0; z-index:500; background:radial-gradient(circle at 50% 10%,#344a75,#081225 62%); color:white; display:flex; flex-direction:column; align-items:center; justify-content:space-between; padding:70px 24px 45px; }
.call-user { text-align:center; }
.call-user .avatar { width:92px; height:92px; border-radius:30px; margin:0 auto 18px; font-size:30px; }
.call-user h2 { margin:0; font-size:25px; }
.call-user p { color:rgba(255,255,255,.62); }
.call-actions { display:flex; gap:28px; }
.call-btn { width:64px; height:64px; border-radius:50%; border:0; color:white; background:rgba(255,255,255,.14); font-size:23px; }
.call-btn.end { background:#e53f50; }
.video-grid { position:absolute; inset:0; overflow:hidden; }
.video-grid video.remote { width:100%; height:100%; object-fit:cover; background:#0a1220; }
.video-grid video.local { position:absolute; width:110px; height:160px; right:14px; top:55px; object-fit:cover; border-radius:16px; border:2px solid rgba(255,255,255,.5); background:#18233b; }
.call-overlay { position:relative; z-index:2; width:100%; height:100%; display:flex; flex-direction:column; justify-content:space-between; align-items:center; }
.profile-card { background:linear-gradient(135deg,#0c4fc7,#1d70ed); color:white; border-radius:18px; padding:18px; display:flex; align-items:center; gap:13px; }
.profile-card .avatar { background:rgba(255,255,255,.18); color:white; }
.setting-row { display:flex; align-items:center; gap:12px; padding:14px; border-bottom:1px solid var(--line); background:white; }
.setting-row:first-child { border-radius:16px 16px 0 0; }
.setting-row:last-child { border-bottom:0; border-radius:0 0 16px 16px; }
.setting-icon { width:36px; height:36px; border-radius:12px; background:var(--primary-soft); color:var(--primary); display:grid; place-items:center; }
.setting-main { flex:1; min-width:0; }
.setting-main b { display:block; font-size:12px; }
.setting-main span { color:var(--muted); font-size:9px; }
.signature-canvas { width:100%; height:190px; border:1px dashed #9aa7bb; border-radius:14px; touch-action:none; background:white; }
.camera-preview { width:100%; height:260px; border-radius:16px; object-fit:cover; background:#101827; }
.contract-content { white-space:pre-wrap; line-height:1.8; font-size:12px; background:#fbfcfe; border:1px solid var(--line); border-radius:14px; padding:15px; max-height:340px; overflow:auto; }
.storage-bar { height:8px; border-radius:999px; background:#e7ebf1; overflow:hidden; }
.storage-bar span { display:block; height:100%; background:var(--primary); border-radius:inherit; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns:1fr; }
  .notice-composer { grid-template-columns:1fr; }
}
@media (max-width: 820px) {
  .login-page { grid-template-columns:1fr; }
  .login-hero { min-height:auto; padding:32px 24px; }
  .login-copy { margin:70px 0; }
  .login-features { grid-template-columns:repeat(2,1fr); }
  .login-panel { padding:20px; }
  .admin-app { grid-template-columns:1fr; }
  .admin-sidebar { transform:translateX(-100%); transition:transform .2s; }
  .admin-sidebar.open { transform:translateX(0); }
  .admin-main { grid-column:1; }
  .admin-content { padding:18px 14px 36px; }
  .admin-topbar { padding:0 14px; }
  .stats-grid { grid-template-columns:1fr 1fr; }
  .chat-admin-layout { grid-template-columns:1fr; }
  .chat-sidebar { display:none; }
}
@media (max-width: 560px) {
  .login-card { padding:22px; }
  .login-hero { display:none; }
  .login-panel { min-height:100vh; }
  .form-grid { grid-template-columns:1fr; }
  .form-grid .span-2 { grid-column:span 1; }
  .stats-grid { grid-template-columns:1fr; }
  .page-head { flex-direction:column; }
  .quick-grid { grid-template-columns:repeat(4,1fr); }
  .modal-backdrop { padding:0; align-items:end; }
  .modal { max-height:92vh; border-radius:22px 22px 0 0; }
}

/* V1-P002: screenshot-inspired emerald / slate palette */
.admin-app::before{content:"";position:fixed;left:0;right:0;top:0;height:3px;background:#318af2;z-index:80;}
.admin-sidebar{background:#112d25;}
.admin-nav button.active{background:#214f42;border-left:3px solid #42b99b;box-shadow:none;}
.admin-topbar{background:rgba(247,250,249,.96);}
.card,.stat-card{border-color:#d8e5e0;box-shadow:0 8px 24px rgba(24,72,59,.06);}
.btn.primary,.btn.success{background:#117864;}
.btn.primary:hover,.btn.success:hover{background:#0d6756;}
th{background:#f1f6f4;color:#63736d;}
tr:hover td{background:#f4faf7;}
.mobile-header{background:linear-gradient(135deg,#125f51,#19826d);}

/* V001R-P004: secure attendance-point setup and three-stage employee check-in */
.justify-center{justify-content:center}.flex-wrap{flex-wrap:wrap}.mt-6{margin-top:6px}
.security-callout{display:flex;flex-direction:column;gap:6px;padding:14px 16px;border:1px solid #b9ddd2;background:#eff9f6;border-radius:14px;color:#144c3e;line-height:1.55}
.security-callout b{font-size:14px}.security-callout span{font-size:12px;color:#4e7167}
.location-flow{display:grid;grid-template-columns:1fr auto 1fr auto 1fr;align-items:center;gap:10px}
.location-flow>div{background:var(--panel-2);border:1px solid var(--line);border-radius:14px;padding:14px;min-height:86px}
.location-flow b,.location-flow span{display:block}.location-flow b{color:var(--primary);margin-bottom:6px}.location-flow span{font-size:11px;color:var(--muted);line-height:1.5}.location-flow i{color:#8da49d;font-style:normal;font-size:20px}
.location-card-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:14px}
.location-card{border:1px solid var(--line);background:linear-gradient(180deg,#fff,#f8fbfa);border-radius:16px;padding:17px;box-shadow:0 5px 15px rgba(17,72,60,.04)}
.location-coordinates{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:14px}
.location-coordinates span{display:block;background:#eef6f3;border-radius:10px;padding:9px;font-size:10px;color:var(--muted)}
.location-coordinates b{display:block;color:var(--text);font-size:12px;margin-top:3px}
.location-capture{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:14px;border:1px dashed #91bfb2;background:#f5fbf9;border-radius:16px;padding:18px}
.location-pin{width:52px;height:52px;border-radius:16px;background:var(--primary-soft);display:grid;place-items:center;font-size:25px}
.qr-print-sheet{text-align:center;border:1px solid var(--line);border-radius:18px;padding:24px;background:white}
.qr-print-sheet img{width:min(390px,90%);image-rendering:pixelated}.qr-company{font-size:14px;font-weight:750;color:var(--muted)}.qr-title{font-size:24px;font-weight:850;margin:8px 0 12px}.qr-rule{max-width:640px;margin:14px auto;line-height:1.75;font-weight:650;color:#1f4f43}
.attendance-steps{margin:15px 0}.attendance-live-status{display:flex;flex-direction:column;gap:5px;text-align:center;padding:13px 15px;border-radius:13px;background:#f2f6f5;border:1px solid var(--line)}
.attendance-live-status b{font-size:14px}.attendance-live-status span{font-size:11px;color:var(--muted);line-height:1.55}.attendance-live-status.success{background:var(--success-soft);border-color:#b8dfd1;color:var(--success)}.attendance-live-status.error{background:var(--danger-soft);border-color:#efc2ca;color:var(--danger)}.attendance-live-status.warning{background:var(--warning-soft);border-color:#efd39d;color:var(--warning)}
.manual-qr-panel{margin-top:12px;padding:12px;background:#fff9ec;border:1px solid #efd7a7;border-radius:12px}.manual-qr-panel label{display:block;font-size:11px;color:#7d5b19;margin-bottom:8px;line-height:1.5}
.qr-camera{height:300px;margin-top:14px;background:radial-gradient(circle at center,#263a34,#0b1713)}
@media(max-width:700px){.location-flow{grid-template-columns:1fr}.location-flow i{transform:rotate(90deg);text-align:center}.location-coordinates{grid-template-columns:1fr}.location-capture{grid-template-columns:auto 1fr}.location-capture .btn{grid-column:1/-1}.qr-camera{height:240px}}
