/* ==========================================================================
   SmartSync — One-Click Publish
   Design system + component styles
   ========================================================================== */

/* flatpickr (+ confirmDate plugin) — shared vendored infra, powers the
   Scheduler config step's date fields (see app.js's initDatetimePickers).
   @import must come first per CSS spec; both files end in .css so Dart Sass
   passes them through instead of resolving as Sass partials. */
@import url("/o/static-resources/views/lib/css/flatpickr/flatpickr.min.css");
@import url("/o/static-resources/views/lib/css/flatpickr/confirmDate.min.css");

/* flatpickr's calendar is a plain sibling of the modal overlay in the DOM
   (appended to <body>, not #modal-root), so its default z-index (99999)
   loses to .modal-overlay's 999999. Bumped above that so it renders on top. */
.flatpickr-calendar {
  z-index: 1000000 !important;
}

:root {
  --navy-900: #0e1c3a;
  --navy-800: #142b52;
  --navy-700: #1c3a6b;
  --navy-600: #24478c;
  --navy-500: #2c56a3;

  --bg: #eaedf3;
  --bg-lighter: #f4f6fa;
  --card: #ffffff;
  --border: #e3e7ef;
  --border-strong: #d4d9e3;

  --text-900: #1c3a6b;
  --text-800: #1c2338;
  --text-700: #333a4d;
  --text-500: #667085;
  --text-400: #98a2b3;

  --green-bg: #ddf4e8;
  --green-text: #1c7a4d;
  --amber-bg: #fdecd8;
  --amber-text: #a8611a;
  --red-bg: #fbe0db;
  --red-text: #c0392b;
  --blue-bg: #e2edff;
  --blue-text: #2c5fc9;
  --purple-bg: #eee3fb;
  --purple-text: #6b3fa0;
  --cyan-bg: #d9f3f7;
  --cyan-text: #157a8c;

  --indigo-bg: #e6e4fb;
  --indigo-text: #4f46a3;
  --teal-bg: #d7f5ef;
  --teal-text: #0e8a74;

  --link: #2c72f9;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(16, 22, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 22, 42, 0.12);
  --shadow-lg: 0 20px 60px rgba(16, 22, 42, 0.28);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--text-800);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a:hover { text-decoration: underline; }

ul { list-style: none; margin: 0; padding: 0; }

/* ---------- Liferay wrapper overflow reset ----------
   A descendant's CSS can't override how an ancestor clips its own overflow,
   so any Liferay wrapper above #app-shell with a bounded height would cut
   off our content no matter what scroll rules we set below it. These are
   page-level singletons with no scroll-dependent design of their own, so
   forcing them open here is safe site-wide. */
#wrapper,
#content-body,
#main-content {
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
}

/* .portlet-boundary/.portlet-content etc. are generic classes reused by every
   portlet on the page, so this reset is scoped to our own portlet ID —
   applying it site-wide would risk breaking portlets that rely on their own
   bounded/scrollable layout. */
#p_p_id_OneClickPublishPortlet_,
#p_p_id_OneClickPublishPortlet_ .portlet,
#p_p_id_OneClickPublishPortlet_ .portlet-boundary,
#p_p_id_OneClickPublishPortlet_ .portlet-content,
#p_p_id_OneClickPublishPortlet_ .portlet-content-container,
#p_p_id_OneClickPublishPortlet_ .portlet-body {
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
}

/* ---------- Scrollbars ----------
   Scoped to all four of this portlet's root containers since #modal-root/
   #slideover-root/#enduser-root are re-parented onto <body>, not nested
   inside #app-shell. Firefox has no thumb-only equivalent to
   ::-webkit-scrollbar-thumb, hence the separate scrollbar-color shorthand. */
#app-shell ::-webkit-scrollbar-thumb,
#modal-root ::-webkit-scrollbar-thumb,
#slideover-root ::-webkit-scrollbar-thumb,
#enduser-root ::-webkit-scrollbar-thumb {
  background: #1c3a6b !important;
}
#app-shell,
#modal-root,
#slideover-root,
#enduser-root {
  scrollbar-color: #1c3a6b transparent;
}

/* ---------- App shell ----------
   min-height:100vh is a floor, not a cap — content taller than one viewport
   just grows the page via normal scroll. !important for the same
   Liferay-theme-override reasons as the Modal/Buttons sections. */

#app-shell {
  display: flex !important;
  min-height: 100vh !important;
}

#app-shell .sidebar {
  width: 210px !important;
  flex-shrink: 0 !important;
  background: var(--navy-900) !important;
  color: #fff !important;
  padding: 22px 0 !important;
  display: flex !important;
  flex-direction: column !important;
  position: sticky !important;
  top: 0 !important;
  height: 100vh !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

.sidebar__logo {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.2px;
  padding: 0 22px 20px;
  color: #fff;
}

.sidebar__group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #6b7fa8;
  padding: 16px 22px 6px;
  text-transform: uppercase;
}

.sidebar__item {
  display: block;
  padding: 9px 22px;
  color: #b9c4dc !important;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.12s ease, color 0.12s ease;
}

.sidebar__item:hover {
  background: rgba(255,255,255,0.05);
  color: #fff !important;
  text-decoration: none;
}

.sidebar__item.active {
  background: var(--navy-700);
  color: #fff !important;
  font-weight: 700;
  border-left-color: #6ea8ff;
}

.sidebar__spacer { flex: 1; }

/* ---------- Main content ---------- */

#app-shell .main {
  flex: 1 !important;
  min-width: 0 !important;
  padding: 32px 40px 60px !important;
  box-sizing: border-box !important;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-500);
  margin-bottom: 6px;
}

.breadcrumb a { color: var(--text-500); }
.breadcrumb a:hover { color: var(--link); }

.page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-900);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-500);
  margin: 0 0 24px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

/* ---------- Buttons ----------
   Scoped under the app's four top-level mount points and hardened with
   !important: the host Liferay theme's own Bootstrap-based `.btn` rules can
   load with equal/higher cascade priority and otherwise repaint these. */

#app-shell .btn,
#modal-root .btn,
#slideover-root .btn,
#enduser-root .btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 9px 18px !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid transparent !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.12s ease !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  text-decoration: none !important;
  margin: 0 !important;
}

#app-shell .btn-primary,
#modal-root .btn-primary,
#slideover-root .btn-primary,
#enduser-root .btn-primary { background: #1c3a6b !important; color: #fff !important; border-color: #1c3a6b !important; }
#app-shell .btn-primary:hover,
#modal-root .btn-primary:hover,
#slideover-root .btn-primary:hover,
#enduser-root .btn-primary:hover { background: #24478c !important; border-color: #24478c !important; }
#app-shell .btn-primary:disabled,
#modal-root .btn-primary:disabled,
#slideover-root .btn-primary:disabled,
#enduser-root .btn-primary:disabled { background: #a9b4c9 !important; border-color: #a9b4c9 !important; cursor: not-allowed !important; }

#app-shell .btn-secondary,
#modal-root .btn-secondary,
#slideover-root .btn-secondary,
#enduser-root .btn-secondary { background: #fff !important; color: var(--text-700) !important; border-color: var(--border-strong) !important; }
#app-shell .btn-secondary:hover,
#modal-root .btn-secondary:hover,
#slideover-root .btn-secondary:hover,
#enduser-root .btn-secondary:hover { background: #f5f6f9 !important; }

#app-shell .btn-danger,
#modal-root .btn-danger,
#slideover-root .btn-danger,
#enduser-root .btn-danger { background: var(--red-text) !important; color: #fff !important; border-color: var(--red-text) !important; }
#app-shell .btn-danger:hover,
#modal-root .btn-danger:hover,
#slideover-root .btn-danger:hover,
#enduser-root .btn-danger:hover { background: #a52d1f !important; border-color: #a52d1f !important; }

#app-shell .btn-danger-outline,
#modal-root .btn-danger-outline,
#slideover-root .btn-danger-outline,
#enduser-root .btn-danger-outline { background: #fff !important; color: var(--red-text) !important; border-color: #e7b6ac !important; }
#app-shell .btn-danger-outline:hover,
#modal-root .btn-danger-outline:hover,
#slideover-root .btn-danger-outline:hover,
#enduser-root .btn-danger-outline:hover { background: var(--red-bg) !important; }

#app-shell .btn-link,
#modal-root .btn-link,
#slideover-root .btn-link,
#enduser-root .btn-link { background: transparent !important; color: var(--link) !important; padding: 9px 4px !important; font-weight: 700 !important; border-color: transparent !important; }
#app-shell .btn-link:hover,
#modal-root .btn-link:hover,
#slideover-root .btn-link:hover,
#enduser-root .btn-link:hover { text-decoration: underline !important; }

#app-shell .btn-sm,
#modal-root .btn-sm,
#slideover-root .btn-sm,
#enduser-root .btn-sm { padding: 6px 12px !important; font-size: 13px !important; }

