/* Portal home — mobile app shell + Morobot brand palette */

/*
 * The palette values are emitted by _BrandTheme (rendered from Admin -> Branding) as an
 * inline <style> in the head, which this file is loaded after. Those values therefore
 * already win and the admin's palette drives the shell.
 *
 * This file must NOT re-declare the same names with a literal value, because it comes
 * later in document order and would pin the shell to teal. It also must not use
 * `--x: var(--x, fallback)` - a custom property referencing itself is invalid and
 * resolves to nothing, which blanks the colour entirely.
 *
 * So the fallback lives in a separate name that _BrandTheme never sets. Anything that
 * needs the palette uses `var(--morobot-x, var(--morobot-x-default))`, which reads the
 * brand value when present and the shipped default otherwise.
 */
:root,
[data-style="light"],
html.light-style {
  --morobot-primary-default: #0d9488;
  --morobot-primary-dark-default: #0f766e;
  --morobot-primary-hover-default: #0f766e;
  --morobot-primary-light-default: #5eead4;
  --morobot-primary-rgb-default: 13, 148, 136;
  --morobot-accent-default: #0891b2;
  --morobot-soft-default: #ecfdf5;
  --morobot-soft-2-default: #ccfbf1;
  --morobot-ink-default: #134e4a;
  --morobot-border-subtle-default: #99f6e4;
}

/* Beat Vuexy theme-default purple (#7367f0) with matching specificity */
.btn-primary {
  --bs-btn-bg: var(--morobot-primary, var(--morobot-primary-default));
  --bs-btn-border-color: var(--morobot-primary, var(--morobot-primary-default));
  --bs-btn-hover-bg: var(--morobot-primary-hover, var(--morobot-primary-hover-default));
  --bs-btn-hover-border-color: var(--morobot-primary-hover, var(--morobot-primary-hover-default));
  --bs-btn-active-bg: var(--morobot-primary-dark, var(--morobot-primary-dark-default));
  --bs-btn-active-border-color: var(--morobot-primary-dark, var(--morobot-primary-dark-default));
  --bs-btn-disabled-bg: var(--morobot-primary, var(--morobot-primary-default));
  --bs-btn-disabled-border-color: var(--morobot-primary, var(--morobot-primary-default));
  color: #fff !important;
  background-color: var(--morobot-primary, var(--morobot-primary-default)) !important;
  border-color: var(--morobot-primary, var(--morobot-primary-default)) !important;
  box-shadow: 0 0.125rem 0.375rem 0 rgba(var(--morobot-primary-rgb, var(--morobot-primary-rgb-default)), 0.3) !important;
}

.btn-primary.btn[class*=btn-]:not([class*=btn-label-]):not([class*=btn-outline-]):not([class*=btn-text-]):not(.btn-icon):not(:disabled):not(.disabled) {
  box-shadow: 0 0.125rem 0.375rem 0 rgba(var(--morobot-primary-rgb, var(--morobot-primary-rgb-default)), 0.3) !important;
}

.btn-primary:hover,
.btn-check:focus + .btn-primary,
.btn-primary:focus,
.btn-primary.focus {
  color: #fff !important;
  background-color: var(--morobot-primary-hover, var(--morobot-primary-hover-default)) !important;
  border-color: var(--morobot-primary-hover, var(--morobot-primary-hover-default)) !important;
}

.btn-check:checked + .btn-primary,
.btn-check:active + .btn-primary,
.btn-primary:active,
.btn-primary.active,
.btn-primary.show.dropdown-toggle,
.show > .btn-primary.dropdown-toggle {
  color: #fff !important;
  background-color: var(--morobot-primary-dark, var(--morobot-primary-dark-default)) !important;
  border-color: var(--morobot-primary-dark, var(--morobot-primary-dark-default)) !important;
}

.btn-primary.disabled,
.btn-primary:disabled {
  color: #fff !important;
  background-color: var(--morobot-primary, var(--morobot-primary-default)) !important;
  border-color: var(--morobot-primary, var(--morobot-primary-default)) !important;
}

