.global-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  font-size: 22px;
  font-weight: 600;
  padding: 14px 16px;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;

  position: sticky;
  top: 0;
  z-index: 2000;
}


.header-version {
  font-size: 12px;
  font-weight: 400;
  margin-left: 6px;
  opacity: 0.6;
}

.header-account {
  margin-left: 12px;
  font-weight: 600;
  opacity: 0.85;
}

.header-account small {
  font-size: 11px;
  opacity: 0.7;
  margin-left: 6px;
}


.dimmed {
  opacity: 0.4;
  pointer-events: none;
}



    .border-blue-500 {
      border-color: #3b82f6 !important;
      border-width: 2px !important;
    }

    .item a {
      color: #1a0dab;
      text-decoration: underline;
      cursor: pointer;
    }
    .item a:hover {
      color: #551a8b;
    }

    .section-block {
      margin: 20px 0;
    }

    .editable-block {
      border: 1px solid #ccc;
      padding: 10px;
      min-height: 60px;
      border-radius: 6px;
      background: #fafafa;
      font-size: 1.1em;
    }

    #preview-container {
    border: 1px solid #ccc;
    padding: 10px;
    background: #fafafa;
    border-radius: 6px;
    }

  #html-preview {
    width: 100%;
    height: 700px;
    border: 1px solid #aaa;
    background: white;
    border-radius: 4px;
    }

.action-btn {
  background: #006aff;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.action-btn:hover {
  background: #005fcc;
}

/* Roll-låst (får inte användas) */
.action-btn.dimmed {
  opacity: 0.35;
  pointer-events: none;
}

/* Dirty-låst (måste spara först) */
.action-btn.dirty-locked {
  opacity: 0.6;
  pointer-events: none;
  filter: grayscale(0.4);
}


#action-bar {
  display: none;
    position: fixed;
  top: 45px; /* eller 50px om du vill ha mer luft */
}

#logout-btn {
  margin-left: auto; /* flyttar logout till höger */
  background-color: #f87171; /* valfritt: gör den rödare */
  color: white;
}

.format-btn {
  background: #8ab1de45;
  color: rgb(13, 12, 12);
  border: none;
  padding: 4px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 10px;
  transition: background 0.2s;
}

.format-btn:hover {
  background: #97b7db;
}

#format-bar {
  display: none;
}




body {
  padding-top: 95px;
  padding: 0 16px;
}

#app-view {
  margin-top: 45px; /* samma som action-bar top */
}

button.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#dirty-indicator {
  font-size: 18px;
  margin-left: 8px;
  cursor: help;
  color: #d97706; /* amber-600 */
}

.drag-handle {
  touch-action: none;
}

.drag-handle:hover svg {
  fill: #0ace00;
  cursor: grab;
}

.drag-handle:active svg {
  fill: #0ace00;
  cursor: grabbing;
}

.object-item {
  user-select: none;
}


button svg {
  transition: fill 0.15s ease;
}

.delete-btn svg {
  stroke: #000;
  transition: stroke 0.15s ease;
}

.delete-btn:hover svg {
  stroke: rgb(252, 1, 1); /* röd */
}



#link-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  z-index: 6000; /* Viktigt */
}

@keyframes diamondBlink {
  0%   { opacity: 0;   filter: brightness(3) saturate(2); transform: scale(1.15); }
  40%  { opacity: 1;   filter: brightness(1.4) saturate(1.3); transform: scale(1.00); }
  70%  { opacity: 1;   filter: brightness(1.0) saturate(1.0); }
  100% { opacity: 1;   filter: none; }
}

.global-header .header-title.diamond {
  animation: diamondBlink 0.9s ease-out;
  display: inline-block;
}

.header-logo {
  height: 36px;   /* eller vad som passar */
  width: auto;
}

.header-title {
  position: relative;
  display: inline-block;
  overflow: hidden;
}

.header-title::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -120%;
  width: 90%;
  height: 220%;
  background: linear-gradient(
    120deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.9) 50%,
    rgba(255,255,255,0) 100%
  );
  transform: skewX(-20deg);
  opacity: 0;
}

.header-title.glint::after {
  animation: glintSweep 3.2s ease-out forwards;
}

@keyframes glintSweep {
  0%   { left: -120%; opacity: 0; }
  10%  { opacity: 0.4; }
  40%  { left: 20%; opacity: 1; }
  70%  { left: 120%; opacity: 0.6; }
  100% { left: 160%; opacity: 0; }
}



