/* ============================================================
   Sigma Nursery — Prototype Review Workspace & Marker System
   Design Standards:
   - Primary: #116834
   - Background: #FFFFFF
   - Border: #D9D9D9
   - Corner Radius: 6px
   - Text: #111111
   - Secondary: #999999
   ============================================================ */

/* ---------- Workspace Shell & Global Header ---------- */
.workspace-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  max-width: 100vw;
  background: #f8fafc;
  overflow: hidden;
  box-sizing: border-box;
}

.workspace-global-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  min-height: 48px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 20px;
  box-sizing: border-box;
  z-index: 200;
  flex-shrink: 0;
}

.workspace-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.workspace-brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #116834;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.workspace-header-divider {
  width: 1px;
  height: 16px;
  background: #cbd5e1;
  flex-shrink: 0;
}

.workspace-page-context {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-context-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22c55e;
  display: inline-block;
  flex-shrink: 0;
}

.workspace-page-context strong {
  color: #1e293b;
  font-weight: 600;
}

.workspace-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.workspace-mode-switcher {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  gap: 2px;
}

.mode-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 12px;
  min-height: 32px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
  line-height: 1.2;
  box-sizing: border-box;
}

.mode-switch-btn:hover {
  color: #1e293b;
  background: rgba(255, 255, 255, 0.7);
}

.mode-switch-btn:focus-visible {
  outline: 2px solid #116834;
  outline-offset: 1px;
}

.mode-switch-btn.is-active {
  background: #ffffff;
  color: #116834;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.mode-switch-btn svg {
  stroke-width: 2;
  flex-shrink: 0;
}

/* ---------- Workspace Layout & Modes ---------- */
.workspace-layout {
  display: flex;
  flex-direction: row;
  flex: 1 1 auto;
  height: calc(100vh - 48px);
  height: calc(100dvh - 48px);
  width: 100vw;
  max-width: 100vw;
  background: #f8fafc;
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
}

/* --- MODE 1: SPLIT VIEW (Default) --- */
.workspace-layout.mode-split .workspace-preview-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: #f1f5f9;
  border-right: 1px solid #e2e8f0;
  padding: 20px 14px;
  width: 420px;
  min-width: 380px;
  max-width: 440px;
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  position: relative;
}

.workspace-layout.mode-split .workspace-preview-column .device-stage {
  min-height: auto;
  padding: 0;
  background: transparent;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.workspace-layout.mode-split .workspace-review-column {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  width: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: #f8fafc;
  padding: 24px 28px 48px;
  box-sizing: border-box;
}

/* --- MODE 2: HP FOCUS --- */
.workspace-layout.mode-hp .workspace-review-column {
  display: none !important;
}

.workspace-layout.mode-hp .workspace-preview-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
  background: #f8fafc;
  border-right: none;
  padding: 24px 16px 48px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.workspace-layout.mode-hp .device-stage {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* --- MODE 3: WEB FOCUS --- */
.workspace-layout.mode-web .workspace-preview-column {
  display: none !important;
}

.workspace-layout.mode-web .workspace-review-column {
  display: flex;
  flex-direction: column;
  flex: 1 1 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: #f8fafc;
  padding: 24px 32px 48px;
  box-sizing: border-box;
}

/* ---------- Device Preview Toolbar (Di atas Frame HP) ---------- */
.device-toolbar-container {
  width: 375px;
  max-width: 100%;
  z-index: 100;
}

.device-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  gap: 8px;
}

.device-toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.device-live-dot {
  width: 8px;
  height: 8px;
  background-color: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
  flex-shrink: 0;
}

.device-page-tag {
  font-size: 0.78rem;
  color: #4b5563;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-page-tag strong {
  color: #111827;
  font-weight: 700;
}

.device-toolbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.export-dropdown-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.btn-export-screen {
  background: #116834;
  color: #ffffff;
  border: none;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px 0 0 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-export-screen:hover {
  background: #0d5529;
}

.btn-export-screen.is-loading {
  background: #64748b;
  cursor: wait;
}

.btn-export-options {
  background: #0d5529;
  color: #ffffff;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 6px 6px;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-export-options:hover {
  background: #083c1c;
}

.export-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  min-width: 230px;
  z-index: 500;
  display: none;
  flex-direction: column;
  gap: 2px;
}

.export-dropdown-menu.is-open {
  display: flex;
  animation: dropdown-fade-in 0.15s ease;
}

@keyframes dropdown-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.export-dropdown-item {
  background: transparent;
  border: none;
  text-align: left;
  padding: 8px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #334155;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.12s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.export-dropdown-item:hover {
  background: #f0fdf4;
  color: #116834;
}

/* Kolom Kanan: Review Panel */
.workspace-review-column {
  background: var(--white);
}

/* ---------- Marker Layer (Relative to Mobile Screen) ---------- */
.marker-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 250;
  border-radius: 32px;
  overflow: hidden;
}