#app-shell .btn-block,
#modal-root .btn-block,
#slideover-root .btn-block,
#enduser-root .btn-block { width: 100% !important; }

#app-shell .btn[disabled],
#modal-root .btn[disabled],
#slideover-root .btn[disabled],
#enduser-root .btn[disabled] { opacity: 0.55 !important; cursor: not-allowed !important; }

/* ---------- Cards ---------- */

.card {
  background: var(--card);
  border: 0px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card-pad { padding: 22px 24px; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-green { background: var(--green-bg); color: var(--green-text); }
.badge-amber { background: var(--amber-bg); color: var(--amber-text); }
.badge-red { background: var(--red-bg); color: var(--red-text); }
.badge-blue { background: var(--blue-bg); color: var(--blue-text); }
.badge-purple { background: var(--purple-bg); color: var(--purple-text); }
.badge-cyan { background: var(--cyan-bg); color: var(--cyan-text); }
.badge-gray { background: #eef0f4; color: var(--text-500); }

/* ---------- Stat cards row ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  margin-top: 10px;
}

/* Deployment Audit Log (publish-history.js) has only 4 stat-cards (no "Current
   Version" — that's per-app, not org-wide) — the shared 5-column .stat-grid
   above is for app-detail.js's 5-card layout. */
.stat-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

.stat-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
}

.stat-card__content { min-width: 0; }

.stat-card__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-400);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stat-card__value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-900);
  line-height: 1.1;
}

.stat-card--blue .stat-card__value { color: var(--blue-text); }
.stat-card--green .stat-card__value { color: var(--green-text); }
.stat-card--amber .stat-card__value { color: var(--amber-text); }
.stat-card--purple .stat-card__value { color: var(--purple-text); }
.stat-card--red .stat-card__value { color: var(--red-text); }
.stat-card--cyan .stat-card__value { color: var(--cyan-text); }

.stat-card__hint {
  font-size: 12px;
  color: var(--text-500);
  margin-top: 6px;
}

.stat-card__icon {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, var(--icon-glow-strong), var(--icon-glow-soft) 65%, transparent 100%);
}

.stat-card__icon svg { width: 20px; height: 20px; }

/* Soft blurred halo behind the icon, clipped by .stat-card's own rounded
   corners — the glow effect from the reference design, rather than a
   flat-edged icon chip. */
.stat-card__icon::before {
  content: "";
  position: absolute;
  inset: -22px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--icon-glow-soft), transparent 70%);
  filter: blur(10px);
}

.stat-card--blue .stat-card__icon { color: var(--blue-text); --icon-glow-strong: rgba(44, 95, 201, 0.28); --icon-glow-soft: rgba(44, 95, 201, 0.14); }
.stat-card--green .stat-card__icon { color: var(--green-text); --icon-glow-strong: rgba(28, 122, 77, 0.28); --icon-glow-soft: rgba(28, 122, 77, 0.14); }
.stat-card--amber .stat-card__icon { color: var(--amber-text); --icon-glow-strong: rgba(168, 97, 26, 0.28); --icon-glow-soft: rgba(168, 97, 26, 0.14); }
.stat-card--purple .stat-card__icon { color: var(--purple-text); --icon-glow-strong: rgba(107, 63, 160, 0.28); --icon-glow-soft: rgba(107, 63, 160, 0.14); }
.stat-card--red .stat-card__icon { color: var(--red-text); --icon-glow-strong: rgba(192, 57, 43, 0.28); --icon-glow-soft: rgba(192, 57, 43, 0.14); }
.stat-card--cyan .stat-card__icon { color: var(--cyan-text); --icon-glow-strong: rgba(21, 122, 140, 0.28); --icon-glow-soft: rgba(21, 122, 140, 0.14); }

/* ---------- App overview bar (App Detail) ---------- */

.overview-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.overview-bar__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-400);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.overview-bar__value { font-size: 16px; font-weight: 800; color: var(--text-900); }
.overview-bar__sub { font-size: 12px; color: var(--text-500); margin-top: 2px; }

/* ---------- Dashboard app cards ---------- */

.app-card {
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(16, 22, 42, 0.08);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.app-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.app-card__header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--blue-bg), var(--purple-bg));
  /* .app-card itself can't clip to its rounded corners (overflow: hidden)
     without also clipping the "+N More" popover below, which needs to
     escape the card's bounds — so header/footer round themselves instead. */
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.app-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-600);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.app-card__header-main { flex: 1; min-width: 0; }

.app-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-900);
}

.app-card__status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-500);
}
.app-card__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-text);
  flex-shrink: 0;
}
.app-card__version-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--green-bg);
  color: var(--green-text);
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: normal;
}

.app-card__actions { display: flex; flex-direction: row; align-items: center; gap: 8px; flex-shrink: 0; }

.app-card__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  padding: 18px 24px;
}
.app-card-list--horizontal .app-card__stats { gap: 18px; }
.app-card__stat {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
/* Pinned to the end of its row via the flex auto-margin trick, so "+N More"
   (and its popover) stays at a consistent spot regardless of how many tiles
   fit before it. */
.app-card__stat--more { position: relative; margin-left: auto; }
.app-card__stat--more .app-card__stat-count { color: var(--text-500); }
.app-card__stat-more-trigger {
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
}
.app-card__stat-more-trigger::-webkit-details-marker { display: none; }
.app-card__stat-more-trigger:hover .app-card__stat-count,
.app-card__stat-more-trigger:hover .app-card__stat-label { color: var(--navy-700); }
.app-card__stat-more-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 190px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.app-card__stat-more-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-700);
  white-space: nowrap;
}
/* Reuses the same colored .app-card__stat-icon badge as the main tiles,
   just smaller — this is a compact list, not a grid of tiles. */
.app-card__stat-more-item .app-card__stat-icon { width: 24px; height: 24px; border-radius: 6px; }
.app-card__stat-more-item .app-card__stat-icon svg { width: 13px; height: 13px; }
.app-card__stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-card__stat-count { font-size: 16px; font-weight: 800; color: var(--text-900); line-height: 1.1; }
.app-card__stat-label { font-size: 11.5px; font-weight: 600; color: var(--text-500); }

.app-card__footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.app-card__view-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--link);
}
.app-card__view-link:hover { text-decoration: underline; }
.app-card__view-link svg { flex-shrink: 0; }

/* ---------- Dashboard search + view toggle ----------
   Scoped under #app-shell and hardened with !important, same reasoning as
   the .btn rules above: the host Liferay theme's own Bootstrap-based input/
   span rules can load with equal or higher cascade priority and otherwise
   silently strip border/shadow/radius/position off these. */

#app-shell .page-header__controls {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-shrink: 0 !important;
}

#app-shell .dashboard-search {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: 280px !important;
  flex-shrink: 0 !important;
}
/* position:absolute takes the icon out of flow, so the parent's
   align-items:center has no effect on it — top/transform do the centering
   instead. Missing this was the earlier overlap-with-placeholder bug. */
#app-shell .dashboard-search__icon {
  position: absolute !important;
  top: 50% !important;
  left: 14px !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  display: inline-flex !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--text-400) !important;
  pointer-events: none !important;
}
#app-shell .dashboard-search__input {
  width: 100% !important;
  height: 40px !important;
  padding: 0 34px 0 38px !important;
  margin: 0 !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-md) !important;
  background: #fff !important;
  font-size: 14px !important;
  font-family: inherit !important;
  font-weight: 400 !important;
  color: var(--text-800) !important;
  box-sizing: border-box !important;
  box-shadow: var(--shadow-sm) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}
#app-shell .dashboard-search__input::placeholder { color: var(--text-400) !important; opacity: 1 !important; }
#app-shell .dashboard-search__input:hover { border-color: var(--text-400) !important; }
#app-shell .dashboard-search__input:focus {
  outline: none !important;
  border-color: var(--link) !important;
  box-shadow: 0 0 0 3px rgba(44, 114, 249, 0.15), var(--shadow-sm) !important;
}
#app-shell .dashboard-search__clear {
  position: absolute !important;
  top: 50% !important;
  left: auto !important;
  bottom: auto !important;
  right: 6px !important;
  transform: translateY(-50%) !important;
  width: 24px !important;
  height: 24px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: var(--text-400) !important;
  cursor: pointer !important;
}
#app-shell .dashboard-search__clear:hover { background: var(--bg-lighter) !important; color: var(--text-700) !important; }

/* ---------- Dashboard search: empty state ---------- */

.dashboard-empty-state {
  text-align: center;
  padding: 70px 20px;
}
.dashboard-empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-lighter);
  color: var(--text-400);
  margin: 0 auto 16px;
}
.dashboard-empty-state__title { font-size: 16px; font-weight: 800; color: var(--text-900); margin-bottom: 6px; }
.dashboard-empty-state__desc { color: var(--text-500); margin: 0; }

