/* =========================================================
   ATOSY ERP
   BPMN APPLE LIQUID VIEW
   ========================================================= */

#atosy-bpmn-view {
  display: none;
}

#atosy-bpmn-view.is-open {
  display: block;
}

.atosy-bpmn-page {
  width: min(1580px, calc(100% - 28px));
  margin: 18px auto 28px;
}

.bpmn-liquid-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;

  padding: 22px 24px;

  border-radius: 28px;

  background:
    linear-gradient(
      135deg,
      rgba(5, 42, 104, .88),
      rgba(7, 85, 194, .76)
    );

  border: 1px solid rgba(122, 186, 255, .26);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.14),
    0 18px 50px rgba(0,20,70,.26);

  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);

  color: white;
}

.bpmn-hero-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.bpmn-hero-icon {
  width: 72px;
  height: 72px;
  min-width: 72px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 22px;

  font-size: 34px;

  background:
    linear-gradient(
      135deg,
      #7a55ff,
      #8f35ff
    );

  box-shadow:
    0 14px 34px rgba(120,70,255,.40),
    inset 0 1px 0 rgba(255,255,255,.30);
}

.bpmn-hero-copy h1 {
  margin: 0 0 7px;
  font-size: 30px;
  line-height: 1.1;
}

.bpmn-hero-copy p {
  margin: 0;
  opacity: .82;
  font-size: 14px;
}

.bpmn-kpis {
  display: grid;
  grid-template-columns: repeat(4, 150px);
  gap: 12px;
}

.bpmn-kpi {
  min-height: 74px;
  padding: 14px 16px;

  border-radius: 20px;

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,.13),
      rgba(255,255,255,.06)
    );

  border: 1px solid rgba(255,255,255,.13);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.13);
}

.bpmn-kpi-label {
  display: block;
  font-size: 12px;
  opacity: .75;
  margin-bottom: 5px;
}

.bpmn-kpi strong {
  font-size: 27px;
}

.bpmn-kpi small {
  margin-left: 6px;
  font-weight: 700;
}

.bpmn-kpi .up {
  color: #35e7a5;
}

.bpmn-kpi .down {
  color: #ff6b78;
}

/* =========================================================
   MAIN WORK AREA
   ========================================================= */

.bpmn-work-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  margin-top: 14px;
}

.bpmn-canvas-shell,
.bpmn-detail-shell {
  border-radius: 24px;

  background: rgba(255,255,255,.97);

  border: 1px solid rgba(255,255,255,.64);

  box-shadow:
    0 18px 42px rgba(0, 31, 94, .20);

  overflow: hidden;
}

.bpmn-canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 18px 20px;

  border-bottom: 1px solid rgba(29, 91, 176, .09);
}

.bpmn-canvas-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bpmn-canvas-heading-icon {
  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 14px;

  color: white;
  font-size: 22px;

  background:
    linear-gradient(135deg, #1788ff, #2f66ff);

  box-shadow:
    0 8px 18px rgba(32,109,255,.30);
}

.bpmn-canvas-heading h2 {
  margin: 0;
  color: #0d3276;
  font-size: 20px;
}

.bpmn-canvas-heading p {
  margin: 3px 0 0;
  color: #7a8baa;
  font-size: 12px;
}

.bpmn-canvas-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bpmn-tool {
  border: 1px solid rgba(43,108,211,.12);
  background: #f8fbff;
  color: #174a96;

  border-radius: 999px;

  padding: 9px 13px;

  font-size: 12px;
  font-weight: 700;

  cursor: pointer;
}

.bpmn-canvas {
  position: relative;

  min-height: 460px;

  padding: 62px 30px 45px;

  overflow-x: auto;

  background:
    radial-gradient(
      circle,
      rgba(35,100,190,.16) 1px,
      transparent 1px
    );

  background-size: 18px 18px;
}

.bpmn-flow {
  min-width: 980px;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 10px;
}

.bpmn-start,
.bpmn-end {
  width: 48px;
  height: 48px;
  min-width: 48px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  font-weight: 800;
}

.bpmn-start {
  background: #d9ffe8;
  border: 3px solid #1dbb5f;
  color: #159a4c;
}

.bpmn-end {
  background: #ffe3e8;
  border: 3px solid #ff4059;
  color: #ff4059;
}

.bpmn-arrow {
  width: 22px;
  min-width: 22px;
  height: 2px;

  position: relative;

  background: #2679ee;
}

.bpmn-arrow::after {
  content: "";
  position: absolute;

  right: -1px;
  top: -4px;

  border-left: 7px solid #2679ee;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.bpmn-node {
  width: 142px;
  min-width: 142px;
  min-height: 145px;

  border: 1px solid rgba(26,91,185,.11);

  border-radius: 20px;

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,.98),
      rgba(246,250,255,.98)
    );

  box-shadow:
    0 12px 25px rgba(0,42,105,.10);

  padding: 14px 12px;

  cursor: pointer;

  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.bpmn-node:hover {
  transform: translateY(-4px);

  border-color: rgba(36,115,255,.34);

  box-shadow:
    0 16px 30px rgba(0,54,133,.17);
}

