/* ממשק ניהול החנות - פריסה של תפריט צד מימין, סרגל עליון, תוכן לבן */
:root {
  --side: #d3eafb; --side-ink: #2b3a4a; --side-hover: #bfe0f8; --side-active: #1677c5;
  --top: #d3eafb; --bg: #f3f8fc; --panel: #fff; --ink: #1f2d3d; --muted: #6b7a8c; --line: #e3e9ef;
  --brand: #1677c5; --brand-dark: #0f5d9c; --ok: #27ae60; --warn: #e67e22; --bad: #e03b3b; --violet: #8e7cf0;
  --radius: 8px; --shadow: 0 1px 3px rgba(20, 50, 80, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Segoe UI", "Rubik", Arial, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; }
a { color: var(--brand); cursor: pointer; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid #cfd8e1; border-radius: 6px; padding: 7px 9px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22, 119, 197, .15); }
textarea { resize: vertical; min-height: 70px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: Consolas, monospace; direction: ltr; unicode-bidi: embed; }
.ltr { direction: ltr; unicode-bidi: embed; }

/* ---------- פריסה ---------- */
.shell { display: grid; grid-template-columns: 230px 1fr; grid-template-rows: 54px 1fr; height: 100vh; }
.shell.collapsed { grid-template-columns: 62px 1fr; }
.topbar { grid-column: 1 / 3; grid-row: 1; display: flex; align-items: center; gap: 14px; background: var(--top); padding: 0 16px; border-bottom: 1px solid #c3dcef; }
.topbar .room { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; min-width: 214px; }
.topbar .room .ic { width: 26px; height: 26px; }
.topbar .burger { background: none; border: 0; font-size: 20px; color: var(--side-ink); padding: 4px 8px; }
.topbar .spacer { flex: 1; }
.topsearch { position: relative; width: 300px; }
.topsearch input { width: 100%; border-radius: 6px; border-color: #c6dbec; }
.topsearch .results { position: absolute; top: 38px; inset-inline: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); z-index: 30; max-height: 360px; overflow: auto; }
.topsearch .results div { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.topsearch .results div:hover { background: #f1f7fc; }
.badge-btn { position: relative; background: none; border: 0; font-size: 18px; padding: 6px; color: var(--side-ink); }
.badge-btn .b { position: absolute; top: -2px; inset-inline-end: -6px; background: var(--bad); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 6px; font-weight: 700; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; cursor: pointer; position: relative; }
.avatar .menu { position: absolute; top: 40px; inset-inline-end: 0; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); min-width: 180px; z-index: 40; font-weight: 400; }
.avatar .menu div { padding: 9px 14px; cursor: pointer; }
.avatar .menu div:hover { background: #f1f7fc; }

.side { grid-column: 1; grid-row: 2; background: var(--side); overflow-y: auto; padding: 10px 8px 30px; border-inline-start: 1px solid #c3dcef; }
.side .item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--side-ink); cursor: pointer; user-select: none; margin-bottom: 2px; }
.side .item:hover { background: var(--side-hover); }
.side .item.on { background: var(--side-active); color: #fff; font-weight: 600; }
.side .item .ico { width: 20px; text-align: center; font-size: 16px; flex: 0 0 20px; }
.side .item .lbl { flex: 1; }
.side .item .cnt { background: var(--bad); color: #fff; font-size: 11px; border-radius: 9px; padding: 0 6px; }
.side .sub { padding-inline-start: 18px; }
.side .sub .item { padding: 7px 12px; font-size: 13.5px; }
.side .support { margin-top: 14px; border: 1px solid var(--ok); color: var(--ok); background: #fff; border-radius: 8px; padding: 9px; text-align: center; cursor: pointer; font-weight: 600; }
.shell.collapsed .side .lbl, .shell.collapsed .side .sub, .shell.collapsed .side .support { display: none; }

.main { grid-column: 2; grid-row: 2; overflow-y: auto; padding: 18px 22px 60px; }
.page-title { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-title h1 { font-size: 20px; margin: 0; font-weight: 700; }
.page-title .spacer { flex: 1; }

/* ---------- רכיבים ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card h2 { font-size: 16px; margin: 0 0 12px; font-weight: 700; }
.card h3 { font-size: 14.5px; margin: 16px 0 8px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.col { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.field > span { font-size: 13px; color: #44515f; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); border-inline-start: 3px solid #d6e4f0; padding-inline-start: 6px; }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.btn { border: 1px solid var(--brand); background: #fff; color: var(--brand); padding: 7px 14px; border-radius: 6px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: #eef6fc; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.ok { border-color: var(--ok); color: var(--ok); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: #e3f6ea; color: #1e8449; }
.pill.bad { background: #fde7e7; color: #c0392b; }
.pill.warn { background: #fdf0e1; color: #b9650c; }
.pill.idle { background: #eef1f4; color: #6b7a8c; }
.pill.blue { background: #e1effa; color: var(--brand); }
.pill.green-solid { background: #3ddc84; color: #0b3d22; }

.tabs { display: inline-flex; border: 1px solid var(--brand); border-radius: 7px; overflow: hidden; }
.tabs button { border: 0; background: #fff; color: var(--brand); padding: 7px 16px; border-inline-start: 1px solid var(--brand); }
.tabs button:first-child { border-inline-start: 0; }
.tabs button.on { background: var(--brand); color: #fff; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); }
.kpi .head { background: #1677c5; color: #fff; display: grid; place-items: center; height: 52px; font-size: 24px; }
.kpi.c2 .head { background: #0f5d9c; } .kpi.c3 .head { background: #13537f; } .kpi.c4 .head { background: #4a5a6a; } .kpi.c5 .head { background: #5b6b7b; }
.kpi .body { display: flex; justify-content: space-around; padding: 12px 8px; text-align: center; }
.kpi .v { font-size: 20px; font-weight: 700; }
.kpi .k { font-size: 12px; color: var(--muted); }
.tile { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #fff; border: 1px solid var(--line); }
.tile .t { color: #fff; font-weight: 700; padding: 10px; text-align: center; }
.tile .b { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.tile .b .r { display: flex; justify-content: space-between; gap: 10px; }
.tile.blue .t { background: #1677c5; } .tile.navy .t { background: #0f5d9c; } .tile.violet .t { background: var(--violet); } .tile.sky .t { background: #5b9bd5; } .tile.green .t { background: #3cb879; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }

/* גרף עמודות */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; border-bottom: 1px solid var(--line); padding-top: 18px; }
.bars .bar { flex: 1; background: var(--violet); border-radius: 4px 4px 0 0; position: relative; min-height: 2px; }
.bars .bar span { position: absolute; top: -18px; inset-inline: 0; text-align: center; font-size: 11px; font-weight: 700; color: #44515f; }
.bars-lbl { display: flex; gap: 6px; font-size: 11px; color: var(--muted); }
.bars-lbl span { flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* טבלה */
.dt { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.dt .bar-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.dt .bar-top .spacer { flex: 1; }
.dt .scroll { overflow: auto; max-height: calc(100vh - 290px); }
.dt table { width: 100%; border-collapse: collapse; }
.dt th, .dt td { padding: 9px 10px; text-align: right; border-bottom: 1px solid #edf1f5; white-space: nowrap; }
.dt th { position: sticky; top: 0; background: #fff; z-index: 2; font-weight: 700; color: #34495e; cursor: pointer; user-select: none; }
.dt th .sort { color: var(--brand); font-size: 11px; }
.dt tr.filters th { top: 38px; padding: 4px 6px; cursor: default; }
.dt tr.filters input, .dt tr.filters select { width: 100%; padding: 4px 6px; font-size: 12.5px; min-width: 60px; }
.dt tbody tr:hover { background: #f5fafe; }
.dt tbody tr.click { cursor: pointer; }
.dt tfoot td { font-weight: 700; background: #f8fbfd; position: sticky; bottom: 0; }
.dt .bar-bottom { display: flex; align-items: center; gap: 6px; padding: 10px 12px; flex-wrap: wrap; }
.dt .bar-bottom .spacer { flex: 1; }
.dt .pg button { border: 0; background: none; padding: 4px 9px; border-radius: 5px; color: var(--ink); }
.dt .pg button.on { background: #e3eaf1; font-weight: 700; }
.dt .empty { text-align: center; color: var(--muted); padding: 30px; }
.dt .count { font-weight: 700; padding: 10px 12px; border-top: 1px solid var(--line); }

/* צ'אט */
.chat { display: grid; grid-template-columns: 330px 1fr; gap: 16px; height: calc(100vh - 150px); }
.chat .list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.chat .list .head { padding: 10px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); background: #f4f9fd; }
.chat .list .items { overflow-y: auto; flex: 1; }
.chat .thread-item { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.chat .thread-item:hover, .chat .thread-item.on { background: #eef6fc; }
.chat .thread-item .t { display: flex; justify-content: space-between; font-weight: 700; }
.chat .thread-item .t .time { color: var(--ok); font-weight: 600; font-size: 12px; }
.chat .thread-item .p { display: flex; justify-content: space-between; gap: 8px; color: #44515f; font-size: 13px; }
.chat .thread-item .p .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat .thread-item .n { background: #3ddc84; color: #0b3d22; border-radius: 50%; min-width: 22px; height: 22px; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.chat .conv { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.chat .conv .head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat .conv .msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #f7fafc; }
.chat .msg { max-width: 70%; padding: 8px 12px; border-radius: 12px; position: relative; white-space: pre-wrap; word-break: break-word; }
.chat .msg.customer { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.chat .msg.staff { align-self: flex-end; background: #dcefff; }
.chat .msg .meta { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; align-items: center; }
.chat .msg .acts { display: none; gap: 4px; }
.chat .msg:hover .acts { display: inline-flex; }
.chat .msg .acts button { border: 0; background: none; padding: 0 2px; font-size: 13px; }
.chat .compose { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat .compose textarea { flex: 1; min-height: 44px; max-height: 140px; }
.chat .empty-conv { margin: auto; text-align: center; color: var(--muted); max-width: 380px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.chat .help { background: #f4f8fb; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; text-align: right; }

/* עמדות חיות */
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.st-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; border-top: 4px solid #b0bac5; display: flex; flex-direction: column; gap: 5px; box-shadow: var(--shadow); }
.st-card.free { border-top-color: var(--ok); } .st-card.busy { border-top-color: var(--brand); } .st-card.maint { border-top-color: var(--warn); } .st-card.off { border-top-color: var(--bad); opacity: .85; }
.st-card .nm { font-weight: 700; font-size: 15px; }
.st-card .tm { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.st-card .tm.low { color: var(--bad); }
.st-card .acts { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.st-card .acts .btn { padding: 3px 8px; font-size: 12.5px; }
.group-title { font-weight: 700; margin: 16px 0 8px; color: #34495e; display: flex; gap: 8px; align-items: center; }

/* קיוסק - תצוגת חבילות */
.kiosk-preview { display: flex; flex-direction: column; gap: 10px; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.pk { border: 2px solid #000; border-radius: 16px; padding: 12px; text-align: center; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.pk .nm { font-weight: 700; padding-bottom: 6px; border-bottom: 2px solid currentColor; min-height: 28px; }
.pk .ln { display: flex; justify-content: center; gap: 6px; align-items: center; }
.pk .ln b { font-size: 18px; }
.pk .sd { font-size: 12px; color: var(--muted); }

/* חלונות */
dialog { border: 0; border-radius: 12px; padding: 0; max-width: min(640px, 94vw); width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.wide { max-width: min(1000px, 96vw); }
dialog::backdrop { background: rgba(15, 30, 45, .45); }
dialog .dlg-h { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 16px; display: flex; align-items: center; }
dialog .dlg-h .x { margin-inline-start: auto; border: 0; background: none; font-size: 20px; color: var(--muted); }
dialog .dlg-b { padding: 16px 18px; max-height: 70vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
dialog .dlg-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.err { color: var(--bad); min-height: 1.2em; font-size: 13px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #1f2d3d; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 100; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.bad { background: var(--bad); }

.notice { background: #fff8e1; border: 1px solid #f3d27a; border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.notice.blue { background: #eaf4fc; border-color: #b9d9f3; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { border: 1px solid #c9d6e2; border-radius: 6px; padding: 3px 8px; background: #fff; cursor: pointer; font-size: 13px; }
.chip.on { background: #e1effa; border-color: var(--brand); color: var(--brand); font-weight: 600; }
.swatches { display: flex; gap: 8px; align-items: center; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #c9d6e2; cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--brand); }
.hours-row { display: flex; gap: 8px; align-items: center; background: #f1f5f8; border-radius: 8px; padding: 8px 10px; flex-wrap: wrap; }
.days { display: flex; gap: 3px; }
.days label { border: 1px solid #c9d6e2; border-radius: 5px; padding: 2px 7px; cursor: pointer; background: #fff; font-size: 13px; }
.days label.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.days input { display: none; }
.meter { background: #e6edf3; border-radius: 4px; height: 8px; width: 110px; overflow: hidden; display: inline-block; vertical-align: middle; }
.meter > div { height: 100%; background: var(--brand); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #d3eafb, #f3f8fc); }
.login-card { background: #fff; border-radius: 14px; box-shadow: 0 10px 40px rgba(20, 60, 100, .15); padding: 28px; width: min(380px, 92vw); display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { margin: 0; font-size: 22px; }

@media print { .side, .topbar, .no-print { display: none !important; } .shell { display: block; } .main { overflow: visible; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .main { grid-column: 1; }
  .side { position: fixed; inset-block: 54px 0; inset-inline-start: 0; width: 240px; z-index: 50; transform: translateX(100%); transition: transform .2s; }
  .shell.mobile-open .side { transform: none; }
  .topsearch { width: 160px; }
  .topbar .room { min-width: 0; }
  .chat { grid-template-columns: 1fr; height: auto; }
  .main { padding: 12px; }
}

table.simple { width: 100%; border-collapse: collapse; }
table.simple th, table.simple td { padding: 7px 8px; text-align: right; border-bottom: 1px solid #edf1f5; }
table.simple th { font-weight: 700; color: #34495e; font-size: 13px; }

/* ---------- תצוגה כהה ---------- */
:root[data-theme=dark] {
  --side: #172231; --side-ink: #d4dde7; --side-hover: #20324a; --side-active: #2f80d1;
  --top: #172231; --bg: #0f1722; --panel: #18222f; --ink: #e4ebf2; --muted: #93a3b5; --line: #2a3747;
  --brand: #4c9be8; --brand-dark: #2f80d1; --shadow: none; color-scheme: dark;
}
[data-theme=dark] input, [data-theme=dark] select, [data-theme=dark] textarea { background: #101a26; border-color: #33445a; color: var(--ink); }
[data-theme=dark] .topbar, [data-theme=dark] .side { border-color: #24354a; }
[data-theme=dark] .topsearch input { border-color: #33445a; }
[data-theme=dark] .topsearch .results, [data-theme=dark] .avatar .menu, [data-theme=dark] dialog { background: var(--panel); color: var(--ink); border-color: var(--line); }
[data-theme=dark] .topsearch .results div:hover, [data-theme=dark] .avatar .menu div:hover { background: #20324a; }
[data-theme=dark] .side .support, [data-theme=dark] .btn, [data-theme=dark] .tabs button, [data-theme=dark] .chip, [data-theme=dark] .days label { background: transparent; }
[data-theme=dark] .btn:hover { background: #1d2c3d; }
[data-theme=dark] .btn.primary, [data-theme=dark] .tabs button.on { background: var(--brand); color: #fff; }
[data-theme=dark] .kpi, [data-theme=dark] .tile, [data-theme=dark] .dt, [data-theme=dark] .st-card, [data-theme=dark] .chat .list, [data-theme=dark] .chat .conv { background: var(--panel); }
[data-theme=dark] .dt th { background: var(--panel); color: #c3d0dd; }
[data-theme=dark] .dt th, [data-theme=dark] .dt td, [data-theme=dark] table.simple th, [data-theme=dark] table.simple td { border-color: #243243; }
[data-theme=dark] .dt tbody tr:hover, [data-theme=dark] .chat .thread-item:hover, [data-theme=dark] .chat .thread-item.on { background: #1d2c3d; }
[data-theme=dark] .dt tfoot td { background: #1b2735; }
[data-theme=dark] .dt .pg button { color: var(--ink); }
[data-theme=dark] .dt .pg button.on { background: #2a3b50; }
[data-theme=dark] .chat .list .head, [data-theme=dark] .chat .help { background: #1b2735; }
[data-theme=dark] .chat .conv .msgs { background: #121c28; }
[data-theme=dark] .chat .msg.customer { background: var(--panel); border-color: var(--line); }
[data-theme=dark] .chat .msg.staff { background: #1e3a5c; }
[data-theme=dark] .chat .thread-item .p { color: #b6c3d1; }
[data-theme=dark] .notice { background: #2b2614; border-color: #6b5a22; }
[data-theme=dark] .notice.blue { background: #15283b; border-color: #2b4c6e; }
[data-theme=dark] .hours-row { background: #1b2735; }
[data-theme=dark] .chip.on { background: #1e3a5c; }
[data-theme=dark] .pk { background: #fff; color: inherit; }
[data-theme=dark] .meter { background: #2a3747; }
[data-theme=dark] .field > span { color: #c3d0dd; }
[data-theme=dark] .field .hint { border-color: #2f445c; }
[data-theme=dark] .login-wrap { background: linear-gradient(160deg, #172231, #0f1722); }
[data-theme=dark] .login-card { background: var(--panel); }
[data-theme=dark] .pill.ok { background: #143823; color: #6fdc98; }
[data-theme=dark] .pill.bad { background: #3d1a1a; color: #ff8c8c; }
[data-theme=dark] .pill.warn { background: #3b2a12; color: #f5b55f; }
[data-theme=dark] .pill.idle { background: #26313e; color: #9fb0c2; }
[data-theme=dark] .pill.blue { background: #18304a; color: #7dbcf2; }
[data-theme=dark] .bars-lbl, [data-theme=dark] .bars .bar span { color: #b6c3d1; }
.theme-btn { background: none; border: 1px solid transparent; border-radius: 6px; padding: 5px 8px; color: var(--side-ink); font-size: 13px; }
.theme-btn:hover { border-color: #9cc4e4; }

/* מצב מפתח */
.shell.imp { grid-template-rows: auto 54px 1fr; }
.shell.imp .topbar { grid-row: 2; } .shell.imp .side, .shell.imp .main { grid-row: 3; }
.imp-banner { grid-column: 1 / 3; grid-row: 1; background: #fff3cd; color: #6b4e00; border-bottom: 1px solid #f0d58a; padding: 6px 16px; display: flex; gap: 12px; align-items: center; font-weight: 600; font-size: 13px; }
[data-theme=dark] .imp-banner { background: #3b2f0b; color: #f5d27a; border-color: #6b5a22; }

/* תצוגה מקדימה של מסך הכניסה בעמדה (יחס 16:9, חלון הכניסה באמצע - כמו בעמדה) */
dialog.wide:has(.lock-preview) { width: min(1100px, 96vw); }
.lock-preview { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: #e3eef8; container-type: inline-size; }
.lock-preview > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lock-preview .lp-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2cqw; }
.lock-preview .lp-clock { font-size: 5.5cqw; font-weight: 300; color: #fff; text-shadow: 0 .2cqw 1cqw rgba(0,0,0,.65); line-height: 1; }
.lock-preview .lp-room { font-size: 1.8cqw; color: #fff; text-shadow: 0 .2cqw 1cqw rgba(0,0,0,.65); }
.lock-preview .lp-box { width: 20.8cqw; background: #fff; border-radius: .8cqw; padding: 1.1cqw; display: flex; flex-direction: column; gap: .6cqw; box-shadow: 0 .6cqw 2cqw rgba(0,0,0,.35); outline: .2cqw dashed #e67e22; outline-offset: .3cqw; }
.lock-preview .lp-tabs { display: flex; gap: .3cqw; font-size: .8cqw; }
.lock-preview .lp-tabs span { flex: 1; text-align: center; padding: .4cqw; border-radius: .4cqw; background: #f2f6fa; color: #1f2d3d; }
.lock-preview .lp-tabs span.on { background: #2f6fd6; color: #fff; }
.lock-preview .lp-in { font-size: 1cqw; padding: .6cqw; border: 1px solid #c7d6e5; border-radius: .4cqw; background: #f2f6fa; color: #888; text-align: center; }
.lock-preview .lp-btn { font-size: 1cqw; padding: .6cqw; border-radius: .4cqw; background: #2f6fd6; color: #fff; text-align: center; }
.help-body { padding: 6px 4px 10px; line-height: 1.7; }
.help-body h3 { margin: 10px 0 4px; font-size: 15px; }
.help-body p { margin: 4px 0; }

/* מפת החדר */
.room-map { display: grid; gap: 8px; overflow-x: auto; padding: 4px; }
.map-cell { min-height: 92px; border-radius: 10px; padding: 8px; text-align: center; font-size: 13px; cursor: default; display: flex; flex-direction: column; gap: 2px; justify-content: center; }
.map-cell.empty { border: 2px dashed #c7d6e5; cursor: pointer; }
.map-cell.st { border: 2px solid transparent; color: #1f2d3d; }
.map-cell.free { background: #e3f6ea; } .map-cell.busy { background: #dbe9fb; } .map-cell.maint { background: #fdf0e1; } .map-cell.off { background: #eef1f4; color: #6b7a8c; }
.map-cell.pick { border-color: #e67e22; }
.map-cell .tm { font-weight: 700; font-size: 16px; } .map-cell .tm.low { color: #c0392b; }
[data-theme=dark] .map-cell.st { color: #e8ebf0; }
[data-theme=dark] .map-cell.free { background: #173b26; } [data-theme=dark] .map-cell.busy { background: #17304f; } [data-theme=dark] .map-cell.maint { background: #3b2a12; } [data-theme=dark] .map-cell.off { background: #262c35; }

.map-cell.item { background: transparent; border: 1px dashed #c7d6e5; color: #4b5b6d; }
.map-cell.item.wall { background: repeating-linear-gradient(45deg, #9aa7b4, #9aa7b4 6px, #b6c1cc 6px, #b6c1cc 12px); border: none; min-height: 92px; }
.map-cell.item.door { background: #fff8e1; border-color: #f3d27a; }
.map-cell.item.printer { background: #f3eefc; border-color: #c9b6f0; }

/* ---------- 0.9: חיפוש כללי, בחירה מרובה, ביטול טעינה ---------- */
.topsearch .results .sec { cursor: default; background: #f4f8fb; color: var(--muted); font-size: 12px; font-weight: 700; padding: 4px 12px; }
.topsearch .results div.kb { background: #e3f0fb; }
kbd { font-family: Consolas, monospace; background: #f1f5f8; border: 1px solid #cfd8e1; border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; font-size: 12px; }
.bulk-bar { position: sticky; top: -18px; z-index: 5; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #fff8e6; border: 1px solid #f0d58c; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.bulk-bar .spacer { flex: 1; }
.st-card.selected { outline: 3px solid var(--brand); outline-offset: -1px; }
.undo-bar { position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%); background: #1f2d3d; color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 99; display: flex; gap: 10px; align-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.undo-bar .btn { background: #fff; color: #1f2d3d; }
.undo-bar .x { background: none; border: 0; color: #fff; font-size: 18px; }
.tpl-sel { max-width: 180px; }
[data-theme=dark] .topsearch .results .sec { background: #1b2735; }
[data-theme=dark] .topsearch .results div.kb { background: #20324a; }
[data-theme=dark] .bulk-bar { background: #2b2614; border-color: #6b5a22; }
[data-theme=dark] kbd { background: #1b2735; border-color: #33445a; }

/* ---------- מובייל: ממשק נוח בטלפון ---------- */
@media (max-width: 860px) {
  body { font-size: 15px; }
  .topbar { gap: 6px; padding: 0 8px; }
  .topbar .room { font-size: 0; gap: 0; }
  .topbar .room span { font-size: 20px; }
  .topsearch { flex: 1; width: auto; }
  .topsearch .results { position: fixed; top: 54px; inset-inline: 6px; max-height: 70vh; }
  .theme-btn { display: none; }
  .btn { min-height: 38px; }
  .btn.sm { min-height: 32px; }
  .page-title h1 { font-size: 18px; }
  .row > .field { flex: 1 1 100%; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .st-grid { grid-template-columns: 1fr !important; }
  .dt .scroll { max-height: none; }
  .dt .bar-top { gap: 6px; }
  dialog, dialog.wide { max-width: 100vw; width: 100vw; margin: auto 0 0; border-radius: 14px 14px 0 0; }
  dialog .dlg-b { max-height: 75vh; }
  .dlg-f .btn { flex: 1; }
  .undo-bar { inset-inline: 8px; left: auto; transform: none; bottom: 16px; flex-wrap: wrap; }
  .chat .compose { flex-wrap: wrap; }
  .bulk-bar { top: -12px; }
  .room-map { overflow-x: auto; }
  input, select, textarea { font-size: 16px; }
}

/* ---------- 0.10 ---------- */
.clock-btn { border: 1px solid #b9d3ea; background: #fff; border-radius: 18px; padding: 5px 12px; font-size: 13px; white-space: nowrap; }
.clock-btn.on { background: #e8f7ee; border-color: #8fd1a9; color: #1e7b45; font-weight: 600; }
.today { background: linear-gradient(135deg, #ffffff, #eef6fd); }
.today-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.today-h h2 { margin: 0; font-size: 20px; }
.today-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.today-chip { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.today-chip .i { font-size: 18px; } .today-chip b { font-size: 20px; } .today-chip span:last-child { color: var(--muted); font-size: 12.5px; }
.today-chip.warn { border-color: #f0c36d; background: #fff8e6; }
.sc-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sc { border: 1px solid #c6dbec; background: #fff; border-radius: 10px; padding: 9px 14px; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.sc:hover { background: #f1f7fc; } .sc .i { font-size: 18px; } .sc.edit { font-weight: 400; color: var(--muted); border-style: dashed; }
.tag { display: inline-flex; align-items: center; gap: 4px; background: #e8f1fb; color: #0f5d9c; border-radius: 12px; padding: 1px 9px; font-size: 12.5px; margin: 1px 2px; }
.tag .x { border: 0; background: none; color: inherit; padding: 0; font-size: 14px; }
.task { display: flex; gap: 12px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.task input[type=checkbox] { width: 20px; height: 20px; margin-top: 2px; }
.task-b { flex: 1; min-width: 0; } .task-t { font-weight: 700; font-size: 15px; } .task-m { margin-top: 4px; }
.task.done .task-t { text-decoration: line-through; color: var(--muted); } .task.done { opacity: .75; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-h { text-align: center; font-weight: 700; color: var(--muted); padding: 4px; }
.cal-c { min-height: 92px; border: 1px solid var(--line); border-radius: 6px; padding: 4px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-c.empty { border: 0; } .cal-c.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal-d { font-size: 12px; color: var(--muted); }
.cal-t { font-size: 11.5px; background: #e8f1fb; border-radius: 4px; padding: 1px 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-t.late { background: #fde4e4; } .cal-t.done { background: #e8f7ee; text-decoration: line-through; }
[data-theme=dark] .clock-btn, [data-theme=dark] .sc { background: transparent; border-color: #33445a; color: var(--ink); }
[data-theme=dark] .clock-btn.on { background: #173a26; color: #8fe0ad; }
[data-theme=dark] .today { background: var(--panel); }
[data-theme=dark] .today-chip.warn { background: #2b2614; border-color: #6b5a22; }
[data-theme=dark] .tag, [data-theme=dark] .cal-t { background: #1e3a5c; color: #cfe3f7; }
@media (max-width: 860px) {
  .clock-btn { padding: 4px 8px; font-size: 12px; }
  .cal-c { min-height: 60px; } .cal-t { font-size: 10px; }
  .today-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.dt th.selcol, .dt td.selcol { width: 34px; text-align: center; }
.dt tr.sel td { background: #eaf3fd; }
[data-theme=dark] .dt tr.sel td { background: #1e3a5c; }