/* ---------- Dashboard view toggle (vertical / horizontal layout) ---------- */

.view-toggle {
  display: inline-flex;
  align-self: center;
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.view-toggle__btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-left: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-500);
  cursor: pointer;
}
.view-toggle__btn:first-child { border-left: none; }
.view-toggle__btn:hover { background: #f5f6f9; color: var(--text-800); }
.view-toggle__btn.is-active { background: var(--navy-700); color: #fff; }

.app-card-list--horizontal {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.app-card-list--horizontal .app-card { margin-bottom: 0; }

/* ---------- Table ---------- */

.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-400);
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-800);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8f9fc; }

.mono-link { color: var(--link); font-weight: 700; }

.avatar-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.avatar-chip__dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--blue-bg); color: var(--blue-text);
  font-size: 10px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}

.icon-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-500);
}
.icon-btn:hover { background: #f5f6f9; color: var(--text-800); }
.icon-btn--edit { background: #406db6 ; border-color: #b9cdf0; color: #ffffff ; }
.icon-btn--edit:hover { background: #d3e0fa; color: var(--blue-text); }
.icon-btn--delete { background: #d72b4e; border-color: #f0bdb2; color:#ffffff ; }
.icon-btn--delete:hover { background: #f7cac1; color: var(--red-text); }
.icon-btn--reload {
  background: var(--blue-bg);
  border-color: #c3d6f5;
  color: var(--blue-text);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.icon-btn--reload:hover { background: #d3e0fa; border-color: var(--blue-text); }
.icon-btn--reload:active svg { transform: rotate(180deg); }
.icon-btn--reload svg { transition: transform 0.3s ease; }

/* ---------- Filters bar ---------- */

.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.filters-bar input[type="text"],
.filters-bar select {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 13.5px;
}
.filters-bar input[type="text"] { flex: 1; }

/* ---------- Wizard ---------- */

/* Step progress folded into the head — ring counter, progress bar, and step
   chips all inside the same .modal__head surface instead of a separate
   stepper row. Only layout changes (stacked); colors stay so this still
   reads as the same gradient head as Review Artifacts / Final Review. */
#modal-root .modal__head.wizard-head {
  display: block !important;
  padding-bottom: 16px !important;
  margin-bottom: 16px !important;
}
.wizard-head__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
#modal-root .wizard-head .modal__title { margin: 0 0 2px !important; font-size: 18px !important; }
.wizard-head__subtitle { font-size: 12px; font-weight: 600; color: var(--text-500); }

.wizard-head__ring {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  background: var(--navy-700);
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.wizard-head__ring-icon { color: #fff; flex-shrink: 0; }
.wizard-head__ring-text { font-size: 12px; font-weight: 800; color: #fff; white-space: nowrap; }

.wizard-head__bar { display: flex; gap: 5px; margin-top: 10px; }
.wizard-head__bar-seg {
  flex: 1; height: 5px; border-radius: 999px; background: var(--border-strong);
  transition: background 0.2s ease;
}
.wizard-head__bar-seg.done { background: var(--navy-700); }

/* min-width:0 lets a chip shrink below its label's natural width when 5
   chips no longer fit one row — .wizard-head__chip-label's overflow:hidden/
   ellipsis (below) keeps the label from forcing the chip wider. */
.wizard-head__chips { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.wizard-head__chip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: var(--radius-sm); flex: 1 1 120px; min-width: 0;
  transition: background 0.15s ease;
}
.wizard-head__chip.active { background: rgba(28, 58, 107, 0.08); }

/* Pending state uses a flat --blue-bg/--blue-text chip instead of a bare
   white/gray circle — done/active keep their own state colors (success
   green / navy), since those signal step progress rather than category. */
.wizard-head__chip-icon {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  background: var(--blue-bg); color: var(--blue-text);
}
.wizard-head__chip-icon svg { width: 13px; height: 13px; }
.wizard-head__chip.done .wizard-head__chip-icon { background: var(--green-text); color: #fff; }
.wizard-head__chip.active .wizard-head__chip-icon { background: var(--navy-700); color: #fff; }
.wizard-head__chip-label {
  font-size: 14px; font-weight: 700; color: var(--text-900);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wizard-head__chip.pending .wizard-head__chip-label { color: var(--text-500); }

.wizard-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}

.wizard-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}

.wizard-card__title { font-size: 19px; font-weight: 800; color: var(--text-900); }
.wizard-card__desc { font-size: 13.5px; color: var(--text-500); margin: 4px 0 20px; }

.config-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  overflow: hidden;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.config-item:hover { box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
.config-item:focus-within { outline: 2px solid var(--link); outline-offset: 2px; }

.config-item__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
}

/* Flat --blue-bg/--blue-text chip, rather than a one-off gray tile. */
.config-item__icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--blue-bg); color: var(--blue-text);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.config-item__icon svg { width: 16px; height: 16px; }

.config-item__info { display: flex; gap: 12px; align-items: center; }
.config-item__name { font-size: 15px; font-weight: 700; color: var(--text-900); }
.config-item__sub { font-size: 12.5px; color: var(--text-500); margin-top: 2px; }
.config-item__right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.config-item__body {
  padding: 18px 18px 20px;
  border-top: 1px solid var(--border);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
  margin-bottom: 16px;
}

/* ---------- cloud_provider: Headers key/value editor (azure_openai, no-auth) ---------- */

.headers-table {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.headers-row {
  display: grid;
  grid-template-columns: 1fr 1fr 36px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.headers-row:last-child { border-bottom: none; }
.headers-row--head {
  background: var(--bg-lighter);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-500);
}
.headers-row .input { margin: 0; }
.headers-row__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--red-text) !important;
  cursor: pointer;
}
.headers-row__remove svg { width: 18px !important; height: 18px !important; }
.headers-row__remove:hover { background: var(--red-bg) !important; color: var(--red-text) !important; }

/* Scoped to this exact button (not the shared .btn-secondary class) so the
   bump in contrast stays local to the Headers editor. Repeated on :hover —
   .btn-secondary:hover's two-class selector otherwise outranks the single
   attribute selector below and flashes it back to gray on hover. */
#modal-root [data-action="add-header-row"],
#modal-root [data-action="add-header-row"]:hover {
  background: #1c3a6b !important;
  color: #fff !important;
  border-color: #1c3a6b !important;
}

/* Holds the Create Manual User form's three boolean flags in ONE .field-grid
   cell (the grid is 2-up — three loose .field-checkbox divs would each break
   the pairing with the Role field beside them). Wraps on a narrow modal. */
.field-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin-top: 26px;
}
.field-checkbox-group .field-checkbox { margin-top: 0; }

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
}
.field-checkbox input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.field-checkbox label {
  margin-bottom: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-800);
  cursor: pointer;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-800);
  margin-bottom: 4px;
}
.field .dev-value {
  font-size: 11.5px;
  color: var(--text-400);
  margin-bottom: 6px;
}
.field .dev-value b { color: var(--text-500); font-weight: 700; }

.input, .field input[type="text"], .field input[type="password"], .field select, textarea.input {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 14px;
}
.input.locked { background: #f2f4f8; color: var(--text-500); }
.input.invalid { border-color: var(--red-text); }

/* Target Environment picker — hover styling for the open dropdown's <option>
   list. Only Chromium/Firefox paint this; Safari's native dropdown ignores
   :hover on <option>, but that's a harmless no-op there. */
select[data-action="change-target-env"] option:hover {
  background: #1c3a6b !important;
  color: #fff !important;
}
.input-with-icon { position: relative; }
.input-with-icon input { padding-right: 34px; }
.input-with-icon .icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-400); cursor: pointer; }

/* Stands in for a control when there's nothing to choose from — see
   rolesField's empty case. */
.field-note-inline {
  font-size: 12.5px;
  color: var(--text-500);
  padding: 9px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-lighter);
}

.field-error { font-size: 12px; color: var(--red-text); margin-top: 4px; }
.field-note { font-size: 12.5px; color: var(--text-500); margin: -6px 0 14px; }

/* ---------- Roles chip combobox (Create Manual User form) ----------
   Scoped under #modal-root with !important since its options and chip-remove
   controls are bare <button>s — exactly what the host Liferay theme's
   Bootstrap CSS repaints into grey theme buttons otherwise. */

/* The real <select multiple> behind the chips: still in the DOM (and still
   carrying data-user-field, so readAddUserForm/populateAddUserForm work
   through their normal multi-select branch), just never shown. */
#modal-root .role-select__native { display: none !important; }

#modal-root .role-select { position: relative !important; }

/* Mimics .input, but grows to fit the chips inside it. */
#modal-root .role-select__control {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px !important;
  min-height: 38px !important;
  padding: 5px 8px !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-sm) !important;
  background: #fff !important;
  cursor: text !important;
  box-sizing: border-box !important;
}
#modal-root .role-select.open .role-select__control { border-color: var(--link) !important; }
#modal-root .role-select.invalid .role-select__control { border-color: var(--red-text) !important; }