.bpmn-node.is-selected {
  border: 2px solid #6a62ff;

  box-shadow:
    0 0 0 5px rgba(104,91,255,.10),
    0 18px 32px rgba(58,48,180,.17);
}

.bpmn-node-icon {
  width: 48px;
  height: 48px;

  margin: 0 auto 10px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 16px;

  color: white;
  font-size: 23px;
  font-weight: 800;
}

.bpmn-node[data-tone="blue"] .bpmn-node-icon {
  background: linear-gradient(135deg,#1593ff,#2870ff);
}

.bpmn-node[data-tone="green"] .bpmn-node-icon {
  background: linear-gradient(135deg,#2bd28b,#13a95e);
}

.bpmn-node[data-tone="orange"] .bpmn-node-icon {
  background: linear-gradient(135deg,#ffb13b,#ff7d2c);
}

.bpmn-node[data-tone="purple"] .bpmn-node-icon {
  background: linear-gradient(135deg,#9a61ff,#6f45e7);
}

.bpmn-node-title {
  color: #112f68;

  text-align: center;

  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;

  min-height: 36px;
}

.bpmn-node-count {
  margin-top: 8px;

  color: #236be7;

  text-align: center;

  font-size: 12px;
  font-weight: 800;
}

.bpmn-node-status {
  display: block;

  width: max-content;

  max-width: 100%;

  margin: 8px auto 0;

  padding: 5px 9px;

  border-radius: 999px;

  background: #e9f7ef;

  color: #168d53;

  font-size: 10px;
  font-weight: 700;
}

.bpmn-node-status.orange {
  background: #fff3dd;
  color: #e78a0b;
}

.bpmn-node-status.purple {
  background: #efe8ff;
  color: #7449dc;
}

.bpmn-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 18px;

  padding: 12px 18px;

  border-top:
    1px solid rgba(29,91,176,.08);

  color: #59739e;

  font-size: 11px;
}

.bpmn-legend-item {
  display: flex;
  gap: 7px;
  align-items: center;
}

.bpmn-legend-dot {
  width: 14px;
  height: 14px;

  border-radius: 50%;

  background: #27c56c;
}

.bpmn-legend-dot.orange {
  background: #ffa23b;
}

.bpmn-legend-dot.purple {
  background: #8958ff;
}

/* =========================================================
   DETAIL PANEL
   ========================================================= */

.bpmn-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 18px;

  border-bottom:
    1px solid rgba(29,91,176,.09);
}

.bpmn-detail-header h3 {
  margin: 0;

  color: #113778;

  font-size: 18px;
}

.bpmn-detail-body {
  min-height: 515px;

  padding: 18px;
}

.bpmn-empty-detail {
  height: 100%;
  min-height: 470px;

  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;

  text-align: center;

  color: #7890b7;
}

.bpmn-empty-illustration {
  width: 120px;
  height: 100px;

  margin-bottom: 24px;

  border-radius: 28px;

  background:
    linear-gradient(
      135deg,
      #edf4ff,
      #dbe9ff
    );

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 52px;

  color: #5596ff;
}

.bpmn-empty-detail strong {
  color: #163e83;

  font-size: 16px;
}

.bpmn-empty-detail p {
  max-width: 285px;

  margin:
    8px auto 20px;

  line-height: 1.55;

  font-size: 12px;
}

.bpmn-svoa-mini-grid {
  width: 100%;

  display: grid;

  grid-template-columns:
    repeat(4, 1fr);

  gap: 8px;
}

.bpmn-svoa-mini {
  padding: 12px 4px;

  border-radius: 15px;

  border:
    1px solid rgba(44,107,201,.10);

  background:
    #f7faff;

  font-size: 11px;
}

.bpmn-svoa-mini b {
  display: flex;

  width: 30px;
  height: 30px;

  margin: 0 auto 6px;

  align-items: center;
  justify-content: center;

  border-radius: 11px;

  color: white;
}

.bpmn-svoa-mini.s b { background: #1687ff; }
.bpmn-svoa-mini.v b { background: #8757ff; }
.bpmn-svoa-mini.o b { background: #1ecf8b; }
.bpmn-svoa-mini.a b { background: #ff9f3f; }

.bpmn-selected-detail {
  display: none;
}

.bpmn-selected-detail.is-visible {
  display: block;
}

.bpmn-empty-detail.is-hidden {
  display: none;
}

.bpmn-detail-title {
  margin: 0 0 14px;

  color: #123a80;

  font-size: 21px;
}

.bpmn-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);

  gap: 10px;

  margin-bottom: 18px;
}

.bpmn-detail-stat {
  padding: 12px;

  border-radius: 15px;

  background: #f7faff;

  border:
    1px solid rgba(44,107,201,.09);
}

.bpmn-detail-stat span {
  display: block;

  color: #7890b7;

  font-size: 10px;

  margin-bottom: 5px;
}

.bpmn-detail-stat strong {
  color: #143b80;

  font-size: 15px;
}

.bpmn-related-title {
  margin: 18px 0 10px;

  color: #173f83;

  font-size: 13px;
}

.bpmn-related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.bpmn-related-card {
  padding: 12px;

  border-radius: 15px;

  border:
    1px solid rgba(44,107,201,.09);

  background: #f8fbff;
}

.bpmn-related-card b {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
}

.bpmn-related-card span {
  font-size: 11px;
  color: #6f84a7;
}

/* =========================================================
   SUMMARY
   ========================================================= */

.bpmn-summary {
  display: grid;

  grid-template-columns:
    repeat(4, 1fr);

  margin-top: 14px;

  border-radius: 24px;

  overflow: hidden;

  background:
    linear-gradient(
      135deg,
      rgba(9,58,131,.88),
      rgba(7,82,180,.72)
    );

  border:
    1px solid rgba(118,185,255,.22);

  box-shadow:
    0 18px 42px rgba(0,22,78,.20);

  color: white;
}

.bpmn-summary-item {
  padding: 18px 22px;

  border-right:
    1px solid rgba(255,255,255,.12);
}

.bpmn-summary-item:last-child {
  border-right: 0;
}

.bpmn-summary-item span {
  display: block;
  opacity: .72;
  font-size: 11px;
}

.bpmn-summary-item strong {
  display: block;
  margin-top: 3px;
  font-size: 26px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1180px) {

  .bpmn-liquid-hero {
    grid-template-columns: 1fr;
  }

  .bpmn-kpis {
    grid-template-columns: repeat(4, 1fr);
  }

  .bpmn-work-area {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {

  .atosy-bpmn-page {
    width: calc(100% - 16px);
  }

  .bpmn-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .bpmn-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* =========================================================
   ATOSY BPMN PHASE 2
   NAVY GRADIENT + LIQUID BACKGROUND
   ========================================================= */

html[data-atosy-theme="focus"] body,
html[data-atosy-theme="navy"] body {
  background:
    radial-gradient(
      circle at 12% 2%,
      rgba(0, 148, 255, .52),
      transparent 27%
    ),
    radial-gradient(
      circle at 84% 8%,
      rgba(33, 91, 255, .48),
      transparent 30%
    ),
    radial-gradient(
      circle at 75% 78%,
      rgba(46, 61, 255, .28),
      transparent 38%
    ),
    linear-gradient(
      135deg,
      #03132f 0%,
      #06377e 44%,
      #0759c8 100%
    ) !important;

  background-attachment: fixed !important;
}


/* lớp nền cũ phải trong suốt */
.app-background {
  background: transparent !important;
  overflow: hidden;
}


/* Liquid light ribbons */
.app-background::before {
  content: "";
  position: absolute;

  width: 125vw;
  height: 290px;

  left: -12vw;
  top: -120px;

  border-radius: 50%;

  background:
    linear-gradient(
      100deg,
      transparent 5%,
      rgba(0, 166, 255, .20) 30%,
      rgba(74, 95, 255, .24) 55%,
      transparent 85%
    );

  filter: blur(16px);

  transform: rotate(-4deg);

  pointer-events: none;
}


.app-background::after {
  content: "";
  position: absolute;

  width: 105vw;
  height: 330px;

  right: -28vw;
  bottom: -180px;

  border-radius: 50%;

  background:
    linear-gradient(
      120deg,
      transparent,
      rgba(0, 180, 255, .18),
      rgba(53, 75, 255, .20),
      transparent
    );

  filter: blur(22px);

  transform: rotate(-12deg);

  pointer-events: none;
}


/* Các orb cũ thành liquid glow */
.app-orb {
  opacity: .60 !important;
  filter: blur(55px) !important;
}

.orb-1 {
  background:
    rgba(0, 159, 255, .45) !important;
}

.orb-2 {
  background:
    rgba(73, 83, 255, .36) !important;
}

.orb-3 {
  background:
    rgba(0, 207, 255, .24) !important;
}


/* shell phải trong suốt */
.app-shell,
.app-main {
  background: transparent !important;
}


/* BPMN phải nổi trên Liquid background */
#atosy-bpmn-view {
  position: relative;
  z-index: 2;
}


/* Hero làm trong hơn */
.bpmn-liquid-hero {
  background:
    linear-gradient(
      135deg,
      rgba(4, 35, 91, .74),
      rgba(9, 91, 207, .55)
    ) !important;

  backdrop-filter:
    blur(28px)
    saturate(165%);

  -webkit-backdrop-filter:
    blur(28px)
    saturate(165%);

  border:
    1px solid
    rgba(113, 189, 255, .30) !important;
}


/* bottom summary cũng Liquid */
.bpmn-summary {
  background:
    linear-gradient(
      135deg,
      rgba(3, 35, 91, .78),
      rgba(7, 94, 204, .56)
    ) !important;

  backdrop-filter:
    blur(24px)
    saturate(155%);

  -webkit-backdrop-filter:
    blur(24px)
    saturate(155%);
}