.btn-outline-primary {
  --bs-btn-color: var(--morobot-primary, var(--morobot-primary-default));
  --bs-btn-border-color: var(--morobot-primary, var(--morobot-primary-default));
  --bs-btn-hover-bg: var(--morobot-primary, var(--morobot-primary-default));
  --bs-btn-hover-border-color: var(--morobot-primary, var(--morobot-primary-default));
  --bs-btn-active-bg: var(--morobot-primary-dark, var(--morobot-primary-dark-default));
  --bs-btn-active-border-color: var(--morobot-primary-dark, var(--morobot-primary-dark-default));
  color: var(--morobot-primary, var(--morobot-primary-default)) !important;
  border-color: var(--morobot-primary, var(--morobot-primary-default)) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary.active {
  color: #fff !important;
  background-color: var(--morobot-primary, var(--morobot-primary-default)) !important;
  border-color: var(--morobot-primary, var(--morobot-primary-default)) !important;
}

.btn-label-primary {
  background: var(--morobot-soft, var(--morobot-soft-default)) !important;
  color: var(--morobot-primary-dark, var(--morobot-primary-dark-default)) !important;
  border-color: transparent !important;
}

.bg-primary {
  background-color: var(--morobot-primary, var(--morobot-primary-default)) !important;
}

.text-primary {
  color: var(--morobot-primary, var(--morobot-primary-default)) !important;
}

.bg-label-primary {
  background-color: var(--morobot-soft, var(--morobot-soft-default)) !important;
  color: var(--morobot-primary-dark, var(--morobot-primary-dark-default)) !important;
}

/* Sidebar active — must beat [dir=rtl] .bg-menu-theme… !important purple gradient */
.bg-menu-theme.menu-vertical .menu-item.active > .menu-link:not(.menu-toggle),
[dir=rtl] .bg-menu-theme.menu-vertical .menu-item.active > .menu-link:not(.menu-toggle),
.menu-vertical .menu-item.active > .menu-link {
  background: linear-gradient(-270deg, rgba(var(--morobot-primary-rgb, var(--morobot-primary-rgb-default)), 0.75) 0%, var(--morobot-primary, var(--morobot-primary-default)) 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(var(--morobot-primary-rgb, var(--morobot-primary-rgb-default)), 0.35) !important;
}

.bg-menu-theme.menu-vertical .menu-item.active > .menu-link:not(.menu-toggle) .menu-icon,
.menu-vertical .menu-item.active > .menu-link .menu-icon {
  color: #fff !important;
}

.layout-wrapper:not(.layout-horizontal) .bg-menu-theme .menu-inner > .menu-item.active:before,
[dir=rtl] .layout-wrapper:not(.layout-horizontal) .bg-menu-theme .menu-inner > .menu-item.active:before {
  background: var(--morobot-primary, var(--morobot-primary-default)) !important;
}

.menu-vertical .menu-link:hover {
  color: var(--morobot-primary-dark, var(--morobot-primary-dark-default));
}

.menu-vertical .menu-item:not(.active) > .menu-link:hover {
  background: var(--morobot-soft, var(--morobot-soft-default)) !important;
}

.bg-menu-theme .menu-item.active > .menu-link {
  color: #fff !important;
}

.app-brand .app-brand-text {
  color: var(--morobot-primary-dark, var(--morobot-primary-dark-default));
}

.form-control:focus,
.form-select:focus {
  border-color: var(--morobot-primary, var(--morobot-primary-default));
  box-shadow: 0 0 0 0.2rem rgba(var(--morobot-primary-rgb, var(--morobot-primary-rgb-default)), 0.2);
}

.da-home {
  position: relative;
}

.da-home-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1rem;
}

.da-home-brand {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--morobot-primary, var(--morobot-primary-default));
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.da-dash-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
  .da-dash-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
}

.da-dash-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid rgba(47, 43, 61, 0.06);
  border-radius: 16px;
  padding: 14px 12px;
  box-shadow: 0 1px 2px rgba(47, 43, 61, 0.04);
}