/* Sits alongside the chips and takes the leftover width, so typing continues
   on the same line rather than pushing the control taller. */
#modal-root .role-select__search {
  flex: 1 1 80px !important;
  min-width: 80px !important;
  border: 0 !important;
  outline: none !important;
  padding: 4px 2px !important;
  margin: 0 !important;
  font-family: inherit !important;
  font-size: 14px !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Picked roles use the shared .chip style defined above (label + id badge +
   remove), the same one the Existing Users field uses. */

/* Overlays whatever follows rather than pushing the rest of the form down —
   .field-grid rows would otherwise reflow every time the menu opens. */
#modal-root .role-select__menu {
  display: none !important;
  position: absolute !important;
  z-index: 20 !important;
  left: 0 !important;
  right: 0 !important;
  top: calc(100% + 4px) !important;
  max-height: 210px !important;
  overflow-y: auto !important;
  padding: 5px !important;
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-md) !important;
}
#modal-root .role-select.open .role-select__menu { display: block !important; }

#modal-root .role-select__option {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  text-align: left !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: var(--radius-sm) !important;
  padding: 8px 10px !important;
  margin: 0 !important;
  font-family: inherit !important;
  font-size: 13.5px !important;
  font-weight: 400 !important;
  text-transform: none !important;
  color: var(--text-800) !important;
  cursor: pointer !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}
#modal-root .role-select__option:hover { background: var(--bg-lighter) !important; }

#modal-root .role-select__empty {
  font-size: 12.5px !important;
  color: var(--text-500) !important;
  padding: 10px !important;
}

/* Collapsed config item — same bordered-card treatment as its expanded
   sibling .config-item, since it's always rendered standalone rather than
   nested inside a shared list wrapper. */
.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.item-row:hover { box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
.item-row:focus-within { outline: 2px solid var(--link); outline-offset: 2px; }

.tag-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}
.wizard-actions__right { display: flex; gap: 10px; }

/* ---------- Modal ----------
   Scoped under #modal-root (re-parented onto <body> by app.js) with
   !important throughout: the host Liferay theme's Bootstrap-based CSS
   applies broad rules to bare tags/classes with a cascade order we don't
   control, so this guarantees the component always wins regardless of
   load order. */

#modal-root .modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important;
  margin: 0 !important;
  background: rgba(16, 22, 42, 0.45) !important;
  -webkit-backdrop-filter: blur(3px) !important;
  backdrop-filter: blur(3px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 999999 !important;
  padding: 24px !important;
  box-sizing: border-box !important;
}

#modal-root .modal {
  background: #fff !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  width: 100% !important;
  /* The Classic theme's bare `.modal { height: 100% }` would otherwise
     stretch every modal to fill the viewport. `height: auto` lets each
     modal hug its own content and vertically center instead. */
  height: auto !important;
  max-height: 90vh !important;
  /* Scrolling happens on .modal__scroll (an inner child) instead — a
     scrollbar directly on this rounded box would square off its corners
     the instant content overflowed. overflow:hidden here just clips the
     scroll/footer children to the radius. */
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  position: relative !important;
}

#modal-root .modal-sm { max-width: 460px !important; }
#modal-root .modal-md { max-width: 620px !important; }
#modal-root .modal-lg { max-width: 80% !important; }
#modal-root .modal-xl { max-width: 1040px !important; }

/* The Review Artifacts -> wizard steps -> Final Review flow is one
   continuous popup (see app.js's modal types) — a fixed height (not just
   max-height) keeps its size constant across every step instead of the box
   growing/shrinking and jumping around as you step through it. */
#modal-root .modal.modal-flow { height: 80% !important; }

/* The loading state (see app.js's 'loading' modal) is the one modal-flow
   screen that skips .modal__scroll entirely — .modal__pad sits directly in
   the flex column, so without this it hugs the top of that fixed 80vh box
   with a huge dead gap below. Stretched + centered so the spinner/message
   sit in the middle of the reserved space instead. */
#modal-root .modal.modal-flow > .modal__pad {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Scrollable body for a modal with a fixed-position footer (.modal__footer)
   — everything above the actions bar lives here so Cancel/Previous/Next
   stays pinned at the bottom. min-height:0 is required for a flex child to
   shrink and scroll instead of just growing past its container. */
#modal-root .modal__scroll {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}

#modal-root .modal__pad { padding: 28px 32px !important; }

/* Sticky footer for the multi-step flow's actions bar (see
   .modal__scroll above) — a plain sibling below it, not part of the
   scrolling content, so it never needs to be scrolled into view. */
#modal-root .modal__footer {
  flex-shrink: 0 !important;
  padding: 16px 32px 22px !important;
  border-top: 1px solid var(--border) !important;
  background: #fff !important;
}
#modal-root .modal__footer .wizard-actions,
#modal-root .modal__footer .modal__actions { margin-top: 0 !important; }

/* Gradient header band — same blue/purple wash as .app-card__header — bled
   to the modal's edges via negative margins matching .modal__pad's padding,
   so it reads as one continuous surface rather than a flat white popup.
   !important overrides any inline margin-bottom callers set. */
#modal-root .modal__head {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 16px !important;
  margin: -28px -32px 22px !important;
  padding: 22px 32px !important;
  background: linear-gradient(135deg, var(--blue-bg), var(--purple-bg)) !important;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  border-bottom: 1px solid var(--border) !important;
}

/* Circular icon badge that sits beside the title, matching
   .app-card__icon's white-chip-on-gradient treatment exactly. */
#modal-root .modal__head-icon {
  width: 42px !important; height: 42px !important;
  border-radius: var(--radius-md) !important;
  background: #fff !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  color: var(--navy-600) !important;
  box-shadow: var(--shadow-sm) !important;
  flex-shrink: 0 !important;
}
#modal-root .modal__head-main { flex: 1 !important; min-width: 0 !important; }
#modal-root .modal__head-row { display: flex !important; align-items: center !important; gap: 14px !important; }

#modal-root .modal__title {
  font-size: 21px !important; font-weight: 800 !important;
  color: var(--text-900) !important; margin: 0 0 6px !important;
  line-height: 1.3 !important;
  letter-spacing: -0.01em !important;
}
#modal-root .modal__desc {
  font-size: 13.5px !important; color: var(--text-500) !important; margin: 0 !important;
}
/* Also scoped under #slideover-root — the Publish Details panel (see
   publish-history.js's renderPublishDetailSlideover) reuses this same close
   button, but mounts under its own root, not #modal-root. */
#modal-root .modal__close,
#slideover-root .modal__close {
  background: none !important; border: none !important; cursor: pointer !important;
  color: var(--text-400) !important; font-size: 20px !important; line-height: 1 !important;
  padding: 4px !important; margin: 0 !important; box-shadow: none !important;
}
/* Tints red on hover only — same "this will close it" affordance as a
   browser tab's × — rather than always-red, which in this app's own color
   system (see .btn-danger/.icon-btn--delete/badge-red) would misread as a
   destructive action. Closing this panel deletes nothing. */
#modal-root .modal__close:hover,
#slideover-root .modal__close:hover { color: var(--red-text) !important; }

#modal-root .modal__eyebrow {
  display: inline-block !important;
  background: var(--blue-bg) !important; color: var(--blue-text) !important;
  font-size: 11px !important; font-weight: 800 !important; letter-spacing: 0.04em !important;
  padding: 4px 10px !important; border-radius: 999px !important; text-transform: uppercase !important;
  margin: 0 !important;
}

#modal-root .modal__actions {
  display: flex !important; align-items: center !important; justify-content: flex-end !important;
  gap: 10px !important;
  margin-top: 24px !important;
}
#modal-root .modal__actions.spread { justify-content: space-between !important; }

