/* UiPath Master Scheduler — design system.
 * Plain CSS (the Tailwind CDN does not process @apply in external files). Tailwind is used only for layout
 * utilities; every color comes from the tokens below, so [data-theme] switches the whole UI consistently.
 */

/* ------------------------------------------------------------------ tokens */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #080c14;
  --bg-grad-1: rgba(56, 189, 248, .07);
  --bg-grad-2: rgba(139, 92, 246, .07);
  --surface: #0f1522;
  --surface-2: #141b2b;
  --surface-3: #1a2336;
  --elevated: #161e30;
  --border: #222c40;
  --border-strong: #2e3a52;
  --text: #e6ebf5;
  --text-2: #aab4c8;
  --text-3: #7a869d;
  --accent: #7c8cff;
  --accent-2: #9aa6ff;
  --accent-contrast: #0b1020;
  --accent-soft: rgba(124, 140, 255, .14);
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .13); --ok-border: rgba(52, 211, 153, .35);
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .13); --warn-border: rgba(251, 191, 36, .35);
  --err: #fb7185; --err-soft: rgba(251, 113, 133, .13); --err-border: rgba(251, 113, 133, .38);
  --info: #38bdf8; --info-soft: rgba(56, 189, 248, .13); --info-border: rgba(56, 189, 248, .35);
  --busy: #a78bfa; --busy-soft: rgba(167, 139, 250, .15); --busy-border: rgba(167, 139, 250, .42);
  --muted-soft: rgba(148, 163, 184, .10); --muted-border: rgba(148, 163, 184, .25);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .55);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
  --ring: 0 0 0 3px rgba(124, 140, 255, .35);
  --skeleton-a: #161e2e; --skeleton-b: #1f2940;
  --chart-grid: rgba(148, 163, 184, .10);
  --chart-text: #8a96ad;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-grad-1: rgba(99, 102, 241, .06);
  --bg-grad-2: rgba(14, 165, 233, .05);
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eef1f7;
  --elevated: #ffffff;
  --border: #e3e7f0;
  --border-strong: #cfd6e4;
  --text: #121826;
  --text-2: #475067;
  --text-3: #6b7489;
  --accent: #4f5bd5;
  --accent-2: #3f4ac2;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(79, 91, 213, .10);
  --ok: #059669; --ok-soft: rgba(5, 150, 105, .10); --ok-border: rgba(5, 150, 105, .30);
  --warn: #b45309; --warn-soft: rgba(217, 119, 6, .11); --warn-border: rgba(217, 119, 6, .32);
  --err: #e11d48; --err-soft: rgba(225, 29, 72, .09); --err-border: rgba(225, 29, 72, .30);
  --info: #0284c7; --info-soft: rgba(2, 132, 199, .10); --info-border: rgba(2, 132, 199, .30);
  --busy: #7c3aed; --busy-soft: rgba(124, 58, 237, .10); --busy-border: rgba(124, 58, 237, .32);
  --muted-soft: rgba(100, 116, 139, .09); --muted-border: rgba(100, 116, 139, .25);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -14px rgba(16, 24, 40, .18);
  --shadow-lg: 0 24px 60px -20px rgba(16, 24, 40, .35);
  --ring: 0 0 0 3px rgba(79, 91, 213, .28);
  --skeleton-a: #eef1f6; --skeleton-b: #e2e7f0;
  --chart-grid: rgba(100, 116, 139, .15);
  --chart-text: #5b6478;
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 14px; line-height: 1.5; font-feature-settings: "tnum" 1, "cv11" 1;
  background-image: radial-gradient(1200px 600px at 100% -10%, var(--bg-grad-1), transparent 60%),
                    radial-gradient(900px 500px at -10% 110%, var(--bg-grad-2), transparent 60%);
  background-attachment: fixed;
}
::selection { background: var(--accent-soft); }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
.hidden { display: none !important; }
.mono, code { font-family: "JetBrains Mono", "Cascadia Code", Consolas, ui-monospace, monospace; font-size: 12px; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.t-ok { color: var(--ok); } .t-warn { color: var(--warn); } .t-err { color: var(--err); } .t-info { color: var(--info); } .t-busy { color: var(--busy); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(90deg, color-mix(in srgb, var(--surface) 82%, transparent) 248px, transparent 248px); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; background: color-mix(in srgb, var(--surface) 82%, transparent);
  border-right: 1px solid var(--border); backdrop-filter: blur(12px); z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #6d7cff 0%, #a26bff 55%, #3cc6ff 100%); box-shadow: 0 6px 18px -6px rgba(109, 124, 255, .7);
}
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -.01em; line-height: 1.15; }
.brand-sub { font-size: 11px; color: var(--text-3); }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 10px 10px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: 10px; border: 0;
  background: transparent; color: var(--text-2); font: inherit; font-weight: 500; cursor: pointer; text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.tab-active { background: var(--accent-soft); color: var(--text); }
.nav-item.tab-active .icon { color: var(--accent-2); }
.nav-count {
  margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; text-align: center;
  background: var(--surface-3); color: var(--text-2);
}
.nav-item.tab-active .nav-count { background: var(--accent); color: var(--accent-contrast); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.clock-card {
  border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; padding: 10px 12px;
}
.clock-time { font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace; font-size: 19px; font-weight: 600; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.clock-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border);
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 16px 28px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.page-title { font-size: 20px; font-weight: 650; letter-spacing: -.015em; line-height: 1.2; }
.page-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }
.mobile-only { display: none !important; }

