:root {
  --bg: #f4f6f8; --card: #fff; --line: #d9dee3; --ink: #1a1f24;
  --muted: #8a949e; --primary: #1D9E75; --primary-d: #157a5b;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; font-family: "Segoe UI", "Noto Sans Hebrew", Arial, sans-serif;
  background: var(--bg); color: var(--ink); }

/* ---------- login ---------- */
.login-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.login-card { background: var(--card); padding: 28px 24px; border-radius: 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,.1); width: min(360px, 90vw); text-align: center; }
.login-card h1 { margin: 0; color: var(--primary); }
.login-logo { width: 150px; height: auto; margin: 0 auto 4px; display: block; }
.login-card .sub { color: var(--muted); margin: 4px 0 18px; }
.login-card input { width: 100%; padding: 14px; margin: 7px 0; border: 1px solid var(--line);
  border-radius: 10px; font-size: 17px; }
.login-card button { width: 100%; padding: 14px; margin-top: 10px; border: 0; border-radius: 10px;
  background: var(--primary); color: #fff; font-size: 18px; font-weight: 700; }
.err { background: #fde8e8; color: #b42318; padding: 10px; border-radius: 8px; margin-bottom: 8px; }

/* ---------- top bar / nav ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center;
  background: #2c3e50; color: #fff; padding: 10px 14px; position: sticky; top: 0; z-index: 30; }
.brand { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.bar-logo { height: 30px; width: auto; background: #fff; border-radius: 6px; padding: 3px; }
.who { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.link { background: none; border: 0; color: #cdd8e3; text-decoration: underline; font-size: 14px; }

.weeknav { display: flex; gap: 8px; align-items: center; justify-content: center;
  padding: 10px; flex-wrap: wrap; }
.weeknav .nav { padding: 10px 14px; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; font-size: 15px; font-weight: 600; }
.weeknav input { padding: 9px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; }
.weeklabel { text-align: center; color: var(--muted); margin-bottom: 6px; font-size: 14px; }

/* month folders bar */
.months-bar { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px 4px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.months-bar::-webkit-scrollbar { display: none; }
.month-folder { flex: 0 0 auto; padding: 9px 16px; border: 1px solid var(--line);
  background: #fff; color: #45525e; border-radius: 12px 12px 0 0; font-size: 14px;
  font-weight: 600; white-space: nowrap; }
.month-folder.active { background: #2c3e50; color: #fff; border-color: #2c3e50;
  font-weight: 700; box-shadow: 0 -2px 6px rgba(0,0,0,.08); }
.month-add { flex: 0 0 auto; padding: 9px 14px; border: 1px dashed var(--primary);
  background: #eaf6f1; color: var(--primary-d); border-radius: 12px 12px 0 0;
  font-size: 14px; font-weight: 700; white-space: nowrap; }

/* ---------- grid ---------- */
.gridwrap { overflow: auto; margin: 0 6px 90px; -webkit-overflow-scrolling: touch; }
table#grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
#grid th, #grid td { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line);
  padding: 0; text-align: center; }
#grid thead th { background: #2c3e50; color: #fff; position: sticky; top: 0; z-index: 20;
  padding: 8px 6px; min-width: 92px; }
#grid thead th .dn { font-weight: 700; font-size: 15px; }
#grid thead th .dd { font-size: 11px; opacity: .85; }
/* sticky employee-name column on the right (RTL) */
#grid .empname { position: sticky; right: 0; z-index: 10; background: #f2f4f7;
  font-weight: 700; text-align: right; padding: 0 10px; min-width: 110px; border-left: 2px solid var(--line); }
#grid thead th.corner { position: sticky; right: 0; z-index: 25; background: #2c3e50; }
#grid td.cell { height: 50px; min-width: 92px; font-size: 14px; font-weight: 600; cursor: pointer; }
#grid td.cell.off { color: #c2c8ce; font-weight: 400; background: #fafbfc; }

/* ---------- actions ---------- */
.actions { position: fixed; bottom: 0; right: 0; left: 0; display: flex; gap: 8px;
  padding: 10px; background: rgba(244,246,248,.96); border-top: 1px solid var(--line);
  backdrop-filter: blur(4px); z-index: 25; }
