/* GENERATED from src/Shared/ui-tokens/components.css by scripts/sync-ui-tokens.mjs. Do not edit this copy: edit the source, then run `node scripts/sync-ui-tokens.mjs`. */
/*
 * Shared base components for the admin portal and the agent desktop: one definition, two apps.
 * Plain CSS classes over the tokens in tokens.css (no colour values here, only var(--ink), var(--space-6) and the like; class names keep their cc- prefix until the component restyle (6c-2)).
 * Agent uses the classes directly; Portal applies them from its shadcn wrappers.
 * After editing, run `node scripts/sync-ui-tokens.mjs` from the repo root.
 */

/*
 * Buttons (design system: Button). Kinds: primary (ink fill), secondary (ink outline), subtle (line outline),
 * danger (Hang up only); ghost is a link-like text button. Sizes come from control-* and button-pad-*:
 * sm 32 (row actions; --dense is the same), md 36 (the default: headers, forms), lg 40 (call controls),
 * xl 44 (Answer and Decline). Text sets the width. An icon sits on the left; --ic drops that side's padding
 * by 2px; --icon is a square icon-only button (it needs an aria-label).
 */
.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--control-md);
  padding-inline: var(--button-pad-md);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--type-body-size);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.cc-btn > svg {
  flex: none;
}
.cc-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.cc-btn--dense,
.cc-btn--sm {
  height: var(--control-sm);
  padding-inline: var(--button-pad-sm);
  font-size: 13px;
}
.cc-btn--md {
  height: var(--control-md);
  padding-inline: var(--button-pad-md);
}
.cc-btn--lg {
  height: var(--control-lg);
  padding-inline: var(--button-pad-lg);
}
.cc-btn--xl {
  height: var(--control-xl);
  padding-inline: var(--button-pad-xl);
  font-size: 15px;
  font-weight: 600;
}
.cc-btn--ic.cc-btn--sm,
.cc-btn--ic.cc-btn--dense {
  padding-inline-start: calc(var(--button-pad-sm) - 2px);
}
.cc-btn--ic {
  padding-inline-start: calc(var(--button-pad-md) - 2px);
}
.cc-btn--ic.cc-btn--lg {
  padding-inline-start: calc(var(--button-pad-lg) - 2px);
}
.cc-btn--ic.cc-btn--xl {
  padding-inline-start: calc(var(--button-pad-xl) - 2px);
}
.cc-btn--icon {
  width: var(--control-md);
  padding-inline: 0;
}
.cc-btn--icon.cc-btn--sm,
.cc-btn--icon.cc-btn--dense {
  width: var(--control-sm);
}
.cc-btn--primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}
.cc-btn--primary:hover {
  background: var(--ink-secondary);
  border-color: var(--ink-secondary);
}
.cc-btn--secondary {
  background: var(--surface);
  border-color: var(--ink);
  color: var(--ink);
}
.cc-btn--secondary:hover {
  background: var(--surface-muted);
}
.cc-btn--subtle {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.cc-btn--subtle:hover {
  background: var(--surface-muted);
}
.cc-btn--ghost {
  background: transparent;
  color: var(--ink);
}
.cc-btn--ghost:hover {
  background: var(--surface-muted);
}
.cc-btn--danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--on-danger);
  font-weight: 600;
}
.cc-btn--danger:hover {
  filter: brightness(0.9);
}
/* A pressed toggle (Mute, Hold, Keypad, Transfer) takes the primary fill; the label and icon change with it. */
.cc-btn[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}
/* Disabled: a disabled-bg fill for primary, a disabled-fg border and text for the others. The reason goes nearby. */
.cc-btn:disabled,
.cc-btn[aria-disabled="true"] {
  background: var(--surface);
  border-color: var(--disabled-fg);
  color: var(--disabled-fg);
  filter: none;
  cursor: not-allowed;
}
.cc-btn--primary:disabled,
.cc-btn--primary[aria-disabled="true"] {
  background: var(--disabled-bg);
  border-color: var(--disabled-bg);
  color: var(--disabled-fg);
}
.cc-btn--ghost:disabled,
.cc-btn--ghost[aria-disabled="true"] {
  background: transparent;
  border-color: transparent;
}

/*
 * The mark (design system: Mark): an ink L on a 3 x 3 grid, one signal corner block in the top-right cell.
 * <span class="lc-mark" role="img" aria-label="..."><span class="lc-mark__v"></span><span class="lc-mark__h"></span>
 * <span class="lc-mark__c"></span></span>. Set the size with width and height (mark-header 24px by default,
 * 60px on the ringing card, 14px in an agent tile, 16px minimum). Add lc-ring to the corner block while a call
 * rings (session state Offered) and only then.
 */
.lc-mark {
  position: relative;
  display: inline-block;
  flex: none;
  width: var(--mark-header);
  height: var(--mark-header);
}
.lc-mark > span {
  position: absolute;
}
.lc-mark__v {
  left: 0;
  top: 0;
  width: 33.334%;
  height: 100%;
  background: var(--ink);
}
.lc-mark__h {
  left: 0;
  bottom: 0;
  width: 100%;
  height: 33.334%;
  background: var(--ink);
}
.lc-mark__c {
  right: 0;
  top: 0;
  width: 33.334%;
  height: 33.334%;
  background: var(--signal);
}
@keyframes lc-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.18; }
}
.lc-ring {
  animation: lc-blink 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .lc-ring {
    animation: none;
    outline: 2px solid var(--signal);
    outline-offset: 2px;
  }
}