.marker-layer.is-review-mode {
  pointer-events: auto;
  cursor: crosshair;
  background: rgba(17, 104, 52, 0.04);
}

.marker-pin-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: #111111;
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: banner-pulse 1.5s ease infinite alternate;
}

@keyframes banner-pulse {
  from { opacity: 0.9; transform: translateX(-50%) translateY(0); }
  to { opacity: 1; transform: translateX(-50%) translateY(-2px); }
}

.marker-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  cursor: pointer;
  z-index: 260;
  transition: transform 0.15s ease;
}

.marker-pin:hover {
  transform: translate(-50%, -108%) scale(1.12);
  z-index: 280;
}

.marker-pin.is-selected {
  transform: translate(-50%, -108%) scale(1.18);
  z-index: 290;
}

.marker-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 13px;
  background: #e53935;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.45);
  border: 2px solid #ffffff;
  position: relative;
}

.marker-badge::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #e53935;
}

.marker-pin.status-proses .marker-badge {
  background: #d97706;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.45);
}
.marker-pin.status-proses .marker-badge::after {
  border-top-color: #d97706;
}

.marker-pin.status-selesai .marker-badge {
  background: #116834;
  box-shadow: 0 2px 8px rgba(17, 104, 52, 0.45);
}
.marker-pin.status-selesai .marker-badge::after {
  border-top-color: #116834;
}

.marker-ripple {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(229, 57, 53, 0.6);
  animation: marker-wave 1.8s ease-out infinite;
}

@keyframes marker-wave {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ---------- Review Panel Header & Toolbar ---------- */
.review-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  width: 100%;
}

.review-title-group {
  flex: 1 1 220px;
  min-width: 0;
}

.review-title-group h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 2px;
  overflow-wrap: break-word;
}