/* alert / callout boxes */
.callout {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 13.5px;
  margin: 14px 0;
  border: 1px solid transparent;
}
.callout-warning { background: #fdf6e3; border-color: #f3e2ae; color: #6b5510; }
.callout-danger { background: var(--red-bg); border-color: #f0bdb2; color: #8a2c1f; }
.callout-success { background: var(--green-bg); border-color: #b9e6cc; color: #185f3d; }
.callout-info { background: #eef2fb; border-color: #d6e0f5; color: var(--text-700); }
.callout b { display: block; margin-bottom: 2px; }

/* Bulleted message list — e.g. per-row CSV upload warnings (see
   renderCsvRowWarningsModal) — the global `ul { list-style: none }` reset above needs its own
   override here since this is the one place a real bullet list reads better than plain prose. */
.modal-message-list {
  list-style: disc;
  padding-left: 20px;
  margin: 4px 0 14px;
  max-height: 180px;
  overflow-y: auto;
}
.modal-message-list li {
  font-size: 13px;
  color: var(--text-700);
  line-height: 1.6;
  margin-bottom: 2px;
}
/* Bullet marker tinted to match the modal's own severity (see .result-icon.danger/.warning) —
   ::marker only ever needs to carry color, so this is the one place styling it directly (rather
   than through the shared text color above) reads as intentional instead of an inconsistency. */
.modal-message-list--danger li::marker { color: var(--red-text); }
.modal-message-list--warning li::marker { color: var(--amber-text); }

/* Icon + title/lead-line row shared by the CSV upload validation popups — icon
   sits beside the text (unlike the centered "Can't Publish Yet" dialog) since
   a bulleted list follows and a centered header would push it down further. */
.csv-modal__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 4px;
}

/* App-name list in renderDeploymentBlockedModal — centered, wrapping chip
   row under the intro sentence. */
.deployment-blocked-apps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 14px 0;
}

/* Per entity-type breakdown — left-aligned inside the otherwise centered
   modal body, same icon-tile treatment as the dashboard's "Consists of"
   stat tiles (see dashboard.js's renderStatTile). */
.unpublish-details-group { margin-bottom: 14px; }
.unpublish-details-group:last-child { margin-bottom: 0; }
.unpublish-details-group__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.unpublish-details-group__icon {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.unpublish-details-group__icon svg { width: 14px; height: 14px; }
.unpublish-details-group__label {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-700);
}
.unpublish-details-group__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* .result-icon.csv-modal__icon (not just .csv-modal__icon) deliberately —
   .result-icon's own 56px/margin rule below has equal specificity and comes
   later, so it would otherwise win; both classes are always present together. */
.result-icon.csv-modal__icon { width: 40px; height: 40px; margin: 0; flex-shrink: 0; }
.csv-modal__icon svg { width: 22px; height: 22px; }
.csv-modal__title { margin: 0 0 4px; font-size: 17px; }
.csv-modal__lead { margin: 0; font-size: 13.5px; color: var(--text-700); line-height: 1.5; }
.csv-modal__hint { margin: 8px 0 0; font-size: 12.5px; color: var(--text-500); line-height: 1.5; }

/* result icon circles */
.result-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}
.result-icon.success { background: #ddf4e8; color: #1c9a5b; }
.result-icon.danger { background: var(--red-bg); color: var(--red-text); }
.result-icon.warning { background: var(--amber-bg); color: var(--amber-text); }

/* centered result page */
.result-page {
  max-width: 560px;
  margin: 60px auto 0;
  text-align: center;
}
/* Top accent strip colored by outcome — same tone vocabulary as the
   progress bar's tone-success/partial/failed classes, so a result page
   reads as the same "how it turned out" signal wherever it shows up. */
.result-page .card { text-align: left; padding: 40px 44px; border-top: 4px solid transparent; }
.result-page .card.tone-success { border-top-color: #1c9a5b; }
.result-page .card.tone-partial { border-top-color: var(--amber-text); }
.result-page .card.tone-danger { border-top-color: var(--red-text); }
.result-page h2 { text-align: center; font-size: 22px; margin: 0 0 8px; }
.result-page p.center-sub { text-align: center; color: var(--text-500); font-size: 13.5px; margin: 0 0 20px; }

.version-transition {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.version-transition .v-block { text-align: center; }
.version-transition .v-label { font-size: 11px; font-weight: 800; color: var(--text-400); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px;}
.version-transition .v-value { font-size: 20px; font-weight: 800; color: var(--text-900); }
.version-transition .v-value.live { color: #1c9a5b; }
.version-transition .v-value.partial { color: var(--amber-text); }
.version-transition .arrow { color: var(--text-400); font-size: 20px; }


/* ---------- Artifact tree (Review Artifacts to Publish) ---------- */

/* Custom checkbox: filled navy square with a bold white X when checked,
   instead of the browser's native tick — scoped to this modal only so it
   doesn't affect the plain settings-style checkboxes used elsewhere. */
.artifact-tree input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-radius: 5px;
  background: #fff;
  position: relative;
  margin: 0;
}
.artifact-tree input[type="checkbox"]:checked {
  background: var(--navy-700);
  border-color: var(--navy-700);
}
.artifact-tree input[type="checkbox"]:checked::before,
.artifact-tree input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 11px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}
.artifact-tree input[type="checkbox"]:checked::before { transform: translate(-50%, -50%) rotate(45deg); }
.artifact-tree input[type="checkbox"]:checked::after { transform: translate(-50%, -50%) rotate(-45deg); }

/* Process flows — card grid (Review Artifacts to Publish). Each process is a
   clickable card instead of a checkbox row; the real checkbox stays in the
   DOM (visually hidden) for app.js's 'toggle-process' handler and keyboard
   operability — the surrounding <label> makes the whole card clickable. */
.artifact-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
/* Below the modal's own breakpoint, 4 fixed columns get too cramped —
   drop to 2, then 1, same as the reference layout would on a narrower
   screen, instead of a fixed 4-up grid squeezing every card's content. */
@media (max-width: 860px) {
  .artifact-card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 460px) {
  .artifact-card-grid { grid-template-columns: 1fr; }
}
.artifact-card {
  position: relative;
  display: block;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
/* This is a bare <label> (wrapping the real checkbox — see
   artifact-selection.js's processCard), which Bootstrap's theme CSS gives
   its own default margin — the same bare-tag collision the Modal/Buttons
   sections guard against, hardened the same way here. */
#modal-root .artifact-card {
  margin: 0 !important;
  padding: 12px 14px !important;
}
.artifact-card:hover { border-color: var(--navy-500); box-shadow: var(--shadow-sm); }
.artifact-card:focus-within { outline: 2px solid var(--link); outline-offset: 2px; }
.artifact-card.selected { border-color: var(--navy-700); background: #f2f6ff; }
/* RPA workflow cards (see rpaWorkflowCard) — always follow their parent
   process, never independently clickable, so the hover/focus affordances
   that imply "click me" are suppressed. */
.artifact-card--readonly { cursor: default; }
.artifact-card--readonly:hover { border-color: var(--border-strong); box-shadow: none; }
.artifact-card--readonly.selected:hover { border-color: var(--navy-700); }
.artifact-card--readonly:focus-within { outline: none; }

/* !important throughout — same reason as .role-select__native/.selectize__*
   elsewhere: without it, the host theme's own checkbox width/height/position
   could leave this occupying real (if invisible) space above
   .artifact-card__head, causing a gap before the head row. */
.artifact-tree .artifact-card__native-checkbox {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
}
/* Inline at the end of .artifact-card__head (not absolutely positioned over
   the corner) — shares the row with icon/name/badge instead of floating
   independently, so the head no longer needs reserved right-side padding.
   margin-left:auto pushes it to the row's far end regardless of name/badge width. */
.artifact-card__check {
  flex-shrink: 0;
  margin-left: auto;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.artifact-card.selected .artifact-card__check { background: var(--navy-700); border-color: var(--navy-700); }
.artifact-card__check svg { width: 11px; height: 11px; }

.artifact-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.artifact-card__head .badge { flex-shrink: 0; }
.artifact-card__name {
  flex: 1;
  min-width: 0;
  font-weight: 800;
  font-size: 14px;
  color: var(--text-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* "+N more" / "Show less" trailing tile in the process card grid — a dashed
   placeholder sized to match a real card's header-only height, so it
   doesn't stretch its grid row taller than card-only rows (grid rows
   default to align-items: stretch). */
.artifact-card--more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 58px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-lighter);
  color: var(--navy-700);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.artifact-card--more:hover { border-color: var(--navy-500); background: #eef2fb; }
.artifact-card--more svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ---------- Artifact accordion (Review Artifacts to Publish) ----------
   Entity sections are independently-collapsible rows, stacked vertically,
   rather than mutually-exclusive tabs — several can be expanded at once
   (see app.js's 'toggle-artifact-section' / artifactExpandedSections). */
/* Its own bordered box per row, darker than the hairline dividers
   elsewhere (--border-strong, not --border) — reads as a stack of
   distinct cards rather than one flat list. */
.artifact-accordion-row {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}
.artifact-accordion-row:last-child { margin-bottom: 0; }
.artifact-accordion-row__head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  padding: 14px 16px;
  margin: 0;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  background: linear-gradient(135deg, var(--blue-bg), var(--purple-bg)) ;
  transition: background 0.15s ease;
}
.artifact-accordion-row__head:hover { background: var(--bg-lighter); }
/* Persistent tint (not just on :hover) once open, same "this one's active"
   convention as .wizard-head__chip.active — makes an already-open row
   obvious at a glance, not just mid-hover. */
.artifact-accordion-row.expanded .artifact-accordion-row__head { background: rgba(28, 58, 107, 0.05); }
/* Chevron rotates to point down once expanded, same "twisty" convention as
   every other collapsible section in the app; turns navy on hover so the
   row reads as clickable even before the pointer reaches the label text. */
.artifact-accordion-row__chevron {
  display: flex;
  flex-shrink: 0;
  color: var(--text-400);
  transform: rotate(-90deg);
  transition: transform 0.15s ease, color 0.15s ease;
}
.artifact-accordion-row__head:hover .artifact-accordion-row__chevron { color: var(--navy-700); }
.artifact-accordion-row.expanded .artifact-accordion-row__chevron { transform: rotate(0deg); }
.artifact-accordion-row__chevron svg { width: 12px; height: 12px; }
.artifact-accordion-row__label {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-900);
}
.artifact-tab__count {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.6;
  color: var(--text-400);
  background: var(--bg-lighter);
  padding: 0 7px;
  border-radius: 999px;
}
/* Bold navy, not muted gray — this is a live count the user acts on, not
   secondary metadata. Pushed to the row's far end regardless of label/count
   width via margin-left:auto. */
.artifact-accordion-row__status {
  margin-left: auto;
  color: var(--navy-700);
  font-weight: 800;
  font-size: 12.5px;
  white-space: nowrap;
}
/* No animation by default: markup is re-inserted on every modal render, so
   --opening/--closing is only added by the render that just toggled this row
   (see app.js's '_artifactJustToggledKey'), preventing replays. grid-template-
   rows: 1fr (not max-height) tracks real content height, avoiding a snap-shut
   glitch a guessed max-height ceiling caused on close. */
.artifact-accordion-row__body {
  display: grid;
  grid-template-rows: 1fr;
}
.artifact-accordion-row__body-inner {
  overflow: hidden;
  min-height: 0;
  padding: 0 16px 16px;
}
.artifact-accordion-row__body--opening { animation: artifactAccordionRowOpen 0.28s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes artifactAccordionRowOpen {
  from { opacity: 0; grid-template-rows: 0fr; }
  to { opacity: 1; grid-template-rows: 1fr; }
}
/* Timed to match app.js's setTimeout for 'toggle-artifact-section' (220ms)
   — the body is actually dropped from the DOM right as this finishes, so
   the two need to agree on duration. */
.artifact-accordion-row__body--closing { animation: artifactAccordionRowClose 0.22s cubic-bezier(0.4, 0, 1, 1); }
@keyframes artifactAccordionRowClose {
  from { opacity: 1; grid-template-rows: 1fr; }
  to { opacity: 0; grid-template-rows: 0fr; }
}
.artifact-accordion-row__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #fff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy-700);
  cursor: pointer;
  white-space: nowrap;
}
.btn-pill:hover { background: var(--bg-lighter); border-color: var(--navy-500); }
.btn-pill svg { width: 13px; height: 13px; }

/* "Used in: <process names>" note under an entity row, derived from that
   entity's dependantOnProcessIds. */
.entity-used-in {
  font-size: 12px;
  color: var(--text-400);
  margin-top: 2px;
}

/* diff rows (review configuration changes) */
.diff-block { margin-bottom: 20px; }
.diff-block__title { font-size: 13px; font-weight: 800; color: var(--text-900); margin-bottom: 8px; }
.diff-block__title .count { color: var(--text-500); font-weight: 600; }
.diff-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 6px;
}
.diff-row.removed { background: #fdf1ef; }
.diff-row.modified { background: #fdf8ea; }
.diff-row .diff-tag {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 5px; margin-right: 10px;
}
.diff-row.removed .diff-tag { background: #f6cec4; color: #8a2c1f; }
.diff-row.modified .diff-tag { background: #f1e2a8; color: #6b5510; }
.diff-row__name { font-weight: 700; color: var(--text-900); }
.diff-row__detail { font-size: 13px; color: var(--text-500); }
.diff-row__meta { font-size: 13px; color: var(--text-500); }
.strike { text-decoration: line-through; color: #c0392b; margin-right: 6px; }
.new-val { color: #1c7a4d; font-weight: 700; }

/* ---------- Slide-over panel ---------- */

.slideover-backdrop {
  position: fixed; inset: 0; background: rgba(16,22,42,0.35); z-index: 90;
}
.slideover {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 420px; background: #fff; box-shadow: var(--shadow-lg);
  z-index: 91; padding: 0; overflow-y: auto;
}
/* Same blue/purple gradient band + icon chip as .modal__head (see the
   Modal section) — a slide-over is just a docked detail surface, so it
   gets the same header treatment as every other detail/config surface
   in the app instead of the plain white bar it had before. */
.slideover__head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px; margin: 0; padding: 26px 28px 20px;
  background: linear-gradient(135deg, var(--blue-bg), var(--purple-bg));
  border-bottom: 1px solid var(--border);
}
.slideover__head-row { display: flex; align-items: center; gap: 14px; }
.slideover__head-icon {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  background: #fff; display: flex; align-items: center; justify-content: center;
  color: var(--navy-600); box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.slideover__body { padding: 20px 28px 28px; }
.slideover__title { font-size: 19px; font-weight: 800; color: var(--text-900); margin: 0 0 4px; }
.slideover__sub { font-size: 13px; color: var(--text-500); }

.detail-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.detail-row__name { font-weight: 700; color: var(--text-900); font-size: 14.5px; }
.detail-row__count { font-size: 12.5px; color: var(--text-500); margin-top: 2px; }
.detail-row__right { display: flex; align-items: center; gap: 8px; }

/* ---------- Final review page ---------- */

.review-card { margin-bottom: 18px; border: 1px solid var(--border); }
.review-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.review-card__title { font-size: 16px; font-weight: 800; color: var(--text-900); }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 40px; }
.review-field-label { font-size: 11px; font-weight: 800; letter-spacing: 0.05em; color: var(--text-400); text-transform: uppercase; margin-bottom: 4px; }
.review-field-value { font-size: 15px; font-weight: 700; color: var(--text-900); }
.review-field-value--missing { color: var(--red-text); font-style: italic; }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center; padding: 80px 20px; color: var(--text-500);
}
.empty-state h3 { color: var(--text-900); font-size: 18px; margin-bottom: 8px; }

/* ---------- End-user deploy screens (no sidebar chrome) ---------- */
.enduser-shell {
  min-height: 100vh;
  background: var(--bg);
}
.enduser-topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  border-top: 3px solid var(--navy-700);
  padding: 16px 32px; font-weight: 800; font-size: 15px; color: var(--text-900);
}
.enduser-center {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 20px;
}
.enduser-card { text-align: center; max-width: 460px; }
.enduser-icon { margin-bottom: 18px; color: var(--navy-700); }

/* Classic OS-style "chasing blade" spinner (see SVG.spinner) — each of the
   8 <line> blades fades out on its own staggered delay so the dim spot
   appears to sweep around the ring, rather than a rigid whole-icon rotation. */
.spinner-fade line { animation: spinnerFadeBlade 1s linear infinite; }
@keyframes spinnerFadeBlade {
  0% { opacity: 1; }
  100% { opacity: 0.15; }
}
.enduser-card h2 { font-size: 20px; font-weight: 800; color: var(--text-900); margin: 0 0 10px; }
.enduser-card p { font-size: 14px; color: var(--text-500); margin: 0 0 22px; line-height: 1.5; }

.progress-bar-track {
  height: 8px; background: #dde2ec; border-radius: 999px; overflow: hidden; margin-bottom: 10px;
}
.progress-bar-fill {
  height: 100%; background: var(--navy-700); border-radius: 999px;
  transition: width 0.3s ease, background-color 0.3s ease;
}
/* Bar color reflects the actual polled deployment outcome instead of always
   staying navy, so a failed/partial run reads as such even briefly, before
   the page moves on to its dedicated result screen. */
.progress-bar-fill.tone-progress { background: var(--navy-700); }
.progress-bar-fill.tone-success { background: var(--green-text); }
.progress-bar-fill.tone-partial { background: var(--amber-text); }
.progress-bar-fill.tone-failed { background: var(--red-text); }
.progress-time { font-size: 12.5px; color: var(--text-500); }

/* ---------- Sessions breakdown ---------- */
.session-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.session-row:last-of-type { border-bottom: none; }
.session-count { font-size: 44px; font-weight: 800; color: var(--text-900); line-height: 1; }

/* quick options pills */
.pill-group { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pill {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: #fff; font-size: 13.5px; font-weight: 700; cursor: pointer; color: var(--text-700);
}
.pill.selected { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }

.force-logout-at-box {
  background: var(--blue-bg); border: 1px solid #c3d6f5; border-radius: var(--radius-md);
  padding: 14px 16px; margin: 4px 0 14px;
}
.force-logout-at-box__value { font-size: 15px; font-weight: 800; color: var(--text-900); margin-top: 2px; }
.force-logout-at-box__relative { font-size: 13px; font-weight: 600; color: var(--text-500); margin-left: 6px; }

.info-box {
  background: #f6f8fc; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px; font-size: 13px; color: var(--text-600); margin-top: 4px;
}
.info-box strong { color: var(--text-800); }

/* radio option cards (unpublish modal) */
.radio-card {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer;
}
.radio-card.selected { border-color: var(--navy-700); background: #f5f8ff; }
.radio-card.danger-option { border-color: #f0c3ba; }
.radio-card input { margin-top: 3px; }
.radio-card__title { font-weight: 800; color: var(--text-900); font-size: 14.5px; }
.radio-card.danger-option .radio-card__title { color: var(--red-text); }
.radio-card__desc { font-size: 13px; color: var(--text-500); margin-top: 2px; }
.radio-card select { margin-top: 8px; padding: 6px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); }

/* Running-instances disclosure — same card shell as .info-box, just
   collapsible since the flow list can run long; the count/blocked-notice
   stays visible, the per-flow breakdown only shows once expanded. */
.unpublish-flows-accordion {
  background: #f6f8fc; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 10px 16px; font-size: 13px; color: var(--text-700);
}
.unpublish-flows-accordion summary { cursor: pointer; padding: 4px 0; }
.unpublish-flows-accordion summary strong { font-weight: 700; color: var(--text-800); }
.unpublish-flows-accordion__sub { display: block; font-size: 12.5px; color: var(--text-500); margin-top: 2px; }
.unpublish-flows-accordion__body { margin-top: 8px; }
.unpublish-flow-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; border-top: 1px solid var(--border);
}
.unpublish-flow-row:first-child { border-top: 0; }
.unpublish-flow-row__name { font-weight: 600; color: var(--text-800); }
.unpublish-flow-row__count { font-size: 12px; font-weight: 700; color: var(--amber-text); }

/* Empty-state counterpart to .unpublish-flows-accordion — green rather than
   muted gray, since "nothing running" is a reassuring safe-to-proceed
   state, not a throwaway detail. */
.unpublish-no-running {
  background: var(--green-bg); border: 1px solid #b9e6cc; border-radius: var(--radius-md);
  padding: 10px 16px; margin-top: 16px; font-size: 13px; font-weight: 700; color: var(--green-text);
}

/* checkbox row */
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-700); font-weight: 600; }

/* utility */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.text-muted { color: var(--text-500); }
.small { font-size: 12.5px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* checkbox styling */
input[type="checkbox"] {
  width: 17px; height: 17px; accent-color: var(--navy-700); cursor: pointer; flex-shrink: 0;
}
input[type="radio"] { accent-color: var(--navy-700); cursor: pointer; }

.section-divider { height: 1px; background: var(--border); margin: 18px 0; }

/* fade-in animation for view swaps */
.view-fade { animation: fadeIn 0.15s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: translateY(0);} }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--navy-900); color: #fff; padding: 12px 20px; border-radius: var(--radius-md);
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-md); z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- AG Grid (Deployment management / Publish History tables) ----------
   Overrides ag-theme-alpine's own tokens so the grid reads as one of this
   design system's own components (same border/radius/shadow as .table-wrap,
   same fonts/palette) instead of AG Grid's out-of-the-box look. */
#app-detail-grid.ag-theme-alpine,
#publish-history-grid.ag-theme-alpine,
#added-users-grid.ag-theme-alpine,
#view-logs-grid.ag-theme-alpine {
  --ag-font-family: var(--font);
  /* Matches the plain .table-wrap table's own font-size (see "table" below) so
     a row of data reads the same size whether it's rendered by AG Grid or a
     plain <table> elsewhere in this portlet. */
  --ag-font-size: 13.5px;
  --ag-background-color: var(--card);
  --ag-header-background-color: var(--bg-lighter);
  /* Column headers dark/bold (this is a heading), row values a lighter gray
     (this is data, not the focal point) — the reverse of AG Grid's own
     defaults, which is what read as backwards here. */
  --ag-header-foreground-color: var(--text-800);
  --ag-foreground-color: var(--text-500);
  --ag-border-color: var(--border);
  --ag-row-border-color: var(--border);
  --ag-row-hover-color: var(--bg-lighter);
  --ag-cell-horizontal-padding: 22px;
  --ag-borders: solid 1px;
  /* Height is set inline by grid-service.js (computeGridHeight for the paged
     grids, or mountClientGrid's own row-count sizing for #added-users-grid/
     #view-logs-grid) — this is just a fallback before that runs, so it's
     deliberately NOT !important like the rest of this rule, or it would pin
     every client-side grid to a fixed height instead of fitting its rows. */
  height: 528px;
  /* !important: the host Liferay theme's own Bootstrap table/card borders
     otherwise win (equal-or-higher specificity + its own !important), which
     is what made this render with a heavier default border and no shadow
     instead of this design system's light border + soft shadow. */
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden !important;
  box-shadow: var(--shadow-sm) !important;
}
#app-detail-grid.ag-theme-alpine .ag-header,
#publish-history-grid.ag-theme-alpine .ag-header,
#added-users-grid.ag-theme-alpine .ag-header,
#view-logs-grid.ag-theme-alpine .ag-header {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}
#app-detail-grid.ag-theme-alpine .ag-cell,
#publish-history-grid.ag-theme-alpine .ag-cell,
#added-users-grid.ag-theme-alpine .ag-cell,
#view-logs-grid.ag-theme-alpine .ag-cell {
  display: flex;
  align-items: center;
}

/* ---------- Bulk User Upload page (CSV import) ---------- */

/* Sits beside the download button in the wizard-card__head corner (see
   renderDownloadTemplateButton). */
.csv-download-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Deliberately its own class, not .btn — the shared #app-shell .btn rules'
   !important background/shadow (see the Buttons section) would just as
   easily clobber this gradient/shadow if layered on top of .btn. */
.btn-template-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--blue-bg), var(--cyan-bg));
  color: var(--blue-text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-template-download:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-template-download:active { transform: translateY(0); }
.btn-template-download:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow-sm);
}
.btn-template-download svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Small (i) trigger + hover/focus popover — see renderCsvFormatInfo. Pure
   CSS (:hover/:focus-within), no open/close state to track; tabindex on the
   wrapper makes it keyboard-reachable too. Opens downward/right-aligned
   since it sits at the top-right of the wizard card. */