.da-dash-stat-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--morobot-soft, var(--morobot-soft-default));
  color: var(--morobot-primary, var(--morobot-primary-default));
  flex-shrink: 0;
}

.da-dash-stat-ico .ti {
  font-size: 1.25rem;
}

.da-dash-stat b {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: #2f2b3d;
  line-height: 1.2;
}

.da-dash-stat span {
  display: block;
  font-size: 0.72rem;
  color: #8a8699;
  margin-top: 2px;
}

.da-dash-section {
  margin-bottom: 1.35rem;
}

.da-dash-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #2f2b3d;
  margin: 0 0 0.65rem;
}

.da-dash-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0.65rem;
}

.da-dash-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 768px) {
  .da-dash-shortcuts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.da-dash-shot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: start;
  background: #fff;
  border: 1px solid rgba(47, 43, 61, 0.08);
  border-radius: 16px;
  padding: 14px 12px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(47, 43, 61, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
  font: inherit;
}

.da-dash-shot:hover {
  border-color: rgba(var(--morobot-primary-rgb, var(--morobot-primary-rgb-default)), 0.35);
  box-shadow: 0 6px 16px rgba(var(--morobot-primary-rgb, var(--morobot-primary-rgb-default)), 0.1);
  color: inherit;
}

.da-dash-shot .ti {
  font-size: 1.35rem;
  color: var(--morobot-primary, var(--morobot-primary-default));
  margin-bottom: 2px;
}

.da-dash-shot span {
  font-weight: 700;
  font-size: 0.92rem;
  color: #2f2b3d;
}

.da-dash-shot small {
  font-size: 0.72rem;
  color: #8a8699;
}

.da-dash-shot-primary {
  background: linear-gradient(145deg, var(--morobot-soft, var(--morobot-soft-default)), #fff);
  border-color: rgba(var(--morobot-primary-rgb, var(--morobot-primary-rgb-default)), 0.25);
}

.da-dash-recent {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.da-dash-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fff;
  border: 1px solid rgba(47, 43, 61, 0.06);
  border-radius: 14px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}

.da-dash-row:hover {
  border-color: rgba(var(--morobot-primary-rgb, var(--morobot-primary-rgb-default)), 0.35);
  color: inherit;
}

.da-dash-row-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.da-dash-row-main strong {
  font-size: 0.95rem;
  color: #2f2b3d;
  word-break: break-word;
}

.da-dash-row-main .text-muted {
  font-size: 0.72rem;
  white-space: nowrap;
}

.da-dash-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.72rem;
  color: #8a8699;
}

.da-home-brand-en,
.morobot-brand-en {
  display: none !important;
}

.morobot-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  min-width: 0;
}

.morobot-brand-mark {
  display: block;
  flex-shrink: 0;
  border-radius: 8px;
}

.morobot-brand-link .app-brand-text {
  margin-inline-start: 0.35rem !important;
  color: var(--morobot-primary-dark, var(--morobot-primary-dark-default));
}

.morobot-brand-link .morobot-brand-en {
  margin-inline-start: 0.35rem;
  display: none;
}

@media (min-width: 1200px) {
  .morobot-brand-link .morobot-brand-en {
    display: inline;
  }
}

