* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #0b1020; --card: #151d3a; --line: #243056; --ink: #eef2ff; --muted: #9fb0d0;
  --brand: #6c5ce7; --brand2: #00d4ff; --green: #22c55e; --red: #ef4444;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); min-height: 100vh; overflow-x: hidden;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.hidden { display: none !important; }
.view { min-height: 100vh; display: flex; flex-direction: column; }

.brand { font-weight: 700; letter-spacing: .3px; }
.brand b { color: var(--brand2); }
.brand.big { font-size: 22px; }

/* Login */
#view-login { align-items: center; justify-content: center; padding: 24px; }
.card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 28px; }
.card .brand.big { text-align: center; margin-bottom: 22px; }
form { display: flex; flex-direction: column; gap: 14px; }
input {
  width: 100%; padding: 15px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: #0f1730; color: var(--ink); font-size: 16px; outline: none;
}
input:focus { border-color: var(--brand); }

.btn { border: none; border-radius: 12px; font-size: 16px; font-weight: 700; color: #fff;
  padding: 15px; cursor: pointer; }
.btn:disabled { opacity: .6; }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand2)); }
.btn.success { background: var(--green); }
.btn.danger { background: var(--red); }

/* Top bar */
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--line); }
.actions { display: flex; gap: 6px; }
.icon-btn { background: transparent; border: none; color: var(--ink); font-size: 20px;
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer; }
.icon-btn:active { background: #1b2748; }

/* Home */
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 24px; text-align: center; }
.big-icon { font-size: 84px; line-height: 1; }
.status { font-size: 20px; color: var(--muted); }
.punch { width: 100%; max-width: 320px; padding: 20px; font-size: 20px; letter-spacing: 1px; }
.msg { min-height: 22px; font-size: 15px; }
.msg.ok { color: var(--green); }
.msg.err { color: #f59e0b; }
.hint { font-size: 12px; color: #64748b; margin-top: 4px; }
.secondary { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 22px; }
.btn.ghost2 { background: var(--card); border: 1px solid var(--line); color: var(--ink); font-size: 14px; padding: 12px 16px; }
.leave-body { padding: 18px; }
.leave-body > * { margin-bottom: 14px; }
.leave-body form { display: flex; flex-direction: column; gap: 14px; }
.balance { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-align: center; }
.balance b { font-size: 30px; color: var(--brand2); display: block; }
.row2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.row2 label { min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.leave-body { max-width: 100%; }
.leave-body input, .leave-body textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.lv-item { gap: 10px; }
.lv-item > div { min-width: 0; }
textarea { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: #0f1730; color: var(--ink); font-size: 15px; font-family: inherit; }
.lv-item { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.lv-status { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.lv-status.pending { background: rgba(245,158,11,.15); color: #f59e0b; }
.lv-status.approved { background: rgba(34,197,94,.15); color: #22c55e; }
.lv-status.rejected { background: rgba(239,68,68,.15); color: #ef4444; }
.err { color: #f87171; font-size: 14px; min-height: 18px; }

/* History */
.list { flex: 1; overflow: auto; }
.row { display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px; border-bottom: 1px solid var(--line); }
.row-date { font-weight: 600; }
.row-times { color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); padding: 24px; text-align: center; }
