/* Master Brand Suite v9.1 - DTP, Scaling & Canvas Styles */

.brand-suite-layout {
  display: grid;
  grid-template-columns: 460px 1fr;
  height: calc(100vh - var(--toolbar-height));
  width: 100vw;
  overflow: hidden;
  background-color: #0f172a;
  color: #f8fafc;
}

/* Brand Suite Sidebar */
.bs-sidebar {
  background-color: #1e293b;
  border-right: 1px solid #334155;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bs-sidebar h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.bs-sidebar h2 {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #3b82f6;
  margin-bottom: 6px;
  border-bottom: 1px solid #334155;
  padding-bottom: 4px;
}

.bs-sidebar p.sub {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 2px;
  line-height: 1.4;
}

.bs-project-select-box {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid #3b82f6;
  padding: 10px;
  border-radius: 6px;
}

.bs-project-select-box select {
  width: 100%;
  padding: 8px;
  background: #0f172a;
  color: white;
  border: 1px solid #334155;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.85rem;
  cursor: pointer;
}

.bs-form-group {
  margin-bottom: 6px;
}

.bs-sidebar label {
  display: block;
  font-size: 0.68rem;
  color: #94a3b8;
  margin-bottom: 2px;
  font-weight: 600;
  text-transform: uppercase;
}

.bs-sidebar input[type="text"],
.bs-sidebar input[type="number"],
.bs-sidebar select,
.bs-sidebar textarea {
  width: 100%;
  background: #0f172a;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 6px;
  border-radius: 6px;
  font-size: 0.78rem;
}

.bs-sidebar input[type="color"] {
  background: transparent;
  border: none;
  width: 26px;
  height: 26px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.bs-dynamic-row {
  display: grid;
  grid-template-columns: 26px 80px 1fr;
  gap: 5px;
  align-items: center;
  margin-bottom: 5px;
  background: rgba(0,0,0,0.25);
  padding: 5px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.05);
}

.bs-dynamic-row-font {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 70px 1.1fr;
  gap: 4px;
  align-items: center;
  margin-bottom: 5px;
  background: rgba(0,0,0,0.25);
  padding: 5px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.05);
}

.bs-upload-zone {
  border: 2px dashed #334155;
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  background: rgba(0,0,0,0.15);
  transition: all 0.2s;
  cursor: pointer;
  margin-bottom: 4px;
  display: block;
}

.bs-upload-zone:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.bs-upload-zone input[type="file"] {
  display: none;
}

.bs-upload-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #f8fafc;
  display: block;
  cursor: pointer;
}

.bs-asset-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 70px;
  overflow-y: auto;
  margin-top: 4px;
}

.bs-asset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.3);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  border-left: 3px solid #10b981;
}

.bs-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

.bs-btn-action {
  background: #334155;
  color: white;
  border: none;
  padding: 7px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.75rem;
  transition: 0.2s;
  text-align: center;
}

.bs-btn-action:hover {
  background: #3b82f6;
}

.bs-output-toolbar {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

.bs-btn-tab {
  background: #334155;
  border: none;
  color: #94a3b8;
  padding: 4px 10px;
  font-size: 0.7rem;
  border-radius: 4px;
  cursor: pointer;
}

.bs-btn-tab.active {
  background: #3b82f6;
  color: white;
}

.bs-prompt-editor-box {
  background: #050505;
  color: #10b981;
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  padding: 10px;
  border-radius: 6px;
  width: 100%;
  height: 140px;
  border: 1px solid #334155;
  resize: vertical;
}

/* Main Canvas Area */
.bs-main-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: #334155;
}

