/* Hall Page Specific Styles */

.hall-page {
  padding: 0;
}

@media (min-width: 769px) {
  body.hall-page .container {
    max-width: 94vw;
  }
}

/* ===== Assigned Hall Edit - Header (Grid) ===== */
.page-header.assigned-hall-edit-header {
  display: grid;
  grid-template-areas: "content actions";
  grid-template-columns: 1fr auto;
  gap: 1.5rem 2rem;
  align-items: flex-start;
  min-width: 0;
}
.assigned-hall-edit-header-content {
  grid-area: content;
  min-width: 0;
}
.assigned-hall-edit-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e40af;
  line-height: 1.3;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.assigned-hall-edit-meta {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.35rem;
}
.assigned-hall-edit-meta-label {
  color: #94a3b8;
  font-weight: 500;
}
.assigned-hall-edit-event-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.assigned-hall-edit-event-link:hover {
  color: #1e40af;
}
.assigned-hall-edit-meta-sep {
  color: #cbd5e1;
  margin: 0 0.15rem;
}
.assigned-hall-header-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
  align-self: center;
  min-width: 0;
}
.assigned-hall-lock-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  min-width: 200px;
}
.assigned-hall-lock-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: #334155;
  margin-bottom: 0.25rem;
}
.assigned-hall-lock-desc {
  margin: 0 0 0.5rem 0;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.35;
}
@media (max-width: 992px) {
  .page-header.assigned-hall-edit-header {
    grid-template-areas: "content" "actions";
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .assigned-hall-header-actions {
    align-self: stretch;
    justify-content: flex-start;
  }
}

/* ===== Assigned Hall Edit - Tabovi ===== */
.assigned-hall-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.assigned-hall-tabs [role="tab"] {
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #64748b;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.assigned-hall-tabs [role="tab"]:hover {
  color: #334155;
}
.assigned-hall-tabs [role="tab"][aria-selected="true"] {
  color: #1e40af;
  border-bottom-color: #1e40af;
}
.assigned-hall-tab-panels .tab-panel {
  display: none;
}
.assigned-hall-tab-panels .tab-panel.active {
  display: block;
}
.assigned-hall-section {
  margin-bottom: 1.5rem;
}
.assigned-hall-section:last-child {
  margin-bottom: 0;
}
.assigned-hall-collapsible {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.assigned-hall-collapsible summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: #1e293b;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.assigned-hall-collapsible summary::-webkit-details-marker {
  display: none;
}
.assigned-hall-collapsible summary::before {
  content: '▶';
  font-size: 0.7rem;
  transition: transform 0.2s;
}
.assigned-hall-collapsible[open] summary::before {
  transform: rotate(90deg);
}

/* ===== Assigned Hall Edit - Dizajn LEVO (veći), forma DESNO ===== */
.assigned-hall-edit-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 0.5rem;
}
.assigned-hall-main {
  flex: 1;
  min-width: 0;
}
/* Dizajn panel - LEVO, dominantan prostor */
.assigned-hall-scene-panel {
  position: relative;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: flex 0.3s ease, min-width 0.3s ease, padding 0.3s ease;
}
.scene-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}
.scene-panel-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
}
.scene-panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.scene-sidebar-toggle-link {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  color: #475569;
  cursor: pointer;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.scene-sidebar-toggle-link:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}
.scene-panel-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.demo-page .scene-panel-actions {
  flex: 1;
  min-width: 0;
}
.demo-page .scene-panel-actions .demo-example-select {
  flex: 1;
  min-width: 120px;
}
.demo-page .scene-panel-actions .btn {
  flex-shrink: 0;
}
.scene-sidebar-toggle-btn .toggle-icon,
.scene-sidebar-show-btn .toggle-icon {
  display: inline-block;
  transition: transform 0.2s;
}
.scene-panel-content {
  overflow: hidden;
}
/* Na velikim ekranima: paleta levo, canvas full size desno */
@media (min-width: 1280px) {
  .assigned-hall-scene-panel .scene-panel-content {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: stretch;
    min-height: 0;
  }
  .assigned-hall-scene-panel .scene-panel-elements-column {
    flex-shrink: 0;
    width: 120px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
  }
  .assigned-hall-scene-panel .scene-panel-elements-palette {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .scene-panel-canvas-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0.25rem;
  }
  .scene-panel-canvas-options .canvas-bg-picker {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
  .scene-panel-canvas-options .canvas-bg-label-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .scene-panel-canvas-options .canvas-bg-picker-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .scene-panel-canvas-options .canvas-bg-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .scene-panel-canvas-options .canvas-bg-swatch {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border: 1px solid rgba(0,0,0,0.2);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.5) inset;
  }
  .scene-panel-canvas-options .canvas-bg-swatch.is-active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
  }
  .scene-panel-canvas-options .canvas-chairs-toggle-label {
    font-size: 0.8rem;
  }
  .assigned-hall-scene-panel .scene-panel-elements-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #e2e8f0;
  }
  .assigned-hall-scene-panel .scene-panel-elements-column .scene-panel-palette {
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    border: none;
  }
  .assigned-hall-scene-panel .scene-panel-elements-column .scene-panel-presence {
    margin-bottom: 0;
    padding: 0.5rem 0;
    background: transparent;
    border: none;
    border-top: 1px solid #e2e8f0;
  }
  .assigned-hall-scene-panel .scene-panel-elements-column .scene-panel-presence h4 {
    font-size: 0.75rem;
    margin-bottom: 0.35rem;
  }
  .assigned-hall-scene-panel .scene-panel-elements-column #presenceOnlineList {
    max-height: 120px;
    font-size: 0.75rem;
  }
  .assigned-hall-scene-panel .scene-panel-elements-column .edit-palette-grid {
    flex-direction: column;
    gap: 0.4rem;
  }
  .assigned-hall-scene-panel .scene-panel-elements-column .template,
  .assigned-hall-scene-panel .scene-panel-elements-column .edit-grid-palette-btn {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    min-height: 64px !important;
    margin: 0 auto;
  }
  .assigned-hall-scene-panel .scene-panel-elements-column .template.wall,
  .assigned-hall-scene-panel .scene-panel-elements-column .template.wall.vertical {
    width: 64px !important;
    height: 28px !important;
    min-width: 64px !important;
    min-height: 28px !important;
  }
  .assigned-hall-scene-panel .scene-panel-elements-column .template.wall.vertical {
    width: 28px !important;
    height: 64px !important;
    min-width: 28px !important;
    min-height: 64px !important;
  }
  .assigned-hall-scene-panel .scene-panel-elements-column .template.door {
    width: 44px !important;
    height: 64px !important;
    min-width: 44px !important;
    min-height: 64px !important;
  }
  .assigned-hall-scene-panel .scene-panel-elements-column .template.zone {
    width: 64px !important;
    height: 40px !important;
    min-width: 64px !important;
    min-height: 40px !important;
  }
  .assigned-hall-scene-panel .scene-panel-elements-column .template.wedding {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;
    border-radius: 50% !important;
  }
  .assigned-hall-scene-panel .scene-panel-elements-column .template.wedding-square {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;
    border-radius: 6px !important;
  }
  .assigned-hall-scene-panel .scene-panel-elements-column .template-label {
    font-size: 0.7rem;
    bottom: -20px;
  }
  .assigned-hall-scene-panel .scene-panel-canvas-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .assigned-hall-scene-panel .scene-panel-canvas-column .scene-panel-canvas-wrap {
    flex: 1;
    min-height: 560px;
    height: auto;
    margin-bottom: 0.5rem;
  }
}
.scene-panel-palette {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}
.scene-panel-presence {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
/* Canvas - veliki, koristi prostor (panel je sticky pa možemo više vh) */
.scene-panel-canvas-wrap {
  width: 100%;
  margin-bottom: 0.75rem;
  min-height: 520px;
  height: clamp(520px, calc(100vh - 160px), 1000px);
}
.scene-panel-canvas-wrap .canvas-container {
  height: 100%;
  min-height: 480px;
}
.scene-panel-canvas-wrap .canvas-zoom-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
}
.scene-sidebar-show-btn {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-100%, -50%);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 0.75rem 0.5rem;
  font-size: 0.85rem;
  border: 1px solid #e2e8f0;
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: #f8fafc;
  cursor: pointer;
  white-space: nowrap;
  z-index: 50;
  box-shadow: -2px 0 8px rgba(0,0,0,0.06);
  transition: background 0.2s, color 0.2s;
}
.scene-sidebar-show-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.assigned-hall-scene-panel.collapsed {
  flex: 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  padding: 0;
  margin: 0;
  border: none;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}
.assigned-hall-scene-panel.collapsed .scene-panel-header,
.assigned-hall-scene-panel.collapsed .scene-panel-content {
  display: none;
}
.assigned-hall-scene-panel.collapsed .scene-sidebar-show-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  writing-mode: horizontal-tb;
  left: 0;
  transform: translate(0, -50%);
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  background: #fff;
  border: 2px solid #0ea5e9;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.25);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.assigned-hall-scene-panel.collapsed .scene-sidebar-show-btn:hover {
  background: #f0f9ff;
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
}

@media (min-width: 1024px) {
  .assigned-hall-edit-layout {
    flex-direction: column;
    gap: 1.5rem;
  }
  /* Dizajn: full width */
  .assigned-hall-scene-panel {
    width: 100%;
    max-width: none;
    position: sticky;
    top: 1rem;
  }
  .assigned-hall-main {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 1023px) {
  .assigned-hall-scene-panel {
    order: -1;
  }
  .assigned-hall-scene-panel.collapsed {
    min-height: 0;
    height: 0;
    margin: 0;
  }
  .assigned-hall-scene-panel.collapsed .scene-sidebar-show-btn {
    left: 0;
    transform: translate(0, -50%);
  }
}

/* Dugme Dodaj goste iz Excela - dovoljna širina za tekst */
#importGuestsBtn,
#ownerImportGuestsBtn {
  min-width: 220px;
  white-space: nowrap;
  padding: 0.5rem 1.25rem;
}