@keyframes glintSweep {
  0%   { left: -100%; opacity: 0; }
  10%  { opacity: 1; }
  60%  { left: 120%; opacity: 1; }
  100% { left: 150%; opacity: 0; }
}

.dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

.dialog.hidden {
  display: none;
}

.dialog-content {
  background: white;
  padding: 24px;
  border-radius: 8px;
  width: 420px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.dialog-content h2 {
  margin-top: 0;
  margin-bottom: 16px;
}

.dialog-content textarea {
  width: 100%;
  height: 100px;
  margin-bottom: 12px;
}

.dialog-content input[type="text"],
.dialog-content input[type="datetime-local"] {
  width: 100%;
  margin-bottom: 12px;
  padding: 6px;
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-buttons button {
  padding: 8px 14px;
}

.utskick-row {
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

.utskick-row strong {
  color: #333;
}

.utskick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.utskick-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  padding: 10px 14px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: background 0.15s;
}

.utskick-item:hover {
  background: #f7f7f7;
}

.utskick-status {
  font-size: 22px;
}

.utskick-main {
  display: flex;
  flex-direction: column;
}

.utskick-date {
  font-size: 12px;
  color: #666;
}

.utskick-to {
  font-size: 12px;
  color: #444;
}


.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.popup.hidden {
  display: none;
}

.hidden {
  display: none;
}

.popup-content {
  background: white;
  padding: 20px;
  width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* Gör popupen bredare */
.popup-content {
  width: 800px;        /* ändra till vad du vill */
  max-width: 90vw;
}

/* Gör h2 till en flex-container */
.popup-content h2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 10px 0;
}

/* Stäng-knappen */
#closeUtskickPopup {
  padding: 4px 10px;
  font-size: 14px;
  cursor: pointer;
}


.popup-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.utskick-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
}

.utskick-status {
  font-size: 22px;
}

.utskick-main {
  display: flex;
  flex-direction: column;
}

.utskick-date {
  font-size: 12px;
  color: #666;
}

.utskick-to {
  font-size: 12px;
  color: #444;
}

.delete-btn svg {
  stroke: #000;
  transition: stroke 0.15s ease;
}

.delete-btn:hover svg {
  stroke: #d00; /* röd */
}

#date-list {
  width: 100%;  
}

/* Panelens grund */
.slide-panel {
  position: fixed;
  top: 0;
  right: -320px; /* gömd */
  width: 320px;
  height: 100vh;
  background: #ffffff;
  border-left: 1px solid #ddd;
  box-shadow: -4px 0 12px rgba(0,0,0,0.08);
  transition: right 0.25s ease;
  display: flex;
  flex-direction: column;
  z-index: 9999;
  box-sizing: border-box;
}

/* När panelen är öppen */
.slide-panel.open {
  right: 0;
}

/* Header */
.slide-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  font-size: 16px;
  font-weight: 600;
}

/* Innehåll */
.slide-panel-content {
  padding: 16px;
    width: 100%;
  box-sizing: border-box;
  overflow: auto;
}


/* Stäng-knapp */
.close-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.close-btn:hover {
  opacity: 1;
}


/* använd denna klass för att få en snygg layout med stäng-knappen */
.header-close {
  display: flex;
  justify-content: space-between;
  align-items: center;
}


#toast-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none; /* gör att klick går igenom */
}

.toast {
  background: rgba(50, 50, 50, 0.95);
  color: white;
  padding: 14px 22px;
  border-radius: 6px;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto; /* toasten själv kan få hover/click om du vill */
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

[contenteditable="true"][data-placeholder]:empty::before,
[contenteditable="true"][data-placeholder]:not(:focus):has(br:only-child)::before {
  content: attr(data-placeholder);
  color: #888;
  font-style: italic;
  pointer-events: none;
}

#analyzeTable {
  font-size: 11px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 4px solid #ccc;
  border-top-color: #4e79a7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 10px 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#chartTitle {
  font-size: 14px;
  margin-bottom: 8px;
  color: #444;
}


  


@keyframes fadeIn {
  from { opacity:0 }
  to { opacity:1 }
}
@keyframes popIn {
  from { transform:scale(0.92); opacity:0 }
  to { transform:scale(1); opacity:1 }
}


.hidden {
  visibility: hidden;
}