/* Pills: status text on its tint. The text carries the meaning, the colour only supports it. */
.cc-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--type-overline-size);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.cc-pill--info {
  background: var(--tint-hold);
  color: var(--text-hold);
}
.cc-pill--wrap {
  background: var(--tint-wrap);
  color: var(--text-wrap);
}
.cc-pill--danger {
  background: var(--tint-busy);
  color: var(--text-danger);
}
.cc-pill--neutral {
  background: var(--line-subtle);
  color: var(--ink-secondary);
}

/*
 * StatusIndicator: a 10px dot plus its word, always (the status-* colours mean presence or call state and nothing else).
 * Offline is a hollow 2px ring; Ringing has a 4px halo (the header mark blinks at the same time).
 * <span class="cc-presence cc-presence--away">Away</span>. Away and On break use status-hold (the design's Break).
 */
.cc-presence {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink);
  font-size: var(--type-body-size);
}
.cc-presence::before {
  content: "";
  flex: none;
  box-sizing: border-box;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--status-offline);
}
.cc-presence--available::before {
  background: var(--status-available);
}
.cc-presence--away::before,
.cc-presence--break::before {
  background: var(--status-hold);
}
.cc-presence--dnd::before {
  background: var(--status-busy);
}
.cc-presence--offline::before {
  background: transparent;
  border: 2px solid var(--status-offline);
}
.cc-presence--oncall::before {
  background: var(--status-busy);
}
.cc-presence--ringing::before {
  background: var(--status-ringing);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--status-ringing) 28%, transparent);
}
.cc-presence--wrapup::before,
.cc-presence--wrap::before {
  background: var(--status-wrap);
}
.cc-presence--hold::before {
  background: var(--status-hold);
}
.cc-presence--busy::before {
  background: var(--status-busy);
}

/* Cards and panels */
.cc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

/* Inputs */
.cc-input {
  width: 100%;
  min-height: var(--control-xl);
  padding: 0 var(--space-3);
  background: var(--surface-muted);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--type-body-size);
}
.cc-input::placeholder {
  color: var(--ink-muted);
}
.cc-input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  border-color: var(--ink);
}
.cc-input[aria-invalid="true"] {
  border-color: var(--status-busy);
}
.cc-input:disabled {
  background: var(--disabled-bg);
  color: var(--disabled-fg);
  cursor: not-allowed;
}

/* Wide tables scroll inside their own box, never the page. */
.cc-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

/* Section labels and monospace figures */
.cc-label {
  color: var(--ink-muted);
  font-size: var(--type-overline-size);
  font-weight: 600;
  letter-spacing: var(--type-overline-tracking);
  text-transform: uppercase;
}
.cc-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/*
 * DataTable (design system): a bordered surface box (.cc-table-scroll) around .lc-table. Quiet caption headers,
 * line-subtle dividers, no zebra and no hover fill beyond surface-muted. The first column is .lc-name (body-strong)
 * with an optional .lc-sub mono line; counts and numbers are .lc-num (data mono, right-aligned).
 */
.lc-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.lc-table th {
  padding: var(--space-3) var(--space-4);
  color: var(--ink-muted);
  font-size: var(--type-caption-size);
  font-weight: 400;
}
.lc-table td {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--line-subtle);
  vertical-align: middle;
}
.lc-table tbody tr:hover {
  background: var(--surface-muted);
}
.lc-name {
  font-weight: 500;
}
.lc-sub {
  display: block;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: var(--type-caption-size);
}
.lc-num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
th.lc-num {
  font-family: inherit;
}

/* KpiTile: a caption label, a 44px mono value with an optional 24px unit; tiles joined by 1px line gutters. */
.lc-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.lc-kpi {
  padding: var(--space-5) var(--space-6);
  background: var(--surface);
}
.lc-kpi__label {
  color: var(--ink-muted);
  font-size: var(--type-caption-size);
}
.lc-kpi__value {
  margin-top: var(--space-1);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.lc-kpi__unit {
  color: var(--ink-muted);
  font-size: 24px;
  letter-spacing: 0;
}
.lc-kpi--breach .lc-kpi__value {
  color: var(--status-busy);
}
@media (max-width: 1024px) {
  .lc-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* AgentTile: status, name, a caption line, the time in state on the right; two columns. */
.lc-agents {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}
.lc-agent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.lc-agent__who {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}
.lc-agent__line {
  color: var(--ink-muted);
  font-size: var(--type-caption-size);
}
.lc-agent--offline {
  color: var(--ink-muted);
}
@media (max-width: 700px) {
  .lc-agents {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* PrioritySelector: 1 / 2 / 3, three joined mono buttons in one line box (role=radiogroup, role=radio). */
.lc-prio {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.lc-prio button {
  width: 38px;
  height: 34px;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  cursor: pointer;
}
.lc-prio button:first-child {
  border-left: 0;
}
.lc-prio button[aria-checked="true"] {
  background: var(--ink);
  color: var(--on-ink);
}
.lc-prio button:disabled {
  color: var(--disabled-fg);
  cursor: not-allowed;
}