/* ===== Hall Edit Page - Redesign ===== */
.edit-page .container { max-width: none; padding: 0; }
body.edit-page { overflow-x: hidden; }
.edit-page { overflow-x: hidden; }
.edit-layout { max-width: 1600px; width: 100%; margin: 0 auto; padding: 1rem 1.25rem 2rem; background: #f8fafc; min-height: calc(100vh - 60px); box-sizing: border-box; }

/* Nakon logovanja - širi layout */
body:has(.navbar) .edit-layout { max-width: 94vw; }
.edit-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; padding-bottom: 0.75rem; border-bottom: 1px solid #e2e8f0; }
.edit-back { color: #64748b; text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.edit-back:hover { color: #1e40af; }
.edit-title { font-size: 1.35rem; font-weight: 600; color: #0f172a; margin: 0; }
.edit-loading { text-align: center; padding: 3rem; color: #64748b; font-size: 1rem; }
.edit-main { min-width: 0; }
.edit-form { background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); overflow: hidden; border: 1px solid #e2e8f0; max-width: 100%; min-width: 0; }
.edit-toolbar { background: #fff; padding: 1rem 1.25rem; border-bottom: 1px solid #e2e8f0; }
.edit-toolbar-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.edit-field { display: flex; flex-direction: column; gap: 0.35rem; flex-shrink: 0; }
.edit-field label { font-size: 0.8rem; font-weight: 600; color: #475569; text-transform: uppercase; letter-spacing: 0.03em; }
.edit-input, .edit-select { padding: 0.5rem 0.75rem; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 0.95rem; min-width: 140px; max-width: 100%; transition: border-color 0.2s, box-shadow 0.2s; box-sizing: border-box; }
.edit-input:focus, .edit-select:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
.edit-template-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: nowrap; }
.edit-template-row .edit-select { min-width: 140px; }
.edit-actions { display: flex; gap: 0.5rem; flex-wrap: nowrap; margin-left: auto; align-items: center; flex-shrink: 0; }
.edit-warning { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.25rem; background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; font-size: 0.875rem; margin: 0 1.25rem; margin-top: 0.75rem; border-radius: 8px; }
.edit-instructions, .edit-grid-section { margin: 0 1.25rem; margin-top: 0.75rem; padding: 0.75rem 1rem; background: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0; }
.edit-instructions summary, .edit-grid-section summary { cursor: pointer; font-size: 0.9rem; font-weight: 600; color: #475569; list-style: none; }
.edit-instructions summary::-webkit-details-marker, .edit-grid-section summary::-webkit-details-marker { display: none; }
.edit-instructions summary::before, .edit-grid-section summary::before { content: '▸ '; display: inline-block; margin-right: 0.25rem; transition: transform 0.2s; }
.edit-instructions[open] summary::before, .edit-grid-section[open] summary::before { transform: rotate(90deg); }
.edit-instructions ol { margin: 0.5rem 0 0 1.25rem; padding: 0; font-size: 0.85rem; color: #64748b; line-height: 1.7; }
.edit-delete-info { padding: 0.75rem 1rem; background: #fef2f2; border-radius: 8px; border: 1px solid #fecaca; }
.edit-delete-info summary { cursor: pointer; font-size: 0.9rem; font-weight: 600; color: #991b1b; list-style: none; }
.edit-delete-info summary::-webkit-details-marker { display: none; }
.edit-delete-info summary::before { content: '▸ '; display: inline-block; margin-right: 0.25rem; transition: transform 0.2s; }
.edit-delete-info[open] summary::before { transform: rotate(90deg); }
.edit-delete-info ul { font-size: 0.85rem; color: #7f1d1d; line-height: 1.6; }
.edit-grid-palette-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; padding: 0;
  background: rgba(14, 165, 233, 0.12);
  border: 2px dashed #0ea5e9; border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.edit-grid-palette-btn::before {
  content: '';
  position: absolute;
  inset: 7px;
  background-image: radial-gradient(circle at center, #0369a1 40%, transparent 46%);
  background-size: 20% 20%;
  background-repeat: repeat;
}
.edit-grid-palette-btn:hover {
  transform: scale(1.05); box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
  border-color: #0284c7; background: rgba(2, 132, 199, 0.18);
}
.edit-grid-palette-btn:hover::before {
  background-image: radial-gradient(circle at center, #0284c7 42%, transparent 48%);
}
.edit-grid-palette-btn .template-label {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.canvas-add-icon-btn::before { display: none; }
.canvas-add-icon-btn { flex-direction: column; gap: 0.2rem; }
.canvas-add-icon-btn .template-label { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; font-size: 0.65rem; line-height: 1; }
.canvas-add-icon-btn .template-icon-preview { width: 22px; height: 22px; flex-shrink: 0; }
#gridModal .grid-palette-swatch {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
#gridModal .grid-palette-swatch:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
#gridModal .grid-palette-swatch:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}
.edit-grid-form { margin-top: 1rem; display: grid; grid-template-columns: repeat(4, minmax(100px, 1fr)) auto; gap: 0.75rem; align-items: end; }
.edit-grid-fields { display: contents; }
.edit-grid-field { display: flex; flex-direction: column; gap: 0.25rem; }
.edit-grid-field label { font-size: 0.75rem; font-weight: 600; color: #64748b; }
.edit-grid-btn { grid-column: 5; grid-row: 2; justify-self: end; }
.edit-palette { padding: 1rem 1.25rem; background: #f1f5f9; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; min-width: 0; }
.edit-palette-label { font-size: 0.8rem; font-weight: 600; color: #64748b; white-space: nowrap; flex-shrink: 0; }
.edit-palette-grid { flex: 1; margin: 0; padding: 0; gap: 1rem; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; }
.edit-canvas-wrap { position: relative; width: 100%; max-width: 100%; height: clamp(560px, calc(100vh - 260px), 1000px); min-height: 560px; background: #f8fafc; border: 1px solid #e2e8f0; overflow: auto; box-sizing: border-box; }
.edit-canvas-wrap .canvas-zoom-controls { position: absolute; top: 12px; right: 12px; z-index: 20; display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; background: #fff; padding: 6px 10px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); border: 1px solid #e2e8f0; white-space: nowrap; }
.canvas-bg-picker { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.canvas-bg-label { font-size: 0.75rem; color: #64748b; white-space: nowrap; cursor: pointer; font-weight: 500; }
.canvas-bg-input { width: 28px; height: 28px; padding: 2px; border: 1px solid #e2e8f0; border-radius: 6px; cursor: pointer; background: #fff; }
.canvas-bg-input::-webkit-color-swatch-wrapper { padding: 0; }
.canvas-bg-input::-webkit-color-swatch { border: none; border-radius: 4px; }
.canvas-bg-swatches { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.canvas-bg-swatch {
  width: 22px; height: 22px; min-width: 22px; min-height: 22px; padding: 0;
  border: 1px solid rgba(0,0,0,0.18); border-radius: 5px;
  cursor: pointer; background: #fff; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.4) inset;
}
.canvas-bg-swatch:hover { transform: scale(1.08); box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.canvas-bg-swatch.is-active { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35); }
/* Canvas - blag tačkasti pattern na pozadini */
.edit-page #canvas-container #canvas,
.hall-page #canvas-container #canvas { position: absolute; top: 0; left: 0; width: 2400px; height: 1500px; min-width: 2400px; min-height: 1500px; background-color: #f8fafc; background-image: radial-gradient(circle, rgba(0,0,0,0.06) 1px, transparent 1px); background-size: 24px 24px; border-radius: 0; overflow: visible; box-sizing: border-box; border: none; }
.edit-error { padding: 1rem; margin: 1rem 1.25rem; background: #fee2e2; color: #b91c1c; border-radius: 8px; font-size: 0.9rem; }
.edit-success { padding: 1rem; margin: 1rem 1.25rem; background: #d1fae5; color: #065f46; border-radius: 8px; font-size: 0.9rem; }

/* Veliki ekran - sve u jedan red */
@media (min-width: 1100px) {
  .edit-toolbar-row { flex-wrap: nowrap; gap: 1rem; }
  .edit-field#templateSelectorWrap .edit-template-row .edit-select { min-width: 160px; }
  .edit-field#templateMaxGuestsWrap .edit-input { min-width: 80px; }
  .edit-field#templateMenuWrap .edit-select { min-width: 140px; }
  .edit-toolbar-row > .edit-field:first-child .edit-input { min-width: 160px; }
}

/* Tablet - ranije prelaz na vertikalni layout */
@media (max-width: 1052px) {
  .edit-toolbar-row { flex-direction: column; align-items: stretch; gap: 1rem; }
  .edit-field .edit-input, .edit-field .edit-select { min-width: 0; width: 100%; }
  .edit-template-row { flex-wrap: wrap; gap: 0.5rem; }
  .edit-template-row .edit-select { flex: 1; min-width: 200px; }
  .edit-actions { margin-left: 0; flex-wrap: wrap; gap: 0.5rem; }
  .edit-actions .edit-btn { flex: 1 1 calc(50% - 0.25rem); min-width: 140px; }
  .edit-grid-form { grid-template-columns: repeat(4, minmax(90px, 1fr)); gap: 0.6rem; }
  .edit-grid-btn { grid-column: 1 / -1; grid-row: 3; justify-self: start; }
}

@media (max-width: 828px) {
  .edit-layout { padding: 0.75rem 1rem 1.5rem; }
  .edit-header { flex-wrap: wrap; gap: 0.5rem; }
  .edit-title { font-size: 1.15rem; }
  .edit-toolbar { padding: 0.75rem 1rem; }
  .edit-toolbar-row { flex-direction: column; align-items: stretch; gap: 1rem; }
  .edit-field .edit-input, .edit-field .edit-select { min-width: 0; width: 100%; }
  .edit-template-row { flex-wrap: wrap; gap: 0.5rem; }
  .edit-template-row .edit-select { flex: 1; min-width: 0; }
  .edit-template-row .edit-btn { min-height: 44px; min-width: 44px; padding: 0.5rem 0.75rem; }
  .edit-actions { margin-left: 0; flex-wrap: wrap; gap: 0.5rem; }
  .edit-actions .edit-btn { flex: 1 1 calc(50% - 0.25rem); min-width: 120px; min-height: 44px; }
  .edit-instructions, .edit-grid-section { margin: 0 0.75rem; padding: 0.5rem 0.75rem; }
  .edit-instructions ol { margin-left: 1rem; font-size: 0.8rem; }
  .edit-canvas-wrap { height: clamp(420px, 60vh, 700px); min-height: 420px; }
  .edit-grid-form { grid-template-columns: repeat(3, minmax(80px, 1fr)) auto; gap: 0.5rem; }
  .edit-grid-btn { grid-column: 4; grid-row: 3; font-size: 0.8rem; padding: 0.4rem 0.6rem; }
  .edit-palette { padding: 0.75rem 1rem; flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .edit-palette-label { font-size: 0.75rem; white-space: normal; }
  .edit-palette-grid { justify-content: center; gap: 0.6rem; flex-wrap: wrap; }
  .edit-palette-grid .template { transform: none; }
  .edit-palette-grid .template.circle,
  .edit-palette-grid .template.rectangle { width: 56px; height: 56px; }
  .edit-palette-grid .template.wedding { width: 56px; height: 56px; border-radius: 50%; }
  .edit-palette-grid .template.wedding-square { width: 56px; height: 56px; border-radius: 6px; }
  .edit-palette-grid .template.door { width: 56px; height: 70px; }
  .edit-palette-grid .template.wall { width: 77px; height: 14px; }
  .edit-palette-grid .template.wall.vertical { width: 14px; height: 77px; }
  .edit-palette-grid .template.zone { width: 56px; height: 42px; }
  .edit-grid-palette-btn { width: 56px; height: 56px; }
  .edit-canvas-wrap .canvas-zoom-controls { top: 6px; right: 6px; padding: 4px 6px; gap: 3px; }
  .edit-canvas-wrap .zoom-btn { width: 28px; height: 28px; font-size: 14px; }
  .edit-canvas-wrap .zoom-level { font-size: 12px; min-width: 40px; }
  .edit-warning { margin: 0 0.75rem; padding: 0.5rem 0.75rem; font-size: 0.8rem; }
  .edit-error, .edit-success { margin: 0.75rem 1rem; padding: 0.75rem; font-size: 0.85rem; }
  #editModal { max-width: calc(100vw - 2rem); margin: 1rem; max-height: calc(100vh - 2rem); overflow: visible; }
  #editModal .modal-header { padding: 1rem 1.25rem; }
  #editModal .modal-body { padding: 1rem 1.25rem; max-height: calc(100vh - 12rem); overflow-y: auto; }
  #editModal .form-section { margin-bottom: 1.25rem; padding-bottom: 1rem; }
  #editModal .section-title { font-size: 1rem; margin-bottom: 0.75rem; }
  #editModal .modal-footer .footer-actions { flex-wrap: wrap; gap: 0.5rem; }
  #editModal .btn-modal { flex: 1 1 auto; min-width: 100px; }
}
@media (max-width: 540px) {
  .edit-layout { padding: 0.5rem 0.75rem 1rem; }
  .edit-title { font-size: 1rem; }
  .edit-toolbar { padding: 0.5rem 0.75rem; }
  .edit-grid-form { grid-template-columns: repeat(2, 1fr); }
  .edit-grid-field { min-width: 0; }
  .edit-grid-btn { grid-column: 1 / -1; grid-row: auto; justify-self: stretch; }
  .edit-actions .edit-btn { flex: 1 1 100%; }
  .edit-palette-grid,
  .templates-grid.edit-palette-grid,
  .scene-panel-palette {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    justify-items: center;
  }
  .edit-palette-grid .template { transform: none; }
  .edit-palette-grid .template.circle,
  .edit-palette-grid .template.rectangle { width: 50px; height: 50px; }
  .edit-palette-grid .template.wedding { width: 50px; height: 50px; border-radius: 50%; }
  .edit-palette-grid .template.wedding-square { width: 50px; height: 50px; border-radius: 6px; }
  .edit-palette-grid .template.door { width: 50px; height: 62px; }
  .edit-palette-grid .template-wedding-icon { width: 18px; height: 18px; }
  .edit-palette-grid .template.wall { width: 68px; height: 12px; }
  .edit-palette-grid .template.wall.vertical { width: 12px; height: 68px; }
  .edit-palette-grid .template.zone { width: 50px; height: 38px; }
  .edit-grid-palette-btn { width: 50px; height: 50px; }
  .edit-canvas-wrap { height: clamp(360px, 55vh, 600px); min-height: 360px; }
  .edit-canvas-wrap .zoom-btn { width: 28px; height: 28px; min-width: 28px; min-height: 28px; }
  #editModal { margin: 0.5rem; max-width: calc(100vw - 1rem); }
  #editModal .modal-header { padding: 0.75rem 1rem; }
  #editModal .modal-header h3 { font-size: 1.1rem; }
  #editModal .modal-body { padding: 0.75rem 1rem; }
  #editModal .form-input-modal { min-height: 44px; font-size: 16px; }
  #editModal .btn-modal { width: 100%; min-height: 44px; padding: 0.6rem 1rem; }
  #editModal .modal-footer .footer-actions { flex-direction: column; gap: 0.5rem; }
  #editModal .footer-actions .btn-modal { width: 100%; }
  #editModal .table-color-palette .palette-swatches { gap: 0.35rem; }
  #editModal .palette-swatch { width: 28px; height: 28px; min-width: 28px; min-height: 28px; }
}
@media (max-width: 420px) {
  .edit-layout { padding: 0.5rem 0.5rem 0.75rem; }
  .edit-toolbar { padding: 0.5rem; }
  .edit-instructions, .edit-grid-section { margin: 0 0.5rem; padding: 0.5rem 0.6rem; }
  .edit-warning { margin: 0 0.5rem; padding: 0.5rem 0.6rem; }
  .edit-error, .edit-success { margin: 0.5rem; }
  .edit-palette { padding: 0.5rem; }
  .edit-palette-grid,
  .templates-grid.edit-palette-grid,
  .scene-panel-palette {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    justify-items: center;
  }
  .edit-palette-grid .template,
  .edit-palette-grid .edit-grid-palette-btn { transform: none; flex-shrink: 0; }
  .edit-palette-grid .template.circle,
  .edit-palette-grid .template.rectangle { width: 44px; height: 44px; }
  .edit-palette-grid .template.wedding { width: 44px; height: 44px; border-radius: 50%; }
  .edit-palette-grid .template.wedding-square { width: 44px; height: 44px; border-radius: 6px; }
  .edit-palette-grid .template-wedding-icon { width: 16px; height: 16px; }
  .edit-palette-grid .template.door { width: 44px; height: 55px; }
  .edit-palette-grid .template.wall { width: 60px; height: 10px; }
  .edit-palette-grid .template.wall.vertical { width: 10px; height: 60px; }
  .edit-palette-grid .template.zone { width: 44px; height: 34px; }
  .edit-palette-grid .edit-grid-palette-btn { width: 44px; height: 44px; }
  .edit-palette-label { white-space: normal; font-size: 0.7rem; }
  .edit-palette-grid .template:hover { transform: scale(1.02); }
  .edit-template-row { flex-direction: column; align-items: stretch; }
  .edit-template-row .edit-select { min-width: 0; }
  .edit-grid-form { gap: 0.4rem; }
  .edit-field .edit-input, .edit-field .edit-select { min-width: 0; width: 100%; }
  .edit-canvas-wrap .canvas-zoom-controls { flex-wrap: nowrap; padding: 4px 6px; gap: 3px; }
  .edit-canvas-wrap .zoom-btn { width: 28px; height: 28px; min-width: 28px; min-height: 28px; font-size: 14px; }
  .edit-canvas-wrap .zoom-level { font-size: 11px; min-width: 36px; }
  #editModal { margin: 0.5rem; max-width: calc(100vw - 1rem); }
}

/* Template styles - work both with and without .hall-page class */
.template {
  position: relative;
  margin: 0;
  border: 2px solid #333;
  cursor: grab;
  background: #e0f2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

.template:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.template.circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.template.rectangle {
  width: 80px;
  height: 80px;
  border-radius: 8px;
}

.template.wedding {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fce7f3 0%, #fbcfe8 40%, #f9a8d4 100%);
  border: 2px solid #e879f9;
  position: relative;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.25);
  color: #be185d;
}

.template.wedding::before {
  content: none;
}

.template.wedding-square {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  background: linear-gradient(145deg, #fce7f3 0%, #fbcfe8 40%, #f9a8d4 100%);
  border: 2px solid #e879f9;
  position: relative;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.25);
  color: #be185d;
}

.template.wedding-square::before {
  content: none;
}

.template-wedding-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: inherit;
}

.template.door {
  width: 80px;
  height: 100px;
  border-radius: 6px;
  background: linear-gradient(165deg, #a0522d 0%, #8b4513 50%, #a0522d 100%);
  border: 2px solid #5c3a1a;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.template.door::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border: 2px solid #5c3a1a;
  border-radius: 4px;
  background: linear-gradient(145deg, rgba(139, 69, 19, 0.5) 0%, rgba(101, 67, 33, 0.6) 100%);
}

.template.wall {
  width: 110px;
  height: 18px;
  background: transparent;
  border: none;
  position: relative;
}

.template.wall::before {
  content: '';
  position: absolute;
  left: 5px;
  right: 5px;
  top: 50%;
  height: 6px;
  transform: translateY(-50%);
  background: linear-gradient(145deg, #374151 0%, #4b5563 50%, #6b7280 100%);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.template.wall.vertical {
  width: 18px;
  height: 110px;
}

.template.wall.vertical::before {
  left: 50%;
  right: auto;
  top: 5px;
  bottom: 5px;
  width: 6px;
  height: auto;
  transform: translateX(-50%);
}

/* Template label styles */
.template-label {
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75em;
  color: #666;
  white-space: nowrap;
  pointer-events: none;
}

/* Templates grid styles */
.templates-grid {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  gap: 1.5em;
  align-items: center;
  margin-bottom: 0;
}

.hall-page .main-nav {
  margin-bottom: 0;
}

.hall-header {
  background: #f8f9fa;
  padding: 1.5em 2em;
  border-bottom: 2px solid #e9ecef;
  margin-bottom: 1.5em;
}

.hall-header h1 {
  margin: 0 0 1em 0;
  font-size: 1.8em;
  color: #1e40af;
}

.hall-controls {
  display: flex;
  gap: 1em;
  align-items: center;
  flex-wrap: wrap;
}

/* Hall controls input - koristi .form-input */
.hall-controls input[type="text"] {
  flex: 1;
  min-width: 250px;
  padding: 0.75rem 1rem;
  min-height: 44px;
  font-size: 1rem;
  border: 2px solid #3b82f6;
  border-radius: 6px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hall-controls input[type="text"]:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.hall-controls input[type="text"]::placeholder {
  color: #94a3b8;
}

.hall-content {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
  padding: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

/* Override #sidebar from style.css */
.hall-page #sidebar,
.hall-page .sidebar {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  flex: none !important;
  flex-basis: auto !important;
  background: #f8f9fa;
  padding: 1.5em 2em;
  border-radius: 0;
  border: none;
  border-bottom: 2px solid #e9ecef;
  position: static !important;
  display: flex !important;
  flex-direction: row;
  gap: 2em;
  align-items: flex-start;
  flex-wrap: wrap;
  box-sizing: border-box;
}

.hall-page .sidebar > h3 {
  width: 100%;
  flex-basis: 100%;
  margin: 0 0 1em 0;
  color: #1e40af;
  font-size: 1.2em;
}

.templates-grid {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  gap: 1.5em;
  align-items: center;
  margin-bottom: 0;
}

.hall-page .template {
  position: relative;
  margin: 0;
  border: 2px solid #333;
  cursor: grab;
  background: #e0f2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hall-page .template:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.hall-page .template.circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.hall-page .template.rectangle {
  width: 80px;
  height: 80px;
  border-radius: 8px;
}

.hall-page .template.wedding {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fce7f3 0%, #fbcfe8 40%, #f9a8d4 100%);
  border: 2px solid #e879f9;
  position: relative;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.25);
  color: #be185d;
}

.hall-page .template.wedding-square {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  background: linear-gradient(145deg, #fce7f3 0%, #fbcfe8 40%, #f9a8d4 100%);
  border: 2px solid #e879f9;
  position: relative;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.25);
  color: #be185d;
}

.hall-page .template.wedding::before,
.hall-page .template.wedding-square::before {
  content: none;
}

.hall-page .template-wedding-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: inherit;
}

.hall-page .template.door {
  width: 80px;
  height: 100px;
  border-radius: 6px;
  background: linear-gradient(165deg, #a0522d 0%, #8b4513 50%, #a0522d 100%);
  border: 2px solid #5c3a1a;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.hall-page .template.door::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border: 2px solid #5c3a1a;
  border-radius: 4px;
  background: linear-gradient(145deg, rgba(139, 69, 19, 0.5) 0%, rgba(101, 67, 33, 0.6) 100%);
}

.hall-page .template.wall {
  width: 110px;
  height: 18px;
  background: transparent;
  border: none;
  position: relative;
}

.hall-page .template.wall::before {
  content: '';
  position: absolute;
  left: 5px;
  right: 5px;
  top: 50%;
  height: 6px;
  transform: translateY(-50%);
  background: #4b5563;
  border-radius: 6px;
}

.hall-page .template.wall.vertical {
  width: 18px;
  height: 110px;
}

.hall-page .template.wall.vertical::before {
  left: 50%;
  right: auto;
  top: 5px;
  bottom: 5px;
  width: 6px;
  height: auto;
  transform: translateX(-50%);
}

.template-label {
  display: none;
}

/* Compact template labels for horizontal layout */
.hall-page .sidebar .template-label {
  display: none;
}

.hall-page .hint {
  display: none; /* Hide hint in horizontal layout */
}

.hall-page .hint p {
  margin: 0.5em 0;
  font-size: 0.9em;
  color: #666;
  line-height: 1.5;
}

/* Hall Shape Controls - for future use if needed */
.hall-shape-controls {
  display: none; /* Hidden for now, can be shown if needed */
}

/* Hall Shape on Canvas */
.hall-shape {
  position: absolute;
  border: 3px dashed #3b82f6;
  background: rgba(7, 70, 130, 0.05);
  pointer-events: none;
  z-index: 1;
  box-sizing: border-box;
}

.hall-shape.hall-shape-circle {
  border-radius: 50%;
}

.hall-shape.hall-shape-square {
  /* Square is handled by width = height in JS */
  border-radius: 4px;
}

.hall-shape.active {
  pointer-events: auto;
  cursor: move;
}

.hall-shape.active:hover {
  border-color: #2563eb;
  background: rgba(7, 70, 130, 0.1);
}

/* Konzistentan drop-shadow za sve canvas elemente */
#canvas-container,
#canvas-container .canvas,
.hall-page #canvas-container .canvas,
.edit-page #canvas-container .canvas {
  --canvas-drop-shadow: drop-shadow(0 2px 6px rgba(0,0,0,0.18));
  --canvas-drop-shadow-hover: drop-shadow(0 4px 12px rgba(0,0,0,0.22));
  user-select: none;
}

/* Make sure tables are always above hall shape */
.hall-shape ~ .table,
.canvas .table {
  position: absolute;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  cursor: move;
  z-index: 10 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  filter: var(--canvas-drop-shadow);
  box-shadow: 
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06);
  transition: filter 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
  overflow: visible;
  box-sizing: border-box;
  user-select: none;
}

/* Tablecloth effect - fabric texture + gradient overlay */
.canvas .table::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  background: 
    linear-gradient(135deg, 
      rgba(255, 255, 255, 0.42) 0%, 
      rgba(255, 255, 255, 0.12) 35%,
      rgba(255, 255, 255, 0) 50%, 
      rgba(0, 0, 0, 0.04) 100%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 4 4' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

/* Sjajna ivica - 3D highlight na gornjoj ivici */
.canvas .table::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 -1px 0 rgba(0, 0, 0, 0.04) inset;
  pointer-events: none;
  z-index: 2;
}

/* Hover effect - smoother lift */
.canvas .table:hover {
  filter: var(--canvas-drop-shadow-hover);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5),
              inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  border-color: rgba(0, 0, 0, 0.2);
}

/* Selected state - clear feedback */
.canvas .table.selected {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
  filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.3));
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15);
  animation: table-selected-pulse 2s ease-in-out infinite;
}
@keyframes table-selected-pulse {
  0%, 100% { filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.3)); box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15); }
  50% { filter: drop-shadow(0 6px 16px rgba(37, 99, 235, 0.4)); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2); }
}

/* Over-capacity table (više gostiju nego mesta) */
.canvas .table.over-capacity {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
  filter: drop-shadow(0 2px 6px rgba(220, 38, 38, 0.15));
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3);
  animation: over-capacity-pulse 1.5s ease-in-out infinite;
}
@keyframes over-capacity-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.15); }
}

/* Circle tables - round with soft draped edge effect */
.canvas .table[data-shape="circle"] {
  border-radius: 50%;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45),
              inset 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.canvas .table[data-shape="circle"]::before,
.canvas .table[data-shape="circle"]::after {
  border-radius: 50%;
}

.canvas .table[data-shape="circle"]::before {
  background: 
    radial-gradient(circle at 30% 30%, 
      rgba(255, 255, 255, 0.45) 0%, 
      rgba(255, 255, 255, 0.12) 40%,
      rgba(0, 0, 0, 0.04) 100%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 4 4' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* Rectangle tables - more rounded, elegant */
.canvas .table[data-shape="rectangle"] {
  border-radius: 14px;
}

.canvas .table[data-shape="rectangle"]::before,
.canvas .table[data-shape="rectangle"]::after {
  border-radius: 14px;
}

.canvas .table[data-shape="rectangle"]::before {
  background: 
    linear-gradient(145deg, 
      rgba(255, 255, 255, 0.42) 0%, 
      rgba(255, 255, 255, 0.08) 45%,
      rgba(0, 0, 0, 0.05) 100%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 4 4' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* Wedding tables - rose/pink palette (matches palette template) */
.canvas .table[data-shape="wedding"],
.canvas .table[data-shape="wedding"]::before,
.canvas .table[data-shape="wedding"]::after,
.canvas .table[data-shape="wedding-square"],
.canvas .table[data-shape="wedding-square"]::before,
.canvas .table[data-shape="wedding-square"]::after {
  border-radius: 14px;
}

.canvas .table.wedding-table,
.canvas .table[data-wedding="true"] {
  border: 2px solid #e879f9;
  filter: drop-shadow(0 4px 12px rgba(236, 72, 153, 0.25));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5),
              inset 0 -2px 4px rgba(0, 0, 0, 0.08);
  background: linear-gradient(145deg, 
    #fce7f3 0%, 
    #fbcfe8 40%,
    #f9a8d4 100%) !important;
}

.canvas .table.wedding-table::before,
.canvas .table[data-wedding="true"]::before {
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.5) 0%, 
    rgba(255, 255, 255, 0.15) 30%,
    rgba(255, 255, 255, 0) 50%, 
    rgba(236, 72, 153, 0.1) 100%);
}

.canvas .table.wedding-table::after,
.canvas .table[data-wedding="true"]::after {
  border: 1px solid rgba(255, 255, 255, 0.6);
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
}

/* Wedding table badge/icon - positioned on the left side (top-left corner) */
.canvas .table.wedding-table .wedding-icon,
.canvas .table[data-wedding="true"] .wedding-icon {
  position: absolute;
  top: -12px;
  left: -12px;
  background: linear-gradient(135deg, #fce7f3 0%, #f9a8d4 100%);
  color: #be185d;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e879f9;
  filter: drop-shadow(0 2px 6px rgba(236, 72, 153, 0.35));
  z-index: 30;
  pointer-events: none;
  line-height: 1;
}

.canvas .table.wedding-table .wedding-icon svg,
.canvas .table[data-wedding="true"] .wedding-icon svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Wedding table hover effect */
.canvas .table.wedding-table:hover,
.canvas .table[data-wedding="true"]:hover {
  filter: drop-shadow(0 6px 16px rgba(236, 72, 153, 0.35));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6),
              inset 0 -2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px) scale(1.02);
}

/* Stolice sa brojevima – ko gde sedi */
.canvas-chair {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #ffffff 0%, #f8fafc 25%, #f1f5f9 60%, #e2e8f0 100%);
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08),
              0 1px 2px rgba(0, 0, 0, 0.06),
              inset 0 1px 0 rgba(255, 255, 255, 0.95);
  z-index: 15;
  pointer-events: none;
  line-height: 1.2;
  padding: 4px 5px;
  box-sizing: border-box;
  min-width: 28px;
  min-height: 28px;
  backdrop-filter: blur(1px);
}

.canvas-chair-num {
  font-size: 13px;
  font-weight: 800;
  color: #334155;
  line-height: 1;
  letter-spacing: -0.02em;
}

.canvas-chair-name {
  font-size: 8px;
  font-weight: 600;
  color: #475569;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
  line-height: 1;
  letter-spacing: 0.01em;
}


.canvas-chairs-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.canvas-chairs-checkbox {
  margin: 0;
  cursor: pointer;
}

/* Resize handle for tables (owner/admin only) */
.canvas .table .resize-handle,
.canvas .door .resize-handle,
.canvas .wall .resize-handle {
  width: 12px;
  height: 12px;
  background: #555;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 3px;
  position: absolute;
  right: -2px;
  bottom: -2px;
  cursor: se-resize;
  z-index: 20;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease, filter 0.2s ease;
  pointer-events: auto;
}

.canvas .table .resize-handle:hover,
.canvas .door .resize-handle:hover,
.canvas .wall .resize-handle:hover {
  background: #666;
  transform: scale(1.2);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}

/* Naziv elementa - kompaktno, pogodno za brojeve (1, 2, Sto 1...) */
.canvas .table .table-name {
  user-select: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #1e293b;
  z-index: 20;
  pointer-events: none;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.9);
  max-width: 90%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.95);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.08));
}
.canvas .table .table-name:empty {
  display: none;
}

/* Seat count badge - zaobljen, sa blagim hover efektom */
.canvas .table .table-seats-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 26px;
  width: max-content;
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 13px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  pointer-events: none;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  transition: filter 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.canvas .table:hover .table-seats-badge {
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.15));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.95) inset;
}
.canvas .table .table-seats-badge.seats-badge-filled {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  border-color: rgba(0, 0, 0, 0.12);
  filter: drop-shadow(0 2px 6px rgba(34, 197, 94, 0.35));
}
.canvas .table .table-seats-badge.seats-badge-over {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border-color: rgba(0, 0, 0, 0.12);
  filter: drop-shadow(0 2px 6px rgba(239, 68, 68, 0.35));
}

/* Canvas icon - dekorativna ikonica, najveći z-index (--icon-size iz JS) */
.canvas .canvas-icon {
  position: absolute;
  width: var(--icon-size, 36px);
  height: var(--icon-size, 36px);
  min-width: 20px;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: move;
  color: #64748b;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
  box-sizing: border-box;
  user-select: none;
}

.canvas .canvas-icon:hover {
  color: #334155;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.2));
}

.canvas .canvas-icon i {
  width: 70%;
  height: 70%;
  min-width: 16px;
  min-height: 16px;
}

.template.zone {
  background: rgba(14, 165, 233, 0.08);
  border: 2px dashed #0ea5e9;
  width: 80px;
  height: 60px;
  border-radius: 6px;
}

.template.canvas-icon-template {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
}

.template.canvas-icon-template:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #475569;
}

.template.canvas-icon-template .template-icon-preview {
  width: 24px;
  height: 24px;
}

.canvas .zone-block {
  user-select: none;
  position: absolute;
  background: rgba(14, 165, 233, 0.08);
  border: none;
  border-radius: 8px;
  z-index: 1;
  box-sizing: border-box;
  pointer-events: auto;
  overflow: visible;
  filter: drop-shadow(0 2px 6px rgba(14, 165, 233, 0.12));
}

/* Dashed border sa animacijom pomeranja crtice */
.canvas .zone-block::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  padding: 2px;
  background:
    linear-gradient(90deg, var(--zone-border-color, #0ea5e9) 50%, transparent 50%),
    linear-gradient(90deg, var(--zone-border-color, #0ea5e9) 50%, transparent 50%),
    linear-gradient(0deg, var(--zone-border-color, #0ea5e9) 50%, transparent 50%),
    linear-gradient(0deg, var(--zone-border-color, #0ea5e9) 50%, transparent 50%);
  background-size: 20px 2px, 20px 2px, 2px 20px, 2px 20px;
  background-position: 0 0, 0 100%, 0 0, 100% 0;
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: zone-dash 20s linear infinite;
  pointer-events: none;
}

@keyframes zone-dash {
  to {
    background-position: 20px 0, -20px 100%, 0 -20px, 100% 20px;
  }
}

.canvas .zone-block .zone-label {
  user-select: none;
  position: absolute;
  top: -18px;
  left: 12px;
  background: #ffffff;
  padding: 5px 14px;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
  z-index: 10;
  white-space: nowrap;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

.canvas .zone-block .resize-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #0ea5e9;
  border: 2px solid #ffffff;
  border-radius: 50%;
  cursor: se-resize;
  z-index: 2;
  pointer-events: auto;
}

/* Vrata - drvena tekstura, 3D efekat */
.canvas .door {
  user-select: none;
  position: absolute;
  background: linear-gradient(165deg,
    #a0522d 0%,
    #8b4513 15%,
    #6b3410 35%,
    #8b4513 50%,
    #6b3410 65%,
    #8b4513 85%,
    #a0522d 100%);
  border: 2px solid #5c3a1a;
  border-radius: 6px;
  cursor: move;
  z-index: 5 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  font-weight: bold;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15),
              inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  transform-origin: center center;
  box-sizing: border-box;
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.canvas .door:hover {
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2),
              inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}

.canvas .door.selected {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Unutrašnji okvir - staklo/panel vrata */
.canvas .door::before {
  content: '';
  position: absolute;
  top: 8%;
  left: 8%;
  right: 8%;
  bottom: 8%;
  border: 2px solid #5c3a1a;
  border-radius: 4px;
  background: linear-gradient(145deg,
    rgba(139, 69, 19, 0.4) 0%,
    rgba(101, 67, 33, 0.6) 50%,
    rgba(139, 69, 19, 0.3) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  pointer-events: none;
}
/* Vrata sa prilagođenom bojom - unutrašnji okvir prati boju */
.canvas .door[data-fill-color]::before {
  border-color: var(--door-border, #5c3a1a);
  background: linear-gradient(145deg,
    rgba(0, 0, 0, 0.08) 0%,
    rgba(0, 0, 0, 0.15) 50%,
    rgba(0, 0, 0, 0.06) 100%);
}

.canvas .wall {
  position: absolute;
  background: linear-gradient(145deg, #374151 0%, #4b5563 50%, #6b7280 100%);
  border-radius: 4px;
  cursor: move;
  z-index: 5;
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.canvas .wall:hover {
  background: linear-gradient(145deg, #4b5563 0%, #6b7280 50%, #9ca3af 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  filter: brightness(1.05);
}

.canvas .wall.selected {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* SVG walls (parabola sa 3 tačke) */
.walls-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.walls-layer .wall-item {
  pointer-events: auto;
}

.walls-layer .wall-path {
  fill: none;
  stroke: url(#wallGradient) #4b5563;
  stroke-width: 8;
  stroke-linecap: round;
  cursor: move;
  pointer-events: stroke;
  filter: url(#wallShadow);
  transition: stroke 0.2s ease, stroke-width 0.2s ease, filter 0.2s ease;
}

.walls-layer .wall-path:hover {
  stroke: url(#wallGradientHover) #6b7280;
  stroke-width: 10;
  filter: url(#wallShadowHover);
}

.walls-layer .wall-handle {
  fill: #4b5563;
  stroke: #fff;
  stroke-width: 2;
  cursor: move;
  pointer-events: auto;
}

.walls-layer .wall-handle:hover {
  fill: #2563eb;
}

.walls-layer .wall-handle.control {
  fill: #6b7280;
}

/* Naziv vrata - kompaktno, kao kod stolova */
.canvas .door .door-name {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120%;
  text-align: center;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.95);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.08));
  z-index: 20;
}
.canvas .door .door-name:empty {
  display: none;
}

.canvas-container {
  user-select: none;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  height: clamp(560px, calc(100vh - 220px), 1400px) !important;
  min-height: 560px !important;
  flex: 1 1 100% !important;
  flex-basis: 100% !important;
  background: #fff;
  border-radius: 0;
  border: none;
  border-top: 2px solid #e9ecef;
  padding: 0;
  box-shadow: none;
  margin: 0;
  box-sizing: border-box;
  overflow: auto;
  position: relative;
}

.canvas-container:fullscreen,
.canvas-container.pseudo-fullscreen {
  overflow: auto !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  min-height: 100vh !important;
}

.canvas-container:fullscreen .canvas-zoom-controls,
.canvas-container.pseudo-fullscreen .canvas-zoom-controls {
  left: auto !important;
  right: 10px !important;
  transform: none !important;
  top: 20px !important;
}

@supports (-webkit-touch-callout: none) {
  .canvas-container:-webkit-full-screen,
  .canvas-container.pseudo-fullscreen {
    overflow: auto !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    min-height: 100vh !important;
  }

  .canvas-container:-webkit-full-screen .canvas-zoom-controls,
  .canvas-container.pseudo-fullscreen .canvas-zoom-controls {
    left: auto !important;
    right: 10px !important;
    transform: none !important;
    top: 20px !important;
  }
}

/* Canvas wrapper for centering */
.canvas-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Canvas zoom controls - inline, ne lomi se */
.canvas-zoom-controls {
  position: sticky;
  top: 10px;
  right: 10px;
  left: auto;
  margin-left: auto;
  width: fit-content;
  z-index: 1000;
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid #ddd;
  white-space: nowrap;
}

.zoom-btn {
  background: #3b82f6;
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.zoom-btn:hover {
  background: #2563eb;
}

.zoom-btn:active {
  background: #053a5f;
}

.zoom-btn-active,
.zoom-btn-toggle.zoom-btn-active {
  background: #1d4ed8;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.zoom-level {
  font-size: 14px;
  font-weight: 600;
  color: #1e40af;
  min-width: 50px;
  text-align: center;
  margin-left: 5px;
}

.hall-page #canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  border: 2px dashed #999;
  background: #f9f9f9;
  border-radius: 4px;
  overflow: visible;
  transform-origin: center center;
  transition: transform 0.1s ease-out;
  margin: auto;
  display: block;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.04), inset 0 -1px 2px rgba(255,255,255,0.5);
}

#canvasContent {
  position: absolute;
  left: 0;
  top: 0;
  width: 2400px;
  height: 1500px;
  transform-origin: 0 0;
}

/* Responsive */
@media (max-width: 1200px) {
  .hall-page .sidebar,
  .hall-page #sidebar {
    width: 100% !important;
    flex-wrap: wrap;
    gap: 1.5em;
  }

  .templates-grid {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 1em;
  }

  .hall-page #canvas {
    min-height: 540px;
    height: calc(100vh - 260px);
  }

  .canvas-container {
    height: clamp(540px, calc(100vh - 260px), 1200px) !important;
    min-height: 540px !important;
  }
}

@media (max-width: 828px) {
  .hall-header {
    padding: 1em;
  }

  .hall-header h1 {
    font-size: 1.5em;
  }

  .hall-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .hall-controls input[type="text"] {
    min-width: 100%;
  }

  .hall-content {
    padding: 0 0.5em 1em 0.5em;
  }

  .hall-page .sidebar,
  .hall-page #sidebar {
    width: 100% !important;
    padding: 1em;
    gap: 1em;
  }

  .templates-grid {
    flex-wrap: wrap;
    gap: 0.75em;
  }

  .hall-page .template {
    width: 60px;
    height: 60px;
  }

  .hall-page .template.rectangle {
    width: 70px;
    height: 50px;
  }

  .hall-page #canvas {
    min-height: 440px;
    height: calc(100vh - 240px);
  }

  .canvas-container {
    padding: 1em;
    height: clamp(460px, 65vh, 800px) !important;
    min-height: 460px !important;
  }
}

/* Canvas / Demo page - Mobile responsive */
@media (max-width: 828px) {
  .hall-page .demo-container,
  .demo-page .demo-container {
    padding: 90px 0.75rem 0; /* 90px ispod fixed header-a */
    max-width: 100%;
    overflow-x: hidden;
  }

  .hall-page .page-content,
  .demo-page .page-content {
    padding: 0;
  }

  .demo-page .demo-banner {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }

  .demo-page .demo-banner h2 {
    font-size: 1.1rem !important;
  }

  .demo-page .demo-banner p {
    font-size: 0.85rem !important;
  }

  .hall-page .user-hall-header,
  .demo-page .user-hall-header {
    padding: 1rem !important;
  }

  .hall-page .user-hall-header-content,
  .demo-page .user-hall-header-content {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .hall-page .user-hall-title,
  .demo-page .user-hall-title {
    font-size: 1.25rem !important;
  }

  .hall-page .user-hall-stats,
  .demo-page .user-hall-stats {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
  }

  .hall-page .user-hall-stat-box,
  .demo-page .user-hall-stat-box {
    min-width: 80px;
    padding: 0.5rem 0.75rem;
  }

  .hall-page .user-hall-stat-value,
  .demo-page .user-hall-stat-value {
    font-size: 1.25rem !important;
  }

  .hall-page .user-hall-fill-bar,
  .demo-page .user-hall-fill-bar {
    width: 120px !important;
    min-width: 100px;
  }

  .hall-page .user-hall-tutorial,
  .demo-page .user-hall-tutorial {
    margin-bottom: 1rem !important;
  }

  .hall-page .user-hall-tutorial > div,
  .demo-page .user-hall-tutorial > div {
    flex-direction: column !important;
    padding: 0.75rem !important;
    gap: 0.5rem !important;
  }

  .hall-page .user-hall-tutorial h4,
  .demo-page .user-hall-tutorial h4 {
    font-size: 0.9rem !important;
  }

  .hall-page .user-hall-tutorial div > div,
  .demo-page .user-hall-tutorial div > div {
    font-size: 0.8rem !important;
  }

  /* Templates palette - mobile, 4 po redu */
  .hall-page .info-card .templates-grid,
  .demo-page .info-card .templates-grid,
  .hall-page .templates-grid,
  .demo-page .templates-grid,
  .hall-page .edit-palette-grid,
  .hall-page .scene-panel-palette,
  .demo-page .edit-palette-grid,
  .demo-page .scene-panel-palette {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem !important;
    justify-items: center;
  }

  .hall-page .template,
  .demo-page .template {
    width: 50px !important;
    height: 50px !important;
  }

  .hall-page .template.rectangle,
  .demo-page .template.rectangle {
    width: 55px !important;
    height: 45px !important;
  }

  .hall-page .template.wedding,
  .demo-page .template.wedding {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
  }

  .hall-page .template.wedding-square,
  .demo-page .template.wedding-square {
    width: 50px !important;
    height: 50px !important;
    border-radius: 6px !important;
  }

  .hall-page .template.door,
  .demo-page .template.door {
    width: 50px !important;
    height: 60px !important;
  }

  .hall-page .template.wall,
  .demo-page .template.wall {
    width: 80px !important;
    height: 14px !important;
  }

  .hall-page .template.wall.vertical,
  .demo-page .template.wall.vertical {
    width: 14px !important;
    height: 80px !important;
  }

  .hall-page .template.zone,
  .demo-page .template.zone {
    width: 55px !important;
    height: 45px !important;
  }

  /* Canvas buttons row */
  .hall-page [id="generateExampleBtn"],
  .hall-page [id="clearDemoBtn"],
  .demo-page [id="generateExampleBtn"],
  .demo-page [id="clearDemoBtn"] {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.9rem;
    padding: 0.6rem 0.75rem;
  }

  .hall-page .canvas-container,
  .demo-page .canvas-container {
    height: clamp(420px, 60vh, 700px) !important;
    min-height: 420px !important;
  }

  /* Zoom controls - kompaktno na telefonu */
  .canvas-zoom-controls {
    flex-wrap: nowrap !important;
    padding: 3px 5px !important;
    gap: 2px !important;
    top: 4px !important;
    right: 4px !important;
    white-space: nowrap !important;
  }

  .hall-page .canvas-zoom-controls .zoom-btn,
  .demo-page .canvas-zoom-controls .zoom-btn {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    font-size: 12px !important;
  }

  .hall-page .canvas-zoom-controls .zoom-level,
  .demo-page .canvas-zoom-controls .zoom-level {
    font-size: 10px !important;
    min-width: 30px !important;
  }

  .hall-page .canvas-zoom-controls .canvas-bg-label,
  .demo-page .canvas-zoom-controls .canvas-bg-label {
    display: none !important;
  }

  .hall-page .canvas-zoom-controls .canvas-bg-input,
  .demo-page .canvas-zoom-controls .canvas-bg-input {
    width: 20px !important;
    height: 20px !important;
  }

  /* Guest list filters */
  .hall-page .info-card > div[style*="flex-wrap"]:not(.templates-grid),
  .demo-page .info-card > div[style*="flex-wrap"]:not(.templates-grid) {
    flex-direction: column;
  }

  /* Templates palette - 2-3 per row on mobile (ne menjamo flex-direction) */
  .hall-page .info-card .templates-grid,
  .demo-page .info-card .templates-grid,
  .hall-page .templates-grid,
  .demo-page .templates-grid {
    flex-direction: row !important;
    flex-wrap: wrap !important;
  }

  .hall-page #guestSearchInput,
  .demo-page #guestSearchInput {
    min-width: 100% !important;
  }

  .hall-page #guestTableDropdown,
  .demo-page #guestTableDropdown {
    min-width: 100% !important;
  }

  /* Raspored dana - inputi puna širina na mobilnom */
  #timelineAddRow {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  #timelineAddRow > div {
    min-width: 0 !important;
    width: 100% !important;
  }
  #timelineAddRow #timelineTimeInput,
  #timelineAddRow #timelineLabelInput {
    width: 100% !important;
    box-sizing: border-box;
  }

  .hall-page .info-card,
  .demo-page .info-card {
    padding: 1rem !important;
  }

  /* Guest list header + Export/Print buttons - responsive */
  .hall-page .guest-list-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  .hall-page .guest-list-actions {
    flex-wrap: wrap !important;
    width: 100%;
  }

  .hall-page .guest-action-btn {
    flex: 1 1 auto !important;
    min-width: min(100%, 180px) !important;
    justify-content: center !important;
  }
}

@media (max-width: 540px) {
  .hall-page .demo-container,
  .demo-page .demo-container {
    padding: 90px 0.5rem 0; /* 90px ispod fixed header-a */
  }

  .hall-page .user-hall-stat-box,
  .demo-page .user-hall-stat-box {
    min-width: 70px;
    padding: 0.4rem 0.5rem;
  }

  .hall-page .user-hall-stat-value,
  .demo-page .user-hall-stat-value {
    font-size: 1.1rem !important;
  }

  .hall-page .user-hall-fill-indicator,
  .demo-page .user-hall-fill-indicator {
    flex-direction: column;
    align-items: stretch;
  }

  .hall-page .user-hall-fill-bar,
  .demo-page .user-hall-fill-bar {
    width: 100% !important;
  }

  /* Buttons stack on very small screens */
  .hall-page .canvas-actions,
  .demo-page .canvas-actions {
    flex-direction: column;
  }

  .hall-page #generateExampleBtn,
  .hall-page #clearDemoBtn,
  .demo-page #generateExampleBtn,
  .demo-page #clearDemoBtn {
    width: 100%;
  }

  .hall-page .canvas-container,
  .demo-page .canvas-container {
    height: clamp(380px, 55vh, 600px) !important;
    min-height: 380px !important;
  }

  .hall-page .template,
  .demo-page .template {
    width: 44px !important;
    height: 44px !important;
  }

  .hall-page .template.rectangle,
  .demo-page .template.rectangle {
    width: 50px !important;
    height: 40px !important;
  }

  .hall-page .template.wedding,
  .demo-page .template.wedding {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
  }

  .hall-page .template.wedding-square,
  .demo-page .template.wedding-square {
    width: 44px !important;
    height: 44px !important;
    border-radius: 6px !important;
  }

  .hall-page .template.door,
  .demo-page .template.door {
    width: 44px !important;
    height: 55px !important;
  }

  /* Na veoma uskim ekranima - dugmad Export/Štampaj u punu širinu */
  .hall-page .guest-list-actions {
    flex-direction: column !important;
  }

  .hall-page .guest-action-btn {
    width: 100% !important;
    min-width: 100% !important;
    justify-content: center !important;
  }

  #importGuestsBtn,
  #ownerImportGuestsBtn {
    min-width: 100% !important;
  }

  /* Kartice gostiju - sadržaj i dugmad Izmeni/Sto - omogući wrap */
  .hall-page .guest-item .guest-info > div {
    flex-wrap: wrap !important;
  }

  .hall-page .guest-item .guest-info > div > div:last-child {
    flex-wrap: wrap !important;
    flex-shrink: 1 !important;
  }
}

/* Checkbox za selekciju gostiju - povećana veličina */
.demo-guest-assign-cb,
.owner-guest-assign-checkbox,
.guest-assign-checkbox,
#ownerGuestSelectAllCheckbox,
#demoGuestSelectAllCheckbox,
#guestSelectAllCheckbox {
  width: 1.35rem;
  height: 1.35rem;
  min-width: 1.35rem;
  min-height: 1.35rem;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* Checkbox u th - ista veličina kao u redovima (th može imati drugi font-size) */
.user-guests-table th input[type="checkbox"],
.owner-guests-table th input[type="checkbox"],
.demo-guests-table th input[type="checkbox"] {
  width: 1.35rem;
  height: 1.35rem;
  min-width: 1.35rem;
  min-height: 1.35rem;
  box-sizing: border-box;
}

/* Red 1: stolovi + strane | Red 2: pretraga */
.guest-search-filter-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.guest-filter-tables-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: stretch;
}
.guest-filter-tables-row .guest-search-filter-select,
.guest-filter-tables-row .guest-search-filter-dropdown {
  flex: 1 1 100%;
  min-width: 0;
  box-sizing: border-box;
}
/* Inline stolovi + strane van telefona (541px = iznad max-width: 540px) */
@media (min-width: 541px) {
  .guest-filter-tables-row {
    flex-wrap: nowrap;
  }
  .guest-filter-tables-row .guest-search-filter-select,
  .guest-filter-tables-row .guest-search-filter-dropdown {
    flex: 1 1 0;
    min-width: 110px;
    max-width: 50%;
  }
}
/* Na velikom ekranu - kao 4 filtera u redu, svaki po 25% (gap 0.75rem između) */
@media (min-width: 1024px) {
  .guest-filter-tables-row .guest-search-filter-select,
  .guest-filter-tables-row .guest-search-filter-dropdown {
    flex: 0 0 calc((100% - 3 * 0.75rem) / 4);
    min-width: 0;
    max-width: none;
  }
}
.guest-filter-search-row {
  width: 100%;
}
.guest-filter-search-row .guest-search-filter-input {
  width: 100%;
  box-sizing: border-box;
}

/* Strana - radio dugmad (visina kao filteri, min 44px) */
/* Owner edit je unutar .form-group - .form-group input pregazi stilove; ovde ih vraćamo */
.form-group .guest-side-radios .guest-side-radio-label input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  font: inherit;
  color: currentColor;
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  min-height: 1.25rem;
  padding: 0;
  border: 0.15em solid var(--guest-side-radio-border);
  border-radius: 50%;
  background-color: #fff;
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
.form-group .guest-side-radios {
  --guest-side-radio-color: #166534;
  --guest-side-radio-border: #94a3b8;
}
.form-group .guest-side-radios .guest-side-radio-label {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  grid-template-columns: 1.5rem auto;
}
.form-group .guest-side-radios .guest-side-radio-label:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.form-group .guest-side-radios .guest-side-radio-label:has(input:checked) {
  border-color: var(--guest-side-radio-color);
  background: #f0fdf4;
}
.form-group .guest-side-radios .guest-side-radio-label input[type="radio"]::before {
  content: "";
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.12s ease-in-out;
  box-shadow: inset 1em 1em var(--guest-side-radio-color);
  background-color: CanvasText;
}
.form-group .guest-side-radios .guest-side-radio-label input[type="radio"]:checked {
  border-color: var(--guest-side-radio-color);
}
.form-group .guest-side-radios .guest-side-radio-label input[type="radio"]:checked::before {
  transform: scale(1);
}
.form-group .guest-side-radios .guest-side-radio-label input[type="radio"]:hover:not(:disabled) {
  border-color: var(--guest-side-radio-color);
}
.form-group .guest-side-radios .guest-side-radio-label input[type="radio"]:focus {
  outline: none;
}
.form-group .guest-side-radios .guest-side-radio-label input[type="radio"]:focus-visible {
  outline: max(2px, 0.15em) solid var(--guest-side-radio-color);
  outline-offset: max(2px, 0.15em);
}
.form-group .guest-side-radios .guest-side-radio-label {
  display: grid;
  gap: 0.5rem;
  align-items: center;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.3;
}
.guest-side-radios {
  --guest-side-radio-color: #166534;
  --guest-side-radio-border: #94a3b8;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
}
.guest-side-radio-label {
  display: grid;
  grid-template-columns: 1.5rem auto;
  gap: 0.5rem;
  align-items: center;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.3;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s, background-color 0.15s;
}
.guest-side-radio-label:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.guest-side-radio-label:has(input:checked) {
  border-color: var(--guest-side-radio-color);
  background: #f0fdf4;
}
.guest-side-radio-label input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  font: inherit;
  color: currentColor;
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  min-height: 1.25rem;
  border: 0.15em solid var(--guest-side-radio-border);
  border-radius: 50%;
  background-color: #fff;
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.guest-side-radio-label input[type="radio"]::before {
  content: "";
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.12s ease-in-out;
  box-shadow: inset 1em 1em var(--guest-side-radio-color);
  background-color: CanvasText; /* Windows High Contrast Mode */
}
.guest-side-radio-label input[type="radio"]:checked {
  border-color: var(--guest-side-radio-color);
}
.guest-side-radio-label input[type="radio"]:checked::before {
  transform: scale(1);
}
.guest-side-radio-label input[type="radio"]:hover:not(:disabled) {
  border-color: var(--guest-side-radio-color);
}
.guest-side-radio-label input[type="radio"]:focus {
  outline: none;
}
.guest-side-radio-label input[type="radio"]:focus-visible {
  outline: max(2px, 0.15em) solid var(--guest-side-radio-color);
  outline-offset: max(2px, 0.15em);
}

/* Responsive - veći touch target na mobilnom (min 44px) */
@media (max-width: 540px) {
  .guest-side-radios,
  .form-group .guest-side-radios {
    gap: 0.5rem 1rem;
  }
  .guest-side-radio-label,
  .form-group .guest-side-radios .guest-side-radio-label {
    font-size: 1rem;
    min-height: 44px;
    padding: 0.5rem 0;
    align-items: center;
  }
  .guest-side-radio-label input[type="radio"],
  .form-group .guest-side-radios .guest-side-radio-label input[type="radio"] {
    width: 0.65rem;
    height: 0.65rem;
    min-width: 0.65rem;
    min-height: 0.65rem;
  }
}

/* Brzo dodaj rezervacije - poravnanje radio dugmadi i inputa u jednoj liniji */
.quick-add-guests-section .quick-add-guests-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.quick-add-guests-section .quick-add-guests-row > div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.quick-add-guests-section .quick-add-guests-row > div > label,
.quick-add-guests-section .quick-add-guests-row > div > span {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0;
  display: block;
}
.quick-add-guests-section .quick-add-guests-row input[type="text"] {
  min-height: 44px;
  box-sizing: border-box;
}
.quick-add-guests-section .quick-add-guests-row .guest-side-radios-wrap .guest-side-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}
.quick-add-guests-section .quick-add-guests-row .guest-side-radios-wrap .guest-side-radio-label {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  align-items: center;
  margin: 0;
}
.quick-add-guests-section .quick-add-guests-row > button {
  flex-shrink: 0;
  min-height: 44px;
}

/* Demo: iste visine kao na ostalim stranicama (form-input ima drugačiji padding) */
.demo-page .quick-add-guests-section .quick-add-guests-row input.form-input {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;
}
.demo-page .quick-add-guests-section .quick-add-guests-row .guest-side-radios-wrap .guest-side-radio-label {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  align-items: center;
}

/* Demo: dropdown Potvrda u liniji sa checkboxima - ne prelama u novi red, ista širina kao checkbox */
.demo-page .demo-filters-row .filter-group-3 {
  flex-wrap: nowrap;
}
.demo-page .filter-group-3 .demo-confirmed-filter-inline {
  align-self: center;
  min-height: 38px;
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  /* ista širina kao filter-group-3-checkbox */
  width: 11.5em;
  min-width: 11.5em;
  box-sizing: border-box;
}

/* Brzo dodaj rezervacije - mobilni: ime, prezime, napomena, strana, dugme - 100% širine, svako u novom redu */
@media (max-width: 540px) {
  .quick-add-guests-section {
    padding: 0.75rem 1rem !important;
    overflow-x: hidden;
    min-width: 0;
  }
  .quick-add-guests-section .quick-add-guests-row {
    flex-direction: column !important;
    align-items: stretch !important;
    min-width: 0;
    overflow-x: hidden;
  }
  .quick-add-guests-section .quick-add-guests-row > div {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: none !important;
  }
  .quick-add-guests-section .quick-add-guests-row input,
  .quick-add-guests-section .quick-add-guests-row select {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }
  .quick-add-guests-section .quick-add-guests-row > button {
    width: 100%;
  }
}
/* Input za pretragu gostiju - boja kao primary dugme */
#ownerGuestSearchInput,
#userTablesSearchInput,
#demoTablesSearchInput {
  background: #eff6ff;
  border: 2px solid #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}
#ownerGuestSearchInput:focus,
#userTablesSearchInput:focus,
#demoTablesSearchInput:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.guest-search-filter-input {
  padding: 0.6rem 0.9rem;
  border: 2px solid #64748b;
  border-radius: 8px;
  font-size: 0.9rem;
  box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.15);
}
.guest-search-filter-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.guest-search-filter-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.9rem;
}
.guest-search-filter-dropdown {
  position: relative;
}

/* Tabelarni pregled gostiju - 2 kolone (user hall, owner, demo) */
.user-guests-tables-grid,
.owner-guests-tables-grid,
.demo-guests-tables-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.user-guests-table-wrap,
.owner-guests-table-wrap,
.demo-guests-table-wrap {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
.user-guests-table,
.owner-guests-table,
.demo-guests-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.user-guests-table th,
.owner-guests-table th,
.demo-guests-table th {
  padding: 0.6rem 0.75rem;
  text-align: left;
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
}
.user-guests-table td,
.owner-guests-table td,
.demo-guests-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}
.user-guests-table tbody tr:nth-child(even),
.owner-guests-table tbody tr:nth-child(even),
.demo-guests-table tbody tr:nth-child(even) {
  background: #f8fafc;
}
.user-guests-table tbody tr:last-child td,
.owner-guests-table tbody tr:last-child td,
.demo-guests-table tbody tr:last-child td {
  border-bottom: none;
}
.user-guests-table tbody tr:hover,
.owner-guests-table tbody tr:hover,
.demo-guests-table tbody tr:hover {
  background: #f1f5f9 !important;
}
.user-guests-table th.sortable,
.owner-guests-table th.sortable,
.demo-guests-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.user-guests-table th.sortable:hover,
.owner-guests-table th.sortable:hover,
.demo-guests-table th.sortable:hover {
  background: #f1f5f9;
}
.user-guests-table th.sortable .sort-icon,
.owner-guests-table th.sortable .sort-icon,
.demo-guests-table th.sortable .sort-icon {
  opacity: 0.5;
  font-size: 0.75em;
  margin-left: 0.25rem;
}
.user-guests-table th.sortable.sorted-asc .sort-icon::after,
.owner-guests-table th.sortable.sorted-asc .sort-icon::after,
.demo-guests-table th.sortable.sorted-asc .sort-icon::after {
  content: ' ↑';
  opacity: 1;
}
.user-guests-table th.sortable.sorted-desc .sort-icon::after,
.owner-guests-table th.sortable.sorted-desc .sort-icon::after,
.demo-guests-table th.sortable.sorted-desc .sort-icon::after {
  content: ' ↓';
  opacity: 1;
}
.user-guests-table th:nth-child(4),
.user-guests-table td:nth-child(4),
.owner-guests-table th:nth-child(4),
.owner-guests-table td:nth-child(4),
.demo-guests-table th:nth-child(4),
.demo-guests-table td:nth-child(4) {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-guests-table-wrap.no-napomena th:nth-child(5),
.user-guests-table-wrap.no-napomena td:nth-child(5),
.demo-guests-table-wrap.no-napomena th:nth-child(5),
.demo-guests-table-wrap.no-napomena td:nth-child(5) {
  display: none;
}
.user-guests-tables-grid.no-checkbox-column .user-guests-table th:first-child,
.user-guests-tables-grid.no-checkbox-column .user-guests-table td:first-child,
.owner-guests-tables-grid.no-checkbox-column .owner-guests-table th:first-child,
.owner-guests-tables-grid.no-checkbox-column .owner-guests-table td:first-child {
  display: none;
}

/* Akcije - ikonice ne smeju da se lome (predposlednja kolona) */
.user-guests-table td:nth-last-child(2),
.owner-guests-table td:nth-last-child(2),
.demo-guests-table td:nth-last-child(2),
.table-guests-grid td:nth-last-child(2) {
  white-space: nowrap;
  min-width: 140px;
}
.user-guests-table td:nth-last-child(2) button,
.owner-guests-table td:nth-last-child(2) button,
.demo-guests-table td:nth-last-child(2) button,
.table-guests-grid td:nth-last-child(2) button {
  white-space: nowrap;
  flex-shrink: 0;
}
/* Akcije - ikonice fiksne veličine (sprečava istezanje) */
.owner-guests-table td button .btn-icon,
.owner-guests-table td button .lucide,
.owner-guests-table td button svg,
.user-guests-table td button .btn-icon,
.user-guests-table td button .lucide,
.user-guests-table td button svg,
.demo-guests-table td button .btn-icon,
.demo-guests-table td button .lucide,
.demo-guests-table td button svg,
.table-guests-grid td button .btn-icon,
.table-guests-grid td button .lucide,
.table-guests-grid td button svg {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  min-height: 1rem;
  flex-shrink: 0;
}

/* Kolona potvrde (✓) - minimalna širina */
.user-guests-table th:last-child,
.user-guests-table td:last-child,
.owner-guests-table th:last-child,
.owner-guests-table td:last-child,
.demo-guests-table th:last-child,
.demo-guests-table td:last-child,
.table-guests-grid th:last-child,
.table-guests-grid td:last-child {
  width: 2rem !important;
  min-width: 2rem !important;
  max-width: 2rem !important;
  padding: 0.25rem !important;
  text-align: center;
  white-space: nowrap;
}

/* Responsive: table-guests-grid u modalu - horizontalni scroll na uskim ekranima */
.table-guests-grid-wrap .table-guests-grid {
  min-width: 380px;
}

/* Drag & drop za zamenu mesta gostiju */
.table-guests-grid tbody tr[draggable="true"] {
  cursor: grab;
}
.table-guests-grid tbody tr[draggable="true"]:active {
  cursor: grabbing;
}
.table-guests-grid tbody tr.guest-drag-over {
  opacity: 0.6;
}
.table-guests-grid tbody tr.guest-drop-target {
  background: #dbeafe !important;
  box-shadow: inset 0 0 0 2px #3b82f6;
}
@media (max-width: 1052px) {
  .user-guests-tables-grid,
  .owner-guests-tables-grid,
  .demo-guests-tables-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .user-guests-tables-grid,
  .owner-guests-tables-grid,
  .demo-guests-tables-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== Edit modal - isti pattern kao table-guests (full screen na mobilnom) ========== */
/* Icon picker modal */
.icon-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 1051;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 1rem;
}

.icon-picker-modal-inner {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.icon-picker-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.icon-picker-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.icon-picker-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
  padding: 0.25rem;
  line-height: 1;
}

.icon-picker-modal-close:hover {
  color: #334155;
}

.icon-picker-modal-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.icon-picker-search {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 0.5rem;
}

.icon-picker-grid-item {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  color: #64748b;
  transition: all 0.15s ease;
}

.icon-picker-grid-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

.icon-picker-grid-item i {
  width: 24px;
  height: 24px;
}

.icon-picker-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: #64748b;
}

.icon-picker-modal-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #e2e8f0;
}

.icon-picker-hint {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
}

.icon-picker-hint kbd {
  padding: 0.1rem 0.35rem;
  background: #e2e8f0;
  border-radius: 4px;
  font-size: 0.75rem;
}

.canvas-icon-placement-mode .canvas,
.canvas-icon-placement-mode #canvas-container {
  cursor: crosshair;
}

#editModal.edit-modal-dialog .edit-modal-inner {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  background: #fff;
}
#editModal.edit-modal-dialog .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
#editModal.edit-modal-dialog .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#editModal.edit-modal-dialog .modal-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
}
.edit-modal-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s;
}
.edit-modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* ========== Table guests dialog (klik na sto) - zajednički za demo, user, owner ========== */
.table-guests-dialog {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1051;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.table-guests-panel-inner {
  background: white;
  max-width: 1320px;
  width: 98%;
  max-height: 92vh;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.table-guests-panel-header {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.table-guests-panel-header-title-wrap {
  flex: 1;
  min-width: 0;
}
.table-guests-panel-header h4 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.table-guests-panel-notes {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  opacity: 0.95;
  font-style: italic;
  display: none;
}
.table-guests-panel-notes:not(:empty) {
  display: block;
}
.table-guests-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.table-guests-panel-header-actions label {
  font-size: 0.9rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.table-guests-panel-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s;
}
.table-guests-panel-close-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}
.table-guests-panel-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow: hidden;
}
.table-guests-add-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1.5fr auto;
  gap: 0.75rem 1rem;
  align-items: end;
  padding: 1.25rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}
