:root {
  /* Turquoise, with the mark-iT-ing logo's blue / green / red / yellow dots */
  --brand: #0c8599;
  --brand-dark: #0b4f5c;
  --dot-blue: #2f80c3;
  --dot-green: #43a047;
  --dot-red: #e53935;
  --dot-yellow: #f9b800;
  --bg: #f5f3ee;
  --card: #ffffff;
  --text: #1d2b30;
  --muted: #6e7086;
  --line: #e9e5dc;
  --soft: #faf8f4;
  --primary: #0c8599;
  --primary-dark: #0a6c7d;
  --primary-soft: #e3f6f8;
  --ok: #0c8599;
  --ok-bg: #e3f6f8;
  --warn: #8a5a00;
  --warn-bg: #fff4d6;
  --error: #c62828;
  --error-bg: #fdecea;
  --radius: 20px;
  --shadow: 0 2px 0 #ebe6dc;
  --sidebar: 248px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 "Assistant", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- side menu */

/* The menu stands on the right side of the screen, the page beside it. */
body:has(.topbar) { padding-right: var(--sidebar); }
.topbar {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--sidebar); z-index: 10;
  display: flex; flex-direction: column; gap: 26px;
  padding: 26px 14px 18px; overflow-y: auto;
  background: var(--brand-dark);
}
.topbar a, .topbar .link { color: rgba(255, 255, 255, .85); }
.topbar .brand { padding: 0 8px; }