.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--blue-text);
  cursor: help;
  flex-shrink: 0;
}
.info-tooltip svg { width: 14px; height: 14px; }

.info-tooltip__panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  right: 0;
  transform: translateY(-4px);
  width: 340px;
  max-width: 80vw;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 14px 16px;
  text-align: left;
  cursor: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.info-tooltip:hover .info-tooltip__panel,
.info-tooltip:focus-within .info-tooltip__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.info-tooltip__title { font-size: 13px; font-weight: 800; color: var(--text-900); }
.info-tooltip__subtitle { font-size: 11.5px; color: var(--text-500); margin-top: 2px; margin-bottom: 10px; }

.info-tooltip__section-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-400);
  margin-bottom: 6px;
}
.info-tooltip__section-label:not(:first-of-type) { margin-top: 12px; }

.info-tooltip__grid { display: flex; flex-direction: column; gap: 6px; }

.info-tooltip__field {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 12px;
  color: var(--text-700);
  line-height: 1.4;
}
.info-tooltip__field code {
  flex-shrink: 0;
  background: var(--blue-bg);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  color: var(--blue-text);
}

.info-tooltip__optional { display: flex; flex-wrap: wrap; gap: 5px; }
.info-tooltip__optional code {
  background: var(--bg-lighter);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-500);
}