.table-guests-add-row .guest-side-radios-wrap {
  grid-column: span 3;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 0.35rem 0.5rem;
  align-items: end;
}
.table-guests-add-row .add-row-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.table-guests-add-row .add-row-field.add-row-field-napomena {
  min-width: 0;
}
.table-guests-add-row .add-row-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}
.table-guests-add-row .add-row-field input,
.table-guests-add-row .add-row-field .form-input-inline {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.table-guests-add-row .add-row-field input:focus,
.table-guests-add-row .add-row-field .form-input-inline:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
  outline: none;
}
.table-guests-add-row .guest-side-radios-wrap span {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}
.table-guests-add-row .guest-side-radios-wrap .guest-side-radios {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  align-items: center;
}
.table-guests-add-row .guest-side-radios-wrap .guest-side-radio-label {
  white-space: nowrap;
  flex-shrink: 0;
}
.table-guests-add-row #tableGuestsAddBtn {
  min-height: 44px;
  padding: 0.6rem 1.25rem;
  font-weight: 600;
  border-radius: 8px;
  white-space: nowrap;
}
.table-guests-grid-wrap {
  max-height: 520px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  overflow: auto;
}
.table-guests-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table-guests-grid thead {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  z-index: 1;
}
.table-guests-grid th {
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #475569;
  font-size: 0.9rem;
  text-align: left;
}
.table-guests-grid th.table-guests-col-move,
.table-guests-grid th.table-guests-col-num {
  text-align: center;
  width: 2.5rem;
}
.table-guests-grid th.table-guests-col-actions {
  text-align: center;
  width: 180px;
}
.table-guests-grid th.table-guests-col-confirm {
  width: 2rem;
  min-width: 2rem;
  padding: 0.25rem;
  text-align: center;
}
.table-guests-grid td {
  padding: 0.65rem 1rem;
}
.table-guests-grid tbody tr:hover {
  background: #f8fafc;
}
@media (max-width: 768px) {
  .table-guests-add-row {
    grid-template-columns: 1fr;
  }
  .table-guests-add-row .guest-side-radios-wrap {
    grid-column: 1;
  }
  .table-guests-add-row .guest-side-radios-wrap .guest-side-radios {
    grid-template-columns: 1fr;
  }
}
