/* 2.41.0: Agent schedule (Team & reports). Modern Calm: white cards on the page's grey, soft tinted blocks per agent
   (eight calm hues, their own dark shades), the app's colour tokens; the week reads right to left in Hebrew. */
.as {
  --as-c0: #1E6FD9; --as-c1: #7C3AED; --as-c2: #0D9488; --as-c3: #D97706; --as-c4: #DB2777; --as-c5: #4F46E5; --as-c6: #059669; --as-c7: #64748B;
  --as-slot: 22px; --as-grid: color-mix(in srgb, var(--line) 70%, transparent);
  display: flex; flex-direction: column; gap: 16px; min-width: 0;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .as { --as-c0: #7DB7F5; --as-c1: #B79CF7; --as-c2: #5EEAD4; --as-c3: #FBBF24; --as-c4: #F9A8D4; --as-c5: #A5B4FC; --as-c6: #6EE7B7; --as-c7: #94A3B8; } }
:root[data-theme="dark"] .as { --as-c0: #7DB7F5; --as-c1: #B79CF7; --as-c2: #5EEAD4; --as-c3: #FBBF24; --as-c4: #F9A8D4; --as-c5: #A5B4FC; --as-c6: #6EE7B7; --as-c7: #94A3B8; }
.as .c0 { --as-c: var(--as-c0); } .as .c1 { --as-c: var(--as-c1); } .as .c2 { --as-c: var(--as-c2); } .as .c3 { --as-c: var(--as-c3); }
.as .c4 { --as-c: var(--as-c4); } .as .c5 { --as-c: var(--as-c5); } .as .c6 { --as-c: var(--as-c6); } .as .c7 { --as-c: var(--as-c7); }

/* cards */
.as-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; box-shadow: var(--shadow); }
.as-card-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; font-weight: 600; }
.as-card-head p { margin: 6px 0 0; }
.as-mark { width: 28px; height: 28px; border-radius: 9px; display: inline-grid; place-items: center; flex: none; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.as-two-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
details.as-card > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 16px; list-style: none; }
details.as-card > summary::-webkit-details-marker { display: none; }
details.as-card:not([open]) { gap: 0; }

/* the banner: on or off, and the revision */
.as-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 14px; }
.as-banner.off { background: color-mix(in srgb, var(--wait) 9%, var(--panel)); border-color: color-mix(in srgb, var(--wait) 30%, var(--line)); }
.as-banner.on { background: color-mix(in srgb, var(--ok) 8%, var(--panel)); border-color: color-mix(in srgb, var(--ok) 28%, var(--line)); }
.as-banner > .ico { flex: none; }
.as-rev { margin-inline-start: auto; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }

/* chips */
.as-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; background: color-mix(in srgb, var(--muted) 12%, var(--panel)); color: var(--muted); }
.as-chip.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--panel)); }
.as-chip.wait { color: color-mix(in srgb, var(--wait) 85%, var(--ink)); background: color-mix(in srgb, var(--wait) 14%, var(--panel)); }
.as-chip.bad { color: var(--fault); background: color-mix(in srgb, var(--fault) 12%, var(--panel)); }
.as-chip-x { opacity: .85; }
.as-bad { color: var(--fault); }

/* the bar over the week */
.as-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.as-weeknav { display: flex; align-items: center; gap: 6px; }
.as-range { font-size: 15px; min-width: 150px; text-align: center; }
.as-queues { flex: none; max-width: 100%; overflow-x: auto; background: var(--panel); }
.as-queues button { padding: 6px 12px; white-space: nowrap; }
.as-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-inline-start: auto; }