.info-tooltip__note { font-size: 11px; color: var(--text-500); margin-top: 10px; }

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-lighter);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  min-height: 50px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--navy-500);
  background: linear-gradient(135deg, var(--blue-bg), var(--cyan-bg));
}
.dropzone.invalid { border-color: var(--red-text); }
/* Centers its stacked lines both ways within .dropzone (see above) — this
   is a small file picker, not the screen's focal point (the
   existing-users grid below it is). */
.dropzone__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.dropzone__hint { font-size: 12.5px; color: var(--text-500); }

.file-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-lighter);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
}
.file-chip__icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--blue-bg); color: var(--blue-text);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.file-chip__info { flex: 1; min-width: 0; }
.file-chip__name { font-weight: 700; color: var(--text-900); font-size: 13.5px; }

/* Collapsed by default via max-height/opacity (not display:none) so toggling
   .open is an actual animated transition — see app.js's 'toggle-add-user-form',
   which flips this class via DOM rather than re-rendering (a fresh element
   has no "from" state to transition out of). */
.collapsible-panel {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-bottom: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-lighter);
  padding: 0 18px;
  transition: max-height .3s ease, opacity .25s ease, margin-bottom .3s ease, padding .3s ease;
}
/* overflow flips to visible only once the expand transition finishes (the
   `0s ... .3s` delay), so the Roles combobox's dropdown can hang outside this
   panel instead of being clipped mid-animation. Collapsing is unaffected —
   dropping .open re-applies overflow:hidden immediately. */