.bs-canvas-header {
  background: #1e293b;
  padding: 10px 20px;
  border-bottom: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bs-tab-bar {
  display: flex;
  gap: 6px;
}

.bs-tab-btn {
  background: #334155;
  color: #f8fafc;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.bs-tab-btn.active {
  background: #3b82f6;
  color: white;
}

/* Inspector Toolbar */
.bs-inspector-toolbar {
  background: #1e293b;
  padding: 8px 20px;
  border-bottom: 1px solid #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
}

.bs-tool-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bs-switch-btn {
  background: #334155;
  color: #f8fafc;
  border: 1px solid #475569;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.bs-switch-btn.active {
  background: #10b981;
  border-color: #10b981;
}

/* Pasteboard Viewport */
.bs-pasteboard-viewport {
  flex: 1;
  overflow: auto;
  position: relative;
  background-color: #283548;
  display: flex;
}

.bs-pasteboard-container {
  margin: auto;
  padding: 60px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bs-ruler-corner {
  position: absolute;
  top: 30px;
  left: 30px;
  width: 30px;
  height: 30px;
  background: #1e293b;
  border-right: 1px solid #475569;
  border-bottom: 1px solid #475569;
  z-index: 60;
}

.bs-ruler-top {
  position: absolute;
  top: 30px;
  left: 60px;
  right: 30px;
  height: 30px;
  background: #1e293b;
  border-bottom: 1px solid #475569;
  z-index: 55;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.bs-ruler-left {
  position: absolute;
  top: 60px;
  left: 30px;
  bottom: 30px;
  width: 30px;
  background: #1e293b;
  border-right: 1px solid #475569;
  z-index: 55;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  overflow: hidden;
}

.bs-tick-x {
  position: absolute;
  bottom: 0;
  width: 1px;
  background: #64748b;
}

.bs-tick-x.major {
  height: 12px;
  background: #f8fafc;
}

.bs-tick-label-x {
  position: absolute;
  bottom: 14px;
  font-size: 9px;
  color: #94a3b8;
  font-family: monospace;
  transform: translateX(-50%);
}

.bs-tick-y {
  position: absolute;
  right: 0;
  height: 1px;
  background: #64748b;
}

.bs-tick-y.major {
  width: 12px;
  background: #f8fafc;
}

.bs-tick-label-y {
  position: absolute;
  right: 14px;
  font-size: 9px;
  color: #94a3b8;
  font-family: monospace;
  transform: translateY(-50%) rotate(-90deg);
}

.bs-bleed-box {
  padding: var(--bleed-px, 0px);
  background: repeating-linear-gradient(-45deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.15) 8px, rgba(239, 68, 68, 0.05) 8px, rgba(239, 68, 68, 0.05) 16px);
  border: 1px dashed #ef4444;
  position: relative;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}

.bs-bleed-label {
  position: absolute;
  top: -18px;
  right: 0;
  font-size: 9px;
  font-family: monospace;
  color: #ef4444;
  font-weight: bold;
  background: #1e293b;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #ef4444;
}

.bs-norm-sheet {
  background-color: #ffffff;
  color: #0f172a;
  position: relative;
  box-shadow: 0 0 0 1px #000000;
  overflow: hidden;
  flex-shrink: 0;
}

.bs-norm-sheet.show-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background-size: var(--grid-size, 17.5px) var(--grid-size, 17.5px);
  background-image: linear-gradient(to right, rgba(59, 130, 246, 0.15) 1px, transparent 1px), linear-gradient(to bottom, rgba(59, 130, 246, 0.15) 1px, transparent 1px);
}

.bs-norm-sheet.show-guides::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 51;
  border: 1px dashed rgba(59, 130, 246, 0.8);
  margin: var(--safe-px, 17.5px);
}

/* Draggable elements */
.bs-draggable {
  cursor: grab;
  position: absolute;
  user-select: none;
  z-index: 10;
  border: 1px solid transparent;
}

.bs-draggable:hover {
  border-color: rgba(59, 130, 246, 0.5);
}

.bs-draggable.active {
  z-index: 100;
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.03);
}

.bs-draggable.dragging {
  cursor: grabbing;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  opacity: 0.95;
}

