#synchro-loading {
  display: none;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px 24px;
  text-align: center;
  border: 1px solid #e8e8e4;
  color: #111111;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  font-family: var(--font-family-medium);
}

.synchro-backdrop {
  z-index: 90000;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.synchro-dialog {
  z-index: 90001;
  background-color: #ffffff;
  border: 1px solid var(--c-border-primary);
  border-radius: 16px;
  outline: none;
  overflow: hidden;
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.15);
  font-family: var(--font-family);
}

.synchro-dialog-header {
  padding: 24px 32px;
  border-bottom: 1px solid #f0f0ed;
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}

.synchro-tabs ul {
  display: inline-flex;
  list-style: none;
  padding: 4px;
  background: #f4f4f2;
  border-radius: 14px;
  margin-bottom: 24px;
  border: 1px solid #e8e8e4;
}

.synchro-tabs ul li a {
  display: block;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: #888884;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none !important;
  cursor: pointer;
}

.synchro-tabs ul li.active a {
  background: #ffffff;
  color: #111;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0,0,0,0.05);
  transform: translateY(-1px);
}

/* ==========================================================================
   UNIQUE COMPONENT DIALOG DESIGN
   ========================================================================== */

/* ==========================================================================
   COMPONENT DIALOG DESIGN (Standardized)
   ========================================================================== */

.synchro-dialog-component {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important; 
  transform: translate(-50%, -50%) !important;
  width: 800px !important; 
  max-width: 95vw !important;
  max-height: 90vh !important;
  height: auto !important;
  margin: 0 !important;
  border-radius: 12px !important;
  border: 1px solid #eef0f2 !important;
  background: #ffffff !important; 
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.15) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  animation: synchro-modal-zoom 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  z-index: 100000 !important; 
}