.collapsible-panel.open {
  max-height: 800px;
  overflow: visible;
  transition: max-height .3s ease, opacity .25s ease, margin-bottom .3s ease, padding .3s ease, overflow 0s linear .3s;
  opacity: 1;
  margin-bottom: 24px;
  margin-top: 8px;
  padding: 18px;
}
.collapsible-panel__title {
  font-size: 12.5px; font-weight: 800; letter-spacing: 0.02em;
  color: #434b5a; text-transform: uppercase; margin-bottom: 14px;
}
.collapsible-panel__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.add-new-row { display: flex; justify-content: flex-end; margin-top: 10px; }

.added-users { margin-bottom: 24px; }

/* ---------- Existing Users selectize (Bulk User Upload step) ----------
   Replaces the old AG Grid of checkbox rows with a searchable candidate
   list plus chips for the picks. Scoped under #modal-root with !important
   since .selectize__option/.chip__remove are bare <button>s the host
   theme's Bootstrap CSS would otherwise repaint into grey theme buttons. */
/* Separator above the whole block, holding it off the Added Users grid /
   "+ Add New" row above it. */
#modal-root .selectize {
  margin-top: 20px !important;
  padding-top: 20px !important;
  border-top: 1px solid var(--border) !important;
}
#modal-root .selectize__head {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  gap: 12px !important;
}
/* Cancels .collapsible-panel__title's own bottom margin — the gap under the
   head row is owned by .selectize__meta below it instead. */
#modal-root .selectize__title { margin-bottom: 0 !important; }
#modal-root .selectize__selected-count {
  font-size: 12.5px !important;
  font-weight: 800 !important;
  color: var(--blue-text) !important;
  white-space: nowrap !important;
}
/* Sits directly ABOVE the control, so Select all / Clear selection are
   reachable before you go near the search box. Owns the spacing on both
   sides: it follows the head row directly now that the sub-line is gone. */
#modal-root .selectize__meta {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin: 10px 0 8px !important;
  flex-wrap: wrap !important;
}
#modal-root .selectize__meta-count {
  font-size: 12.5px !important;
  color: var(--text-500) !important;
}
#modal-root .selectize__links {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}
/* #modal-root .btn-link already carries !important on its own colors — this
   has to match that specificity to grey these two out when they're no-ops. */
#modal-root .selectize__links .btn-link:disabled {
  opacity: 0.45 !important;
  cursor: default !important;
  text-decoration: none !important;
}

/* Anchors the candidate dropdown to the search input. Only the option list
   became a dropdown — the counter, meta row and selected chips still render
   in normal flow below this wrapper. */
#modal-root .selectize__combo { position: relative !important; }

/* The candidate list is a dropdown hanging off the search input rather than
   an always-visible panel — same behaviour as .role-select__menu. Overlaying
   means the meta row/chips below don't jump when it opens. */
#modal-root .selectize__menu {
  display: none !important;
  position: absolute !important;
  z-index: 20 !important;
  left: 0 !important;
  right: 0 !important;
  top: calc(100% + 4px) !important;
  flex-direction: column !important;
  gap: 2px !important;
  max-height: 210px !important;
  overflow-y: auto !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  background: var(--card) !important;
  padding: 6px !important;
  box-shadow: var(--shadow-md) !important;
}
#modal-root .selectize__combo.open .selectize__menu { display: flex !important; }
#modal-root .selectize__option {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
  text-align: left !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: var(--radius-sm) !important;
  padding: 8px 10px !important;
  margin: 0 !important;
  font-family: inherit !important;
  font-size: 13.5px !important;
  font-weight: 400 !important;
  text-transform: none !important;
  color: var(--text-800) !important;
  cursor: pointer !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}
#modal-root .selectize__option:hover { background: var(--bg-lighter) !important; }
#modal-root .selectize__option-label {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* ---------- Shared selection chip ----------
   One definition used by BOTH combobox fields, so a picked item reads the
   same either way: label + id badge + remove button. Lives inside the
   control, beside the search input. */
#modal-root .chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: var(--blue-bg) !important;
  border: 1px solid #c8dcff !important;
  border-radius: 999px !important;
  padding: 4px 5px 4px 11px !important;
  font-size: 13px !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
/* Read-only variant — no chip__remove button, so both sides get the same
   padding instead of .chip's asymmetric 11px/5px meant to leave room for one
   (see renderDeploymentBlockedModal's app-name list). */
#modal-root .chip--static { padding: 4px 12px !important; }
#modal-root .chip__label {
  font-weight: 700 !important;
  color: var(--text-900) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
#modal-root .chip__badge {
  flex-shrink: 0 !important;
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: 999px !important;
  padding: 1px 8px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: var(--text-500) !important;
  white-space: nowrap !important;
}
#modal-root .chip__remove {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 0 !important;
  flex-shrink: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--text-500) !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}
#modal-root .chip__remove:hover {
  background: #fff !important;
  color: var(--text-900) !important;
}
/* SVG.x is 16px for its other uses (modal close) — too heavy inside a chip. */
#modal-root .chip__remove svg {
  width: 12px !important;
  height: 12px !important;
}

/* "+N more" / "Show less" at the end of a collapsed chip list (see
   renderExistingUsersChips) — same pill shape as a real selection chip, but neutral/muted
   rather than blue so it doesn't read as another picked user, and the whole pill is the
   click target (no separate remove button) rather than label+badge+remove. */
#modal-root .chip--toggle {
  background: var(--bg-lighter) !important;
  border-color: var(--border-strong) !important;
  padding: 4px 12px !important;
  color: var(--link) !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}
#modal-root .chip--toggle:hover {
  background: #fff !important;
  border-color: var(--link) !important;
}

/* Existing Users control — the input-looking box holding the chips and the
   search field, matching .role-select__control. */
#modal-root .selectize__control {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px !important;
  min-height: 38px !important;
  padding: 5px 8px !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-sm) !important;
  background: #fff !important;
  cursor: text !important;
  box-sizing: border-box !important;
}
#modal-root .selectize__combo.open .selectize__control { border-color: var(--link) !important; }
/* Chips wrap among themselves inside the control, with the search input
   taking whatever width is left on the last line. */
#modal-root .selectize__chips {
  display: inline-flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px !important;
}
#modal-root .selectize__search {
  flex: 1 1 140px !important;
  min-width: 140px !important;
  border: 0 !important;
  outline: none !important;
  padding: 4px 2px !important;
  margin: 0 !important;
  font-family: inherit !important;
  font-size: 14px !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Small id pill shown after the email in both a chip and an option — the
   equivalent of the role badge in the reference design; these rows only carry
   an id and an email (see data.buildExistingUsersFromAppReview). */
#modal-root .selectize__badge {
  flex-shrink: 0 !important;
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: 999px !important;
  padding: 1px 8px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: var(--text-500) !important;
  white-space: nowrap !important;
}
#modal-root .selectize__option .selectize__badge { background: var(--bg-lighter) !important; }

#modal-root .selectize__empty {
  font-size: 12.5px !important;
  color: var(--text-500) !important;
  padding: 10px 4px !important;
}

/* ---------- Agent config: ProcessFlow Selection + Variables ----------
   Two-panel layout (see renderAgentProcessFlowAndVariables) — left: this
   app's processes (single-select enforced in app.js); right: the selected
   process's variables as a scrollable clickable list. Same !important-
   scoped-to-#modal-root convention as .selectize, for the same reason. */
#modal-root .agent-processflow-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 20px !important;
  margin-bottom: 14px !important;
}
#modal-root .agent-processflow-panel {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden !important;
  background: var(--card) !important;
}
#modal-root .agent-processflow-panel__head {
  background: var(--bg-lighter) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  color: var(--text-900) !important;
}
#modal-root .agent-processflow-panel__body {
  padding: 12px 14px !important;
  max-height: 230px !important;
  overflow-y: auto !important;
}
#modal-root .agent-process-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 7px 6px !important;
  border-radius: var(--radius-sm) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: var(--text-800) !important;
  cursor: pointer !important;
}
#modal-root .agent-process-row:hover { background: var(--bg-lighter) !important; }
#modal-root .agent-process-row input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
}
#modal-root .agent-variables-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  max-height: 160px !important;
  overflow-y: auto !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 4px !important;
}
#modal-root .agent-variable-row {
  display: block !important;
  width: 100% !important;
  text-align: left !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: var(--radius-sm) !important;
  padding: 7px 8px !important;
  margin: 0 !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: var(--text-800) !important;
  cursor: pointer !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}
#modal-root .agent-variable-row:hover { background: var(--bg-lighter) !important; }
#modal-root .agent-variable-row.selected {
  background: var(--blue-bg) !important;
  color: var(--blue-text) !important;
  font-weight: 700 !important;
}

.preview-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.preview-section__title { font-size: 14px; font-weight: 800; color: var(--text-900); }

tbody tr.preview-row--error { background: #fdf1ef; }
tbody tr.preview-row--error:hover { background: #fbe6e2; }