.bs-coord-badge {
  position: absolute;
  top: -22px;
  left: -1px;
  background: #3b82f6;
  color: white;
  font-family: monospace;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  pointer-events: none;
  white-space: nowrap;
  display: none;
  z-index: 101;
}

.bs-draggable.active .bs-coord-badge,
.bs-draggable:hover .bs-coord-badge {
  display: block;
}

/* Resizer Handles */
.bs-resizer {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #ffffff;
  border: 1px solid #3b82f6;
  z-index: 20;
  display: none;
}

.bs-draggable.active .bs-resizer {
  display: block;
}

.bs-resizer.se { bottom: -4px; right: -4px; cursor: se-resize; }
.bs-resizer.e { top: 50%; right: -4px; transform: translateY(-50%); cursor: e-resize; }
.bs-resizer.s { bottom: -4px; left: 50%; transform: translateX(-50%); cursor: s-resize; }

/* Hide UI for Canvas capture */
.hide-ui-for-capture .bs-resizer, 
.hide-ui-for-capture .bs-coord-badge, 
.hide-ui-for-capture.bs-draggable {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

.hide-ui-for-capture.bs-norm-sheet::before,
.hide-ui-for-capture.bs-norm-sheet::after {
  display: none !important;
}

/* Context Menu */
.bs-context-menu {
  position: absolute;
  background: #1e293b;
  border: 1px solid #475569;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  border-radius: 8px;
  padding: 6px;
  display: none;
  z-index: 9999;
  min-width: 200px;
}

.bs-context-menu-item {
  padding: 10px 14px;
  color: #f8fafc;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 4px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bs-context-menu-item:hover {
  background: #3b82f6;
}

/* Toast */
.app-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #10b981;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  font-size: 0.9rem;
  font-weight: bold;
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Templates */
.din-5008 { width: 735px; height: 1039.5px; padding: 0; }
.sichtfenster { left: var(--win-x-px, 70px); top: var(--win-y-px, 94.5px); width: 297.5px; height: 157.5px; border: 1px dashed #ef4444 !important; background: rgba(239, 68, 68, 0.05); padding: 15px; display: flex; flex-direction: column; justify-content: center; }
.absender-rückführung { font-size: 8px; text-decoration: underline; margin-bottom: 15px; font-weight: bold; }
.empfänger-adresse { font-size: 14px; line-height: 1.4; }
.lochmarke { position: absolute; left: 15px; top: 519.75px; width: 25px; height: 1px; background: #94a3b8; pointer-events: none; }
.falzmarke-1 { position: absolute; left: 15px; top: var(--fold1-px, 304.5px); width: 15px; height: 1px; background: #ef4444; pointer-events: none; }
.falzmarke-2 { position: absolute; left: 15px; top: var(--fold2-px, 672px); width: 15px; height: 1px; background: #ef4444; pointer-events: none; }
.brief-kopf { top: 94.5px; left: 415px; width: 250px; height: 100px; text-align: right; }
.brief-inhalt { top: 350px; left: 87.5px; width: 577.5px; height: 250px; font-size: 14px; line-height: 1.6; }

.visitenkarte { width: 382.5px; height: 247.5px; }
.vk-el-logo { top: 22.5px; left: 22.5px; width: 140px; height: 40px; }
.vk-el-badge { top: 22.5px; left: 280px; width: 55px; height: 15px; }
.vk-el-text { top: 110px; left: 22.5px; width: 337.5px; height: 100px; font-size: 11px; line-height: 1.4; }

.web-grid-view { width: 850px; min-height: 650px; background: #f8fafc; padding: 40px; }
.grid-header { padding: 40px; border-radius: var(--sb-radius, 8px); margin-bottom: 30px; position: relative; }
.grid-kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sb-gap, 24px); }
.kachel { background: white; padding: 24px; border-radius: var(--sb-radius, 8px); border: 1px solid #e2e8f0; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); position: relative; }

.logo-container svg, .vk-logo svg { width: 100%; height: 100%; }
