:root {
  --bg: #f5f6f8; --card: #fff; --ink: #1c2230; --muted: #6b7385; --line: #e3e6ec;
  --brand: #2f5bea; --brand-ink: #fff; --brand-soft: #eaf0ff;
  --ok: #17845a; --ok-soft: #e5f6ee; --warn: #b26a00; --warn-soft: #fff4e0;
  --err: #c6303e; --err-soft: #fdecee; --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Segoe UI", "Noto Sans Hebrew", Arial, sans-serif; background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.5; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

/* layout */
.layout { display: flex; min-height: 100vh; }
.side { width: 220px; background: #141a2a; color: #c9cfdc; padding: 18px 12px; flex-shrink: 0; display: flex; flex-direction: column; }
.side .logo { color: #fff; font-weight: 700; font-size: 18px; padding: 4px 10px 18px; display: flex; gap: 8px; align-items: center; }
.side .logo span { background: var(--brand); border-radius: 8px; width: 28px; height: 28px; display: grid; place-items: center; font-size: 15px; }
.side a { display: block; color: #c9cfdc; padding: 8px 12px; border-radius: 8px; margin-bottom: 2px; }
.side a:hover { background: #222a3d; text-decoration: none; color: #fff; }
.side a.on { background: var(--brand); color: #fff; }
.side .sect { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #6f7890; padding: 14px 12px 6px; }
.side .foot { margin-top: auto; padding: 10px 12px 0; border-top: 1px solid #262e42; font-size: 13px; }
.side .foot button { background: none; border: 0; color: #9aa3b8; padding: 0; cursor: pointer; font: inherit; }
.main { flex: 1; padding: 26px 30px 60px; max-width: 1200px; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.impersonate { background: var(--warn-soft); color: var(--warn); border: 1px solid #f1d39c; padding: 8px 14px; border-radius: var(--radius);
  margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 13px; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }

/* badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: #eef0f4; color: #4a5266; white-space: nowrap; }
.b-running, .b-done, .b-answered { background: var(--ok-soft); color: var(--ok); }
.b-paused, .b-calling, .b-pending { background: var(--warn-soft); color: var(--warn); }
.b-failed, .b-stopped, .b-busy, .b-no-answer, .b-rejected, .b-congestion { background: var(--err-soft); color: var(--err); }
.b-completed { background: var(--brand-soft); color: var(--brand); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-inline-end: 6px; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* progress */
.bar { height: 8px; background: #edf0f5; border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar > div { height: 100%; background: var(--brand); transition: width .5s; }

/* forms */
label { display: block; font-weight: 600; font-size: 13.5px; margin: 12px 0 5px; }
label .muted { font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=time], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #cfd4de; border-radius: 8px; font: inherit; background: #fff; color: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
textarea { min-height: 90px; direction: ltr; text-align: right; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 140px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--ink); border-color: #cfd4de; }
.btn.ok { background: var(--ok); }
.btn.danger { background: #fff; color: var(--err); border-color: #f0b8bf; }
.btn.sm { padding: 5px 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { margin: 0; font-weight: 500; border: 1px solid #cfd4de; border-radius: 8px; padding: 6px 12px; cursor: pointer; display: flex; gap: 6px; }

/* flash */
.flash { padding: 11px 15px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid; }
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: #b6e3cd; }
.flash.err { background: var(--err-soft); color: var(--err); border-color: #f3c2c8; }
.notice { background: var(--brand-soft); border: 1px solid #c9d7ff; padding: 12px 15px; border-radius: var(--radius); font-size: 14px; }
.notice.warn { background: var(--warn-soft); border-color: #f1d39c; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: 100%; max-width: 380px; padding: 30px; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 20px; background: #f3f5f9; padding: 12px 16px; border-radius: 8px;
  direction: ltr; text-align: center; letter-spacing: .05em; user-select: all; }
audio { height: 34px; max-width: 260px; }
.pager { display: flex; gap: 6px; margin-top: 12px; justify-content: center; }

@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .side { width: 100%; flex-direction: row; flex-wrap: wrap; padding: 10px; }
  .side .sect, .side .foot { display: none; }
  .main { padding: 18px 14px 50px; }
}