.server-status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.server-status-pill.online {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.server-status-pill.offline {
  background: #fefce8;
  color: #a16207;
  border: 1px solid #fef08a;
}

.review-title-group p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.btn-refresh-notes:hover {
  background: #e2e8f0 !important;
}

.btn-test-email-trigger:hover {
  background: #dcfce7 !important;
  border-color: #4ade80 !important;
}

.review-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-add-feedback {
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.92rem;
  height: 42px;
  padding: 0 16px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.btn-add-feedback:hover {
  background: #0d5529;
}

.btn-toggle-review-mode {
  height: 42px;
  padding: 0 14px;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-toggle-review-mode:hover {
  border-color: var(--primary);
  background: #f8fafc;
}

.btn-toggle-review-mode.is-active {
  background: #fef2f2;
  border-color: #ef4444;
  color: #b91c1c;
  font-weight: 700;
}

.btn-toggle-all-markers {
  height: 42px;
  padding: 0 14px;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-toggle-all-markers:hover {
  border-color: #0284c7;
  background: #f0f9ff;
  color: #0369a1;
}

.btn-toggle-all-markers.is-hidden-mode {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #64748b;
}

/* ---------- Filters & Stats Bar ---------- */
.review-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
}

.filter-search-wrap {
  flex: 1 1 180px;
  min-width: 140px;
  position: relative;
}

.filter-search-input {
  width: 100%;
  height: 38px;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  font-size: 0.88rem;
  color: var(--text);
}

.filter-search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--text-secondary);
  pointer-events: none;
}

.filter-select {
  height: 38px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
  flex: 0 1 auto;
  min-width: 120px;
  max-width: 100%;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

.review-stats-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  font-size: 0.84rem;
  color: #4b5563;
  font-weight: 600;
}

.stat-pill {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 700;
}

.stat-pill.baru { background: #fee2e2; color: #b91c1c; }
.stat-pill.proses { background: #fef3c7; color: #b45309; }
.stat-pill.selesai { background: #dcfce7; color: #15803d; }

/* ---------- Table Responsive (Desktop & Tablet) ---------- */
/* ---------- Table Responsive (Desktop & Tablet) ---------- */
.review-table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.review-table-container::-webkit-scrollbar {
  height: 7px;
}
.review-table-container::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 4px;
}
.review-table-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.review-table-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.review-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84rem;
}

.review-table th {
  background: #f8fafc;
  padding: 12px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.review-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

/* Kolom Spesifik untuk Harmonisasi Lebar */
.review-table .col-no {
  width: 55px;
  text-align: center;
  font-weight: 800;
  color: #116834;
}

.review-table .col-date {
  width: 95px;
  white-space: nowrap;
  color: #64748b;
  font-size: 0.82rem;
}

.review-table .col-author {
  width: 160px;
  min-width: 140px;
}

.review-table .col-page {
  width: 120px;
  min-width: 110px;
}

.review-table .col-desc {
  min-width: 260px;
  max-width: 380px;
  line-height: 1.55;
  color: #1e293b;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.review-table .col-status {
  width: 110px;
  text-align: center;
}

.review-table .col-role {
  width: 125px;
  color: #64748b;
  font-size: 0.82rem;
}

.review-table .col-marker {
  width: 95px;
  text-align: center;
}

.review-table .col-actions {
  width: 145px;
  text-align: center;
}

.review-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.review-table tbody tr:hover {
  background: #f8fafc;
}

.review-table tbody tr.is-selected {
  background: #f0fdf4;
}

.table-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.table-status-badge.status-baru {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.table-status-badge.status-proses {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

.table-status-badge.status-selesai {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

.table-action-btns {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-table-action {
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
}

.btn-table-action:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0fdf4;
}

.btn-table-action.delete:hover {
  border-color: #ef4444;
  color: #dc2626;
  background: #fef2f2;
}

.btn-toggle-marker-visibility {
  min-width: 80px;
  justify-content: center;
}

.btn-toggle-marker-visibility.is-hidden {
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #cbd5e1;
}

.btn-toggle-marker-visibility.is-hidden:hover {
  background: #e2e8f0;
  color: #334155;
  border-color: #94a3b8;
}

/* ---------- Mobile Feedback Card List (< 768px) ---------- */
.review-mobile-list {
  display: none;
}

.feedback-card-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.feedback-card-item:hover,
.feedback-card-item.is-selected {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(17, 104, 52, 0.08);
}

.feedback-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feedback-card-no {
  font-size: 0.92rem;
  font-weight: 800;
  color: #116834;
}

.feedback-card-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.feedback-card-author {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.feedback-card-desc {
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.feedback-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ---------- Empty State ---------- */
.review-empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ---------- Modal Feedback Form ---------- */
.feedback-form-row {
  margin-bottom: 14px;
}

.feedback-form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.feedback-form-input,
.feedback-form-select,
.feedback-form-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 0.92rem;
  background: #ffffff;
  color: var(--text);
}

.feedback-form-input:focus,
.feedback-form-select:focus,
.feedback-form-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.feedback-form-textarea {
  min-height: 80px;
  resize: vertical;
}

.feedback-marker-coords {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS (UNIVERSAL MULTI-DEVICE)
   ============================================================ */

/* Mobile Navigation Switcher (Hanya Muncul di Layar Mobile < 768px) */
.mobile-workspace-nav {
  display: none;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 300;
  width: 100%;
}

.mobile-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #64748b;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-tab-btn.is-active {
  color: #116834;
  border-bottom-color: #116834;
  background: #f0fdf4;
}

.mobile-tab-badge {
  background: #116834;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Tablet & Split-Screen Desktop (768px – 1199px): Side-by-Side Adaptif */
@media (min-width: 768px) and (max-width: 1199px) {
  .workspace-layout {
    display: flex;
    flex-direction: row;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .workspace-preview-column {
    flex: 0 0 350px;
    width: 350px;
    min-width: 320px;
    max-width: 360px;
    padding: 16px 8px;
    background: #e8eaed;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
  }

  .workspace-preview-column .device-frame {
    width: 330px;
    height: 680px;
    max-height: calc(100dvh - 32px);
    border-radius: 36px;
    padding: 10px;
  }

  .workspace-preview-column .device-toolbar-container {
    width: 330px;
  }

  .workspace-review-column {
    flex: 1 1 auto;
    min-width: 0;
    width: 0;
    padding: 18px 20px 36px;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
  }

  .review-table-container {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
  }

  .review-mobile-list {
    display: none;
  }
}

/* Mobile Smartphone (< 768px): Fullscreen Native App + Tab Switcher Harmonis */
@media (max-width: 767px) {
  html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: #ffffff;
  }

  .mobile-workspace-nav {
    display: flex;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    height: 46px;
  }

  .workspace-layout {
    display: flex;
    flex-direction: column;
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100dvh - 46px) !important;
    height: calc(100vh - 46px) !important;
    overflow: hidden;
    background: #ffffff;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Mode 1: Mobile Prototype Preview */
  .workspace-layout.is-mobile-preview .workspace-preview-column {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    height: 100%;
    padding: 0;
    background: #ffffff;
    overflow: hidden;
  }

  .workspace-layout.is-mobile-preview .workspace-review-column {
    display: none !important;
  }

  .workspace-layout.is-mobile-preview .device-toolbar-container {
    width: 100%;
    padding: 6px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    box-sizing: border-box;
  }

  /* Mode 2: Mobile Catatan Review */
  .workspace-layout.is-mobile-review .workspace-preview-column {
    display: none !important;
  }

  .workspace-layout.is-mobile-review .workspace-review-column {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    height: 100%;
    padding: 14px 14px calc(24px + var(--safe-bottom));
    background: #f8fafc;
    overflow-y: auto;
    box-sizing: border-box;
  }

  .review-panel-head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
  }

  .review-title-group h2 {
    font-size: 1.18rem;
  }

  .review-title-group p {
    display: none;
  }

  .review-actions-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .btn-add-feedback {
    grid-column: span 2;
    width: 100%;
    height: 42px;
    font-size: 0.9rem;
    font-weight: 700;
    justify-content: center;
    border-radius: 8px;
  }

  .btn-toggle-all-markers,
  .btn-toggle-review-mode {
    width: 100%;
    height: 38px;
    font-size: 0.76rem;
    font-weight: 600;
    justify-content: center;
    text-align: center;
    border-radius: 6px;
    padding: 4px 6px;
  }

  .review-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-bottom: 14px;
  }

  .filter-search-wrap,
  .filter-select {
    width: 100%;
    box-sizing: border-box;
    height: 40px;
  }

  .review-stats-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 14px;
  }

  .review-stats-summary > div:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
  }

  .review-stats-summary > div:last-child {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .review-stats-summary > div:last-child button {
    width: 100%;
    height: 36px;
    justify-content: center;
    font-size: 0.8rem;
  }

  /* Sembunyikan tabel desktop pada mobile */
  .review-table-container {
    display: none !important;
  }

  /* List Card Mobile Harmonis */
  .review-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .feedback-card-item {
    width: 100%;
    box-sizing: border-box;
    padding: 14px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  }

  .feedback-card-desc {
    font-size: 0.86rem;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: anywhere;
    color: #334155;
  }

  .feedback-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* ============================================================
   Workspace Main Tabs & Flow Proses Section
   ============================================================ */
.workspace-main-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 20px;
  padding-bottom: 0;
  width: 100%;
  max-width: 100%;
  scrollbar-width: thin;
}

.workspace-main-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: all 0.18s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.workspace-main-tab-btn:hover {
  color: #116834;
  background: #f0fdf4;
}

.workspace-main-tab-btn.is-active {
  color: #116834;
  border-bottom-color: #116834;
  background: #f0fdf4;
}

.workspace-main-tab-btn .tab-badge {
  background: #e2e8f0;
  color: #334155;
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
}

.workspace-main-tab-btn.is-active .tab-badge {
  background: #116834;
  color: #ffffff;
}

.workspace-main-tab-btn .tab-badge-pulse {
  background: #dcfce7;
  color: #166534;
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid #86efac;
}

/* ---------- Flow Proses Section Styles ---------- */
.flow-process-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: tab-content-fade-in 0.2s ease;
}

@keyframes tab-content-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.flow-process-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.flow-process-title-group h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
}

.flow-process-title-group p {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
  line-height: 1.45;
}

.flow-process-stats {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.flow-stat-badge {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}

.flow-stat-badge.active {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.flow-stat-badge.analysis {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Filter Bar */
.flow-role-filter-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.flow-filters-left,
.flow-filters-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  margin-right: 2px;
}

.flow-role-pill {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.flow-role-pill:hover {
  border-color: #116834;
  color: #116834;
  background: #f0fdf4;
}

.flow-role-pill.is-active {
  background: #116834;
  color: #ffffff;
  border-color: #116834;
}

.btn-flow-control {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-flow-control:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Timeline Container & Cards */
.flow-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

.flow-step-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.flow-step-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.flow-step-card.is-active-module {
  border-left: 4px solid #116834;
}

.flow-step-card.is-analysis-module {
  border-left: 4px solid #94a3b8;
}

.flow-step-header-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
}

.flow-step-number-badge {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: #f8fafc;
  color: #1e293b;
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.flow-step-card.is-active-module .flow-step-number-badge {
  background: #f0fdf4;
  color: #116834;
  border-color: #bbf7d0;
}

.flow-step-main-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.flow-step-top-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.flow-step-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.flow-step-status-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.flow-step-status-tag.ready {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.flow-step-status-tag.analysis {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.flow-step-role-tag {
  font-size: 0.72rem;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}

.flow-step-desc {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.45;
}

.flow-step-meta-info {
  display: flex;
  gap: 14px;
  font-size: 0.76rem;
  color: #64748b;
  flex-wrap: wrap;
  margin-top: 2px;
}

.flow-step-meta-info strong {
  color: #1e293b;
}

.flow-step-meta-info code {
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
  color: #0f172a;
}

.flow-step-actions-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-flow-navigate {
  background: #116834;
  color: #ffffff;
  border: none;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-flow-navigate:hover {
  background: #0d5529;
}

.btn-flow-note {
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-flow-note:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Flowchart Toggle Row */
.flow-step-toggle-row {
  display: flex;
  align-items: center;
  padding-top: 2px;
}

.btn-toggle-flowchart {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-toggle-flowchart:hover {
  border-color: #116834;
  color: #116834;
  background: #f0fdf4;
}

.btn-toggle-flowchart.is-expanded {
  background: #116834;
  border-color: #116834;
  color: #ffffff;
}

.btn-toggle-flowchart .toggle-icon {
  font-size: 0.68rem;
}

/* Flowchart Stepper Box */
.flow-step-flowchart-box {
  margin-top: 4px;
  padding: 16px 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
  animation: fadeIn 0.2s ease-in-out;
}

.flowchart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
  gap: 8px;
}

.flowchart-heading {
  font-size: 0.86rem;
  font-weight: 700;
  color: #0f172a;
}

.flowchart-badge-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: 4px;
}

.flowchart-summary-text {
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.45;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  border-radius: 6px;
}

/* Stepper Vertical Tree Sequence */
.flowchart-stepper-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.flow-stepper-item {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.stepper-indicator-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 28px;
  flex-shrink: 0;
}

.stepper-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #116834;
  color: #116834;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  flex-shrink: 0;
}

.stepper-line {
  width: 2px;
  flex: 1;
  background: #cbd5e1;
  margin: 3px 0;
  min-height: 20px;
}

.stepper-content-col {
  flex: 1;
  min-width: 0;
  padding-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stepper-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.stepper-node-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
}

.stepper-type-pill {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
}

.stepper-type-pill.start {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.stepper-type-pill.decision {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.stepper-type-pill.end {
  color: #7e22ce;
  background: #faf5ff;
  border-color: #e9d5ff;
}

.stepper-actor-tag {
  font-size: 0.7rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
}

.stepper-desc {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.4;
}

.stepper-branch-alert {
  font-size: 0.73rem;
  color: #991b1b;
  background: #fff5f5;
  border: 1px solid #fecaca;
  padding: 4px 8px;
  border-radius: 4px;
  margin-top: 3px;
  line-height: 1.35;
}

/* 3-Column Meta Grid */
.flowchart-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
  width: 100%;
  box-sizing: border-box;
}

.flowchart-meta-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.flowchart-meta-box-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #1e293b;
}

.flowchart-meta-box-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.flowchart-meta-box-list li {
  font-size: 0.73rem;
  color: #475569;
  line-height: 1.35;
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.flowchart-meta-box-list li::before {
  content: "•";
  color: #116834;
  font-weight: bold;
}

/* Responsive Adaptive Rules */
@media (max-width: 1100px) {
  .flowchart-meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .flow-step-header-row {
    grid-template-columns: 36px 1fr;
    gap: 10px;
  }
  .flow-step-actions-cell {
    grid-column: span 2;
    width: 100%;
    margin-top: 6px;
  }
  .flow-step-actions-cell button {
    flex: 1;
  }
}/* ---------- Modern Enterprise Transaction Catalog & Management (TASK-UI-TRANSACTION-CATALOG-01) ---------- */
.tx-catalog-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

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

.tx-header-left {
  flex: 1 1 320px;
}

.tx-header-title {
  font-size: 1.65rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 6px 0;
}

.tx-header-subtitle {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

.tx-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-tx-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--primary, #116834);
  color: #ffffff;
  border: 1px solid var(--primary, #116834);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(17, 104, 52, 0.12);
  white-space: nowrap;
}

.btn-tx-primary:hover {
  background: #0d5529;
  border-color: #0d5529;
}

.btn-tx-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-tx-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-tx-destructive {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #ffffff;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-tx-destructive:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #b91c1c;
}

/* Context / Summary Strip */
.tx-context-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #475569;
}

.tx-context-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #0369a1;
}

.tx-context-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0284c7;
}

.tx-context-desc {
  color: #64748b;
  flex: 1;
}

/* Module Navigation */
.tx-modules-nav-wrap {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.tx-module-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  background: #ffffff;
  color: #64748b;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.tx-module-tab:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.tx-module-tab.is-active {
  background: #f0fdf4;
  color: #116834;
  font-weight: 700;
  border-color: #86efac;
  box-shadow: 0 1px 2px rgba(17, 104, 52, 0.08);
}

.tx-module-tab-icon {
  display: flex;
  align-items: center;
  color: currentColor;
}

.tx-module-tab-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
}

.tx-module-tab.is-active .tx-module-tab-count {
  background: #dcfce7;
  color: #166534;
}

/* Toolbar */
.tx-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tx-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 360px;
  min-width: 0;
  flex-wrap: wrap;
}

.tx-search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.tx-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.tx-search-input {
  width: 100%;
  height: 38px;
  padding: 8px 12px 8px 34px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #0f172a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.tx-search-input:focus {
  outline: none;
  border-color: var(--primary, #116834);
  box-shadow: 0 0 0 2px rgba(17, 104, 52, 0.12);
}

.tx-status-select {
  height: 38px;
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  box-sizing: border-box;
}

.tx-status-select:focus {
  outline: none;
  border-color: var(--primary, #116834);
}

.tx-btn-reset-search {
  height: 38px;
  padding: 0 12px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tx-btn-reset-search:hover {
  background: #e2e8f0;
}

.tx-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tx-metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  background: #f8fafc;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.tx-metric-badge.volume {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

/* Content Area Table Container */
.tx-content-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  width: 100%;
}

.tx-table-responsive {
  overflow-x: auto;
  width: 100%;
  scrollbar-width: thin;
}

/* Empty State */
.tx-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  min-height: 240px;
  box-sizing: border-box;
}

.tx-empty-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  margin-bottom: 12px;
}

.tx-empty-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px 0;
}

.tx-empty-desc {
  font-size: 0.84rem;
  color: #64748b;
  margin: 0 0 16px 0;
  max-width: 420px;
  line-height: 1.4;
}

.tx-empty-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Responsive Rules for Mobile */
@media (max-width: 768px) {
  .tx-catalog-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .tx-header-actions {
    justify-content: flex-start;
  }
  .tx-header-actions button {
    flex: 1 1 auto;
    justify-content: center;
  }
  .tx-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .tx-toolbar-left {
    flex-direction: column;
    align-items: stretch;
  }
  .tx-search-box {
    min-width: 100%;
  }
  .tx-toolbar-right {
    justify-content: space-between;
  }
}

/* ============================================================
   Flow Proses Aplikasi — 3-Tier Enterprise Architecture Styles
   ============================================================ */
.flow-app-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  animation: tab-content-fade-in 0.2s ease;
}

.flow-app-top-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.flow-app-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.flow-app-title-line h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.02em;
}

.flow-audit-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.flow-audit-badge.runtime {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
}

.flow-app-subtitle {
  font-size: 0.86rem;
  color: #64748b;
  margin: 0;
  line-height: 1.45;
}

.flow-category-switch-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.flow-cat-btn {
  padding: 7px 14px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.flow-cat-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}

.flow-cat-btn.is-active {
  background: #ffffff;
  color: #116834;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Sub-Navigation Bar */
.flow-sub-nav-bar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.sub-nav-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.flow-phase-chips-wrap,
.flow-role-chips-wrap,
.flow-module-chips-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.flow-phase-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #334155;
  white-space: nowrap;
}

.phase-num {
  background: #116834;
  color: #ffffff;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.7rem;
}

.flow-role-select-chip,
.flow-module-select-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.flow-role-select-chip:hover,
.flow-module-select-chip:hover {
  border-color: #116834;
  color: #116834;
  background: #f0fdf4;
}

.flow-role-select-chip.is-active,
.flow-module-select-chip.is-active {
  background: #116834;
  color: #ffffff;
  border-color: #116834;
}

.flow-role-select-chip.is-active .chip-status-tag {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.chip-status-tag {
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 4px;
}

.chip-status-tag.ok {
  background: #dcfce7;
  color: #166534;
}

.chip-status-tag.dev {
  background: #f1f5f9;
  color: #64748b;
}

.mod-code {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.7rem;
}

.flow-module-select-chip.is-active .mod-code {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.module-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.module-search-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.flow-module-search-input {
  padding: 5px 28px 5px 10px;
  font-size: 0.78rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  width: 220px;
}

.flow-module-search-input:focus {
  border-color: #116834;
}

.btn-clear-search {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

/* Header Card */
.flow-header-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.flow-header-card.is-dev-card {
  background: #fafafa;
  border-left: 4px solid #94a3b8;
}

.flow-header-main-col {
  flex: 1 1 500px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-header-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.flow-verif-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.flow-verif-pill.verified {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.flow-verif-pill.dev {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.flow-route-pill {
  font-size: 0.74rem;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: 4px;
}

.flow-route-pill code {
  color: #0f172a;
  font-weight: 700;
}

.flow-category-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: 4px;
}

.flow-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}

.flow-card-objective {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.45;
  margin: 0;
}

.flow-card-roles-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 2px;
}

.role-actor-chip {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.flow-header-actions-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.btn-open-in-phone {
  background: #116834;
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-open-in-phone:hover {
  background: #0d5529;
}

.view-mode-toggle-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  padding: 3px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.view-mode-btn {
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 4px;
  cursor: pointer;
}

.view-mode-btn.is-active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Diagram Visual Swimlane */
.flow-diagram-wrapper {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.flow-diagram-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.diagram-instruction-text {
  font-size: 0.76rem;
  color: #64748b;
  line-height: 1.4;
}

.diagram-zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-diagram-zoom {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
}

.btn-diagram-zoom.reset {
  width: auto;
  padding: 0 8px;
  font-size: 0.72rem;
}

.btn-diagram-zoom:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.zoom-display {
  font-size: 0.76rem;
  font-weight: 700;
  color: #475569;
  min-width: 42px;
  text-align: center;
}

/* Canvas Area */
.flow-diagram-canvas-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 18px;
  min-height: 380px;
  box-sizing: border-box;
}

.flow-swimlane-container {
  display: flex;
  align-items: stretch;
  gap: 16px;
  min-width: 780px;
  transition: transform 0.15s ease;
}

.flow-swimlane-col {
  flex: 1 1 260px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.flow-swimlane-header {
  background: #f1f5f9;
  border-bottom: 2px solid #cbd5e1;
  padding: 10px 14px;
  border-radius: 7px 7px 0 0;
  text-align: center;
}

.swimlane-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.01em;
}

.flow-swimlane-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

/* Node Cards */
.flow-node-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.flow-node-card:hover {
  border-color: #116834;
  box-shadow: 0 3px 10px rgba(17, 104, 52, 0.12);
  transform: translateY(-2px);
}

.flow-node-card.is-selected {
  border: 2px solid #116834;
  background: #f0fdf4;
  box-shadow: 0 4px 12px rgba(17, 104, 52, 0.16);
}

.flow-node-card.node-start {
  border-top: 4px solid #16a34a;
  border-radius: 12px;
}

.flow-node-card.node-end {
  border-top: 4px solid #7c3aed;
  border-radius: 12px;
}

.flow-node-card.node-decision {
  border-top: 4px solid #d97706;
  background: #fffdfa;
}

.node-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.node-id-tag {
  font-size: 0.68rem;
  font-weight: 800;
  background: #f1f5f9;
  color: #334155;
  padding: 1px 6px;
  border-radius: 4px;
}

.node-type-pill {
  font-size: 0.66rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.node-label-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

.node-desc-text {
  font-size: 0.77rem;
  color: #475569;
  line-height: 1.4;
}

.node-branch-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 5px;
  padding: 5px 8px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.72rem;
  color: #92400e;
  line-height: 1.35;
}

.branch-icon {
  font-size: 0.75rem;
  flex-shrink: 0;
}

.node-connectors-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
}

.connector-line-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
}

.connector-line-pill.yes {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.connector-line-pill.no,
.connector-line-pill.return {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
  border-style: dashed;
}

.connector-arrow {
  color: #116834;
  font-size: 0.75rem;
}

.connector-line-pill.return .connector-arrow {
  color: #991b1b;
}

.connector-target {
  color: #94a3b8;
  font-weight: 400;
}

/* Node Inspector Panel */
.flow-node-inspector-panel {
  background: #ffffff;
  border: 1px solid #116834;
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(17, 104, 52, 0.1);
  animation: tab-content-fade-in 0.18s ease;
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}

.inspector-badge {
  font-size: 0.7rem;
  font-weight: 800;
  background: #116834;
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.inspector-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
  margin: 3px 0 0 0;
}

.btn-close-inspector {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
}

.inspector-body-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.inspector-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inspector-item.full-width {
  grid-column: span 2;
}

.inspector-item.branch-highlight {
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 8px 10px;
  border-radius: 6px;
}

.inspector-item-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.inspector-item-val {
  font-size: 0.8rem;
  color: #1e293b;
  line-height: 1.4;
}

.inspector-footer-action {
  display: flex;
  justify-content: flex-end;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
}

.btn-inspector-navigate {
  background: #116834;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

/* Steps Breakdown View */
.flow-steps-table-wrapper {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.steps-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}

.steps-table-header h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.steps-count-badge {
  font-size: 0.74rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  padding: 2px 8px;
  border-radius: 4px;
}

.flow-steps-vertical-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-breakdown-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.step-breakdown-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.step-bubble {
  width: 32px;
  height: 32px;
  background: #f0fdf4;
  border: 2px solid #116834;
  color: #116834;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-main-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.step-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.step-actor-tag {
  font-size: 0.7rem;
  background: #f1f5f9;
  color: #475569;
  padding: 1px 6px;
  border-radius: 4px;
}

.step-status-tag {
  font-size: 0.68rem;
  font-weight: 700;
  background: #e0f2fe;
  color: #0369a1;
  padding: 1px 6px;
  border-radius: 4px;
}

.step-desc-p {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.45;
  margin: 0;
}

.step-branch-alert {
  font-size: 0.74rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 4px 8px;
  border-radius: 4px;
  margin-top: 3px;
}

.btn-step-open {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #116834;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-step-open:hover {
  background: #f0fdf4;
  border-color: #116834;
}

/* Mermaid Flowchart Canvas & Renderer */
.mermaid-diagram-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 100%;
  width: max-content;
  margin: 0 auto;
}

.mermaid-flow-renderer {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mermaid-flow-renderer svg {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.04));
}

.mermaid-loading-state {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 40px;
}

.loading-spinner-inline {
  width: 16px;
  height: 16px;
  border: 2px solid #cbd5e1;
  border-top-color: #116834;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.mermaid-error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 16px;
  color: #991b1b;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}

.mermaid-error-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.mermaid-error-msg {
  font-size: 0.8rem;
  margin-bottom: 10px;
  font-family: monospace;
}

.mermaid-code-fallback {
  background: #ffffff;
  border: 1px solid #fee2e2;
  border-radius: 6px;
  padding: 10px;
  font-size: 0.75rem;
  overflow-x: auto;
  max-height: 200px;
}

/* Section 6: Bukti Sumber & Ketertelusuran Kode Aktual */
.flow-traceability-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #116834;
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.traceability-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.traceability-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.traceability-icon {
  font-size: 1rem;
}

.traceability-title-row h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}

.traceability-status-tag {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.traceability-status-tag.verified {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.traceability-status-tag.partial {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.traceability-subtitle {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

.traceability-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  padding: 10px 14px;
}

.traceability-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.traceability-col-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
}

.traceability-file-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.traceability-file-list li code {
  font-size: 0.74rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  color: #0f172a;
  display: inline-block;
  word-break: break-all;
}

.traceability-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.handler-tag code {
  font-size: 0.72rem;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.traceability-relation-box {
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.5;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
}

.traceability-relation-box strong {
  color: #0f172a;
  display: block;
  margin-bottom: 2px;
}

.traceability-relation-box p {
  margin: 0;
}

.traceability-unverified-alert {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.76rem;
  line-height: 1.4;
}

/* 4-Box Technical Metadata */
.flow-metadata-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.metadata-section-title h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 2px 0;
}

.metadata-section-title p {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
}

.flow-meta-4grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.flow-meta-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.flow-meta-card.warning-tint {
  background: #fffdf9;
  border-color: #fed7aa;
}

.meta-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 6px;
}

.flow-meta-card.warning-tint .meta-card-head {
  border-bottom-color: #ffedd5;
}

.meta-icon {
  font-size: 0.85rem;
}

.meta-card-head h5 {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}

.meta-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-list li {
  font-size: 0.74rem;
  color: #475569;
  line-height: 1.35;
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.meta-list li::before {
  content: "•";
  color: #116834;
  font-weight: bold;
}

.meta-list.rule-list li::before {
  color: #d97706;
}

.meta-list.limitation-list li::before {
  color: #ea580c;
}

.status-tags-cloud {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.status-tag-item {
  font-size: 0.68rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #334155;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

/* Dev Placeholder Box */
.flow-dev-placeholder-box {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 36px 20px;
  text-align: center;
}

.dev-placeholder-content {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.dev-placeholder-icon {
  font-size: 2.2rem;
}

.dev-placeholder-content h4 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.dev-placeholder-content p {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
}

.dev-placeholder-note {
  font-size: 0.78rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  border-radius: 6px;
  color: #475569;
  margin-top: 6px;
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 1024px) {
  .flow-meta-4grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .flow-app-top-header {
    flex-direction: column;
    align-items: stretch;
  }
  .flow-category-switch-bar {
    width: 100%;
    justify-content: stretch;
  }
  .flow-cat-btn {
    flex: 1;
    text-align: center;
  }
  .flow-header-card {
    flex-direction: column;
    align-items: stretch;
  }
  .flow-header-actions-col {
    align-items: stretch;
    flex-direction: row;
    justify-content: space-between;
  }
  .flow-meta-4grid {
    grid-template-columns: 1fr;
  }
  .inspector-body-grid {
    grid-template-columns: 1fr;
  }
  .inspector-item.full-width {
    grid-column: span 1;
  }
  .step-breakdown-row {
    grid-template-columns: 28px 1fr;
  }
  .step-action-col {
    grid-column: span 2;
    margin-top: 6px;
  }
}