/* the palette and the week side by side */
.as-main { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.as-palette { flex: 0 0 210px; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--sunk, color-mix(in srgb, var(--line) 25%, var(--panel))); }
.as-palette h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.as-palette p { margin: 0; }
.as-agents { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.as-agent { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2px 8px; padding: 7px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); cursor: grab; font-size: 13px; }
.as-agent[draggable="true"]:hover { border-color: var(--as-c); }
.as-agent .as-shift { grid-column: 2 / -1; }
.as-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--as-c); }
.as-aname { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-noext { display: inline-flex; align-items: center; gap: 3px; color: var(--wait); }
.as-palette-foot { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.as-repeat { background: var(--panel); }
.as-repeat button { font-size: 12px; padding: 5px 6px; }
.as-repeat button[aria-checked="true"], .as-daytabs button[aria-selected="true"] { background: var(--accent-soft, color-mix(in srgb, var(--accent) 14%, var(--panel))); color: var(--accent); font-weight: 600; }

/* the week grid */
.as-gridwrap { flex: 1; min-width: 0; max-height: 620px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.as-daytabs { display: none; }
.as-week { display: flex; min-width: 0; }
.as-times { flex: 0 0 48px; position: sticky; inset-inline-start: 0; z-index: 2; background: var(--panel); }
.as-times-body { position: relative; }
.as-times-body span { position: absolute; inset-inline-end: 6px; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; direction: ltr; }
.as-times-body span:first-child { transform: none; }
.as-col { flex: 1 1 0; min-width: 0; border-inline-start: 1px solid var(--line); }
.as-dayhead { position: sticky; top: 0; z-index: 3; height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: var(--panel); border-bottom: 1px solid var(--line); }
.as-dow { font-size: 12px; color: var(--muted); }
.as-dnum { font-size: 15px; font-weight: 600; line-height: 1; }
.as-dayhead.today .as-dnum { color: var(--accent-ink, #fff); background: var(--accent); border-radius: 999px; padding: 2px 7px; }
.as-hol { position: absolute; top: 4px; inset-inline-end: 6px; color: var(--wait); }
.as-colbody { position: relative; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--as-slot) - 1px), var(--as-grid) calc(var(--as-slot) - 1px), var(--as-grid) var(--as-slot)); background-size: 100% calc(var(--as-slot) * 2); cursor: copy; }
.as-colbody { background-image: linear-gradient(to bottom, var(--as-grid) 1px, transparent 1px), linear-gradient(to bottom, color-mix(in srgb, var(--as-grid) 45%, transparent) 1px, transparent 1px); background-size: 100% calc(var(--as-slot) * 2), 100% var(--as-slot); }
.as-colbody.holiday { background-color: color-mix(in srgb, var(--wait) 6%, var(--panel)); }
.as-colbody.drop { outline: 2px dashed var(--accent); outline-offset: -2px; background-color: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.as-block {
  position: absolute; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 1px; padding: 3px 6px; margin: 1px 0 0;
  border-radius: 8px; border: 1px solid color-mix(in srgb, var(--as-c) 45%, transparent); border-inline-start: 3px solid var(--as-c);
  background: color-mix(in srgb, var(--as-c) 14%, var(--panel)); color: var(--ink); font: inherit; font-size: 12px; line-height: 1.25; text-align: start;
  overflow: hidden; cursor: grab; box-shadow: none; min-height: 0;
}
.as-block:hover { background: color-mix(in srgb, var(--as-c) 22%, var(--panel)); }
.as-block:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; z-index: 1; }
.as-block.once { border-style: dashed; border-inline-start-style: solid; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--as-c) 14%, var(--panel)) 0 8px, color-mix(in srgb, var(--as-c) 8%, var(--panel)) 8px 16px); }
.as-block.narrow { padding: 2px 3px; }
.as-block.narrow .as-btime { font-size: 10px; letter-spacing: -.02em; }
.as-block.skipped { opacity: .45; text-decoration: line-through; }
.as-bname { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-btime { display: flex; flex-wrap: wrap; column-gap: 0; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11px; direction: ltr; justify-content: flex-end; max-width: 100%; }
[dir=ltr] .as-btime { justify-content: flex-start; }
.as-btime span { white-space: nowrap; }
.as-bhead { display: flex; align-items: center; gap: 3px; max-width: 100%; min-width: 0; }
.as-bst { flex: none; display: inline-grid; place-items: center; width: 14px; height: 14px; }
.as-bst.ok { color: var(--ok); } .as-bst.wait { color: var(--wait); } .as-bst.bad { color: var(--fault); } .as-bst.muted { color: var(--muted); }
.as-grip { position: absolute; inset-inline: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.as-grip::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 18px; height: 2px; margin-left: -9px; border-radius: 2px; background: color-mix(in srgb, var(--as-c) 60%, transparent); }
.as-off { position: absolute; inset-inline: 2px; display: flex; align-items: flex-start; padding: 3px 6px; border-radius: 8px; font-size: 11px; color: var(--muted); pointer-events: none;
  background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--muted) 10%, transparent) 0 6px, transparent 6px 12px); border: 1px dashed color-mix(in srgb, var(--muted) 40%, transparent); }

