body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Сделать верхнее меню чуть мягче */
.nav-link-soft {
    color: rgba(255, 255, 255, 0.85) !important;
}
.navbar-text-soft {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Таблица паспортов */
.table-passports tbody tr:hover {
    background-color: #f8f9fa;
}

/* Блок с ссылкой на разработчика */
.dev-link {
    color: #000 !important;
    font-weight: 700 !important;
    cursor: pointer;
    text-decoration: none !important;
    transition: color 0.2s ease, transform 0.2s ease;
}

.dev-icon {
    width: 14px !important;
    height: 14px !important;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.dev-link:hover {
    color: rgba(13, 110, 253, 0.75) !important;
    text-decoration: underline !important;
    transform: scale(1.02);
}

.dev-link:hover .dev-icon {
    transform: scale(1.15);
    filter: drop-shadow(0 0 3px rgba(13, 110, 253, 0.4));
}

/* Мини-оформление «обложки паспорта» на главной */
.passport-cover {
    background: #fff;
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 12px;
    padding: 12px 14px;
}
.passport-cover .pc-line {
    border-bottom: 1px solid rgba(0,0,0,.15);
    padding-bottom: 2px;
    margin: 6px 0;
    min-height: 18px;
}
.passport-cover .pc-title {
    font-weight: 800;
    letter-spacing: .04em;
}
.passport-cover .pc-muted {
    color: rgba(0,0,0,.55);
    font-size: 12px;
}

/* Режим «просмотра» для одиночных разделов паспорта */
.doc-field {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,.08);
}
.doc-field:last-child {
    border-bottom: none;
}
.doc-label {
    font-weight: 650;
    line-height: 1.25;
}
.doc-code {
    font-size: 12px;
    color: #dc3545;
    margin-top: 2px;
}
.doc-value {
    margin-top: 6px;
    white-space: pre-wrap;
}
.doc-empty {
    color: rgba(0,0,0,.35);
    font-style: italic;
}


/* Neutral table name hint under scheme block titles */
.table-hint{
    margin-top: 2px; /* slightly tighter */
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #6c757d; /* neutral */
}

/* Плавная стрелка раскрытия краткой информации */
.collapse-toggle .collapse-chevron{
    transition: transform .2s ease, opacity .2s ease;
    opacity: .75;
}
.collapse-toggle[aria-expanded="true"] .collapse-chevron{
    transform: rotate(180deg);
    opacity: 1;
}


/* Краткая информация в одну строку */
.brief-inline { white-space: nowrap; }
.brief-toggle-btn[aria-expanded="true"] i { transform: rotate(180deg); }
.brief-toggle-btn i { transition: transform 0.2s ease; }

/* ===== Minimal editor UI (section_edit.php, multi_table.php) ===== */
.editor-topbar{
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: 14px;
  padding: 14px 16px;
}
.editor-topbar code{
  font-size: 0.85em;
}

.doc-field{
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.doc-label{
  font-weight: 600;
  margin-bottom: 6px;
}
.doc-value{
  font-size: 0.95rem;
}
.doc-empty{
  color: rgba(0,0,0,0.55);
}

/* Если где-то ещё используется отображение кода поля — делаем нейтральным */
.doc-code{
  color: var(--soft-blue) !important;
  margin-top: 0;           /* tighter by ~30% */
  font-size: .78rem;
  line-height: 1.15;
}
.doc-code code{
  color: var(--soft-blue) !important;
  background: var(--soft-blue-bg);
  border: 1px solid rgba(13,110,253,.12);
  border-radius: 10px;
  padding: 1px 8px;
}
/* ===== Field blocks editor (designer) ===== */
.two-col-group{
  position: relative;
  margin-bottom: 1rem;
}
@media (min-width: 992px){
  .two-col-group::before{
    content:"";
    position:absolute;
    top: 1rem;
    bottom:0;
    left:50%;
    width:1px;
    background: rgba(0,0,0,.08);
    transform: translateX(-0.5px);
    pointer-events:none;
  }
  /* create a bit more breathing room around the divider */
  .two-col-group > .row > [class*="col-"]:nth-child(odd){
    padding-right: 22px;
  }
  .two-col-group > .row > [class*="col-"]:nth-child(even){
    padding-left: 22px;
  }
}

/* legacy: keep class but without global divider */
.editor-fields-grid{
  position: relative;
}

.field-block{
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.field-block .form-control,
.field-block .form-select{
  font-size: 0.98rem;
  line-height: 1.35;
  padding-top: .6rem;
  padding-bottom: .6rem;
}
.field-block textarea.form-control{
  resize: vertical;
}
.field-block:hover{
  transform: translateY(-1px);
  box-shadow: 0 .6rem 1.6rem rgba(0,0,0,.08);
  border-color: rgba(13,110,253,.35);
}
.field-block:focus-within{
  box-shadow: 0 .8rem 2rem rgba(13,110,253,.12);
  border-color: rgba(13,110,253,.55);
}
.field-block-value{
  color: rgba(0,0,0,.88);
}


/* ===== Editor Ideal UI tweaks (v11.3.16) ===== */
:root{
  /* very soft accent (light theme) */
  --soft-blue: rgba(13,110,253,.78);
  --soft-blue-bg: rgba(13,110,253,.10);
}

/* make it readable in dark mode too */
@media (prefers-color-scheme: dark){
  :root{
    --soft-blue: rgba(115, 170, 255, .95);
    --soft-blue-bg: rgba(115, 170, 255, .18);
  }
}

/* btn-editor legacy: neutral */
.btn-editor{font-size: inherit; padding: inherit; border-radius: inherit;}
.btn-editor i{font-size: inherit;}

/* right-aligned group helper */
.editor-actions-right{
  margin-left: auto;
  justify-content: flex-end;
}

/* soft accent for meta values (table/db/id) */
.meta-softblue,
.meta-softblue code{
  color: var(--soft-blue) !important;
}
.meta-softblue code{
  background: var(--soft-blue-bg);
  border: 1px solid rgba(13,110,253,.12);
  border-radius: 10px;
  padding: 2px 8px;
}

/* field technical name (manufacturer_and_address etc.) */
.doc-code{
  color: var(--soft-blue) !important;
  margin-top: 0 !important;   /* tighter spacing (requested) */
}
.doc-code code{ color: var(--soft-blue) !important; }

/* slightly tighter gap between title and db-name in block cards */
.field-block .fw-semibold{
  margin-bottom: 0 !important; /* reduce distance to technical name */
}

/* compact (single-line) textarea for short fields like crane_purpose */
.textarea-compact{
  min-height: 42px !important;
  resize: vertical;
}

/* passport.php section cards: show table/db hints in the same soft-blue */
.section-table-hint,
.section-table-hint code{
  color: var(--soft-blue) !important;
}


.field-compact .form-control,
.field-compact .form-select{
  padding-top: .42rem;
  padding-bottom: .42rem;
  font-size: .92rem;
}
.field-compact textarea.form-control{
  min-height: 90px;
}

/* meta-softblue should not force pill look */
.meta-softblue code{background: transparent; border:0; padding:0; border-radius:0;}

/* ===== v11.4.3 UI fixes ===== */

/* index.php: keep headers in one line */
.nowrap{ white-space: nowrap; }
th.nowrap{ font-size: .9rem; }

/* Editor: big surface container for all field blocks + bottom save */
.editor-surface{
  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  border-radius: .375rem; /* same as default buttons */
  padding: 16px;
}

/* Make spacing consistent between any groups (short/long/mixed) */
.editor-fields-wrap > .two-col-group,
.editor-fields-wrap > .one-col-group{
  margin-bottom: 1rem;
}
.editor-fields-wrap > .two-col-group:last-child,
.editor-fields-wrap > .one-col-group:last-child{
  margin-bottom: 0;
}

/* bottom actions inside the same surface */
.editor-bottom-actions{
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0,0,0,.08);
  display:flex;
  justify-content:flex-end;
  gap:.5rem;
}


/* ===== Index page actions (v11.5.1) ===== */
.nowrap{ white-space: nowrap; }
.table thead th.nowrap{ font-size: 0.95rem; }

.actions-cell{ white-space: nowrap; }

/*
  В обычном состоянии: 3 компактные иконки (квадраты) с отступом.
  При наведении на любую: иконки "сливаются" в одну кнопку по ширине всех трёх,
  появляется текст, иконка остаётся.
*/
.actions-fuse{
  --btn: 38px;
  --gap: 10px;
  display:inline-flex;
  align-items:center;
  gap: var(--gap);
  width: calc(var(--btn) * var(--count) + var(--gap) * (var(--count) - 1));
}

.fbtn{
  flex: 0 0 var(--btn);
  width: var(--btn);
  height: var(--btn);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 0; /* keep icon perfectly centered when label is hidden */
  padding: 0;
  text-decoration:none;
  background:#fff;
  border: 1px solid var(--accent, currentColor);
  border-radius: calc(.375rem + 5px); /* +5px as requested */
  overflow:hidden;
  transition: width .22s ease, flex-basis .22s ease, padding .22s ease, background-color .18s ease, color .18s ease, border-color .18s ease, opacity .18s ease;
}

.fbtn .ico{ display:inline-flex; width:18px; height:18px; flex:0 0 auto; }
.fbtn .lbl{
  opacity:0;
  max-width:0;
  overflow:hidden;
  white-space:nowrap;
  transform: translateX(-6px);
  transition: opacity .18s ease, max-width .22s ease, transform .18s ease;
  font-size: 13px;
  font-weight: 700;
  margin-left: 0;
}

.fbtn-open{ --accent:#0d6efd; color: var(--accent); }
.fbtn-edit{ --accent:#6c757d; color: var(--accent); }
.fbtn-delete{ --accent:#dc3545; color: var(--accent); }

/* Режим "слияния" по hover/focus */
.actions-fuse:is(:has(.fbtn:hover), :has(.fbtn:focus-visible)){
  gap: 0;
}

.actions-fuse:is(:has(.fbtn:hover), :has(.fbtn:focus-visible)) .fbtn:not(:hover):not(:focus-visible){
  flex-basis: 0;
  width: 0;
  padding: 0;
  border-width: 0;
  opacity: 0;
}

.actions-fuse:is(:has(.fbtn:hover), :has(.fbtn:focus-visible)) .fbtn:hover,
.actions-fuse:is(:has(.fbtn:hover), :has(.fbtn:focus-visible)) .fbtn:focus-visible{
  flex: 1 1 auto;
  width: 100%;
  justify-content:center;
  padding: 0 14px;
  background: var(--accent);
  color:#fff;
  border-color: var(--accent);
  gap: 10px;
}

.actions-fuse:is(:has(.fbtn:hover), :has(.fbtn:focus-visible)) .fbtn:hover .lbl,
.actions-fuse:is(:has(.fbtn:hover), :has(.fbtn:focus-visible)) .fbtn:focus-visible .lbl{
  opacity:1;
  max-width: 140px;
  transform:none;
  margin-left: 0;
}

/* Клавиатурный фокус */
.fbtn:focus-visible{
  outline: 3px solid rgba(13,110,253,.20);
  outline-offset: 2px;
}