.morobot-login-brand {
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.morobot-login-logo {
  display: block;
  width: 112px;
  height: 112px;
  object-fit: contain;
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(var(--morobot-primary-rgb, var(--morobot-primary-rgb-default)), 0.22);
}

.morobot-login-titles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.morobot-login-titles .app-brand-text {
  color: var(--morobot-primary-dark, var(--morobot-primary-dark-default));
  font-size: 1.45rem;
}

/* Sign-in method indicator on the login page.
   Rendered as pills that look like tabs but are not interactive: the method is chosen by an
   administrator, so the control must not suggest the visitor can switch it. `cursor: default`
   and the muted inactive pill make that clear. */
.morobot-login-mode-tabs {
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: var(--morobot-soft, var(--morobot-soft-default));
}

.morobot-login-mode-tabs .nav-link {
  border-radius: 999px;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  cursor: default;
  color: var(--morobot-ink, var(--morobot-ink-default));
  opacity: 0.65;
}

.morobot-login-mode-tabs .nav-link.active {
  opacity: 1;
  font-weight: 600;
  color: #fff;
  background: var(--morobot-primary, var(--morobot-primary-default));
}

.morobot-login-mode-hint {
  color: var(--morobot-ink, var(--morobot-ink-default));
  opacity: 0.8;
}

.morobot-login-mode-fallback {
  color: var(--morobot-ink, var(--morobot-ink-default));
  opacity: 0.65;
}

.da-source-actions {
  display: inline-flex;
  gap: 2px;
  flex-wrap: nowrap;
  align-items: center;
}

.da-source-card-actions {
  display: flex;
  justify-content: flex-start;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.da-source-card-actions .ds-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f7f7fb;
}

/* Portal reuses editor DS icon + viewer styles when flow.css is linked */
.ds-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6f6b7d;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.ds-icon-btn:hover {
  background: #ebe9f1;
  color: #4b465c;
}

.ds-icon-btn:disabled,
.ds-icon-btn.is-master {
  opacity: 0.55;
  cursor: default;
  color: #28c76f;
  background: #e8f9f0;
}

.ds-icon-btn.is-danger:hover {
  background: #fce4e4;
  color: #ea5455;
}

.ds-icon-btn.is-busy {
  opacity: 0.45;
  pointer-events: none;
}

.ds-badge-master {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #28c76f;
  background: #e8f9f0;
  border-radius: 999px;
  padding: 1px 7px;
  vertical-align: middle;
}

.da-home-title {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.da-home-sub {
  color: #8a8699;
  font-size: 0.8125rem;
  line-height: 1.45;
  margin-top: 0.25rem;
  max-width: 42rem;
}

.da-tasks-panel {
  position: relative;
  min-height: 8rem;
}

.da-tasks-busy {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(2px);
  border-radius: 0.5rem;
}

.da-tasks-busy[hidden] {
  display: none !important;
}

.da-tasks-panel.is-busy {
  pointer-events: none;
  user-select: none;
}

/* Process search: filters the loaded rows client-side, so it sits above the table it narrows. */
.da-task-search {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}

.da-task-search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  max-width: 22rem;
}

.da-task-search-icon {
  position: absolute;
  inset-inline-start: .7rem;
  font-size: 1.05rem;
  color: #94a3b8;
  pointer-events: none;
}

.da-task-search-input {
  width: 100%;
  padding: .5rem 2.1rem;
  border: 1px solid #e2e6ee;
  border-radius: .5rem;
  background: #fff;
  font-size: .9rem;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.da-task-search-input:focus {
  outline: 0;
  border-color: var(--morobot-primary, var(--morobot-primary-default));
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}

/* The native clear affordance duplicates our own button and differs per browser. */
.da-task-search-input::-webkit-search-cancel-button { display: none; }

.da-task-search-clear {
  position: absolute;
  inset-inline-end: .35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.da-task-search-clear:hover { background: #f1f3f7; color: #334155; }
.da-task-search-clear[hidden] { display: none !important; }

.da-task-search-count {
  font-size: .82rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.da-task-search-count[hidden] { display: none !important; }

/* The mobile card list has no table header, so the box needs its own breathing room there. */
@media (max-width: 767.98px) {
  .da-task-search-field { max-width: none; }
}

.da-tasks-busy-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
  max-width: 22rem;
}

.da-tasks-spinner {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid #d8d6de;
  border-top-color: #28c76f;
  border-radius: 50%;
  animation: da-tasks-spin 0.75s linear infinite;
}

.da-tasks-busy-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #5e5873;
  line-height: 1.5;
}

.da-tasks-busy.is-error {
  background: rgba(255, 242, 242, 0.92);
}

.da-tasks-busy.is-error .da-tasks-spinner {
  display: none;
}

.da-tasks-busy.is-error .da-tasks-busy-text {
  color: #ea5455;
}

.da-tasks-busy.is-ok .da-tasks-busy-text {
  color: #28c76f;
}

@keyframes da-tasks-spin {
  to { transform: rotate(360deg); }
}

.da-task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 5.5rem;
}

.da-task-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: 0.9rem;
}

.da-task-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px 14px 12px;
  box-shadow: 0 1px 2px rgba(47, 43, 61, 0.06), 0 8px 20px rgba(47, 43, 61, 0.06);
  border: 1px solid rgba(47, 43, 61, 0.06);
}