.actions button { flex: 1; padding: 13px 6px; border: 0; border-radius: 12px; font-size: 15px; font-weight: 700; }
.actions .secondary { background: #e7ebef; color: var(--ink); }
.actions .primary { background: var(--primary); color: #fff; flex: 1.4; }

/* ---------- bottom sheet ---------- */
.sheet, .modal { position: fixed; inset: 0; z-index: 60; }
.hidden { display: none !important; }
.sheet-bg, .modal-bg { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.sheet-card { position: absolute; bottom: 0; right: 0; left: 0; background: #fff;
  border-radius: 18px 18px 0 0; padding: 16px 14px 22px; max-height: 80vh; overflow: auto; }
.sheet-title { font-weight: 700; font-size: 17px; margin-bottom: 12px; text-align: center; }
.projbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.projbtns button { padding: 16px 8px; border: 0; border-radius: 12px; font-size: 16px;
  font-weight: 700; color: #fff; }
.projbtns button.off { background: #eceff2; color: #555; }
.newproj { width: 100%; margin-top: 12px; padding: 14px; border: 2px dashed var(--primary);
  background: #fff; color: var(--primary-d); border-radius: 12px; font-size: 16px; font-weight: 700; }
.cancel { width: 100%; margin-top: 10px; padding: 13px; border: 0; background: #e7ebef;
  border-radius: 12px; font-size: 15px; }

/* ---------- modal ---------- */
.modal-card { position: absolute; top: 50%; right: 50%; transform: translate(50%, -50%);
  background: #fff; border-radius: 16px; padding: 18px; width: min(440px, 92vw);
  max-height: 84vh; overflow: auto; }
.modal-close { position: absolute; top: 10px; left: 12px; border: 0; background: none; font-size: 20px; }
.modal-card h3 { margin: 0 0 12px; }
.searchrow { display: flex; gap: 8px; margin-bottom: 12px; }
.searchrow input { flex: 1; padding: 11px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; }
.searchrow button { padding: 11px 14px; border: 0; background: var(--primary); color: #fff;
  border-radius: 10px; font-weight: 700; }
.reslist { list-style: none; padding: 0; margin: 0; }
.reslist li { display: flex; justify-content: space-between; align-items: center;
  padding: 9px 4px; border-bottom: 1px solid #eee; gap: 8px; }
.tag { padding: 3px 9px; border-radius: 20px; color: #fff; font-size: 13px; font-weight: 700; }
.tag.off { background: #eceff2; color: #8a949e; }
.searchrow input[type="month"] { flex: 0 0 auto; }
.vacrow { display: flex; align-items: center; gap: 7px; margin: 4px 0 12px; font-size: 15px; }
.searchgo { width: 100%; padding: 12px; border: 0; background: var(--primary); color: #fff;
  border-radius: 10px; font-weight: 700; font-size: 16px; margin-bottom: 12px; }
.ssum { background: #f2f4f7; border-radius: 10px; padding: 11px 12px; font-size: 15px; margin-bottom: 10px; }
.bdown { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.shint { color: var(--muted); }
.daylist li { direction: rtl; }
.preview-img { width: 100%; border: 1px solid var(--line); border-radius: 8px; }

/* management modal */
.mtabs { display: flex; gap: 8px; margin-bottom: 12px; }
.mtab { flex: 1; padding: 10px; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; font-size: 15px; font-weight: 700; color: #45525e; }
.mtab.on { background: #2c3e50; color: #fff; border-color: #2c3e50; }
.addrow { display: flex; gap: 8px; margin-bottom: 12px; }
.addrow input { flex: 1; padding: 11px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; }
.addrow button { padding: 11px 16px; border: 0; background: var(--primary); color: #fff;
  border-radius: 10px; font-weight: 700; }
.mlist { list-style: none; padding: 0; margin: 0; }
.mlist li { display: flex; align-items: center; gap: 9px; padding: 10px 4px; border-bottom: 1px solid #eee; }
.mlist .mname { flex: 1; }
.mlist.closed li { opacity: .55; }
.mempty { color: var(--muted); }
.cdot { width: 16px; height: 16px; border-radius: 4px; flex: 0 0 auto; }
.mclosed-h { margin: 14px 0 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.mclose { padding: 7px 12px; border: 1px solid #e6b0a8; background: #fdf1ef; color: #b42318;
  border-radius: 8px; font-size: 13px; font-weight: 700; }
.mrestore { padding: 7px 12px; border: 1px solid #bfe3d4; background: #eaf6f1; color: var(--primary-d);
  border-radius: 8px; font-size: 13px; font-weight: 700; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 80px; right: 50%; transform: translateX(50%);
  background: #1a1f24; color: #fff; padding: 11px 18px; border-radius: 22px; z-index: 80;
  font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