@keyframes synchro-modal-zoom {
  from { opacity: 0; transform: translate(-50%, -45%) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.synchro-dialog-component .synchro-dialog-header {
  padding: 24px 28px !important;
  background: #ffffff !important;
  border-bottom: 1px solid #f0f0ed !important;
  border-radius: 0 !important;
  cursor: default !important; 
  flex-shrink: 0;
  display: flex !important;
  flex-direction: row !important; /* Title left, Close right */
  justify-content: space-between !important;
  align-items: center !important;
}

.synchro-dialog-component .synchro-dialog-close {
  font-size: 20px !important;
  color: #8a8a88 !important;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  order: 2 !important; /* Always second */
  cursor: pointer;
  text-decoration: none !important;
  margin-left: 20px !important;
}

.synchro-dialog-component .synchro-dialog-close:hover {
  background: #f4f4f2 !important;
  color: #111 !important;
}

.synchro-dialog-component .synchro-dialog-title-wrapper {
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start !important;
  gap: 2px;
  flex: 1;
  order: 1 !important; /* Always first */
}

.synchro-dialog-component .synchro-dialog-header h3 {
  font-size: 18px !important;
  font-weight: 700 !important;
  margin: 0 !important;
  line-height: normal !important;
  color: #111 !important;
  letter-spacing: -0.01em !important;
}

.synchro-dialog-component .synchro-dialog-subtitle {
  font-size: 11px !important;
  font-weight: 500 !important;
  color: #8a8a88 !important;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  display: block !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  box-shadow: none !important;
}

.synchro-dialog-subtitle {
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #111 !important;
  background: #f4f4f2 !important;
  border: 1px solid #e8e8e4 !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  display: inline-block !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  margin: 0 !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.synchro-dialog-subtitle:hover {
  background: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
}

.synchro-dialog-component .synchro-dialog-body {
  padding: 0 !important; 
  background: #ffffff !important;
  flex: 1 1 auto !important;
  overflow-y: auto !important;
}

.synchro-dialog-component .synchro-dialog-footer {
  padding: 16px 24px !important;
  background: #ffffff !important;
  border-top: 1px solid #f0f0ed !important;
  border-radius: 0 !important;
  flex-shrink: 0;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 12px !important;
}

.synchro-dialog-component .synchro-dialog-footer > div {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important; /* Forces one line */
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
}

/* Cleanup generic UI blocks from backend.css */
.synchro-dialog-component .ui-block {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.synchro-dialog-component .ui-tabs {
  padding: 0 !important;
}

.synchro-dialog-component .ui-tabs-nav {
  display: flex !important;
  gap: 12px !important;
  padding: 24px 28px !important;
  margin: 0 !important;
  background: transparent !important;
  border-bottom: 1px solid #f0f0ed !important;
}

.synchro-dialog-component .ui-tabs-nav li {
  margin: 0 !important;
}
.synchro-dialog-component .ui-tabs-nav li a {
  padding: 10px 24px !important;
  color: #111 !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  border: 1px solid #eef0f2 !important;
  border-radius: 100px !important; /* Pill style */
  background: #ffffff !important;
  display: block !important;
  transition: all 0.2s ease;
}

.synchro-dialog-component .ui-tabs-nav li.active a,
.synchro-dialog-component .ui-tabs-nav li.ui-state-active a {
  background: #ffffff !important;
  border-color: #111 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

/* --------------------------------------------------------------------------
   NEW FORM LOGIC: Compact Sidebar Look
   -------------------------------------------------------------------------- */
/* --- Internal forms inherit global styles --- */
.synchro-dialog-component .ui-form {
  padding: 0 !important;
  background: transparent !important;
}

.synchro-dialog-component input[type="text"],
.synchro-dialog-component input[type="password"],
.synchro-dialog-component input[type="number"],
.synchro-dialog-component textarea,
.synchro-dialog-component select,
.synchro-dialog-component .nice-select {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  background: #fdfdfc !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  font-size: 13.5px !important;
  color: #111 !important;
  transition: all 0.2s ease !important;
}

.synchro-dialog-component input:focus,
.synchro-dialog-component textarea:focus,
.synchro-dialog-component .nice-select.open,
.synchro-dialog-component select[multiple]:focus {
  background: #fff !important;
  border-color: #111 !important;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05) !important;
}

.synchro-dialog-component select[multiple] {
  height: auto !important;
  min-height: 120px !important;
  padding: 6px !important;
}

.synchro-dialog-component select[multiple] option {
  padding: 8px 12px !important;
  border-radius: 6px !important;
  margin-bottom: 2px !important;
}

.synchro-dialog-component .nice-select {
  height: auto !important;
  line-height: inherit !important;
}

.synchro-dialog-component .nice-select .current {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  padding-right: 16px;
}

.synchro-dialog-component .nice-select::after {
  right: 12px !important;
  border-color: #888 !important;
  width: 5px !important;
  height: 5px !important;
}

/* Switches */
.synchro-dialog-component .ui-form-row:has(.checkbox.switch) {
  flex-direction: row !important;
}

/* Dialog component — inherits from unified button system in backend.css */


/* Glass effect for backdrop */
.synchro-backdrop {
  background-color: rgba(255, 255, 255, 0.3) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
}

.synchro-dialog-header .synchro-dialog-close {
  display: block;
  font-size: 24px;
  line-height: 1;
  text-decoration: none;
  color: #888888;
  cursor: pointer;
  transition: all 0.2s;
}

.synchro-dialog-header .synchro-dialog-close:hover {
  color: #111;
  background: transparent;
}

.synchro-dialog-body {
  position: relative;
  overflow-y: auto;
  max-height: 80vh;
  font-size: 14px;
  line-height: 1.6;
  color: #111111;
  padding: 24px 32px;
}

.synchro-dialog-footer {
  padding: 24px 32px;
  display: flex !important;
  justify-content: center !important;
  /* Premium Centered Buttons */
  gap: 16px !important;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid #f0f0ed;
}

.synchro-dialog-footer .synchro-button,
.synchro-dialog-footer button:not(.tox *) {
  min-width: 120px !important;
  height: 44px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border-radius: var(--border-radius-pill, 100px) !important;
}

/* Button base — визначено в backend.css (UNIFIED BUTTON SYSTEM).
   Тут лише специфічні overrides для синхро-діалогів. */

/* Secondary / Cancel Style (Outline) — кнопка «Закрити» */
.synchro-button.synchro-dialog-close,
.synchro-dialog-footer .synchro-button.synchro-dialog-close,
.synchro-dialog-footer .synchro-button.blue {
  background-color: transparent !important;
  color: #111 !important;
  border: 1px solid #e8e8e4 !important;
  background: transparent !important; /* Force transparent for outlined */
}

/* Primary Action: Solid Accent (Black) */
.synchro-dialog-footer .synchro-button.green {
  background: #111 !important;
  color: #fff !important;
  font-weight: 700 !important;
}

.synchro-button.synchro-dialog-close:hover {
  background-color: #f4f4f2 !important;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
}

.synchro-toast {
  pointer-events: auto;
  min-width: 320px;
  background: #ffffff;
  border: 1px solid #e8e8e4;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-family-medium);
}
/* Detailed Inputs for components */
.synchro-dialog-component .synchro-form-table select,
.synchro-dialog-component .synchro-form-table input[type="text"],
.synchro-dialog-component .synchro-form-table input[type="number"],
.synchro-dialog-component .synchro-form-table textarea {
  max-width: 100% !important;
  border-radius: 12px !important;
  font-family: var(--font-family) !important;
}

.ui-config-placeholder {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 60px 40px !important;
  text-align: center !important;
  opacity: 0;
  animation: synchro-fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  animation-delay: 0.2s !important;
}

@keyframes synchro-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ui-config-placeholder-icon {
  width: 64px;
  height: 64px;
  background: #f4f4f2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: #a1a19f;
  font-size: 24px;
  border: 1px solid #e8e8e4;
}

.ui-config-placeholder-title {
  font-family: var(--font-family-semibold);
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin-bottom: 8px;
}

.ui-config-placeholder-desc {
  font-size: 13px;
  color: #8a8a88;
  line-height: 1.6;
  max-width: 320px;
}

.synchro-dialog-component .synchro-dialog-footer {
  padding: 20px 28px !important;
  background: #ffffff !important;
  border-top: 1px solid #f0f0ed !important;
  border-radius: 0 !important;
  flex-shrink: 0;
  display: flex !important;
  justify-content: flex-end !important;
  gap: 12px !important;
}
