:root { --blue:#0c5bab; --blue-dark:#084680; --bg:#f1f5f9; --card:#fff; --text:#0f172a; --muted:#64748b; --line:#e2e8f0; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--text); font:16px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; -webkit-text-size-adjust:100%; }
h1 { font-size:1.35rem; margin:0 0 14px; }
h2 { font-size:1.05rem; margin:0 0 12px; }
h3 { font-size:.85rem; text-transform:uppercase; color:var(--muted); margin:18px 0 6px; }
.muted { color:var(--muted); margin:0 0 10px; }
.topbar { position:sticky; top:0; z-index:5; display:flex; align-items:center; justify-content:space-between; gap:12px; background:var(--blue); color:#fff; padding:calc(10px + env(safe-area-inset-top)) 16px 10px; }
.topbar-user { display:flex; flex-direction:column; min-width:0; }
.topbar-user strong, .topbar-user span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.topbar-user span { font-size:.8rem; opacity:.85; }
.btn-logout { background:rgba(255,255,255,.15); color:#fff; border:1px solid rgba(255,255,255,.5); border-radius:8px; padding:8px 14px; font:inherit; font-size:.9rem; }
/* Phone: menu fixed at the bottom */
.menu { position:fixed; bottom:0; left:0; right:0; z-index:10; display:flex; background:#fff; border-top:1px solid var(--line); padding-bottom:env(safe-area-inset-bottom); }
.menu a { flex:1; display:flex; flex-direction:column; align-items:center; gap:2px; padding:8px 2px; color:var(--muted); text-decoration:none; font-size:.72rem; }
.menu svg { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.menu a.active { color:var(--blue); font-weight:700; box-shadow:inset 0 3px 0 var(--blue); }
.container { max-width:980px; margin:0 auto; padding:16px 14px calc(90px + env(safe-area-inset-bottom)); }
.card { display:block; background:var(--card); border:1px solid var(--line); border-radius:14px; padding:16px; margin-bottom:14px; }
summary { cursor:pointer; font-weight:600; }
summary small { display:block; font-weight:400; color:var(--muted); }
details[open] summary { margin-bottom:12px; }
label, .label { display:block; font-size:.85rem; font-weight:600; color:#334155; }
input, select, textarea { display:block; width:100%; margin:4px 0 0; padding:11px 12px; min-height:46px; border:1px solid #cbd5e1; border-radius:10px; background:#fff; color:var(--text); font:inherit; font-size:16px; font-weight:400; }
input:focus, select:focus, textarea:focus { outline:2px solid var(--blue); border-color:transparent; }
input[type=checkbox] { display:inline-block; width:18px; height:18px; min-height:0; margin:0; vertical-align:middle; }
input[type=search] { margin-bottom:12px; }
.grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; }
.grid .full { grid-column:1 / -1; }
.chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; }
.chips label { border:1px solid var(--line); border-radius:20px; padding:8px 12px; }
.btn { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:9px 18px; border:1px solid transparent; border-radius:10px; font:inherit; font-weight:600; text-decoration:none; cursor:pointer; }
.btn-primary { background:var(--blue); color:#fff; }
.btn-primary:hover { background:var(--blue-dark); }
.btn-light { background:#fff; color:var(--blue); border-color:var(--blue); }
.btn-in { background:#15803d; color:#fff; }
.btn-out { background:#b91c1c; color:#fff; }
.btn-block { display:flex; width:100%; margin-bottom:14px; }
.btn-big { min-height:60px; font-size:1.2rem; margin:0; }
.btn:disabled { opacity:.6; }
.punch { text-align:center; }
.clock { font-size:2.3rem; font-weight:700; margin:0 0 12px; font-variant-numeric:tabular-nums; }
.punch-times { display:flex; gap:10px; margin-bottom:14px; }
.punch-times div { flex:1; background:var(--bg); border-radius:10px; padding:10px; }
.punch-times span { display:block; font-size:.78rem; color:var(--muted); }
.done { color:#15803d; font-weight:600; margin:0; }
.filter { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.filter input { margin:0; flex:1; min-width:0; }
table { width:100%; border-collapse:collapse; }
th { text-align:left; font-size:.75rem; text-transform:uppercase; color:var(--muted); background:var(--bg); padding:10px; }
td { padding:10px; border-bottom:1px solid var(--line); vertical-align:middle; overflow-wrap:anywhere; }
.actions { display:flex; gap:8px; flex-wrap:wrap; }
.actions form { display:flex; gap:8px; flex-wrap:wrap; }
.badge { display:inline-block; padding:3px 10px; border-radius:20px; font-size:.78rem; font-weight:700; background:#f1f5f9; color:#475569; }
.badge-present, .badge-approved, .badge-finalized { background:#dcfce7; color:#166534; }
.badge-absent, .badge-rejected { background:#fee2e2; color:#991b1b; }
.badge-pending, .badge-half_day, .badge-draft { background:#fef9c3; color:#713f12; }
.badge-leave { background:#e0f2fe; color:#075985; }
.empty { color:var(--muted); text-align:center; margin:8px 0; }
.alert { padding:12px 14px; border-radius:10px; margin-bottom:14px; font-weight:600; font-size:.92rem; }
.alert-success { background:#dcfce7; color:#166534; }
.alert-warning { background:#fef9c3; color:#713f12; }
.alert-error { background:#fee2e2; color:#991b1b; }
.tabs { display:flex; gap:8px; margin-bottom:14px; }
.tabs a { flex:1; text-align:center; padding:10px; border-radius:10px; background:#fff; border:1px solid var(--line); text-decoration:none; color:var(--muted); font-weight:600; font-size:.9rem; }
.tabs a.active { background:var(--blue); border-color:var(--blue); color:#fff; }
.list { list-style:none; padding:0; margin:0 0 14px; }
.list li { display:flex; justify-content:space-between; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); }
.list small { color:var(--muted); white-space:nowrap; }
.payslip-head { text-align:center; border-bottom:2px dashed #cbd5e1; margin-bottom:12px; }
.payslip-head h2 { margin-bottom:4px; }
.payslip-head p { margin:0 0 8px; font-size:.85rem; color:var(--muted); }
dl { display:grid; grid-template-columns:auto 1fr; gap:6px 16px; margin:0; }
dt { color:var(--muted); }
dd { margin:0; text-align:right; overflow-wrap:anywhere; }
.net { border-top:2px dashed #cbd5e1; margin-top:16px; padding-top:12px; font-size:1.15rem; font-weight:700; }
.net dt { color:var(--text); }
.button-row { display:flex; gap:10px; }
.button-row .btn { flex:1; }
.login-page { min-height:100vh; min-height:100dvh; display:flex; align-items:center; justify-content:center; padding:20px 16px; background:linear-gradient(160deg,var(--blue),var(--blue-dark)); }
.login-card { width:100%; max-width:400px; background:#fff; border-radius:18px; padding:28px 22px; text-align:center; }
.login-card form { text-align:left; }
.login-card label { margin-top:12px; }
.login-card .btn-block { margin:20px 0 0; min-height:50px; }
.login-logo { width:72px; height:72px; border-radius:16px; margin-bottom:10px; }
.password-box { display:flex; gap:8px; align-items:flex-end; }
.password-box input { flex:1; min-width:0; }
.password-box button { min-height:46px; border:1px solid #cbd5e1; background:var(--bg); border-radius:10px; padding:0 12px; font:inherit; font-size:.85rem; }
/* Phone: each table row becomes a card */
@media (max-width:699px) {
  thead { display:none; }
  table, tbody, tr, td { display:block; width:100%; }
  tr { border:1px solid var(--line); border-radius:10px; padding:6px 12px; margin-bottom:10px; }
  td { display:flex; justify-content:space-between; gap:16px; text-align:right; padding:6px 0; border-bottom:1px solid #f1f5f9; }
  td::before { content:attr(data-label); color:var(--muted); font-size:.82rem; text-align:left; white-space:nowrap; }
  td:last-child { border-bottom:0; }
  td.actions { display:flex; }
  td.actions::before { display:none; }
  td.actions > *, td.actions form .btn { flex:1; }
  td.actions > .btn { width:auto; }
}
/* Tablet and computer: menu under the top bar */
@media (min-width:700px) {
  .menu { position:static; justify-content:center; border-top:0; border-bottom:1px solid var(--line); }
  .menu a { flex:0 0 auto; flex-direction:row; gap:8px; font-size:.95rem; padding:12px 20px; }
  .menu a.active { box-shadow:inset 0 -3px 0 var(--blue); }
  .container { padding-bottom:32px; }
}
tr[hidden], [data-row][hidden] { display:none; }
@media print {
  .topbar, .menu, .no-print, h1, .alert { display:none !important; }
  body { background:#fff; }
  .card { border:0; }
}