@media (max-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-102%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg); background: var(--surface);
  }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 35; backdrop-filter: blur(2px); }
  .mobile-only { display: inline-flex !important; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px 14px 40px; }
}
@media (max-width: 640px) {
  .page-title { font-size: 17px; }
  .page-sub { display: none; }
  .hide-sm { display: none !important; }
}

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
@media (max-width: 640px) { .card-pad { padding: 16px; } }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 620; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.section-title { font-size: 15px; font-weight: 620; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

.stat {
  position: relative; overflow: hidden; padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 8px;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.stat-value { font-size: 28px; font-weight: 680; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-hint { font-size: 12px; color: var(--text-3); min-height: 18px; }
.tone-accent { background: var(--accent-soft); color: var(--accent-2); }
.tone-ok { background: var(--ok-soft); color: var(--ok); }
.tone-warn { background: var(--warn-soft); color: var(--warn); }
.tone-info { background: var(--info-soft); color: var(--info); }
.tone-busy { background: var(--busy-soft); color: var(--busy); }
.tone-err { background: var(--err-soft); color: var(--err); }

/* ------------------------------------------------------------------ buttons */
.btn, .btn-primary, .btn-ghost, .btn-danger, .btn-xs, .btn-icon {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; font: inherit;
  font-size: 13px; font-weight: 560; line-height: 1; padding: 9px 14px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s; text-decoration: none;
}
.btn:hover, .btn-ghost:hover, .btn-xs:hover, .btn-icon:hover { background: var(--surface-3); text-decoration: none; }
.btn:active, .btn-primary:active, .btn-ghost:active, .btn-xs:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); box-shadow: 0 6px 16px -8px var(--accent); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--err-soft); border-color: var(--err-border); color: var(--err); }
.btn-danger:hover { background: var(--err); color: #fff; }
.btn-xs { padding: 6px 10px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn-xs.danger { color: var(--err); border-color: var(--err-border); background: transparent; }
.btn-xs.danger:hover { background: var(--err-soft); }
.btn-icon { padding: 7px; border-radius: 9px; background: transparent; border-color: transparent; color: var(--text-2); }
.btn-icon:hover { color: var(--text); }
button:disabled, .btn[aria-disabled="true"], .btn-xs[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.is-loading::after {
  content: ''; position: absolute; width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor;
  border-color: var(--text-2) transparent var(--text-2) transparent; animation: spin .7s linear infinite;
}
.btn-primary.is-loading::after { border-color: var(--accent-contrast) transparent var(--accent-contrast) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .7s linear infinite; display: inline-block; }

/* segmented control */
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 550; padding: 6px 11px; border-radius: 8px; cursor: pointer; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ------------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 550; color: var(--text-2); min-width: 0; }
.field-hint { font-size: 11.5px; font-weight: 400; color: var(--text-3); }
.field-error { font-size: 11.5px; font-weight: 500; color: var(--err); min-height: 0; }
.field-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.input, .input-sm {
  width: 100%; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  padding: 9px 11px; font: inherit; font-size: 13.5px; font-weight: 400; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
  min-height: 38px;
}
.input-sm { width: auto; padding: 6px 9px; min-height: 34px; font-size: 13px; }
select.input, select.input-sm {
  appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a96ad' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.input:hover, .input-sm:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border-strong)); }
.input:focus, .input-sm:focus { border-color: var(--accent); box-shadow: var(--ring); background-color: var(--surface); }
.input::placeholder { color: var(--text-3); }
.input.invalid, .input-sm.invalid, .was-validated .input:invalid { border-color: var(--err); }
.input:disabled { opacity: .6; cursor: not-allowed; }
input[type="date"].input-sm { color-scheme: inherit; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 640px) { .span-2 { grid-column: auto; } }

/* toggle switch (styled checkbox) */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2); user-select: none; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .2s; margin: 0; flex: none; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { box-shadow: var(--ring); }

/* ------------------------------------------------------------------ badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 9px; font-size: 11.5px; font-weight: 580;
  border: 1px solid var(--muted-border); background: var(--muted-soft); color: var(--text-2); white-space: nowrap; line-height: 1.35;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.no-dot::before { display: none; }
.badge-muted { color: var(--text-2); }
.badge-ok { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-border); }
.badge-warn { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-border); }
.badge-err { color: var(--err); background: var(--err-soft); border-color: var(--err-border); }
.badge-info { color: var(--info); background: var(--info-soft); border-color: var(--info-border); }
.badge-busy { color: var(--busy); background: var(--busy-soft); border-color: var(--busy-border); }
.badge-accent { color: var(--accent-2); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.badge.pulse::before { animation: dot-pulse 1.4s ease-in-out infinite; }
@keyframes dot-pulse { 50% { opacity: .25; } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; background: var(--surface-3); color: var(--text-2); }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 12px; max-height: 560px; background: var(--surface); }
.table-wrap.tall { max-height: 720px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th {
  position: sticky; top: 0; z-index: 1; text-align: left; font-weight: 600; color: var(--text-3); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 11px 11px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.table td.wrap { white-space: normal; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-3) 55%, transparent); }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th.sortable::after { content: '↕'; opacity: .35; margin-left: 5px; font-size: 10px; }
.table th.sort-asc::after { content: '↑'; opacity: 1; color: var(--accent-2); }
.table th.sort-desc::after { content: '↓'; opacity: 1; color: var(--accent-2); }
.table td.actions { white-space: nowrap; text-align: right; }
.table td.actions .btn-xs + .btn-xs { margin-left: 4px; }
.cell-main { font-weight: 560; }
.cell-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.table .empty-cell { padding: 0 !important; }
.table tbody tr.row-new td { animation: row-flash 1.6s ease-out; }
@keyframes row-flash { from { background: var(--accent-soft); } }
/* Schedule list (desktop): text columns wrap and headers may break, so every column (incl. "Aktywny") fits the
   card instead of hiding behind a horizontal scroll. Phones use the stacked-card layout below. */
@media (min-width: 641px) {
  #schedules-table th { white-space: normal; }
  #schedules-table th, #schedules-table td { padding-left: 9px; padding-right: 9px; }
  #schedules-table td.sched-when { min-width: 136px; }
  #schedules-table .cron-part { white-space: nowrap; }
  /* Narrow cards: the action buttons may wrap (2 + 1) rather than overflow; wide cards keep them on one line. */
  #sub-schedules .table-wrap { container: sched-list / inline-size; }
  #schedules-table td.actions { white-space: normal; min-width: 104px; }   /* fits 2 buttons per line */
  #schedules-table td.actions .btn-xs { margin: 2px 0 2px 4px; }
}
@container sched-list (min-width: 900px) {
  #schedules-table td.actions { white-space: nowrap; }
}

/* skeleton */
.skeleton { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--skeleton-a) 25%, var(--skeleton-b) 37%, var(--skeleton-a) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* empty state */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 30px 16px; color: var(--text-3); }
.empty-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); margin-bottom: 4px; }
.empty-title { font-weight: 600; color: var(--text); font-size: 14px; }
.empty-hint { font-size: 12.5px; max-width: 420px; }