.da-task-card-top {
  margin-bottom: 10px;
}

.da-task-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #2f2b3d;
  line-height: 1.35;
  word-break: break-word;
}

.da-task-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  color: #8a8699;
  font-size: 0.75rem;
  line-height: 1.4;
}

.da-task-card-meta li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}

.da-task-card-meta .ti {
  font-size: 0.95rem;
  opacity: 0.85;
}

.da-task-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.da-task-stat {
  flex: 1;
  text-align: center;
  background: #f7f7fb;
  border-radius: 12px;
  padding: 8px 4px;
  min-width: 0;
}

.da-task-stat b {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #2f2b3d;
  line-height: 1.2;
}

.da-task-stat span {
  display: block;
  font-size: 0.68rem;
  color: #a8aaae;
  margin-top: 2px;
}

.da-task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-start;
}

/* ── Last run cell + run history dialog ── */
.da-last-run {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.da-last-run .da-edit-meta { flex: 0 1 auto; }
.da-run-count {
  font-size: .72rem;
  padding: 0 .3rem;
  border-radius: 999px;
  background: var(--morobot-soft-2, var(--morobot-soft-2-default));
  color: var(--morobot-primary-dark, var(--morobot-primary-dark-default));
  white-space: nowrap;
}
.da-run-history-btn {
  border: 0;
  background: transparent;
  color: var(--morobot-primary, var(--morobot-primary-default));
  cursor: pointer;
  padding: 2px 4px;
  border-radius: .4rem;
  line-height: 1;
}
.da-run-history-btn:hover { background: var(--morobot-soft, var(--morobot-soft-default)); }
.da-run-history-btn .ti { font-size: 1rem; }

.da-run-history-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
}
.da-run-history-modal[hidden] { display: none; }
.da-run-history-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .45);
}
.da-run-history-box {
  position: relative;
  background: #fff;
  border-radius: .85rem;
  width: min(30rem, calc(100vw - 2rem));
  max-height: min(32rem, calc(100vh - 3rem));
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .22);
}
.da-run-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid #eef0f4;
}
.da-run-history-head h5 { margin: 0; font-size: .98rem; }
.da-run-history-close {
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 0 .25rem;
}
.da-run-history-body { padding: .5rem 1rem 1rem; overflow-y: auto; }
.da-run-history { list-style: none; margin: 0; padding: 0; }
.da-run-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .45rem 0;
  border-bottom: 1px dashed #eef0f4;
  font-size: .86rem;
}
.da-run-history-item:last-child { border-bottom: 0; }
.da-run-history-when { font-variant-numeric: tabular-nums; }
.da-run-history-who { color: #64748b; }
.da-run-history-empty { margin: .75rem 0; }

/* Process details dialog: the facts that used to be four separate table columns. */
.da-details-list { margin: 0; }
.da-details-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem 0;
  border-bottom: 1px dashed #eef0f4;
  font-size: .88rem;
}
.da-details-row:last-child { border-bottom: 0; }
.da-details-row dt {
  color: #64748b;
  font-weight: 500;
  flex: 0 0 auto;
}
.da-details-row dd {
  margin: 0;
  text-align: end;
  min-width: 0;
  overflow-wrap: anywhere;
}
/* The nested edit-meta blocks already carry their own alignment. */
.da-details-row dd .da-edit-meta { text-align: end; }
.da-details-row dd .da-last-run { justify-content: flex-end; }

