.has-editor-toolbar {
  --editor-bar-h: 48px;
  padding-top: var(--editor-bar-h) !important;
}

.editor-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  height: var(--editor-bar-h, 48px);
  background: var(--navy, #132d4f);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.75rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 13px;
}

.editor-bar[hidden] {
  display: none !important;
}

.editor-bar__brand {
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}

.editor-bar__email {
  color: rgba(255, 255, 255, 0.75);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-bar__spacer {
  flex: 1;
}

.editor-bar__btn {
  border: none;
  border-radius: 4px;
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.editor-bar__btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.editor-bar__btn--primary {
  background: var(--red, #dc1f26);
}

.editor-bar__btn--primary:hover {
  background: var(--red-hover, #b8181e);
}

.editor-bar__btn--danger {
  background: rgba(220, 31, 38, 0.85);
}

.editor-login-fab {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9990;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 999px;
  background: var(--navy, #132d4f);
  color: #fff;
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.editor-login-fab:hover {
  background: #1a3d66;
}

.editor-login-fab[hidden] {
  display: none !important;
}

/* Prijava modal */
.editor-auth-open {
  overflow: hidden;
}

.editor-auth {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(19, 45, 79, 0.55);
}

.editor-auth[hidden] {
  display: none !important;
}

.editor-auth__dialog {
  position: relative;
  width: min(400px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem 1.35rem 1.35rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  font-family: Montserrat, system-ui, sans-serif;
}

.editor-auth__dialog h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  color: var(--navy, #132d4f);
}

.editor-auth__hint {
  margin: 0 0 1rem;
  font-size: 13px;
  color: #5a6578;
  line-height: 1.45;
}

.editor-auth__close {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #667;
}

.editor-auth__submit {
  width: 100%;
  margin-top: 0.5rem;
  justify-content: center;
}

.editor-auth__secondary {
  width: 100%;
  margin-top: 0.5rem;
  justify-content: center;
  background: #e8eef6;
  color: var(--navy, #132d4f);
}

.editor-auth label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 0.85rem;
  color: #333;
}

/* Panel */
.editor-drawer {
  position: fixed;
  top: var(--editor-bar-h, 48px);
  right: 0;
  bottom: 0;
  width: min( min(92vw, 920px), 100vw);
  z-index: 9999;
  background: #f0f3f8;
  box-shadow: -4px 0 28px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.24s ease;
  font-family: Montserrat, system-ui, sans-serif;
}

.editor-drawer.is-open {
  transform: translateX(0);
}

.editor-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: #fff;
  border-bottom: 1px solid #dde3ec;
}

.editor-drawer__head h2 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--navy, #132d4f);
}

.editor-drawer__split {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.editor-drawer__list-pane {
  width: 38%;
  min-width: 200px;
  border-right: 1px solid #dde3ec;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: #fff;
}

.editor-drawer__form-pane {
  flex: 1;
  overflow: auto;
  padding: 0.85rem 1rem 1.5rem;
}

.editor-article-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.editor-article-list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border: none;
  border-bottom: 1px solid #eee;
  background: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.editor-list-title {
  display: block;
  font-weight: 600;
  color: #1a2a3d;
  line-height: 1.3;
}

.editor-list-meta {
  display: block;
  font-size: 11px;
  color: #6b7280;
  margin-top: 0.15rem;
}

.editor-article-list button.is-active,
.editor-article-list button:hover {
  background: #e8eef6;
}

.editor-empty {
  font-size: 14px;
  color: #5a6578;
  margin: 2rem 0.5rem;
  line-height: 1.5;
}

.editor-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 0.65rem;
  color: #333;
}

.editor-field-hint {
  font-weight: 400;
  color: #6b7280;
  margin-left: 0.35rem;
}

.editor-details {
  margin: 0.5rem 0 0.75rem;
  padding: 0.5rem 0.65rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
}

.editor-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy, #132d4f);
}

.editor-form__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.5rem 0;
}

.editor-form__actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 0 0;
  margin-top: 0.75rem;
  background: linear-gradient(transparent, #f0f3f8 30%);
}

.editor-preview-link {
  background: #fff;
  color: var(--navy, #132d4f) !important;
  border: 1px solid #cdd5e0;
}

.editor-drawer .admin-input {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid #dde3ec;
  border-radius: 4px;
  font: inherit;
  font-size: 13px;
}

.editor-drawer .admin-error,
.editor-auth .admin-error {
  color: #dc1f26;
  font-size: 13px;
  margin: 0.35rem 0;
}

.editor-drawer .admin-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 12px;
}

.editor-drawer__backdrop {
  position: fixed;
  inset: var(--editor-bar-h, 48px) 0 0 0;
  z-index: 9998;
  background: rgba(19, 45, 79, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.editor-drawer__backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.editor-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 10060;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  background: #0d6b3a;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: Montserrat, system-ui, sans-serif;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease;
  pointer-events: none;
}

.editor-toast.is-visible {
  transform: translateX(-50%) translateY(0);
}

.editor-toast--error {
  background: #dc1f26;
}

@media (max-width: 720px) {
  .editor-drawer__split {
    flex-direction: column;
  }

  .editor-drawer__list-pane {
    width: 100%;
    max-height: 35vh;
    border-right: none;
    border-bottom: 1px solid #dde3ec;
  }

  .editor-bar__brand {
    display: none;
  }
}