/* P04 shell: replaces the legacy sidebar skin; existing form layouts are retained. */
:root {
  --ink: #19243a; --muted: #607089; --canvas: #f6f8fb; --panel: #fff;
  --panel-strong: #f1f5fa; --line: #dce3ee; --blue: #0759d5;
  --green: #146a4b; --green-soft: #e5f5ed; --amber: #825700;
  --amber-soft: #fff4ce; --red: #a22e32; --red-soft: #fff0f0;
  --radius-lg: 12px; --radius-md: 10px; --radius-sm: 8px;
  --shadow: 0 6px 20px rgb(25 36 58 / 5%);
}
body { background: var(--canvas); font-family: "Bahnschrift", "Aptos", sans-serif; }
.cms-workbench.app-shell { display: block; min-height: 100dvh; }
.cms-workbench [hidden] { display: none !important; }
.cms-workbench .content { min-width: 0; padding: 28px 32px 48px; max-width: 1920px; margin: auto; }
.cms-global-header {
  min-height: 76px; padding: 12px 28px; display: flex; align-items: center;
  gap: 32px; border-bottom: 1px solid var(--line); background: white;
  position: relative; z-index: 30;
}
.cms-global-header .brand { color: var(--green); flex-shrink: 0; gap: 10px; }
.cms-global-header .brand strong { font-size: 23px; letter-spacing: -.8px; }
.cms-global-header .brand small { font-size: 11px; color: var(--muted); }
.cms-global-header .brand-mark { width: 32px; height: 32px; box-shadow: none; border-radius: 0; background: url('./assets/travel-ua-mark.svg') center / contain no-repeat; }
.cms-global-header .user-chip { margin-left: auto; border: none; background: none; padding: 0; box-shadow: none; flex-shrink: 0; }
.cms-global-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cms-global-nav .nav-item, .cms-nav-group > summary {
  width: auto; min-height: 44px; padding: 10px 14px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: var(--ink);
  font-size: 14px; font-weight: 600; cursor: pointer; text-align: left;
}
.cms-global-nav .nav-item::before, .cms-global-nav .nav-item::after { content: none; }
.cms-global-nav .nav-item.active, .cms-nav-group.has-current-view > summary { background: #edf4ff; color: #0759d5; }
.cms-nav-group { position: relative; }
.cms-nav-group > summary { display: list-item; list-style-position: inside; }
.cms-nav-menu { position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px; max-width: calc(100vw - 32px); padding: 8px; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 28px rgb(25 36 58 / 12%); }
.cms-nav-menu .nav-item { display: flex; width: 100%; }
.cms-workbench :is(button, input, select, summary, a):focus-visible { outline: 3px solid #0759d5; outline-offset: 3px; }
.cms-workbench :is(button, input, select) { min-height: 44px; }
.cms-workbench :is(input, select, textarea) { border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); }
.cms-workbench .topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; padding: 0; margin: 0 0 18px; border: 0; border-radius: 0; background: none; box-shadow: none; }
.cms-workbench .topbar h1 { margin: 6px 0 8px; font-size: clamp(26px, 3vw, 36px); letter-spacing: -1px; }
.cms-workbench .topbar p { margin: 0; max-width: 70ch; color: var(--muted); font-size: 14px; }
.cms-workbench .topbar .eyebrow { font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.cms-workbench .topbar-actions { gap: 8px; flex-wrap: wrap; }
.cms-workbench .search-field { min-width: 0; max-width: 240px; box-shadow: none; background: white; }
.cms-workbench .search-field input { border: 0; background: transparent; box-shadow: none; min-width: 0; }
@media (min-width: 761px) and (max-width: 1400px) {
  .cms-workbench .topbar-actions { flex: 1 1 100%; width: 100%; justify-content: flex-start; }
}
.cms-workbench .connection-panel { padding: 8px 12px; margin-bottom: 20px; border-radius: 8px; background: #fff; box-shadow: none; }
.cms-workbench .connection-status { overflow-wrap: anywhere; }
.cms-workbench .panel, .cms-workbench .subpanel { background: white; box-shadow: none; border: 1px solid var(--line); border-radius: 12px; }
.cms-workbench .primary-button { background: #ffcf24; color: #19243a; box-shadow: none; border: 1px solid #edbf16; border-radius: 8px; }
.cms-workbench .secondary-button, .cms-workbench .ghost-button { background: white; border: 1px solid var(--line); color: #254264; box-shadow: none; border-radius: 8px; }
.cms-workbench .badge { border-radius: 6px; letter-spacing: 0; text-transform: none; }
.cms-workbench .cms-view.active { min-width: 0; }
.cms-workbench .places-workbench { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.place-category-sidebar { min-width: 0; padding: 8px 14px 24px 0; border-right: 1px solid var(--line); }
.category-disclosure > summary { font-size: 15px; font-weight: 700; padding: 12px 8px; cursor: pointer; }
.category-branches, .category-branches ul { list-style: none; padding: 0; margin: 6px 0; }
.category-branches ul { margin-left: 12px; padding-left: 8px; border-left: 1px solid var(--line); }
.category-branches summary { display: list-item; cursor: pointer; list-style-position: inside; }
.category-branches summary > .category-choice { display: inline-flex; width: calc(100% - 24px); vertical-align: middle; }
.category-choice { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; width: 100%; padding: 10px 8px; background: transparent; border-radius: 6px; color: var(--ink); text-align: left; font-size: 14px; }
.category-choice > span:first-child { overflow-wrap: anywhere; }
.category-choice:hover { background: #f0f4f9; }
.category-choice[aria-pressed="true"] { color: #0759d5; background: #eaf2ff; font-weight: 650; }
.category-count { color: var(--muted); background: #f1f4f8; padding: 2px 5px; border-radius: 5px; font-size: 12px; font-variant-numeric: tabular-nums; }
.cms-workbench .places-workbench .list-panel { padding: 20px; min-width: 0; }
.cms-workbench .list-panel .panel-header h2 { font-size: 21px; }
.cms-workbench .list-panel .filter-row { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(2, minmax(120px, 1fr)); gap: 12px; align-items: end; }
.cms-workbench .list-panel .filter-row label { min-width: 0; font-size: 12px; }
.cms-workbench .list-panel .filter-row input, .cms-workbench .list-panel .filter-row select { width: 100%; min-width: 0; font-size: 14px; }
.cms-workbench .list-panel .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 16px; }
.cms-workbench .list-panel table { width: 100%; min-width: 1040px; border-collapse: collapse; }
.cms-workbench .list-panel th { background: #f7f9fc; color: #485976; font-size: 12px; letter-spacing: 0; text-transform: none; padding: 14px 12px; }
.cms-workbench .list-panel td { padding: 16px 12px; font-size: 14px; vertical-align: middle; border-bottom: 1px solid #e9eef5; }
.cms-workbench .list-panel td:nth-child(2) { min-width: 210px; }
.cms-workbench .list-panel .selected-row { background: #edf4ff; }
.cms-workbench .list-panel td small { color: var(--muted); overflow-wrap: anywhere; font-size: 12px; }
.cms-workbench .list-panel .link-button { color: var(--ink); text-align: left; font-weight: 650; }
.cms-workbench .list-panel input[type="checkbox"] { min-height: 20px; width: 20px; height: 20px; accent-color: var(--blue); }
.place-bulk-disclosure { border-block: 1px solid var(--line); margin-top: 14px; }
.place-bulk-disclosure > summary, .place-existing-queue > summary { min-height: 44px; padding: 12px; cursor: pointer; font-weight: 600; font-size: 14px; }
.place-existing-queue { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.cms-workbench .place-existing-queue > .panel { border: 0; margin: 0; }
.cms-workbench .place-bulk-disclosure .bulk-action-panel { margin: 0; background: #f7f9fc; }
.cms-workbench .pagination-bar { gap: 12px; flex-wrap: wrap; font-size: 13px; }
.cms-workbench .pagination-bar > div { display: flex; gap: 8px; flex-wrap: wrap; }
.cms-workbench .editor-back { margin-bottom: 16px; }
.cms-workbench .is-editing-place .places-workbench { display: block; }
.cms-workbench .editor-panel { width: 100%; min-width: 0; }
.cms-workbench .editor-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-radius: 8px; padding: 6px; background: #f6f8fb; }
.cms-workbench .editor-tabs .tab-button { flex: 0 0 auto; font-size: 14px; border-radius: 6px; }
.cms-workbench .editor-tabs .tab-button.active { color: #0759d5; background: #eaf2ff; }
.cms-workbench .place-edit-hero { box-shadow: none; border-radius: 10px; }
@media (max-width: 1100px) {
  .cms-global-header { flex-wrap: wrap; gap: 12px; padding: 12px 20px; }
  .cms-global-nav { order: 3; width: 100%; }
  .cms-workbench .content { padding: 20px; }
  .cms-workbench .places-workbench { grid-template-columns: 200px minmax(0, 1fr); gap: 16px; }
  .cms-workbench .list-panel .filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .cms-workbench .content { padding: 16px 12px; }
  .cms-global-header { padding: 12px; }
  .cms-global-nav { gap: 4px; }
  .cms-global-nav .nav-item, .cms-nav-group > summary { padding: 10px; font-size: 13px; }
  .cms-nav-group { position: static; }
  .cms-nav-menu { left: 12px; right: 12px; top: auto; min-width: 0; }
  .cms-workbench .topbar-actions { width: 100%; }
  .cms-workbench .places-workbench { grid-template-columns: minmax(0, 1fr); }
  .place-category-sidebar { border: 1px solid var(--line); padding: 4px 8px; background: white; border-radius: 10px; }
  #placeCategoryTree { max-height: 260px; overflow: auto; }
  .cms-workbench .places-workbench .list-panel { padding: 12px; }
  .cms-workbench .list-panel .filter-row { grid-template-columns: minmax(0, 1fr); }
  .cms-workbench .list-panel table { min-width: 0; }
  .cms-workbench .list-panel td:nth-child(2) { min-width: 0; }
  .cms-workbench .list-panel td { padding: 10px; }
  .cms-workbench .panel-header { flex-wrap: wrap; gap: 12px; }
  .cms-workbench .connection-panel { display: flex; flex-wrap: wrap; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .cms-workbench *, .cms-workbench *::before, .cms-workbench *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.cms-section-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.cms-section-nav { position: sticky; top: 16px; display: grid; gap: 4px; max-height: calc(100dvh - 32px); overflow-y: auto; padding-right: 12px; border-right: 1px solid var(--line); }
.cms-section-nav button { background: transparent; color: var(--muted); text-align: left; padding: 12px; border-radius: 8px; line-height: 1.4; overflow-wrap: anywhere; }
.cms-section-nav button:hover { background: #edf2f8; }
.cms-section-nav button[aria-current="page"] { background: #eaf2ff; color: var(--blue); font-weight: 650; }
.cms-section-content, .cms-section-pane { min-width: 0; }
.cms-section-pane > .workspace-grid { grid-template-columns: minmax(0, 1fr); }
.cms-section-pane > .panel, .cms-section-pane > .subpanel { margin-top: 0; }
.cms-media-unavailable { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; min-height: 64px; padding: 8px; background: #edf1f6; color: #53627a; font-size: 12px; text-align: center; }
.cms-workbench .list-panel table { table-layout: auto; }
.cms-workbench #placesTableBody td:nth-child(6) { min-width: 190px; }
.cms-workbench #placesTableBody td:nth-child(9) { min-width: 170px; }
.cms-workbench #placesTableBody td:nth-child(10) { min-width: 110px; }
.cms-workbench #placesTableBody td small { overflow-wrap: break-word; word-break: normal; }
@media (max-width: 1100px) {
  .cms-section-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 760px) {
  .cms-section-layout { grid-template-columns: minmax(0, 1fr); }
  .cms-section-nav { position: static; display: flex; max-height: none; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 8px; }
  .cms-section-nav button { flex: 0 0 auto; max-width: 240px; }
  .cms-workbench .topbar { gap: 12px; }
  .cms-workbench .topbar-actions { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .cms-workbench .topbar-actions > * { width: auto; flex: 0 1 auto; min-width: 0; }
  .cms-workbench .topbar-actions .search-field { flex: 1 0 100%; max-width: none; }
  .cms-workbench .topbar-actions button { padding: 8px 10px; }
  .cms-workbench #placesTableBody td { min-width: 0; }
}
.cms-confirm-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid #d4deea;
  border-radius: 16px;
  color: #182b3d;
  background: #fff;
  box-shadow: 0 24px 80px #10203033;
}
.cms-confirm-dialog::backdrop { background: #10203066; }
.cms-confirm-dialog form { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.cms-confirm-dialog button { padding: 12px 16px; border: 1px solid #cbd6e2; border-radius: 10px; cursor: pointer; }
.cms-confirm-dialog button[value="discard"] { color: #fff; background: #a82e32; }