/* ------------------------------------------------------------------ license tiles */
.lic-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.lic {
  position: relative; overflow: hidden; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2);
  padding: 16px; min-height: 148px; display: flex; flex-direction: column; gap: 6px; transition: border-color .3s, box-shadow .3s, transform .2s;
}
.lic:hover { transform: translateY(-1px); }
.lic-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lic-name { display: flex; align-items: center; gap: 8px; font-weight: 620; font-size: 13.5px; }
.lic-name .icon { color: var(--text-3); }
.lic-state { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.lic-state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.lic-tenant { font-size: 15px; font-weight: 640; margin-top: 6px; }
.lic-process { font-size: 12.5px; color: var(--text-2); }
.lic-meta { font-size: 11.5px; color: var(--text-3); margin-top: auto; display: flex; justify-content: space-between; gap: 8px; }
.lic-timer { font-family: "JetBrains Mono", Consolas, monospace; font-size: 12.5px; color: var(--text-2); }
.lic-progress { height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 4px; }
.lic-progress > span { display: block; height: 100%; border-radius: 999px; background: currentColor; transition: width 1s linear; }
.lic.IDLE { border-color: var(--ok-border); } .lic.IDLE .lic-state { color: var(--ok); }
.lic.ALLOCATING { border-color: var(--warn-border); animation: pulse-border 1.2s ease-in-out infinite; } .lic.ALLOCATING .lic-state { color: var(--warn); }
.lic.BUSY { border-color: var(--busy-border); box-shadow: 0 0 0 1px var(--busy-soft), 0 14px 34px -18px var(--busy); } .lic.BUSY .lic-state, .lic.BUSY .lic-progress { color: var(--busy); }
.lic.COOLDOWN { border-color: var(--info-border); } .lic.COOLDOWN .lic-state, .lic.COOLDOWN .lic-progress { color: var(--info); }
.lic.BUSY .lic-state::before, .lic.ALLOCATING .lic-state::before { animation: dot-pulse 1.2s ease-in-out infinite; }
.lic.BUSY::after {
  content: ''; position: absolute; left: 0; top: 0; height: 2px; width: 45%;
  background: linear-gradient(90deg, transparent, var(--busy), transparent); animation: sweep 2s linear infinite;
}
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(240%); } }
@keyframes pulse-border { 50% { box-shadow: 0 0 0 4px var(--warn-soft); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ------------------------------------------------------------------ quota bars */
.quota-row { display: grid; grid-template-columns: minmax(120px, 200px) 1fr auto; align-items: center; gap: 14px; }
@media (max-width: 640px) { .quota-row { grid-template-columns: 1fr auto; } .quota-row .quota-bar { grid-column: 1 / -1; } }
.quota-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.quota-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .6s ease; }
.quota-bar > span.warn { background: var(--warn); } .quota-bar > span.over { background: var(--err); }
.quota-bar > span.none { background: var(--muted-border); }

/* ------------------------------------------------------------------ charts */
/* Pitfall 6: a canvas with maintainAspectRatio:false MUST sit in a container with an explicit height. */
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 240px; }