/* legend */
.as-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.as-key { display: inline-flex; align-items: center; gap: 5px; }
.as-key.ok { color: var(--ok); } .as-key.wait { color: var(--wait); } .as-key.bad { color: var(--fault); }
.as-sw { width: 14px; height: 10px; border-radius: 3px; display: inline-block; border: 1px solid var(--as-c0); background: color-mix(in srgb, var(--as-c0) 16%, var(--panel)); }
.as-sw.once { border-style: dashed; }
.as-sw.off { border: 1px dashed var(--muted); background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--muted) 20%, transparent) 0 3px, transparent 3px 6px); }

/* tables */
.as-scroll { position: relative; width: 0; min-width: 100%; overflow-x: auto; }
.as-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.as-table th { text-align: start; font-weight: 600; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.as-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.as-table tr:last-child td { border-bottom: 0; }
.as-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.as-act { text-align: end; white-space: nowrap; }
.as-err { margin-top: 3px; max-width: 280px; }

/* forms, settings, log */
.as-two, .as-three { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.as-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.as-shifts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.as-set { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.as-switch-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; }
.as-switch-row small { display: block; margin-top: 3px; font-weight: 400; }
.as-num { max-width: 120px; }
.as-log { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.as-log li { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.as-log li:last-child { border-bottom: 0; }
.as-h3 { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.as-conflicts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.as-conflicts li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 6px 8px; border-radius: 8px; background: color-mix(in srgb, var(--muted) 7%, var(--panel)); }
.as-conflicts li.bad { color: var(--fault); background: color-mix(in srgb, var(--fault) 8%, var(--panel)); }
.as-conflicts li.wait .ico { color: var(--wait); }

@media (max-width: 1100px) {
  .as-two-cards { grid-template-columns: minmax(0, 1fr); }
  .as-palette { flex-basis: 180px; }
}
/* a phone: the agents above, one day at a time (tabs) */
@media (max-width: 760px) {
  .as-main { flex-direction: column; align-items: stretch; }
  .as-palette { flex: none; }
  .as-palette > p { display: none; }
  .as-agents { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .as-agent { flex: none; }
  .as-palette-foot { flex-direction: row; flex-wrap: wrap; }
  .as-agent { grid-template-columns: auto auto auto; }
  .as-agent .as-shift { display: none; }
  .as-daytabs { display: flex; position: sticky; top: 0; z-index: 4; background: var(--panel); border-radius: 0; border-width: 0 0 1px; }
  .as-daytabs button { padding: 8px 2px; font-size: 12px; }
  .as-col:not(.sel) { display: none; }
  .as-col.sel .as-dayhead { top: 37px; }
  .as-tools { margin-inline-start: 0; }
  .as-range { min-width: 0; }
  .as-three { grid-template-columns: minmax(0, 1fr); }
  .as-rev { margin-inline-start: 0; }
  .as-gridwrap { max-height: 70vh; }
}
.as-ext { margin-inline-start: 6px; }
