/* MOISE Tips Control – brand: navy #030F22, gold #FBD649 */
@font-face { font-family: 'Almoni'; src: url('fonts/almoni-regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Almoni'; src: url('fonts/almoni-bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
:root {
  --navy: #030F22; --navy2: #0B1D3A; --navy3: #16294a; --gold: #FBD649; --goldd: #C9A82A; --gold-soft: #FFF6D1;
  --bg: #F4F5F8; --card: #FFFFFF; --ink: #111827; --mute: #5B6577; --line: #E3E6EC; --soft: #F8F9FB;
  --ok: #0E7A4F; --ok-bg: #E6F5EE; --warn: #9A6200; --warn-bg: #FFF4DB; --bad: #B42318; --bad-bg: #FDECEA; --info: #1D4ED8; --info-bg: #EAF0FF;
  --r: 14px; --shadow: 0 1px 2px rgba(3,15,34,.06), 0 4px 16px rgba(3,15,34,.05);
  font-family: 'Almoni', 'Heebo', 'Assistant', 'Segoe UI', system-ui, -apple-system, 'Noto Sans', 'Noto Sans Hebrew', 'Noto Sans Devanagari', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--info); }
.num, .money, td.n { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
[dir=rtl] .money, [dir=rtl] td.n { text-align: left; }
[dir=ltr] td.n { text-align: right; }

/* top bar */
.top { position: sticky; top: 0; z-index: 30; background: var(--navy); color: #fff; border-bottom: 3px solid var(--gold); }
.top-in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.top img.logo { height: 30px; width: auto; display: block; }
.top .ttl { font-weight: 700; font-size: 15px; color: var(--gold); letter-spacing: .02em; }
.top .sp { flex: 1; }
.top .who { font-size: 13px; color: #cfd5df; }
.top .lang { background: transparent; border: 1px solid #3a4a66; color: #fff; border-radius: 8px; padding: 4px 8px; font-size: 13px; cursor: pointer; }
.testbar { background: #B42318; color: #fff; text-align: center; font-size: 12.5px; font-weight: 600; padding: 4px 8px; }

/* nav */
.nav { position: fixed; bottom: 0; inset-inline: 0; z-index: 40; background: var(--navy); display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 2px solid var(--gold); }
.nav a { flex: 1; text-align: center; color: #aeb6c4; text-decoration: none; font-size: 11.5px; padding: 4px 2px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.nav a svg { width: 22px; height: 22px; }
.nav a.on { color: var(--gold); background: rgba(251,214,73,.08); }
@media (min-width: 980px) {
  body { padding-bottom: 0; }
  .nav { position: sticky; top: 53px; bottom: auto; justify-content: center; gap: 6px; padding: 6px 12px; border-top: 0; border-bottom: 1px solid var(--navy3); background: var(--navy2); }
  .nav a { flex: 0 0 auto; flex-direction: row; gap: 8px; font-size: 14px; padding: 8px 14px; }
  .nav a svg { width: 18px; height: 18px; }
}

/* layout */
main { max-width: 1240px; margin: 0 auto; padding: 14px 12px 28px; }
@media (min-width: 700px) { main { padding: 22px 20px 40px; } }
h1 { font-size: 21px; margin: 4px 0 14px; color: var(--navy); }
h2 { font-size: 16.5px; margin: 0 0 10px; color: var(--navy); display: flex; align-items: center; gap: 8px; }
h2 .bar { width: 4px; height: 18px; background: var(--gold); border-radius: 2px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; margin-bottom: 14px; border: 1px solid #edf0f4; }
@media (min-width: 700px) { .card { padding: 18px; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }
.muted { color: var(--mute); font-size: 13px; }
.small { font-size: 12.5px; }
.hide { display: none !important; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (min-width: 1100px) { .kpis.k5 { grid-template-columns: repeat(5, minmax(0,1fr)); } }
.kpi { background: var(--card); border-radius: 12px; padding: 12px 13px; border: 1px solid #edf0f4; box-shadow: var(--shadow); min-width: 0; }
.kpi .l { font-size: 12.5px; color: var(--mute); }
.kpi .v { font-size: 20px; font-weight: 700; color: var(--navy); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.kpi .s { font-size: 12px; color: var(--mute); margin-top: 2px; }
.kpi.hero { background: var(--navy); color: #fff; border: 0; }
.kpi.hero .l { color: #c8cfdb; } .kpi.hero .v { color: var(--gold); font-size: 24px; } .kpi.hero .s { color: #aeb6c4; }
.up { color: var(--ok); } .down { color: var(--bad); }

/* buttons & inputs */
.btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.btn:hover { border-color: #c7cdd8; }
.btn.pri { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.gold { background: var(--gold); color: var(--navy); border-color: var(--goldd); }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.danger { color: var(--bad); border-color: #f3c9c4; }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; justify-content: center; }
label.f { display: block; font-size: 12.5px; color: var(--mute); margin-bottom: 10px; }
label.f > input, label.f > select, label.f > textarea { display: block; width: 100%; margin-top: 4px; }
input[type=text], input[type=number], input[type=password], input[type=date], input[type=search], select, textarea {
  border: 1px solid #d5dae3; border-radius: 10px; padding: 9px 11px; background: #fff; min-height: 40px; outline: none; font-size: 15px; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(251,214,73,.45); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 8px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--navy); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--soft); color: var(--mute); border: 1px solid var(--line); }
.chip.draft { background: #EEF1F6; color: #3c4a62; } .chip.calculated { background: var(--info-bg); color: var(--info); border-color: #cfdcff; }
.chip.approved { background: var(--gold-soft); color: #7a5b00; border-color: #f0dc8a; } .chip.partially_paid { background: var(--warn-bg); color: var(--warn); border-color: #f3dba3; }
.chip.paid { background: var(--ok-bg); color: var(--ok); border-color: #b8e2cc; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: #f3dba3; } .chip.bad { background: var(--bad-bg); color: var(--bad); border-color: #f3c9c4; }
.chip.g { background: var(--navy); color: var(--gold); border-color: var(--navy); }

/* stepper of statuses */
.steps { display: flex; gap: 4px; margin: 4px 0 12px; overflow-x: auto; }
.steps span { flex: 1; min-width: 76px; text-align: center; font-size: 11.5px; padding: 6px 4px; border-radius: 8px; background: #E9ECF2; color: #6b7487; font-weight: 600; }
.steps span.done { background: var(--navy); color: #fff; } .steps span.cur { background: var(--gold); color: var(--navy); }

/* tables */
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; border: 1px solid var(--line); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
table.t th { background: var(--navy); color: #fff; font-weight: 600; padding: 9px 10px; text-align: start; position: sticky; top: 0; white-space: nowrap; font-size: 13px; cursor: default; }
table.t th.sort { cursor: pointer; } table.t th.sort:after { content: ' ⇅'; color: #7f8aa0; font-size: 11px; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:nth-child(even) td { background: var(--soft); }
table.t tr.zero td { color: #8a93a5; background: #fbf7ea; }
table.t tr.miss td { background: var(--bad-bg); }
table.t tfoot td { font-weight: 700; background: var(--gold-soft) !important; border-top: 2px solid var(--navy); }
.dayin { width: 72px; text-align: center; padding: 7px 4px !important; min-height: 38px; font-weight: 700; }
.dayin.miss { border-color: var(--bad); background: #fff5f4; }

/* mobile employee cards in the month screen */
.ecards { display: grid; gap: 10px; }
.ecard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; }
.ecard.zero { background: #fbf7ea; } .ecard.miss { border-color: #f0b4ad; background: #fff7f6; }
.ecard .top1 { display: flex; align-items: center; gap: 8px; }
.ecard .nm { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ecard .amts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--mute); }
.ecard .amts b { display: block; font-size: 14.5px; color: var(--ink); }
.stepper { display: inline-flex; align-items: center; border: 1px solid #d5dae3; border-radius: 10px; overflow: hidden; background: #fff; }
.stepper button { width: 38px; height: 38px; border: 0; background: var(--soft); font-size: 20px; cursor: pointer; color: var(--navy); }
.stepper input { width: 52px; border: 0 !important; text-align: center; font-weight: 700; min-height: 38px; padding: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
.show-desk { display: none; }
@media (min-width: 900px) { .show-desk { display: block; } .show-mob { display: none; } }

/* alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; margin-bottom: 8px; font-size: 14px; }
.alert.warn { background: var(--warn-bg); color: #6b4700; } .alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.info { background: var(--info-bg); color: #1e3a8a; } .alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert a { color: inherit; font-weight: 700; }

/* modal (bottom sheet on phone) */
.modal-bg { position: fixed; inset: 0; background: rgba(3,15,34,.55); z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 16px; } }
.modal h3 { margin: 0 0 12px; color: var(--navy); font-size: 17px; display: flex; align-items: center; gap: 8px; }
.modal h3 .x { margin-inline-start: auto; border: 0; background: var(--soft); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 18px; }
.toast { position: fixed; bottom: calc(86px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 200; font-size: 14px; box-shadow: var(--shadow); border-inline-start: 4px solid var(--gold); max-width: 92vw; }
.toast.err { border-color: #ff6b5e; }
@media (min-width: 980px) { .toast { bottom: 24px; } }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal .h { text-align: center; font-size: 11px; color: var(--mute); }
.cal button { aspect-ratio: 1; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; }
.cal button.work { background: var(--navy); color: var(--gold); border-color: var(--navy); }
.cal button.vacation { background: #E0ECFF; color: #1e3a8a; } .cal button.sick { background: #FDE2E0; color: var(--bad); } .cal button.absent { background: #EEE; color: #555; text-decoration: line-through; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; margin: 8px 0; }

/* login */
.login { max-width: 380px; margin: 8vh auto; padding: 0 16px; }
.login .brand { background: var(--navy); border-radius: 16px 16px 0 0; padding: 22px; text-align: center; border-bottom: 3px solid var(--gold); }
.login .brand img { height: 52px; } .login .brand div { color: var(--gold); font-weight: 700; margin-top: 8px; }
.login .card { border-radius: 0 0 16px 16px; }

/* chart */
.chart svg { width: 100%; height: auto; display: block; }
.chart .lg { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; margin-top: 6px; }
.chart .lg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: middle; }

/* receipt (print) */
.receipt { background: #fff; max-width: 720px; margin: 0 auto; padding: 22px; border-radius: 12px; border: 1px solid var(--line); }
.receipt .rh { background: var(--navy); color: #fff; border-radius: 8px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 3px solid var(--gold); }
.receipt .rh img { height: 40px; } .receipt .rh h2 { color: #fff; margin: 0; font-size: 18px; } .receipt .rh .co { color: #cfd5df; font-size: 12px; }
.receipt table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14.5px; }
.receipt td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.receipt td.v { text-align: end; font-weight: 600; font-variant-numeric: tabular-nums; }
.receipt tr.big td { font-size: 16px; font-weight: 700; color: var(--navy); background: var(--gold-soft); }
.receipt .sig { display: flex; gap: 30px; margin-top: 46px; } .receipt .sig div { flex: 1; border-top: 1.5px solid var(--navy); padding-top: 6px; font-size: 13px; color: var(--mute); }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; padding: 0; }
  .top, .nav, .testbar, .noprint, .toast { display: none !important; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .receipt { border: 0; padding: 0; }
  .modal-bg { position: static; background: none; } .modal { max-height: none; box-shadow: none; }
  table.t th { position: static; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.empty { text-align: center; padding: 26px 10px; color: var(--mute); }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid #c9d0dc; border-top-color: var(--navy); border-radius: 50%; animation: s 0.8s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }
.seg { display: inline-flex; background: #E9ECF2; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: #4b556a; }
.seg button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.pillbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.pillbar select { min-height: 38px; padding: 6px 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: var(--gold); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.elist { display: grid; gap: 8px; }
.eitem { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.eitem:hover { border-color: #c7cdd8; }
.formula { background: var(--soft); border: 1px dashed #cfd5df; border-radius: 10px; padding: 10px 12px; font-size: 13px; color: #3b4558; }
.formula code { direction: ltr; unicode-bidi: isolate; background: #fff; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); }

/* phone fixes after UI check */
select { max-width: 100%; }
.pillbar > select#pp { flex: 1 1 100%; min-width: 0; }
.grid2 > * { min-width: 0; }
.eitem { flex-wrap: wrap; }
.eitem .grow { min-width: 150px; }
a.btn { text-decoration: none; color: var(--ink); }
a.btn.ok, a.btn.pri { color: #fff; }
.formula code { white-space: normal; word-break: break-word; display: inline; }
.steps span { min-width: 0; font-size: 11px; padding: 6px 2px; }
.row > h2.grow { min-width: 170px; }
.nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* attendance: QR poster + PIN slips */
.poster { text-align: center; padding: 10px; }
.poster .plogo { height: 60px; background: var(--navy); padding: 10px 18px; border-radius: 10px; }
.poster h2 { justify-content: center; font-size: 26px; margin: 14px 0 2px; }
.poster .psub { color: var(--mute); margin-bottom: 12px; }
.poster svg { max-width: 100%; height: auto; border: 6px solid var(--gold); border-radius: 12px; padding: 4px; }
.poster .pbr { font-weight: 700; font-size: 18px; color: var(--navy); margin: 10px 0; }
.poster ol { text-align: start; display: inline-block; font-size: 14px; }
.slips { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.slip { border: 1.5px dashed #9aa3b5; border-radius: 10px; padding: 10px; break-inside: avoid; }
.slip-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; } .slip-h img { height: 22px; background: var(--navy); padding: 3px 6px; border-radius: 5px; }
.slip-b { display: flex; gap: 10px; align-items: center; } .slip .big { font-size: 20px; font-weight: 700; letter-spacing: .06em; direction: ltr; color: var(--navy); }
@media print { body.pm main, body.pm .testbar, body.pm .modal h3 .x, body.pm .noprint { display: none !important; } body.pm .modal { width: auto; max-width: none; padding: 0; } .slips { grid-template-columns: 1fr 1fr; } }
.poster .plines { font-size: 14px; line-height: 1.8; color: var(--ink); }

/* attendance month grid */
.gridwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table.agrid { border-collapse: separate; border-spacing: 0; font-size: 12px; width: 100%; }
table.agrid th, table.agrid td { padding: 3px 2px; text-align: center; border-bottom: 1px solid var(--line); min-width: 24px; }
table.agrid th { background: var(--navy); color: #fff; font-weight: 600; position: sticky; top: 0; }
table.agrid .nm { position: sticky; inset-inline-start: 0; z-index: 2; background: #fff; text-align: start; min-width: 104px; max-width: 120px; padding-inline: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; box-shadow: inset -1px 0 0 var(--line); }
table.agrid th.nm { background: var(--navy); color: #fff; z-index: 3; }
table.agrid .sat { background: #F3F0E2; } table.agrid th.sat { background: #1d2b45; }
table.agrid .tot { min-width: 30px; background: var(--gold-soft); } table.agrid th.tot { background: var(--goldd); color: var(--navy); }
.gc { display: inline-flex; width: 20px; height: 20px; border-radius: 5px; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; vertical-align: middle; }
.gc.approved { background: var(--navy); color: var(--gold); } .gc.pending { background: var(--warn-bg); color: var(--warn); border: 1px solid #f3dba3; }
.gc.rejected { background: var(--bad-bg); color: var(--bad); } .gc.none { background: #fff; border: 1px dashed #c3c9d4; } .gc.fut { background: transparent; }
.gc.fl { box-shadow: 0 0 0 2px var(--bad); }
.legend .gc { width: 16px; height: 16px; font-size: 10px; margin-inline-start: 6px; }