/* ------------------------------------------------------------------ toasts */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 10px; width: 380px; max-width: calc(100vw - 28px); pointer-events: none; }
.toast {
  pointer-events: auto; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start;
  border-radius: 12px; padding: 12px 12px 12px 14px; font-size: 13px; border: 1px solid var(--border-strong);
  background: var(--elevated); box-shadow: var(--shadow-lg); animation: toast-in .22s ease-out; position: relative; overflow: hidden;
}
.toast .icon { margin-top: 1px; }
.toast.success .icon { color: var(--ok); } .toast.warning .icon { color: var(--warn); } .toast.error .icon { color: var(--err); } .toast.info .icon { color: var(--info); }
.toast.success { border-left: 3px solid var(--ok); } .toast.warning { border-left: 3px solid var(--warn); }
.toast.error { border-left: 3px solid var(--err); } .toast.info { border-left: 3px solid var(--info); }
.toast-count { margin-left: 6px; font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.toast-close { border: 0; background: transparent; color: var(--text-3); cursor: pointer; padding: 0; line-height: 0; }
.toast-close:hover { color: var(--text); }
.toast.leaving { animation: toast-out .18s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

/* ------------------------------------------------------------------ dialogs */
dialog.modal {
  border: 1px solid var(--border-strong); border-radius: 16px; padding: 0; background: var(--elevated); color: var(--text);
  box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px);
}
dialog.modal.wide { width: min(820px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(3, 6, 12, .55); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.modal-title { font-size: 16px; font-weight: 650; }
.modal-body { padding: 14px 20px; overflow: auto; max-height: calc(100vh - 200px); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; }
.confirm-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }

/* ------------------------------------------------------------------ callouts / onboarding */
.callout { display: flex; gap: 14px; align-items: flex-start; border-radius: 14px; padding: 14px 16px; border: 1px solid var(--border); background: var(--surface); }
.callout .icon-wrap { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.callout-title { font-weight: 620; }
.callout-text { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.callout.accent { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface); }
.callout.warn { border-color: var(--warn-border); background: linear-gradient(135deg, var(--warn-soft), transparent 70%), var(--surface); }
.callout.err { border-color: var(--err-border); background: linear-gradient(135deg, var(--err-soft), transparent 70%), var(--surface); }

/* key-value list */
.kv { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* settings layout */
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; align-items: start; }
.subnav { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.subtab {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; color: var(--text-2);
  font: inherit; font-weight: 520; font-size: 13.5px; padding: 9px 10px; border-radius: 9px; cursor: pointer; text-align: left;
}
.subtab:hover { background: var(--surface-3); color: var(--text); }
.subtab-active { background: var(--accent-soft); color: var(--text); }
.subtab-active .icon { color: var(--accent-2); }
@media (max-width: 1024px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .subnav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; }
  .subtab { width: auto; white-space: nowrap; }
}

/* day panel / lists */
.li-card { border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; background: var(--surface-2); }
.window { display: flex; justify-content: space-between; gap: 8px; align-items: center; border-radius: 9px; padding: 7px 10px; font-size: 12.5px; background: var(--ok-soft); border: 1px solid var(--ok-border); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; color: var(--text-2); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.activity { display: flex; flex-direction: column; }
.activity-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }

/* ------------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero {
  position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; color: #eef1ff;
  background: radial-gradient(800px 500px at 20% 10%, rgba(124, 140, 255, .45), transparent 60%),
              radial-gradient(700px 500px at 90% 90%, rgba(60, 198, 255, .30), transparent 60%),
              linear-gradient(160deg, #0d1330 0%, #121a3d 50%, #0a1024 100%);
}
.login-hero::after {
  content: ''; position: absolute; inset: 0; opacity: .25; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 36px 36px; mask-image: radial-gradient(circle at 30% 30%, #000 0%, transparent 70%);
}
.login-hero > * { position: relative; z-index: 1; }
.login-feature { display: flex; gap: 12px; align-items: flex-start; }
.login-feature .icon-wrap { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.1); flex: none; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 400px; }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-hero { display: none; } }

/* ------------------------------------------------------------------ FullCalendar theme */
#calendar {
  --fc-border-color: var(--border); --fc-page-bg-color: var(--surface); --fc-neutral-bg-color: var(--surface-2);
  --fc-list-event-hover-bg-color: var(--surface-3); --fc-today-bg-color: color-mix(in srgb, var(--accent) 6%, transparent); --fc-now-indicator-color: var(--err);
  --fc-button-bg-color: var(--surface-2); --fc-button-border-color: var(--border-strong); --fc-button-text-color: var(--text);
  --fc-button-hover-bg-color: var(--surface-3); --fc-button-hover-border-color: var(--border-strong);
  --fc-button-active-bg-color: var(--accent); --fc-button-active-border-color: var(--accent);
  --fc-event-text-color: #fff; --fc-small-font-size: 11.5px; font-size: 12.5px;
}
#calendar .fc-toolbar { flex-wrap: wrap; gap: 10px; }
#calendar .fc-toolbar-title { font-size: 16px; font-weight: 640; letter-spacing: -.01em; }
#calendar .fc-button { font-size: 12.5px; font-weight: 560; padding: 6px 11px; border-radius: 9px; text-transform: lowercase; box-shadow: none !important; }
#calendar .fc-button-group > .fc-button { border-radius: 0; }
#calendar .fc-button-group > .fc-button:first-child { border-top-left-radius: 9px; border-bottom-left-radius: 9px; }
#calendar .fc-button-group > .fc-button:last-child { border-top-right-radius: 9px; border-bottom-right-radius: 9px; }
#calendar .fc-button-primary:not(:disabled).fc-button-active { color: var(--accent-contrast); }
#calendar .fc-col-header-cell { background: var(--surface-2); }
#calendar .fc-col-header-cell-cushion, #calendar .fc-daygrid-day-number, #calendar .fc-list-day-cushion a,
#calendar .fc-timegrid-slot-label-cushion { color: var(--text-2); font-weight: 560; }
#calendar .fc-timegrid-slot { height: 2.1em; }
#calendar .fc-scrollgrid { border-radius: 12px; overflow: hidden; }
#calendar .fc-timegrid-event, #calendar .fc-daygrid-event { border-radius: 7px; box-shadow: 0 2px 6px -3px rgba(0,0,0,.45); }
#calendar .fc-list-event-title, #calendar .fc-list-event-time { color: var(--text); }
/* Pitfall 5: the custom content node must fill the harness FullCalendar sized to the duration. */
.fc-block { height: 100%; overflow: hidden; padding: 2px 6px; line-height: 1.2; display: flex; flex-direction: column; gap: 1px; }
.fc-block .fc-block-time { font-size: 10.5px; opacity: .9; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fc-block .fc-block-title { font-size: 11.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-block .fc-block-tenant { font-size: 10.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-event.ev-planned { border-style: dashed !important; border-width: 1.5px !important; }
.fc-event.ev-run { opacity: .96; }
.fc-daygrid-event .fc-block { flex-direction: row; gap: 6px; align-items: center; }
/* Week view: columns are ~100 px wide, so the process name may take 2 lines (then "…"); slightly taller slots give
   a 45-min block room for time + 2-line name. Short blocks (<30 px, FullCalendar's .fc-timegrid-event-short) keep
   one line. Full details stay in the tooltip and the day panel. */
#calendar .fc-timeGridWeek-view .fc-timegrid-slot { height: 2.5em; }
.fc-timeGridWeek-view .fc-block { padding: 2px 4px 2px 5px; gap: 0; line-height: 1.15; }
.fc-timeGridWeek-view .fc-block > * { flex-shrink: 0; }   /* time + name keep their lines; the tenant line is clipped first */
.fc-timeGridWeek-view .fc-block .fc-block-time { font-size: 10px; }
.fc-timeGridWeek-view .fc-block .fc-block-warn { margin-left: 3px; }
.fc-timeGridWeek-view .fc-block .fc-block-title {
  white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
}
/* Short blocks (week and day view): time and name on one line; the week view also drops the end time and delay. */
.fc-timegrid-event-short .fc-block { flex-direction: row; align-items: center; gap: 6px; }
.fc-timegrid-event-short .fc-block .fc-block-time { flex-shrink: 0; }
.fc-timegrid-event-short .fc-block .fc-block-title { flex-shrink: 1; min-width: 0; }
.fc-timegrid-event-short .fc-block .fc-block-tenant { display: none; }
.fc-timeGridWeek-view .fc-timegrid-event-short .fc-block { gap: 4px; }
.fc-timeGridWeek-view .fc-timegrid-event-short .fc-block-title { -webkit-line-clamp: 1; line-clamp: 1; font-size: 11px; }
.fc-timeGridWeek-view .fc-timegrid-event-short :is(.fc-block-end, .fc-block-delay) { display: none; }
/* Stage 4: planned occurrences that do not fit into the license pool / tenant cap. */
.fc-event.ev-over { box-shadow: 0 0 0 2px var(--warn), 0 2px 8px -2px color-mix(in srgb, var(--warn) 60%, transparent) !important; }
.fc-block .fc-block-warn { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; color: var(--warn); font-weight: 700; }
.li-card.li-over { border-color: var(--warn-border); background: linear-gradient(135deg, var(--warn-soft), transparent 70%), var(--surface-2); }

/* capacity banner (calendar) */
.cap-list { list-style: none; margin: 10px 0 4px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cap-item { width: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; text-align: left; padding: 8px 10px;
  border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
  transition: border-color .15s, background .15s; }
.cap-item:hover, .cap-item:focus-visible { border-color: var(--warn-border); background: var(--surface-2); }
.cap-msg { font-size: 13px; font-weight: 560; flex: 1 1 280px; }
.cap-sub { flex-basis: 100%; font-size: 12px; color: var(--text-2); }

.icon-xs { width: 12px; height: 12px; vertical-align: -2px; }
.info-tip { display: inline-flex; color: var(--text-3); cursor: help; border-radius: 50%; }
.info-tip svg { width: 15px; height: 15px; }
.info-tip:hover, .info-tip:focus-visible { color: var(--accent); }

/* misc */
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.fade-in { animation: fade-in .25s ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } }
.tab-panel { animation: fade-in .2s ease-out; }
.help { cursor: help; border-bottom: 1px dotted var(--text-3); }
details.tools > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-weight: 600; }
details.tools > summary::-webkit-details-marker { display: none; }
details.tools[open] > summary .chev { transform: rotate(90deg); }
.chev { transition: transform .15s; }
pre.code { margin: 0; max-height: 220px; overflow: auto; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); padding: 10px; font-size: 11.5px; color: var(--text-2); }

@media (max-width: 1024px) { .shell { background: none; } }

/* ------------------------------------------------------------------ keyboard hints */
.kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface-2);
  color: var(--text-2); font: 600 11px/1 "JetBrains Mono", Consolas, monospace;
}
.btn-primary .kbd { margin-left: 2px; background: color-mix(in srgb, var(--accent-contrast) 18%, transparent); color: inherit; border-color: color-mix(in srgb, var(--accent-contrast) 30%, transparent); }
.shortcuts { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; align-items: center; margin: 0; font-size: 13.5px; }
.shortcuts dt { white-space: nowrap; color: var(--text-3); }
.shortcuts dd { margin: 0; }

/* ------------------------------------------------------------------ toast action */
.toast-action {
  margin-top: 8px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 8px; cursor: pointer;
}
.toast-action:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

/* ------------------------------------------------------------------ clickable rows */
.table tbody tr.row-click { cursor: pointer; }
.table tbody tr.row-click:focus-visible td { background: var(--accent-soft); box-shadow: none; }
.table tbody tr.row-click:focus-visible { outline: none; }
/* Static tint (not only an animation): the row is re-rendered by live updates while highlighted. */
.table tbody tr.row-highlight td { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.table tbody tr.row-highlight td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.activity-item.clickable { cursor: pointer; border-radius: 10px; padding-left: 6px; padding-right: 6px; margin: 0 -6px; }
.activity-item.clickable:hover { background: var(--surface-2); }
.note-line { font-size: 12px; line-height: 1.45; }

/* ------------------------------------------------------------------ license tile extras */
.lic.held { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: linear-gradient(160deg, var(--accent-soft), transparent 55%), var(--surface-2); }
.lic.held .lic-state { color: var(--accent-2); }
.lic-hold { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--accent-2); font-weight: 560; }
.lic-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; font-size: 11px; color: var(--text-3); }
.lic-flow .step { padding: 2px 7px; border-radius: 6px; background: var(--surface-3); white-space: nowrap; }
.lic-flow .step.now { background: var(--warn-soft); color: var(--warn); animation: dot-pulse 1.4s ease-in-out infinite; }
.lic-flow .icon { width: 11px; height: 11px; }
.lic-hint { font-size: 11.5px; color: var(--text-3); line-height: 1.4; }
/* Overdue: past the time limit while UiPath still runs the job — the runtime is kept, the operator is alarmed. */
.lic.overdue { border-color: var(--err-border); box-shadow: 0 0 0 1px var(--err-soft), 0 14px 34px -18px var(--err); }
.lic.overdue .lic-state { color: var(--err); }
.lic-overdue { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--err);
  background: var(--err-soft); border: 1px solid var(--err-border); border-radius: 8px; padding: 3px 8px; }