.da-task-actions .ds-icon-btn,
.da-task-actions-desk .ds-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f7f7fb;
}

.da-task-actions .ds-icon-btn.is-play {
  color: var(--morobot-primary, var(--morobot-primary-default));
  background: var(--morobot-soft, var(--morobot-soft-default));
}

.da-play-target-menu {
  position: absolute;
  z-index: 1100;
  min-width: 260px;
  max-width: min(360px, calc(100vw - 16px));
  max-height: min(420px, calc(100vh - 24px));
  overflow: auto;
  background: #fff;
  border: 1px solid #e6e6f0;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(75, 70, 92, 0.16);
  padding: 6px;
  direction: rtl;
  font-family: Vazirmatn, Tahoma, sans-serif;
}

.da-play-target-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: 100%;
  text-align: right;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: #4b465c;
}

.da-play-target-item:hover,
.da-play-target-item:focus-visible {
  background: #f0fdf4;
  outline: none;
}

.da-play-target-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.da-play-target-sub {
  font-size: 11px;
  color: #8a8698;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.da-play-target-sep {
  height: 1px;
  background: #eeeaf5;
  margin: 4px 6px;
}

.da-play-target-label {
  font-size: 11px;
  font-weight: 700;
  color: #8a8698;
  padding: 6px 10px 2px;
}

.da-play-target-loading,
.da-play-target-empty {
  font-size: 12px;
  color: #8a8698;
  padding: 10px;
  line-height: 1.5;
}

.da-task-actions .ds-icon-btn.is-rec {
  color: #ea5455;
  background: #fce4e4;
}

.da-task-actions .ds-icon-btn.is-smart {
  color: var(--morobot-primary, var(--morobot-primary-default));
  background: var(--morobot-soft-2, var(--morobot-soft-2-default));
}

.da-task-actions .ds-icon-btn.is-edit {
  color: var(--morobot-primary-dark, var(--morobot-primary-dark-default));
  background: var(--morobot-soft-2, var(--morobot-soft-2-default));
}

/* A template child's structure is owned by the mother, so its editor opens read-only. The action is
   still there — it is how the row is opened, and the diagram can still be read — but muted, so the
   diagram glyph is not mistaken for the ordinary edit pencil it replaced. */
.da-task-actions .ds-icon-btn.is-template-child {
  color: #94a3b8;
  background: transparent;
}

.da-task-actions .ds-icon-btn.is-view {
  color: var(--morobot-primary, var(--morobot-primary-default));
}

.da-task-actions .ds-icon-btn.is-xlsx {
  color: #28c76f;
}

.da-task-actions .da-import-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}

.da-task-actions-desk {
  display: inline-flex;
  gap: 2px;
  flex-wrap: nowrap;
  align-items: center;
}

.da-task-id {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: #a8aaae;
  font-family: ui-monospace, Consolas, monospace;
  direction: ltr;
  unicode-bidi: plaintext;
  margin-top: 2px;
  word-break: break-all;
}

.da-home-create {
  display: inline-flex;
  flex-shrink: 0;
  white-space: nowrap;
}

