:root {
  --green: #12a150;
  --green-d: #0b7a3b;
  --green-l: #e8f7ef;
  --mint: #f2f8f4;
  --ink: #10241a;
  --muted: #75857c;
  --line: #e6ede9;
  --blue: #2f6fed;
  --blue-l: #eaf1ff;
  --amber: #f0a020;
  --amber-l: #fff6e5;
  --purple: #7c5cf0;
  --purple-l: #f1edff;
  --rose: #ec5a72;
  --rose-l: #ffedf0;
  --teal: #14a4a4;
  --teal-l: #e6f7f7;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(14, 61, 38, .08);
  --shadow-sm: 0 4px 14px rgba(14, 61, 38, .07);
  --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: #dfece3;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}
body::before {
  content: ''; position: fixed; inset: 0;
  background:
    radial-gradient(900px 600px at 12% -10%, #cbeee0 0%, transparent 60%),
    radial-gradient(800px 500px at 100% 10%, #dbe8ff 0%, transparent 55%),
    linear-gradient(160deg, #eef6f0 0%, #e3eee7 100%);
  z-index: -1;
}
button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--green-d); text-decoration: none; }
img { max-width: 100%; display: block; }
svg { width: 18px; height: 18px; flex: none; }
.hidden { display: none !important; }

/* ---------- app frame ---------- */
#appRoot {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px rgba(12, 60, 36, .05), 0 30px 60px rgba(12, 60, 36, .12);
}
@media (min-width: 520px) {
  body { padding: 24px 0; }
  #appRoot { min-height: calc(100vh - 48px); border-radius: 30px; overflow: hidden; }
  #appRoot .bottomnav { position: sticky; }
}

/* ---------- login ---------- */
#loginScreen {
  min-height: 100vh;
  padding: 28px 24px 30px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: #fff;
}
@media (min-width: 520px) { #loginScreen { min-height: calc(100vh - 48px); } }
.login-art {
  position: absolute; inset: 0 0 auto 0; height: 300px;
  background:
    radial-gradient(220px 160px at 15% 20%, rgba(18, 161, 80, .16), transparent 70%),
    radial-gradient(220px 160px at 90% 0%, rgba(47, 111, 237, .13), transparent 70%),
    linear-gradient(180deg, #eaf7ef 0%, #ffffff 100%);
  z-index: 0;
}
.login-art::after {
  content: ''; position: absolute; right: -60px; top: 60px; width: 200px; height: 200px;
  border-radius: 50%; border: 26px solid rgba(18, 161, 80, .07);
}
.login-head { position: relative; z-index: 1; text-align: center; padding-top: 8px; }
.login-logo { width: 78px; height: 78px; margin: 0 auto 10px; border-radius: 22px; box-shadow: 0 10px 24px rgba(18, 161, 80, .18); }
.brand-name { font-size: 30px; font-weight: 800; letter-spacing: -1px; color: var(--green-d); margin: 0; }
.brand-name span { color: var(--ink); }
.login-tag { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.login-card { position: relative; z-index: 1; margin-top: 22px; flex: 1; display: flex; flex-direction: column; }
.role-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: #f1f5f2; border-radius: 14px; padding: 5px; margin-bottom: 17px;
}
.role-tab {
  padding: 10px; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: #6b7b72;
  display: flex; align-items: center; justify-content: center; gap: 7px; transition: .18s;
}
.role-tab.active { background: #fff; color: var(--green-d); box-shadow: var(--shadow-sm); }
.role-tab svg { width: 16px; height: 16px; }

.field { margin-bottom: 12px; }
.field-label { display: block; font-size: 12.5px; font-weight: 700; color: #41544a; margin-bottom: 6px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > svg { position: absolute; left: 13px; width: 18px; height: 18px; color: #95a69c; pointer-events: none; }
.input-wrap input, .input-wrap select {
  width: 100%; padding: 13px 14px 13px 42px; border: 1.5px solid var(--line);
  background: #fbfdfb; border-radius: 13px; outline: none; font-size: 14px; transition: .16s;
}
.input-wrap input:focus, .input-wrap select:focus, .field textarea:focus { border-color: var(--green); background: #fff; box-shadow: 0 0 0 4px rgba(18, 161, 80, .09); }
.input-wrap .eye-btn { position: absolute; right: 8px; padding: 8px; color: #92a49a; display: flex; }
.input-wrap .eye-btn svg { width: 18px; height: 18px; }
.input-wrap input[type=date], .input-wrap input[type=month] { padding-right: 8px; }
.login-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 16px; font-size: 12.5px; }
.check { display: flex; align-items: center; gap: 8px; color: #4c5f55; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--green); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 18px; border-radius: 13px; font-weight: 700; font-size: 14px;
  background: var(--green); color: #fff; transition: .16s; width: 100%;
}
.btn:hover { background: var(--green-d); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }
.btn-outline { background: #fff; color: #34473d; border: 1.5px solid var(--line); }
.btn-outline:hover { background: #f7fbf8; }
.btn-soft { background: var(--green-l); color: var(--green-d); }
.btn-soft:hover { background: #d9f2e4; }
.btn-blue { background: var(--blue); }
.btn-blue:hover { background: #1d59ca; }
.btn-sm { padding: 8px 13px; font-size: 12.5px; border-radius: 10px; width: auto; }
.btn-xs { padding: 6px 10px; font-size: 11.5px; border-radius: 8px; width: auto; }
.btn-ghost { background: #f4f7f5; color: #40534a; }

.divider { display: flex; align-items: center; gap: 12px; color: #a4b2aa; font-size: 12px; margin: 16px 0; }
.divider::before, .divider::after { content: ''; height: 1px; background: var(--line); flex: 1; }
.btn-google { background: #fff; border: 1.5px solid var(--line); color: #2e3f36; font-weight: 600; }
.login-foot { text-align: center; color: #7d8d84; font-size: 12.5px; margin-top: 18px; }
.login-foot b { color: var(--green-d); cursor: pointer; }
.login-note { margin-top: auto; padding-top: 18px; text-align: center; font-size: 11px; color: #a3b0a9; }
.demo-hint {
  margin-top: 14px; background: #f6faf7; border: 1px dashed #cfe4d7; border-radius: 12px;
  padding: 10px 12px; font-size: 11.5px; color: #5c7166; line-height: 1.6;
}
.demo-hint b { color: #2f5c43; }

/* ---------- app shell ---------- */
#appShell { display: flex; flex-direction: column; flex: 1; min-height: 100vh; }
@media (min-width: 520px) { #appShell { min-height: calc(100vh - 48px); } }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 18px 12px; background: #fff; position: sticky; top: 0; z-index: 30;
}
@media (min-width: 520px) { .topbar { top: 0; } }
.who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #d6f0e1, #b5e3c9); color: var(--green-d);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
  border: 2px solid #fff; box-shadow: 0 0 0 1px #dcebe2;
}
.avatar.lg { width: 76px; height: 76px; font-size: 24px; }
.avatar.xs { width: 34px; height: 34px; font-size: 11.5px; }
.who h4 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who p { margin: 1px 0 0; font-size: 11.5px; color: var(--muted); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 13px; background: #f5f8f6; color: #45574c;
  display: flex; align-items: center; justify-content: center; position: relative; flex: none;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .badge {
  position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--rose); color: #fff; border-radius: 8px; font-size: 9.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}
main#views { padding: 0 18px 100px; flex: 1; }
.view-head { display: flex; align-items: center; gap: 12px; padding: 6px 0 14px; }
.view-head h2 { margin: 0; font-size: 19px; letter-spacing: -.4px; }
.view-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.back-btn { width: 36px; height: 36px; border-radius: 11px; background: #f4f7f5; display: flex; align-items: center; justify-content: center; color: #3d5045; flex: none; }

/* ---------- salary hero ---------- */
.hero {
  background: linear-gradient(135deg, #14a95a 0%, #0c7c40 100%);
  border-radius: 22px; padding: 18px 18px 16px; color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 14px 28px rgba(12, 124, 64, .24);
}
.hero::after {
  content: ''; position: absolute; width: 170px; height: 170px; right: -55px; top: -70px;
  border-radius: 50%; background: rgba(255, 255, 255, .1);
}
.hero::before {
  content: ''; position: absolute; width: 110px; height: 110px; right: 20px; bottom: -70px;
  border-radius: 50%; background: rgba(255, 255, 255, .07);
}
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; position: relative; z-index: 1; }
.hero-label { font-size: 12px; opacity: .88; display: flex; align-items: center; gap: 6px; }
.hero-label svg { width: 14px; height: 14px; }
.hero-amount { font-size: 29px; font-weight: 800; letter-spacing: -1px; margin: 5px 0 0; }
.hero-pill { background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); color: #fff; font-size: 11.5px; font-weight: 600; padding: 6px 11px; border-radius: 20px; }
.hero-target { margin-top: 16px; position: relative; z-index: 1; }
.hero-target .row { display: flex; justify-content: space-between; font-size: 11.5px; opacity: .95; margin-bottom: 7px; }
.bar { height: 7px; background: rgba(255, 255, 255, .25); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: #fff; border-radius: 6px; }

/* ---------- menu grid ---------- */
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 11px; }
.section-title h3 { margin: 0; font-size: 14.5px; font-weight: 800; }
.section-title a, .section-title button { font-size: 12px; color: var(--green-d); font-weight: 600; }
.menu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; }
.menu-item { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.menu-ic {
  width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  background: #f4f8f5; color: var(--green-d);
}
.menu-ic svg { width: 23px; height: 23px; }
.menu-item span { font-size: 11px; font-weight: 600; color: #43564b; line-height: 1.25; }
.menu-ic.c1 { background: var(--green-l); color: #12864f; }
.menu-ic.c2 { background: var(--blue-l); color: var(--blue); }
.menu-ic.c3 { background: var(--rose-l); color: var(--rose); }
.menu-ic.c4 { background: var(--amber-l); color: #cf8600; }
.menu-ic.c5 { background: var(--purple-l); color: var(--purple); }
.menu-ic.c6 { background: var(--teal-l); color: var(--teal); }
.menu-ic.c7 { background: #eef3f0; color: #4e6a5b; }
.menu-ic.c8 { background: #fdeef7; color: #d2418c; }

/* ---------- cards ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.card.flat { box-shadow: none; }
.card + .card { margin-top: 12px; }
.schedule { display: flex; align-items: center; gap: 13px; }
.schedule .time { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.schedule .time svg { width: 13px; height: 13px; }
.schedule h4 { margin: 3px 0 0; font-size: 14px; }
.schedule p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }
.schedule .btn { width: auto; margin-left: auto; padding: 9px 16px; border-radius: 10px; font-size: 12.5px; }
.sch-ic { width: 46px; height: 46px; border-radius: 14px; background: var(--green-l); color: var(--green-d); display: flex; align-items: center; justify-content: center; flex: none; }
.sch-ic svg { width: 22px; height: 22px; }

/* ---------- attendance ---------- */
.date-nav { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 8px 10px; margin-bottom: 14px; }
.date-nav button { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #56695e; background: #f5f8f6; }
.date-nav strong { font-size: 13px; }
.clock-card { text-align: center; padding: 24px 16px; position: relative; }
.ring { width: 190px; height: 190px; margin: 0 auto 6px; position: relative; }
.ring svg { width: 190px; height: 190px; transform: rotate(-90deg); }
.ring .ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .big { font-size: 34px; font-weight: 800; letter-spacing: -1.5px; color: #16302a; font-variant-numeric: tabular-nums; }
.ring .small { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.ring .small svg { width: 13px; height: 13px; color: var(--green); }
.status-live { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--green-l); color: var(--green-d); }
.status-live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.seg-tabs { display: flex; gap: 4px; background: #f1f5f2; padding: 4px; border-radius: 12px; margin-bottom: 14px; }
.seg-tabs button { flex: 1; padding: 9px; border-radius: 9px; font-weight: 700; font-size: 12.5px; color: #6c7d73; }
.seg-tabs button.active { background: #fff; color: var(--green-d); box-shadow: var(--shadow-sm); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f5f2; }
.list-row:last-child { border-bottom: 0; }
.day-ic { width: 40px; height: 40px; border-radius: 12px; background: #f4f8f5; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.day-ic b { font-size: 13px; line-height: 1; }
.day-ic span { font-size: 9px; color: var(--muted); text-transform: uppercase; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row h4 { margin: 0; font-size: 13px; font-weight: 700; }
.list-row p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }
.chip { font-size: 10.5px; font-weight: 700; padding: 4px 9px; border-radius: 20px; white-space: nowrap; }
.chip.ok { background: var(--green-l); color: var(--green-d); }
.chip.wait { background: var(--amber-l); color: #b07300; }
.chip.no { background: var(--rose-l); color: #cc3a53; }
.chip.info { background: var(--blue-l); color: #2456bd; }
.chip.muted { background: #f0f4f1; color: #61756a; }

/* ---------- form ---------- */
.field textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 13px; background: #fbfdfb; outline: none; resize: vertical; min-height: 78px; }
.field select { width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 13px; background: #fbfdfb; outline: none; appearance: none; }
.select-wrap { position: relative; }
.select-wrap::after { content: ''; position: absolute; right: 15px; top: 50%; width: 7px; height: 7px; border-right: 2px solid #93a49a; border-bottom: 2px solid #93a49a; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.upload-box {
  border: 1.5px dashed #cfe0d5; border-radius: 14px; padding: 16px; text-align: center; color: #6f8277;
  background: #fafdfb; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px;
}
.upload-box svg { width: 24px; height: 24px; color: #8aa896; }
.upload-preview { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.upload-preview img { width: 62px; height: 62px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 11px; color: #8a9a91; margin-top: 5px; }
.form-card { padding: 16px; }

/* ---------- slip ---------- */
.slip-total { text-align: center; padding: 18px 12px; border-bottom: 1px dashed #dbe7e0; }
.slip-total p { margin: 0; font-size: 12px; color: var(--muted); }
.slip-total h3 { margin: 6px 0 8px; font-size: 27px; letter-spacing: -1px; color: var(--green-d); }
.slip-row { display: flex; justify-content: space-between; padding: 9px 2px; font-size: 13px; }
.slip-row span { color: #5d7166; }
.slip-row b { font-weight: 700; }
.slip-row.minus b { color: #cc3a53; }
.slip-sep { height: 1px; background: #edf3ef; margin: 6px 0; }
.slip-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid #eef4f0; margin-bottom: 12px; }
.slip-head img { width: 42px; height: 42px; }
.slip-head h4 { margin: 0; font-size: 14px; }
.slip-head p { margin: 1px 0 0; font-size: 10.5px; color: var(--muted); }

/* ---------- bottom nav ---------- */
.bottomnav {
  position: sticky; bottom: 0; z-index: 40; background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; color: #86968d; font-size: 10px; font-weight: 600; padding: 3px 0; }
.nav-item svg { width: 21px; height: 21px; }
.nav-item.active { color: var(--green-d); }
.nav-item.active .nav-ic { background: var(--green-l); }
.nav-ic { padding: 4px 12px; border-radius: 12px; display: flex; transition: .18s; }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 30px 16px; color: #8b9b92; }
.empty svg { width: 42px; height: 42px; color: #c3d4c9; margin-bottom: 8px; }
.empty h4 { margin: 0 0 4px; color: #52665a; font-size: 13.5px; }
.empty p { margin: 0; font-size: 12px; }
.skeleton { background: linear-gradient(90deg, #f0f5f2 25%, #e6efe9 37%, #f0f5f2 63%); background-size: 400% 100%; animation: sk 1.3s infinite; border-radius: 12px; height: 80px; }
@keyframes sk { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }
#toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); z-index: 200;
  background: #12281d; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 12.5px;
  max-width: 88vw; opacity: 0; pointer-events: none; transition: .25s; box-shadow: 0 12px 28px rgba(0, 0, 0, .24);
  text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: #8f2436; }

.modal-wrap { position: fixed; inset: 0; z-index: 150; background: rgba(10, 32, 21, .48); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
@media (min-width: 520px) { .modal-wrap { align-items: center; padding: 20px; } }
.modal {
  background: #fff; width: 100%; max-width: 440px; border-radius: 24px 24px 0 0; padding: 20px;
  max-height: 88vh; overflow: auto; animation: up .25s ease;
}
@media (min-width: 520px) { .modal { border-radius: 24px; } }
@keyframes up { from { transform: translateY(24px); opacity: .6 } to { transform: none; opacity: 1 } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-head p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.modal-close { width: 34px; height: 34px; border-radius: 10px; background: #f4f7f5; display: flex; align-items: center; justify-content: center; color: #55685d; }
.sheet-item { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid #f0f5f2; width: 100%; text-align: left; }
.sheet-item:last-child { border-bottom: 0; }
.sheet-item .menu-ic { width: 40px; height: 40px; border-radius: 12px; }
.sheet-item .menu-ic svg { width: 19px; height: 19px; }
.sheet-item h4 { margin: 0; font-size: 13.5px; }
.sheet-item p { margin: 1px 0 0; font-size: 11px; color: var(--muted); }
.sheet-item > svg:last-child { margin-left: auto; width: 18px; height: 18px; color: #a9b8af; }

.progress-line { height: 6px; background: #eef4f0; border-radius: 5px; overflow: hidden; }
.progress-line > i { display: block; height: 100%; background: var(--green); border-radius: 5px; }

/* print slip */
@media print {
  body { background: #fff; }
  #appRoot { max-width: 100%; box-shadow: none; }
  .topbar, .bottomnav, .no-print, .hero, .menu-grid { display: none !important; }
  main#views { padding: 0; }
  .modal-wrap { position: static; background: #fff; display: block; padding: 0; }
  .modal { max-height: none; box-shadow: none; border-radius: 0; max-width: 100%; }
  .modal-head .modal-close { display: none; }
}