/* ------------------------------------------------------------------ live feed */
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); margin-left: 4px; }
.live-dot.on { background: var(--ok); box-shadow: 0 0 0 0 var(--ok-border); animation: live-ping 2s ease-out infinite; }
@keyframes live-ping { 0% { box-shadow: 0 0 0 0 var(--ok-border); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
.feed { list-style: none; margin: 0; padding: 0; height: 404px; overflow-y: auto; overscroll-behavior: contain; }
.feed-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 8px 2px; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: 0; }
.feed-item.clickable { cursor: pointer; border-radius: 8px; }
.feed-item.clickable:hover { background: var(--surface-2); }
.feed-item.new { animation: fade-in .3s ease-out; }
.feed-icon { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.feed-icon .icon { width: 14px; height: 14px; }
.feed-text { font-size: 12.5px; line-height: 1.4; min-width: 0; overflow-wrap: anywhere; }
.feed-time { font-size: 11px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ drawer (job detail) */
dialog.drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0; height: 100vh; max-height: 100vh; width: min(520px, 100vw);
  border: 0; border-left: 1px solid var(--border-strong); padding: 0; background: var(--elevated); color: var(--text);
  box-shadow: var(--shadow-lg); display: none; flex-direction: column;
}
dialog.drawer[open] { display: flex; animation: drawer-in .22s ease-out; }
dialog.drawer::backdrop { background: rgba(3, 6, 12, .45); backdrop-filter: blur(2px); }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow: auto; padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 18px; }
.drawer-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); }
.drawer-foot:empty { display: none; }
.section-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 600; margin-bottom: 8px; }
.explain { border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.5; border: 1px solid var(--border); background: var(--surface-2); display: flex; gap: 10px; }
.explain .icon { margin-top: 2px; }
.explain.ok { border-color: var(--ok-border); background: var(--ok-soft); } .explain.ok .icon { color: var(--ok); }
.explain.warn { border-color: var(--warn-border); background: var(--warn-soft); } .explain.warn .icon { color: var(--warn); }
.explain.err { border-color: var(--err-border); background: var(--err-soft); } .explain.err .icon { color: var(--err); }
.explain.busy { border-color: var(--busy-border); background: var(--busy-soft); } .explain.busy .icon { color: var(--busy); }
.error-box { border-radius: 10px; padding: 10px 12px; background: var(--err-soft); border: 1px solid var(--err-border); color: var(--err); font-size: 12.5px; overflow-wrap: anywhere; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 16px 28px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: 8px; top: 18px; bottom: -2px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .tl-dot { position: absolute; left: 1px; top: 2px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; }
.timeline .done .tl-dot { border-color: var(--ok); background: var(--ok); }
.timeline .done .tl-dot::after { content: ''; width: 5px; height: 8px; border: solid var(--accent-contrast); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.timeline .done::before { background: var(--ok-border); }
.timeline .now .tl-dot { border-color: var(--busy); background: var(--busy-soft); animation: pulse-ring 1.4s ease-in-out infinite; }
.timeline .fail .tl-dot { border-color: var(--err); background: var(--err); }
.timeline .skip .tl-dot { border-style: dashed; }
.timeline .skip .tl-title { color: var(--text-3); }
@keyframes pulse-ring { 50% { box-shadow: 0 0 0 5px var(--busy-soft); } }
.tl-title { font-weight: 580; font-size: 13px; }
.tl-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }

.copy-btn { border: 0; background: transparent; color: var(--text-3); cursor: pointer; padding: 2px; border-radius: 6px; vertical-align: -3px; }
.copy-btn:hover { color: var(--text); background: var(--surface-3); }
.copy-btn .icon { width: 14px; height: 14px; }

.lic.clickable { cursor: pointer; }
.lic.clickable:focus-visible { box-shadow: var(--ring); }

/* stable heights for live-updated areas (no layout shift) */
#enq-result:empty { display: none; }
.lic { min-height: 164px; }

@media (max-width: 640px) {
  dialog.drawer { width: 100vw; border-left: 0; }
  .drawer-head, .drawer-body, .drawer-foot { padding-left: 16px; padding-right: 16px; }
  .feed { height: 320px; }
  #toasts { right: 14px; left: 14px; width: auto; bottom: 14px; }
}
button.chip { border: 1px solid transparent; cursor: pointer; font: inherit; font-size: 11.5px; }
button.chip:hover { background: var(--accent-soft); color: var(--text); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

/* ------------------------------------------------------------------ accounts, roles, secrets (stage 2) */
/* Elements the current role may not use (data-perm). !important beats layout utilities like .flex/.grid. */
.perm-hidden { display: none !important; }

.input-affix { position: relative; }
.input-affix .input { padding-right: 42px; }
.affix-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }

.link-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; border: 0; background: none;
  color: var(--accent-2); font: inherit; font-size: 12.5px; cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.link-btn:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }

