  :root {
      --bg: #f5f5f7;
      --panel: #ffffff;
      --border: #e0e0e0;
      --primary: #015655;
      --primary-soft: #e0f3f2;
      --primary-verysoft: #f4fbfa;
      --primary-text: #2d7f7b;
      --text: #333333;
      --soft-text: #919191;
  }

  * {
      box-sizing: border-box;
  }

  body {
      margin: 0;
      padding: 0;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: var(--bg);
      color: var(--text);
  }
  html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}


  .page {
      min-height: 100vh;
      padding: 24px;
  }

  .page-inner {
      max-width: 100%;
      margin: 0 auto;
  }

  .page-title {
      font-size: 24px;
      font-weight: 600;
      margin-bottom: 20px;
  }

  .editor-layout {
      display: grid;
      grid-template-columns: 2fr 1fr;
      gap: 24px;
  }

  .editor-layout {
      align-items: stretch;
  }

  .editor-main {
      display: flex;
      flex-direction: column;
      height: 100%;
  }

  .editor-main-body {
      flex: 1 1 auto;
      display: flex;
      flex-direction: column;
      gap: 16px;
  }

  .editor-actions-row {
      display: flex;
      justify-content: flex-end;
      margin-top: 16px;
  }

  .delete-article-btn {
      background: transparent;
      border: none;
      cursor: pointer;
      padding: 4px;
  }


  .editor-main,
  .editor-side {
      background: var(--panel);
      border-radius: 12px;
      border: 1px solid var(--border);
      padding: 20px;
  }

  .editor-main {
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  }

  .editor-side {
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.03);
  }

  .field-group {
      display: flex;
      flex-direction: column;
      gap: 16px;
  }

  .two-col-row {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  input[type="text"],
  input[type="date"],
  select,
  textarea {
      width: 100%;
      padding: 10px 12px;
      border-radius: 8px;
      border: 1px solid var(--border);
      font-size: 14px;
      font-family: inherit;
      color: var(--primary);
      font-weight: 600;
      background: #ffffff;
      transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  }

  /* Filled text inputs (must have placeholder) */
  input[type="text"]:not(:placeholder-shown) {
      border: 1px solid var(--primary);
  }

  /* Filled date input */
  input[type="date"]:valid {
      border: 1px solid var(--primary);
  }

  input::placeholder,
  textarea::placeholder {
      color: var(--soft-text);
  }


  .status-row {
      align-items: center;
  }



  input::placeholder,
  textarea::placeholder {
      color: var(--soft-text);
  }

  input:focus,
  textarea:focus,
  select:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 1px rgba(1, 86, 85, 0.08);
      background-color: #ffffff;
  }

  textarea {
      resize: vertical;
      min-height: 200px;
      line-height: 1.5;
  }

  select {
      appearance: none;
      background-image: linear-gradient(45deg, transparent 50%, var(--soft-text) 50%), linear-gradient(135deg, var(--soft-text) 50%, transparent 50%);
      background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
      background-size: 6px 6px, 6px 6px;
      background-repeat: no-repeat;
  }

  .status-row {
      align-items: center;
  }

  .status-select-wrapper {
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-height: 40px;
      min-width: 150px;
  }

  .status-select-wrapper small {
      font-size: 11px;
      color: var(--soft-text);
  }

  #status.draft {
      background-color: #e0e0e0 !important;
      color: #000 !important;
  }

  #status.publicat {
      background-color: var(--primary-soft) !important;
      color: var(--primary) !important;
      border: none;
  }

  #status.draft {
      background-image:
          linear-gradient(45deg, transparent 50%, #000 50%),
          linear-gradient(135deg, #000 50%, transparent 50%);
  }

  #status.publicat {
      background-image:
          linear-gradient(45deg, transparent 50%, #015655 50%),
          linear-gradient(135deg, #015655 50%, transparent 50%);
  }

  .btn-primary {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 10px 16px;
      border-radius: 10px;
      border: none;
      background: var(--primary);
      color: #ffffff;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      letter-spacing: 0.03em;
      text-transform: uppercase;
      transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.15s ease;
      width: 100%;
      min-height: 40px;
      min-width: 220px !important;
  }

  .btn-primary:hover {
      background: #004544;
      box-shadow: 0 6px 14px rgba(1, 86, 85, 0.25);
      transform: translateY(-1px);
  }

  .btn-primary:active {
      transform: translateY(0);
      box-shadow: none;
  }

  .editor-side-title {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 12px;
  }

  .article-list {
      list-style: none;
      padding: 0;
      margin: 0;
      display: flex;
      flex-direction: column;
      gap: 10px;
  }

  .article-item {
      display: flex;
      flex-direction: column;
      gap: 4px;
      padding: 10px 12px;
      border-radius: 10px;
      border: 1px dashed var(--border);
      background: var(--primary-verysoft);
  }

  .article-item:hover {
      box-shadow: 0px 1px 4px rgba(113, 113, 113, 0.25);
      background: var(--primary-soft);
  }

  .article-item-title {
      font-size: 13px;
      font-weight: 500;
  }

  .article-item-meta {
      font-size: 11px;
      color: var(--soft-text);
      display: flex;
      justify-content: space-between;
  }

  @media (max-width: 1000px) {
      .editor-layout {
          grid-template-columns: 1fr;
      }
  }

  @media (max-width: 640px) {
      .page {
          padding: 16px;
      }

      .two-col-row {
          grid-template-columns: 1fr;
      }

      .btn-primary {
          width: 100%;
      }
  }

  .input-wrapper {
      position: relative;
      width: 100%;
  }

  .char-count {
      position: absolute;
      bottom: 6px;
      right: 10px;
      font-size: 11px;
      color: #999;
      pointer-events: none;
  }

  .slug-modal-overlay {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      background: rgba(0, 0, 0, 0.45);
      z-index: 999;
  }

  .slug-modal-overlay.show {
      display: flex;
  }

  .slug-modal-box {
      background: #ffffff;
      padding: 20px 24px;
      border-radius: 10px;
      max-width: 420px;
      width: 90%;
      box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
      font-size: 14px;
  }

  .slug-modal-actions {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      margin-top: 16px;
  }

  .slug-modal-actions button {
      padding: 6px 14px;
      border-radius: 6px;
      border: none;
      cursor: pointer;
      font-size: 14px;
  }

  #slugConfirmYes,
  #newConfirmNo {
      background: var(--primaryColor, #015655) !important;
      color: #ffffff;
  }

  #slugConfirmNo,
  #newConfirmYes {
      background: #e0e0e0;
      color: #333333;
  }

  #deleteConfirmYes {
      background: rgb(125, 21, 21);
      color: #fff;
  }

  #slugModal p:has(b),
  #newArticleModal p:has(b),
  #deleteModal p:has(b) {
      font-size: 18px;
  }

  .top-actions-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      align-items: center;
      margin-bottom: 20px;
  }

  .top-actions-left {
      display: flex;
      justify-content: flex-start;
  }

  .top-actions-controls {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
  }

  .top-actions-controls .btn-primary,
  .top-actions-controls .btn-secondary {
      width: auto;
      min-width: 120px;
  }

  @media (max-width: 640px) {
      .top-actions-row {
          grid-template-columns: 1fr;
          gap: 10px;
      }

      .top-actions-left {
          justify-content: flex-start;
      }

      .top-actions-controls {
          justify-content: flex-start;
          flex-wrap: wrap;
      }
  }


  .btn-secondary {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 10px 16px;
      border-radius: 10px;
      border: 1px solid var(--primary);
      background: #ffffff;
      color: var(--primary);
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      letter-spacing: 0.03em;
      text-transform: uppercase;
      transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.15s ease;
      min-height: 40px;
  }

  .btn-secondary:hover {
      background: var(--primary-soft);
      box-shadow: 0 6px 14px rgba(1, 86, 85, 0.15);
      transform: translateY(-1px);
  }

  .btn-secondary:active {
      transform: translateY(0);
      box-shadow: none;
  }

  @media (max-width: 640px) {
      .top-actions-row {
          grid-template-columns: 1fr;
      }

      .top-actions-controls {
          justify-content: flex-start;
          flex-wrap: wrap;
      }
  }

  .editor-side-header {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 8px;
  }

  .editor-side-filters {
      display: flex;
      gap: 8px;
  }

  /* select + X wrapper */
  .category-filter-wrapper {
      position: relative;
      flex: 1;
      margin-bottom: 20px;
  }

  /* the category select itself */
  .editor-side-category {
      width: 100%;
      padding: 4px 28px 4px 8px;
      border-radius: 8px;
      border: 1px solid var(--border);
      font-size: 14px;
      background: #fff;
      color: var(--primary-text);
      font-weight: 600;
  }

  .cke_notification_warning {
      display: none;
  }

  /* the X button "inside" the dropdown */
  .category-clear-btn {
      position: absolute;
      top: 50%;
      right: 8px;
      transform: translateY(-50%);
      border: none;
      background: transparent;
      cursor: pointer;
      font-size: 25px;
      line-height: 1;
      padding: 0;
      color: var(--primary);
      display: none;
  }

  /* search on the same row */
  .editor-side-search {
      font-size: 14px;
      padding: 4px 8px;
      margin: 0;
      max-width: none;
      flex: 1;
      max-height: 40px;
  }

  .editor-side-category {
      padding: 4px 8px;
      border-radius: 8px;
      border: 1px solid var(--border);
      font-size: 14px;
      flex: 1;
      background: #fff;
      color: var(--primary-text);
      font-weight: 600;
      min-height: 40px;

  }

  .editor-side-search {
      font-size: 14px;
      padding: 4px 8px;
      margin: 0;
      max-width: none;
      flex: 1;
  }

  .toast {
      position: fixed;
      top: 20px;
      right: 20px;
      padding: 10px 14px;
      border-radius: 8px;
      background: #01636A;
      color: #ffffff;
      font-size: 14px;
      font-weight: 500;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      opacity: 0;
      transform: translateY(-10px);
      pointer-events: none;
      transition: opacity 0.2s ease, transform 0.2s ease;
      z-index: 9999;
  }

  .toast.show {
      opacity: 1;
      transform: translateY(0);
  }

  .toast.error {
      background: #c0392b;
  }

  .article-pagination {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 10px;
      padding-top: 20px;
  }

  .article-pagination .page-btn {
      background: var(--primary);
      color: #fff;
      border: none;
      padding: 6px 10px;
      border-radius: 6px;
      cursor: pointer;
      font-size: 13px;
      font-weight: 600;
  }

  .article-pagination .page-btn[disabled] {
      opacity: 0.4;
      cursor: default;
  }

  .article-pagination .page-info {
      font-size: 13px;
      color: var(--primary-text);
  }

  .status-draft {
      color: var(--soft-text);
  }

  .status-publicat {
      color: var(--primary);
      font-weight: 700;
  }

  .editor-main {
      position: relative;
  }

  /* ====== Preview page ===  */
  .preview-modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.6);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 9999;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease;
  }

  .preview-modal-overlay.show {
      opacity: 1;
      pointer-events: auto;
  }

  .preview-modal-box {
      background: #ffffff;
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: column;
      border-radius: 0;
      overflow: hidden;
  }

  @media (min-width: 1200px) {
      .preview-modal-box {
          width: 80%;
          height: 80%;
          border-radius: 12px;
      }
  }

  .preview-modal-header {
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 16px;
      border-bottom: 1px solid #e0e0e0;
      background: #ffffff;
      position: sticky;
      top: 0;
      z-index: 1;
  }

  .preview-modal-title {
      font-size: 16px;
      font-weight: 600;
  }

  .preview-close-btn {
      border: none;
      background: transparent;
      font-size: 24px;
      line-height: 1;
      cursor: pointer;
      padding: 0 4px;
  }

  .preview-modal-body {
      flex: 1 1 auto;
      overflow: hidden;
  }

  .preview-frame {
      width: 100%;
      height: 100%;
      border: none;
      display: block;
  }

  /* ==== categories ===  */


  .category-row {
      margin-top: 16px;
  }


  .category-select-wrapper {
      position: relative;
  }

  .category-select-toggle {
      display: inline-flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      padding: 8px 12px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: #ffffff;
      font-size: 14px;
      cursor: pointer;
      min-height: 42px;

  }.sidebar-two-col-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 12px;
    align-items: center;
}


 

  .category-dropdown {
      position: absolute;
      z-index: 20;
      top: 110%;
      left: 0;
      right: 0;
      padding: 8px 10px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: #ffffff;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
      display: none;
      max-height: 220px;
      overflow-y: auto;
  }

  .category-dropdown.show {
      display: block;

  }

  .category-option {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      padding: 4px 0;
  }

  .category-option input[type="checkbox"] {
      flex-shrink: 0;
  }

  .category-add {
      display: flex;
      gap: 8px;
      margin-top: 8px;
  }

  .category-add input {
      flex: 1;
  }

  .category-selected-chips {
      margin-top: 8px;
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      font-size: 12px;
  }

  .category-chip {
      padding: 2px 8px;
      border-radius: 999px;
      background: var(--primary-soft);
      color: var(--soft-text);
      font-weight: 500;
  }

  .category-chip-empty {
      font-size: 12px;
      color: var(--soft-text);
  }

  .article-item-categories {
      font-size: 12px;
      color: var(--soft-text);
      margin-top: 2px;
  }

  .three-col-row {
      display: grid;
      grid-template-columns: 1fr 1fr 1.2fr;
      margin-bottom: -20px;
      gap: 10px;
  }

  @media (max-width: 600px) {
      .three-col-row {
          grid-template-columns: 1fr;
          row-gap: 16px;
          margin-bottom: 0;
      }
  }

  .article-item-title-row {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      align-items: baseline;
  }

  .article-item-category-meta {
      font-size: 12px;
      color: var(--soft-text);
      white-space: nowrap;
      text-align: right;
  }


  .gallery-modal-box {
      max-width: 900px;
      width: 90%;
  }

  .gallery-modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 16px;
  }

  .gallery-modal-title {
      font-weight: 700;
      font-size: 16px;
  }

  .gallery-close-btn {
      border: none;
      background: transparent;
      font-size: 24px;
      line-height: 1;
      cursor: pointer;
  }

  .gallery-modal-body {
      max-height: 60vh;
      overflow: auto;
  }

  .gallery-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
      gap: 12px;
  }

  .gallery-image-item {
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 4px;
      background: #fff;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
  }

  .gallery-image-item img {
      max-width: 100%;
      max-height: 120px;
      object-fit: cover;
      display: block;
  }

  .gallery-loading,
  .gallery-error {
      margin-bottom: 12px;
      font-size: 14px;
  }

  .cke_button__image {
      display: none !important;
  }