:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --text: #1d2433;
  --muted: #6b7489;
  --line: #e2e6ee;
  --primary: #2f5bea;
  --primary-soft: #e8eeff;
  --mine: #10a36c;
  --mine-soft: #e3f7ee;
  --danger: #d63c3c;
  --today: #fff6d8;
  --radius: 10px;
  font-family: "Segoe UI", "Rubik", "Assistant", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small-text { font-size: 13px; }

/* פוטר קרדיט */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px 22px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.footer-credit a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.footer-credit a:hover { text-decoration: underline; }

.brand { font-weight: 800; font-size: 22px; letter-spacing: .5px; direction: ltr; }
.brand span { color: var(--primary); }
.brand.big { font-size: 34px; text-align: center; }

/* לוגו */
.brand-logo {
  display: block;
  width: auto;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
}
.brand.big .brand-logo {
  height: 170px;
  margin: 0 auto 10px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(13, 20, 40, .18);
}

.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(20,30,60,.08); padding: 18px; margin-bottom: 16px; }
.card h3 { margin-top: 0; }

label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
label.inline { flex-direction: row; align-items: center; margin: 0; gap: 6px; }
label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--text); }
input, select, textarea { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
input[type=checkbox] { width: 17px; height: 17px; }

.btn { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.btn:hover { background: #f6f7fb; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: #fdeeee; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.05); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.wide { width: 100%; margin-top: 6px; }

.form-error { color: var(--danger); min-height: 18px; font-size: 14px; margin-bottom: 6px; }

/* auth */
.screen { min-height: 100vh; }
#login-screen, #password-screen { display: flex; align-items: center; justify-content: center; padding: 16px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { text-align: center; margin: 8px 0 0; }
.auth-card p { text-align: center; }

/* topbar */
.topbar { display: flex; align-items: center; gap: 18px; padding: 10px 20px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { font: inherit; border: none; background: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.tabs button.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.user-box { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.badge { background: var(--primary); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 20px; }

main { padding: 16px 20px 40px; max-width: 1300px; margin: 0 auto; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar h2 { margin: 0 10px; font-size: 20px; }
.spacer { flex: 1; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.cal-head { text-align: center; font-weight: 600; color: var(--muted); padding: 6px 0; font-size: 14px; }
.day { background: var(--card); border-radius: 8px; min-height: 110px; padding: 6px; border: 1px solid var(--line); cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: border-color .15s; }
.day:hover { border-color: var(--primary); }
.day.other { opacity: .45; }
.day.today { background: var(--today); }
.day.past { background: #fafbfc; }
.day-num { font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.day-num .add { opacity: 0; color: var(--primary); font-size: 18px; line-height: 1; }
.day:hover .add { opacity: 1; }
.chip { background: var(--primary-soft); color: var(--primary); border-radius: 6px; padding: 3px 7px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.chip.mine { background: var(--mine-soft); color: var(--mine); font-weight: 600; }
.chip:hover { filter: brightness(.95); }
.chip .ttl { font-weight: 400; font-size: 11.5px; opacity: .75; margin-inline-start: 5px; }
.chip .ttl::before { content: "· "; }
.week .chip .ttl { display: block; margin: 1px 0 0; }
.week .chip .ttl::before { content: ""; }
.chip .note-ico { margin-inline-start: 4px; opacity: .8; }

.week .day { min-height: 260px; }
.week .chip { white-space: normal; padding: 6px 8px; }
.week .chip .note { display: block; color: var(--text); font-weight: 400; font-size: 12.5px; margin-top: 3px; opacity: .85; }

/* employee view */
.emp-list { list-style: none; padding: 0; margin: 0; }
.emp-list li { display: flex; gap: 14px; align-items: flex-start; padding: 11px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.emp-list li:hover { background: #f8f9fc; }
.emp-list .d { min-width: 150px; font-weight: 600; }
.emp-list .n { color: var(--muted); flex: 1; white-space: pre-wrap; }
.emp-list li.past .d { color: var(--muted); font-weight: 400; }
.summary { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.summary .stat { background: var(--card); border-radius: 8px; padding: 10px 16px; box-shadow: 0 1px 3px rgba(20,30,60,.06); }
.summary .stat b { font-size: 20px; display: block; }

/* users */
.row-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row-form label { margin-bottom: 0; }
.table-wrap { overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th, .users-table td { text-align: right; padding: 9px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.users-table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.users-table tr.inactive td { opacity: .5; }
.users-table td .btn { margin-inline-end: 4px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(15,20,35,.45); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 14px; }
.modal-card { width: 100%; max-width: 440px; margin: 0; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1d2433; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 30; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.toast.error { background: var(--danger); }

@media (max-width: 760px) {
  main { padding: 10px; }
  .topbar { padding: 8px 10px; gap: 8px; }
  .user-box { margin-inline-start: 0; width: 100%; justify-content: space-between; }
  .cal { gap: 3px; }
  .day { min-height: 74px; padding: 3px; }
  .chip { font-size: 11px; padding: 2px 4px; }
  .cal-head { font-size: 12px; }
  .week.cal { grid-template-columns: 1fr; }
  .week .day { min-height: 70px; }
  .emp-list .d { min-width: 110px; }
}