.user-card { border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; padding: 8px 8px 6px; }
.user-card .user-row { padding: 2px 2px 6px; }
.user-actions { display: flex; align-items: center; gap: 2px; border-top: 1px solid var(--border); padding-top: 6px; }
.user-actions .logout-btn { width: auto; margin-left: auto; gap: 6px; padding: 0 10px; font-size: 12.5px; color: var(--text-2); }
.user-actions .logout-btn:hover { color: var(--text); }
.user-name { font-weight: 560; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; min-width: 0; }
.user-meta .badge { font-size: 10.5px; padding: 1px 7px; }
.user-meta .mono { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar.role-admin { background: var(--accent-soft); color: var(--accent-2); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.avatar.role-operator { background: var(--info-soft); color: var(--info); border-color: var(--info-border); }

#readonly-badge { gap: 5px; }
#readonly-badge .icon { width: 13px; height: 13px; }

.secret-box { display: flex; gap: 8px; align-items: stretch; }
.secret-box .input { flex: 1; font-size: 14px; letter-spacing: .02em; }

.role-card { padding: 14px 16px; }
.role-card .perm-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.table tr.row-self td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.table tr.row-disabled td { opacity: .62; }

/* FullCalendar ships its arrow/close icons as an inline data: font (fcicons). The strict CSP has no
   font-src data:, so that @font-face is patched out of static/vendor/fullcalendar.global.min.js (see
   tools/README.md) and the panel draws those few glyphs with the regular font instead. */
.fc .fc-icon { font-family: inherit !important; font-weight: 600; font-size: 1.25em; line-height: 1; }
.fc .fc-icon-chevron-left::before { content: "\2039"; }
.fc .fc-icon-chevron-right::before { content: "\203A"; }
.fc .fc-icon-chevrons-left::before { content: "\00AB"; }
.fc .fc-icon-chevrons-right::before { content: "\00BB"; }
.fc .fc-icon-x::before { content: "\00D7"; }
.fc .fc-icon-minus-square::before { content: "\2212"; }
.fc .fc-icon-plus-square::before { content: "+"; }

/* ------------------------------------------------------------------ backlog: week view, cards, release, connectivity */
/* Week view: at most 2 stacked blocks + "+N" link (views.timeGridWeek.eventMaxStack in app.js). */
#calendar .fc-timegrid-more-link {
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent-2); border-radius: 7px; font-weight: 700; font-size: 11px; padding: 1px 4px;
}
#calendar .fc-timegrid-more-link:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--text); }
.fc-more-label { font-variant-numeric: tabular-nums; }
.fc .fc-popover {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  min-width: 240px; max-width: 320px; z-index: 30; overflow: hidden;
}
.fc .fc-popover-header { background: var(--surface-2); color: var(--text); padding: 8px 10px; font-weight: 600; font-size: 12.5px; }
.fc .fc-popover-close { color: var(--text-2); opacity: 1; }
.fc .fc-popover-body { padding: 8px; display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.fc .fc-popover-body .fc-daygrid-event-harness { margin: 0; }
.fc .fc-popover-body .fc-event { margin: 0; border-radius: 8px; }
.fc .fc-popover-body .fc-block { flex-direction: column; align-items: flex-start; gap: 1px; padding: 5px 8px; height: auto; }
.fc .fc-popover-body .fc-block-title, .fc .fc-popover-body .fc-block-tenant { white-space: normal; }

/* Held license: manual early release. */
.lic-actions { margin-top: 10px; display: flex; justify-content: flex-end; }
.lic-actions .btn { gap: 6px; }

/* Explanation tone for RESOLVING (ambiguous start being resolved). */
.explain.info { border-color: var(--info-border); background: var(--info-soft); } .explain.info .icon { color: var(--info); }

/* UiPath connectivity indicator in the top bar. */
.conn-badge { gap: 6px; white-space: nowrap; }
.conn-badge .icon { width: 13px; height: 13px; }
@media (max-width: 640px) { .conn-badge .conn-text { display: none; } .conn-badge { padding: 4px 7px; } }

/* Phones: wide tables become stacked label/value cards (data-label copied from <th> by app.js). */
@media (max-width: 640px) {
  .table-wrap { overflow: visible; max-height: none; border: 0; border-radius: 0; background: none; }
  .table-wrap.tall { max-height: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table thead { display: none; }
  .table tbody tr {
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
    margin-bottom: 10px; padding: 6px 2px; box-shadow: 0 1px 2px rgba(0,0,0,.12);
  }
  .table tbody tr:last-child { margin-bottom: 0; }
  .table td, .table tbody tr:last-child td {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    padding: 6px 12px; border-bottom: 0; white-space: normal; text-align: right; min-width: 0; overflow-wrap: anywhere;
  }
  .table td::before {
    content: attr(data-label); flex-shrink: 0; max-width: 45%; text-align: left;
    color: var(--text-3); font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  }
  .table td[data-label=""]::before { display: none; }
  .table td[data-label=""] { justify-content: flex-start; text-align: left; }
  .table td.actions { justify-content: flex-end; flex-wrap: wrap; gap: 6px; padding-top: 8px; border-top: 1px solid var(--border); margin-top: 4px; }
  .table td.actions::before { display: none; }
  .table td.actions .btn-xs + .btn-xs { margin-left: 0; }
  .table .empty-cell { display: block; }
  .table .empty-cell::before { display: none; }
  .table tbody tr:hover td { background: none; }
  .table tbody tr.row-highlight { border-color: var(--accent); }
  .table tbody tr.row-highlight td, .table tbody tr.row-highlight td:first-child { background: none; box-shadow: none; }
  .table tr.row-self td:first-child { box-shadow: none; }
  .table tr.row-self { border-color: var(--accent); }
}

/* ------------------------------------------------------------------ schedule builder (Kreator / cron) */
.cron-builder { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface-2); gap: 12px; }
.cb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border); }
.seg-btn { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 5px 12px; border-radius: 7px; cursor: pointer; transition: background .15s, color .15s; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--accent-soft); color: var(--accent-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.seg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cb-panel { display: grid; gap: 12px; }
.cb-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.cb-checks { display: flex; flex-direction: column; gap: 6px; padding-bottom: 4px; }
#cb-row-days, #cb-row-times { grid-template-columns: 1fr !important; }   /* single full-width field */
.day-toggles { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.day-toggle { min-width: 42px; padding: 7px 0; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all .15s; }
.day-toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.day-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.time-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-2); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }
.time-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 2px; border-radius: 5px; display: inline-flex; }
.time-chip button:hover { background: color-mix(in srgb, var(--accent) 25%, transparent); }
.cb-add-time { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.cb-add-time .input { max-width: 130px; }
.cb-summary { display: grid; gap: 8px; border-top: 1px dashed var(--border-strong); padding-top: 12px; }
.cb-desc { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.cb-desc .icon { color: var(--accent-2); }
#cb-cron-out { justify-self: start; white-space: normal; word-break: break-all; }
.cb-preview { display: grid; gap: 6px; font-size: 12.5px; }
.cb-preview .pill-row { gap: 6px; }
.cb-warn { border: 1px solid var(--warn-border); background: var(--warn-soft); color: var(--text); border-radius: 9px; padding: 8px 10px; font-size: 12.5px; }
.cb-warn strong { color: var(--warn); }
textarea#sf-cron { resize: vertical; min-height: 44px; }
@media (max-width: 640px) {
  .cron-builder { padding: 10px; }
  .cb-row { grid-template-columns: 1fr 1fr; }
  /* All seven days on one line on phones (was wrapping into three rows). */
  .day-toggles { flex-wrap: nowrap; gap: 4px; }
  .day-toggle { flex: 1 1 0; min-width: 0; padding: 8px 0; font-size: 12px; }
}

/* ------------------------------------------------------------------ alerts: bell, panel, Pulpit card */
.tone-muted { background: var(--surface-3); color: var(--text-3); }
.bell { position: relative; }
.bell.has-alerts { color: var(--text); }
.bell-count { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  display: grid; place-items: center; font-size: 10.5px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
  background: var(--warn); color: #1c1203; box-shadow: 0 0 0 2px var(--surface); }
.bell-count.crit { background: var(--err); color: #fff; }
.alert-list { display: flex; flex-direction: column; gap: 10px; }
#al-list { margin-top: 14px; }
.alert-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); border-left: 3px solid var(--warn); background: var(--surface-2); }
.alert-item.sev-critical { border-left-color: var(--err); }
.alert-item.sev-info { border-left-color: var(--info); }
.alert-item.is-acked { opacity: .78; }
.alert-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.alert-msg { font-size: 13px; color: var(--text-2); margin-top: 3px; line-height: 1.45; overflow-wrap: anywhere; }
.alert-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-3); margin-top: 6px; }
.alert-actions { flex-shrink: 0; }
.alert-ok { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ok); }
#alerts-card { margin-top: 20px; }
#alerts-card.alerts-card-crit { border-color: var(--err-border); }
.seg-count:not(:empty) { margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); font-size: 11px; }
@media (max-width: 640px) {
  .alert-item { flex-wrap: wrap; }
  .alert-actions { width: 100%; display: flex; justify-content: flex-end; }
}

/* ------------------------------------------------------------------ settings: alerts & monitoring, data reset */
.channel-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.channel-row.is-off .cell-main { color: var(--text-2); }
.btn-link { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-2); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.btn-link:hover { color: var(--accent); }
.danger-zone { border-color: var(--err-border); box-shadow: inset 3px 0 0 var(--err); }
.reset-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.reset-list li { display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); }
.reset-list li b { color: var(--text); }
.reset-list.keep li { justify-content: flex-start; align-items: flex-start; gap: 8px; }
.reset-list.keep .icon { color: var(--ok); margin-top: 3px; flex-shrink: 0; }
.reset-blockers { margin: 6px 0 0; padding-left: 18px; }
.break-all { word-break: break-all; }