/* The marktime logo (templates/_brand.html). */
.mt { display: inline-flex; align-items: center; gap: 10px; text-align: left; }
.mt-icon { flex: none; }
.mt-text { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.mt-word { font-family: "Open Sans", "Segoe UI", sans-serif; font-weight: 800; font-size: 28px; letter-spacing: -.4px; white-space: nowrap; }
/* A gap before the k, as in the mark-iT-ing logo. */
.mt-k { display: inline-block; height: .76em; width: .54em; margin-left: .08em; vertical-align: baseline; }
.mt-mark { color: #4466a1; }
.mt-k-stem { fill: #4466a1; }
.mt-time { color: var(--brand); }
.mt-by { margin-top: 4px; font-family: "Open Sans", "Segoe UI", sans-serif; font-size: 11px; font-weight: 500; color: #000; }
/* On the dark menu: "mark" in white and "time" in light turquoise, so they read on the dark turquoise. */
.topbar .mt-mark, .topbar .mt-by { color: #fff; }
.topbar .mt-k-stem { fill: #fff; }
.topbar .mt-time { color: #7fd8e3; }
/* Above the sign-in card. */
.auth-brand { display: flex; justify-content: center; margin: 40px 0 0; }
/* Under the logo on the sign-in pages: the message (if any), then the card, all in one narrow column. */
.auth-brand ~ .flash { max-width: 420px; margin: 24px auto 0; }
.auth-brand ~ .narrow { margin-top: 24px; }
.auth-brand .mt-word { font-size: 42px; }
.auth-brand .mt-by { font-size: 14px; margin-top: 6px; }
.topbar nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.topbar nav a {
  padding: 10px 14px; border-radius: 999px; font-weight: 600; font-size: 15.5px; color: #fff;
  transition: background .15s, color .15s;
}
.topbar nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; }
.topbar nav a.active { background: #fff; color: var(--brand-dark); text-decoration: none; }
.topbar .me {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 16px 12px 0; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 16px;
}
.topbar .me > span { color: #fff; font-weight: 700; font-size: 17px; }
.topbar .me a:hover, .topbar .me .link:hover { color: #fff; }

main { max-width: 1140px; margin: 0 auto; padding: 34px 28px 64px; }

h1 { font-size: 30px; font-weight: 800; margin: 0 0 4px; letter-spacing: -.3px; }
h2 { font-size: 17px; font-weight: 700; margin: 0 0 14px; }
.sub { color: var(--muted); margin: 0 0 20px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 20px;
}

.narrow { max-width: 420px; margin: 56px auto; }
.narrow.card { padding: 30px 30px 26px; }

.flash { padding: 11px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--error-bg); color: var(--error); }
.notice { background: var(--warn-bg); color: var(--warn); padding: 11px 16px; border-radius: 10px; margin-bottom: 16px; }

/* ---------------------------------------------------------------- tables */

/* Separate borders belong to the cells, so they move with the sticky headings instead of showing through. */
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; }
th { background: var(--soft); color: #4a5568; font-weight: 600; font-size: 13.5px; }
thead th:first-child { border-start-start-radius: 12px; }
thead th:last-child { border-start-end-radius: 12px; }
tbody tr:hover td { background: #fbfaf7; }
tbody tr:last-child td { border-bottom: 0; }
/* Heading rows stay visible while scrolling, as one block (base.html moves them into <thead>). */
thead { position: sticky; top: 0; z-index: 2; }
td.num, th.num { text-align: center; }
.table-wrap { overflow-x: auto; }
/* On wide screens the tables fit, so drop the side scroller: it would stop the headings from sticking. */
@media (min-width: 1000px) { .table-wrap { overflow: visible; } }

th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover, th.sortable:focus-visible { background: #f2efe8; outline: none; }
.sort-arrow { margin-inline-start: 6px; font-size: 11px; color: #b3bccb; }
.sort-arrow.on { color: var(--primary); }

strong.over { color: var(--error); }

/* ---------------------------------------------------------------- forms */

label { display: block; font-size: 13.5px; font-weight: 500; color: #4a5568; margin-bottom: 5px; }
input[type=text], input[type=password], input[type=email], input[type=search], input[type=date], input[type=month],
input[type=number], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d6dce6;
  border-radius: 12px;
  font: inherit;
  color: var(--text);
  background: #fdfcfa;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(12, 133, 153, .18);
}
input[type=checkbox] { accent-color: var(--primary); }
.field { margin-bottom: 16px; }
input[readonly] { background: #eef1f6; color: var(--muted); }
.actions input[type=text] { flex: 1 1 220px; }

.perm-list { display: grid; gap: 10px; margin: 6px 0 10px; }
.perm-list .check {
  align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft);
}
.perm-list .check input { margin-top: 4px; }

/* Teams: the manager's number sits right next to the manager's name. */
th.manager-code-col, td.manager-code-col { width: 120px; }
th.manager-col, td.manager-col { width: 260px; }
td.manager-code-col .combo-input { width: 95px; }

/* Type-to-search box with suggestions (teams screen). */
.combo { position: relative; }
.combo::after { content: "▾"; position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
                color: var(--muted); pointer-events: none; font-size: 12px; }
.combo-input { padding-left: 26px; }
.combo-list { position: absolute; z-index: 5; top: calc(100% + 4px); right: 0; min-width: 230px; max-height: 260px;
              overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--card);
              border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(16, 24, 40, .14); }
.combo-list li { padding: 7px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.combo-list li.active, .combo-list li:hover { background: var(--primary); color: #fff; }
.combo-list li.none { color: var(--muted); cursor: default; background: none; }

th.check-col, td.check-col { width: 38px; text-align: center; }
.check-col input { width: 17px; height: 17px; cursor: pointer; }
.bulk-bar { margin-bottom: 14px; }
.bulk-card { padding-block: 14px; }
.bulk-card .bulk-bar { margin-bottom: 0; }

.calc-notes { margin: 10px 0 16px; padding-inline-start: 1.2em; display: grid; gap: 2px; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-left: 70px; }
.pw-toggle {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  padding: 2px 10px; font-size: 13px; background: #fff; color: var(--primary); border: 1px solid var(--line);
  box-shadow: none;
}
.pw-toggle:hover { background: var(--soft); }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
.check input { width: auto; }

.form-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.form-row .field { flex: 1 1 150px; margin-bottom: 0; }

/* ---------------------------------------------------------------- buttons */

.btn, button {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover, button:hover { background: var(--primary-dark); border-color: var(--primary-dark); text-decoration: none; }
.btn:focus-visible, button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(12, 133, 153, .28); }
.btn.ghost, button.ghost { background: #fff; color: var(--primary); border-color: #b5dee4; }
.btn.ghost:hover, button.ghost:hover { background: var(--primary-soft); border-color: var(--primary); }
.btn.ok, button.ok { background: var(--ok); border-color: var(--ok); }
.btn.ok:hover, button.ok:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.danger, button.danger { background: #fff; color: var(--error); border-color: #f0b8b3; }
.btn.danger:hover, button.danger:hover { background: var(--error-bg); border-color: var(--error); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.link { background: none; border: 0; padding: 0; color: var(--primary); font-weight: inherit; box-shadow: none; }
button.link:hover { text-decoration: underline; background: none; }
form.inline { display: inline; }
/* Buttons inside table rows are a size smaller, so the rows stay compact. */
td .btn, td button:not(.link) { padding: 5px 14px; font-size: 14px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.month-nav { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.month-nav input { width: auto; }

/* ---------------------------------------------------------------- badges, stats, balances */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.open { background: #eef1f6; color: var(--muted); }
.badge.submitted { background: var(--warn-bg); color: var(--warn); }
.badge.approved, .badge.final, .badge.processed { background: var(--ok-bg); color: var(--ok); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat .v { font-size: 24px; font-weight: 700; color: var(--text); }
.stat .l { font-size: 13px; color: var(--muted); }

.balances { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-bottom: 22px; }
/* Balance cards: turquoise for vacation, soft coral for sick days. */
.balance-card {
  border-radius: var(--radius); padding: 18px 22px; color: #fff;
  background: linear-gradient(135deg, #0b7285, #15aabf);
  box-shadow: 0 8px 22px rgba(11, 114, 133, .22);
}
.balance-card.sick { background: linear-gradient(135deg, #e07a6a, #f2a58e); box-shadow: 0 8px 22px rgba(224, 122, 106, .22); }
.balance-title { font-weight: 700; color: rgba(255, 255, 255, .9); }
.balance-value { font-size: 40px; font-weight: 800; line-height: 1.2; margin: 4px 0; }
.balance-detail { font-size: 13.5px; color: rgba(255, 255, 255, .85); }

/* ---------------------------------------------------------------- day table */

table.days td { padding: 5px 12px; }
table.days select, table.days input { padding: 5px 8px; }
table.days tr.off td { background: #f3f1ec; color: var(--muted); }
table.days tr.eve td { background: #fff8e8; }
table.days tr.moed td { background: #ecf7f8; }
table.days tr.absent td:nth-child(4) { font-weight: 600; }
table.days tr.absent select { border-color: #9fd3db; background: #effafb; }
.nowrap { white-space: nowrap; }
.actions.nowrap { flex-wrap: nowrap; }
.sticky-actions { position: sticky; bottom: 0; background: var(--card); padding: 12px 0 4px; border-top: 1px solid var(--line); }
.save-status { font-weight: 600; color: var(--muted); min-width: 150px; }
.save-status.saving { color: var(--warn); }
.save-status.saved { color: var(--ok); }
.save-status.error { color: var(--error); }
details.card summary { cursor: pointer; }

.search-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.search-row input[type=search] { max-width: 300px; }
.fold-all { margin-bottom: 14px; }
details.team-fold > summary { cursor: pointer; list-style: none; margin-bottom: 0; }
details.team-fold > summary::-webkit-details-marker { display: none; }
details.team-fold > summary h2 { margin: 0; }
details.team-fold > summary h2::before {
  content: "◂"; display: inline-block; width: 1.3em; color: var(--muted); transition: transform .15s;
}
details.team-fold[open] > summary h2::before { content: "▾"; }
details.team-fold:not([open]):hover { box-shadow: 0 2px 0 #ddd6c8, 0 6px 18px rgba(11, 79, 92, .07); }
details.team-fold[open] > summary { margin-bottom: 14px; }
.team-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

table.days.compact td, table.days.compact th { padding: 2px 8px; font-size: 13px; }
.detail-summary, .signatures { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 10px; font-size: 14px; }
.signatures { color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding-top: 8px; }

@media print {
  .topbar, .no-print, .flash { display: none; }
  body:has(.topbar) { padding-right: 0; }
  .sort-arrow { display: none; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .card { border: 0; padding: 0; margin: 0; box-shadow: none; }
  .employee-report { break-after: page; }
  table.days tr.off td { background: #eee; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Small screens: the side menu goes back to the top. */
@media (max-width: 900px) {
  body:has(.topbar) { padding-right: 0; }
  .topbar { position: static; width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 16px; }
  .topbar nav { flex-direction: row; flex-wrap: wrap; }
  .topbar nav a { padding: 6px 12px; font-size: 14.5px; }
  .topbar .me { flex-direction: row; width: 100%; border: 0; padding: 0; gap: 14px; }
  .topbar .brand { padding: 0; }
  .topbar .mt-word { font-size: 22px; }
}

@media (max-width: 640px) {
  main { padding: 20px 16px 48px; }
  .card { padding: 16px; }
  th, td { padding: 7px 6px; font-size: 14px; }
}

/* Doctor's notes attached to a month, and the paperclip next to a name in the lists. */
.files { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.files li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; background: var(--soft); border-radius: 12px; }
.files li a { font-weight: 600; }
/* The file input sits inside a Hebrew button; it stays focusable for the keyboard. */
.file-pick { position: relative; overflow: hidden; }
.file-pick input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-pick:focus-within { box-shadow: 0 0 0 3px rgba(12, 133, 153, .28); }
a.clip { text-decoration: none; font-size: 14px; }

/* Several days at once: the bar above the day table. */
.day-bulk { margin-bottom: 14px; padding: 10px 14px; background: var(--soft); border-radius: 12px; }
.day-bulk select { width: auto; min-width: 190px; }
table.days .check-col input { width: 18px; height: 18px; }

/* Guided tour: the page dimmed except the part being explained, and a bubble with the explanation. */
.tour-block { position: fixed; inset: 0; z-index: 999; }
.tour-shade {
  position: fixed; z-index: 1000; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .9), 0 0 0 9999px rgba(6, 38, 45, .58);
  transition: top .2s, left .2s, width .2s, height .2s;
}
.tour-bubble {
  position: fixed; z-index: 1001; width: 330px; max-width: calc(100vw - 24px);
  padding: 18px 20px 16px; background: #fff; border-radius: 18px; box-shadow: 0 14px 40px rgba(0, 0, 0, .28);
}
.tour-bubble h3 { margin: 4px 0 6px; font-size: 18px; color: var(--brand-dark); }
.tour-bubble p { margin: 0 0 14px; line-height: 1.55; }
.tour-count { font-size: 12.5px; font-weight: 700; color: var(--brand); }
.tour-actions { display: flex; align-items: center; gap: 10px; }
.tour-actions .link { margin-inline-start: auto; color: var(--muted); }


/* "אישור דיווח" at the left end of the bar above the day table. */
.day-bulk .submit-end { margin-inline-start: auto; }