.da-fab {
  position: fixed;
  z-index: 1080;
  /* Physical corner opposite the (now-hidden) extension REC so it stays visible in RTL. */
  right: 18px;
  left: auto;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--morobot-primary, var(--morobot-primary-default));
  color: #fff;
  box-shadow: 0 8px 24px rgba(var(--morobot-primary-rgb, var(--morobot-primary-rgb-default)), 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.da-fab:active {
  transform: scale(0.96);
}

.da-fab .ti {
  font-size: 1.55rem;
  line-height: 1;
}

@media (max-width: 767.98px) {
  .layout-navbar.navbar-detached {
    width: calc(100% - 1.5rem) !important;
    margin-inline: 0.75rem !important;
    border-radius: 0.75rem;
    box-shadow: 0 2px 12px rgba(47, 43, 61, 0.08);
  }

  .container-p-y {
    padding-block: 0.85rem !important;
  }

  .container-xxl {
    padding-inline: 0.75rem !important;
  }

  .da-home-head {
    margin-bottom: 0.75rem;
    align-items: center;
  }

  .da-home-title {
    font-size: 1.35rem;
  }

  .da-home-sub {
    font-size: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .da-home-create {
    padding-inline: 0.7rem;
  }

  .da-home-create-label {
    display: none;
  }

  .da-home-create {
    display: none !important;
  }

  #da-create-task-modal .modal-header {
    border-bottom: 0;
    padding-bottom: 0.25rem;
  }

  .content-wrapper,
  .layout-page {
    background: #f3f2f8;
  }
}

/* ── Templates: table chip, menu items, info grid ──
   The chip is a link plus a small unlink button: opening the template's info and detaching from
   it are different intentions, and a single click target would make one of them accidental. */
.da-tpl-wrap {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  max-width: 100%;
}
.da-tpl-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .12rem .5rem;
  border-radius: 999px;
  background: var(--morobot-soft, #eef4f2);
  color: var(--morobot-primary-dark, #283937);
  font-size: .76rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--morobot-border-subtle, rgba(191, 211, 188, .7));
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.da-tpl-chip:hover { background: var(--morobot-soft-2, #e2ece9); }
.da-tpl-chip .ti { font-size: .85rem; flex-shrink: 0; }
/* Behind the template: the row is usable but stale, so it is amber rather than red. */
.da-tpl-chip.is-behind {
  background: #fef9c3;
  color: #a16207;
  border-color: #fde68a;
}
/* The MOTHER of the template: this is the row an author edits to push changes down to the
   children, so it is marked apart from an ordinary child chip rather than looking identical. */
.da-tpl-chip.is-source {
  background: #e7e3fc;
  color: #5e50ee;
  border-color: #cdc4f7;
}
.da-tpl-src-badge {
  font-size: .72rem;
  line-height: 1;
  color: #f59e0b;
  flex-shrink: 0;
}
/* The mother process link on the template management table. Indigo to match the "mother" chip on
   the process list, so the same idea carries the same colour on both pages. */
.da-tpl-mother {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  color: #5e50ee;
  font-weight: 600;
  text-decoration: none;
}
.da-tpl-mother:hover { text-decoration: underline; }
.da-tpl-mother .ti { font-size: .85rem; }
/* The template chip's title carries two lines (state + mother), so keep them apart. */
.da-tpl-chip[title] { cursor: pointer; }
.da-tpl-chip-detach {
  border: 0;
  background: transparent;
  color: #94a3b8;
  padding: 0 .15rem;
  line-height: 1;
  cursor: pointer;
}
.da-tpl-chip-detach:hover { color: #dc2626; }
.da-tpl-chip-detach .ti { font-size: .9rem; }

/* Template marker in the action column, so the relationship is visible without scanning across to
   the template cell. Only children get one — the mother is marked by its own chip instead. */
.ds-icon-btn.is-template { color: #5e50ee; }
.ds-icon-btn.is-template:hover { background: #e7e3fc; color: #5e50ee; }
/* Row actions on the template management table: keep them on one line and aligned. */
.ds-icon-btn-group {
  display: inline-flex;
  align-items: center;
  gap: .15rem;
}
/* Record on a template child: shown disabled to explain why the action is unavailable, rather
   than hidden (a missing button reads as a bug; a greyed one reads as a rule). */
.da-task-actions .ds-icon-btn.is-rec[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

.da-tpl-menu { min-width: 15rem; }
.da-tpl-menu-item { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; }
.da-tpl-menu-title { font-weight: 600; }
.da-tpl-menu-sub { font-size: .72rem; color: #64748b; }

.da-tpl-info-desc { color: #475569; line-height: 1.7; }
.da-tpl-info-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .35rem 1rem;
  margin: 0 0 1rem;
  font-size: .86rem;
}
.da-tpl-info-grid dt { color: #64748b; font-weight: 600; }
.da-tpl-info-grid dd { margin: 0; color: #334155; }
