/* Wiki News Overrides - Articles Grid & Category Filter */

/* ==================== Prevent horizontal scroll globally ==================== */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

main, #docs-section, #content-area {
    overflow-x: hidden;
    max-width: 100%;
}

/* Header mobile fixes */
header {
    flex-wrap: wrap;
    padding: 0.8em;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(85, 85, 85, 0.3);
    width: 100%;
}

.header-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* Prevent horizontal scroll */
#editor-view {
    overflow-x: hidden;
    max-width: 100%;
}

#editor-view * {
    box-sizing: border-box;
}

/* Optimize content width for better readability */
#editor {
    max-width: 900px;
    margin: 0 auto;
}

#page-content {
    max-width: 900px;
    margin: 0 auto;
}

/* Images in editor and page content - optimized width */
#editor img,
#page-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
    border-radius: 4px;
}

/* Prevent images from being too large */
#editor img[src*="attachments"],
#page-content img[src*="attachments"] {
    max-width: 100%;
    width: auto;
}

/* Header with category filter */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(85, 85, 85, 0.3);
}

.category-filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 15px 0;
    align-items: center;
}

/* New unified filter bar */
.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 0;
    width: 100%;
}

.category-filters,
.status-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.category-btn {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    color: #e0e0e0;
    background: rgba(50, 50, 50, 0.6);
    border: 1px solid rgba(85, 85, 85, 0.5);
    transition: all 0.2s ease;
    font-size: 0.9em;
    font-weight: 500;
}

.category-btn:hover {
    background: rgba(0, 123, 255, 0.2);
    border-color: rgba(0, 123, 255, 0.4);
}

.category-btn.active {
    background: rgba(0, 123, 255, 0.3);
    border-color: rgba(0, 123, 255, 0.6);
    color: white;
}

.new-article-btn {
    margin-left: auto;
    background: rgba(40, 167, 69, 0.2);
    border-color: rgba(40, 167, 69, 0.4);
}

.new-article-btn:hover {
    background: rgba(40, 167, 69, 0.3);
}

/* Status Filter (Admin) */
.status-filters {
    padding-top: 8px;
    border-top: 1px solid rgba(85, 85, 85, 0.2);
}

.filter-label {
    color: #aaa;
    font-size: 0.85em;
    font-weight: 500;
    white-space: nowrap;
    margin-right: 5px;
}

.status-btn {
    padding: 5px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #e0e0e0;
    background: rgba(50, 50, 50, 0.5);
    border: 1px solid rgba(85, 85, 85, 0.4);
    transition: all 0.2s ease;
    font-size: 0.8em;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-btn:hover {
    background: rgba(0, 123, 255, 0.15);
    border-color: rgba(0, 123, 255, 0.3);
}

.status-btn.active {
    background: rgba(0, 123, 255, 0.25);
    border-color: rgba(0, 123, 255, 0.5);
    color: white;
}

.status-count {
    display: inline-block;
    padding: 1px 5px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 0.75em;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
    line-height: 1;
}

.status-btn.active .status-count {
    background: rgba(255, 255, 255, 0.25);
}

/* User greeting in header */
.user-greeting {
    color: #aaa;
    font-size: 0.9em;
    margin-right: 10px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-link {
    color: #e0e0e0;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.nav-link:hover {
    background: rgba(0, 123, 255, 0.2);
}

/* Articles Grid - hidden by default, shown via JS */
#articles-grid-view {
    display: none;
    width: 100%;
}

#articles-grid-view.show {
    display: block;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.article-card {
    background: rgba(30, 30, 30, 0.8);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: #e0e0e0;
    border: 1px solid rgba(85, 85, 85, 0.5);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border-color: rgba(0, 123, 255, 0.4);
}

.article-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.article-card-image-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, rgba(50, 50, 50, 0.8) 0%, rgba(30, 30, 30, 0.8) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
    color: rgba(200, 200, 200, 0.3);
}

.article-card-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-card-title {
    margin: 0 0 12px 0;
    font-size: 1.1em;
    color: #fff;
    line-height: 1.4;
}

.article-card-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.article-category,
.article-status {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.category-news {
    background: rgba(0, 123, 255, 0.2);
    color: #64b5ff;
}

.category-press-kit {
    background: rgba(156, 39, 176, 0.2);
    color: #ce93d8;
}

.category-declassified {
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
}

.status-draft {
    background: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
}

.status-pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status-published {
    background: rgba(40, 167, 69, 0.2);
    color: #4caf50;
}

.status-archived {
    background: rgba(97, 97, 97, 0.2);
    color: #616161;
}

.article-card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    color: rgba(200, 200, 200, 0.6);
}

.article-author,
.article-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* No articles */
.no-articles {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: rgba(200, 200, 200, 0.6);
}

.create-first-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 24px;
    background: rgba(0, 123, 255, 0.3);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid rgba(0, 123, 255, 0.5);
    font-weight: 600;
    transition: all 0.2s ease;
}

.create-first-btn:hover {
    background: rgba(0, 123, 255, 0.4);
}

/* Document header - title and actions */
#document-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(85, 85, 85, 0.3);
    padding-bottom: 1em;
    margin-bottom: 1em;
}

#page-title {
    color: #fff;
    font-size: 2em;
    margin: 0;
    flex-grow: 1;
}

/* Document cover image container */
#document-cover-container {
    width: 100%;
    margin: 20px 0;
}

#document-cover-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

/* Document view meta - unified styling */
#page-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin: 15px 0;
    padding: 12px 16px;
    background: rgba(30, 30, 30, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(85, 85, 85, 0.3);
}

#page-category,
#page-status,
#page-author,
#page-date {
    font-size: 0.9em;
    color: rgba(200, 200, 200, 0.8);
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(50, 50, 50, 0.4);
    border: 1px solid rgba(85, 85, 85, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#page-category:hover,
#page-status:hover,
#page-author:hover,
#page-date:hover {
    background: rgba(50, 50, 50, 0.6);
    border-color: rgba(85, 85, 85, 0.4);
}

/* Editor category wrapper */
#editor-meta {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    max-width: 100%;
}

#editor-category-wrapper,
#editor-author-wrapper,
#editor-cover-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

#editor-category-wrapper label,
#editor-author-wrapper label,
#editor-cover-wrapper label {
    color: #e0e0e0;
    font-weight: 500;
    white-space: nowrap;
}

#editor-category {
    padding: 8px 12px;
    background: rgba(50, 50, 50, 0.6);
    border: 1px solid rgba(85, 85, 85, 0.5);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.95em;
    max-width: 200px;
}

#editor-author-name {
    padding: 8px 12px;
    background: rgba(50, 50, 50, 0.6);
    border: 1px solid rgba(85, 85, 85, 0.5);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.95em;
    width: 200px;
}

#editor-dates-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

#editor-dates-wrapper label {
    color: #e0e0e0;
    font-weight: 500;
    white-space: nowrap;
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-inputs input[type="datetime-local"] {
    padding: 8px 12px;
    background: rgba(50, 50, 50, 0.6);
    border: 1px solid rgba(85, 85, 85, 0.5);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.85em;
    width: 160px;
}

.date-inputs input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.date-inputs span {
    color: #888;
}

#editor-cover-image {
    max-width: 150px;
    flex-shrink: 0;
}

/* Upload cover and remove cover buttons - override EVERYTHING */
body.dark-theme #upload-cover-button,
body #upload-cover-button,
body.dark-theme #remove-cover-button,
body #remove-cover-button,
#upload-cover-button,
#remove-cover-button {
    padding: 8px 16px !important;
    padding: 0.5em 1em !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    color: #e0e0e0 !important;
    background: rgba(50, 50, 50, 0.85) !important;
    background-image: none !important;
    border: 1px solid rgba(85, 85, 85, 0.6) !important;
    transition: all 0.2s ease !important;
    font-size: 0.9em !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    height: auto !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    transform: none !important;
    margin: 0 !important;
}

body.dark-theme #upload-cover-button,
body #upload-cover-button,
#upload-cover-button {
    background: rgba(0, 123, 255, 0.6) !important;
    background-image: none !important;
    border-color: rgba(0, 123, 255, 0.8) !important;
}

body.dark-theme #upload-cover-button:hover,
body #upload-cover-button:hover,
#upload-cover-button:hover {
    background: rgba(0, 123, 255, 0.8) !important;
    background-image: none !important;
    border-color: rgba(0, 123, 255, 1) !important;
}

body.dark-theme #remove-cover-button,
body #remove-cover-button,
#remove-cover-button {
    background: rgba(108, 117, 125, 0.6) !important;
    background-image: none !important;
    border-color: rgba(108, 117, 125, 0.8) !important;
}

body.dark-theme #remove-cover-button:hover,
body #remove-cover-button:hover,
#remove-cover-button:hover {
    background: rgba(108, 117, 125, 0.8) !important;
    background-image: none !important;
    border-color: rgba(108, 117, 125, 1) !important;
}

#cover-status {
    color: rgba(200, 200, 200, 0.7);
    font-size: 0.85em;
}

#current-cover-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(30, 30, 30, 0.5);
    border-radius: 6px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
}

#current-cover-img {
    max-height: 80px;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    flex-shrink: 0;
}

#upload-section {
    margin-top: 15px;
    padding: 10px;
    background: rgba(30, 30, 30, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#upload-section span {
    color: rgba(200, 200, 200, 0.7);
    font-size: 0.9em;
    white-space: nowrap;
}

#upload-section input[type="file"] {
    max-width: 200px;
    flex-shrink: 0;
}

/* Upload file button for content images - override EVERYTHING */
body.dark-theme #upload-file-button,
body #upload-file-button,
#upload-file-button {
    padding: 8px 16px !important;
    padding: 0.5em 1em !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    color: #e0e0e0 !important;
    background: rgba(0, 123, 255, 0.6) !important;
    background-image: none !important;
    border: 1px solid rgba(0, 123, 255, 0.8) !important;
    transition: all 0.2s ease !important;
    font-size: 0.9em !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    height: auto !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    transform: none !important;
    margin: 0 !important;
}

body.dark-theme #upload-file-button:hover,
body #upload-file-button:hover,
#upload-file-button:hover {
    background: rgba(0, 123, 255, 0.8) !important;
    background-image: none !important;
    border-color: rgba(0, 123, 255, 1) !important;
}

/* =============================================
   ALL BUTTONS - UNIFIED STYLE
   Override ALL other styles including consolidated-dark.css
   ============================================= */

/* Editor actions container */
#editor-actions {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
}

/* ALL buttons in editor-actions - base styles - override EVERYTHING */
body #editor-actions button,
body.dark-theme #editor-actions button {
    padding: 8px 16px !important;
    padding: 0.5em 1em !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    color: #e0e0e0 !important;
    background: rgba(50, 50, 50, 0.85) !important;
    background-image: none !important;
    border: 1px solid rgba(85, 85, 85, 0.6) !important;
    transition: all 0.2s ease !important;
    font-size: 0.9em !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    height: auto !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    transform: none !important;
    margin: 0 !important;
    text-shadow: none !important;
    width: auto !important;
    max-width: none !important;
}

/* Hover state for all editor buttons */
body #editor-actions button:hover,
body.dark-theme #editor-actions button:hover {
    background: rgba(0, 123, 255, 0.3) !important;
    background-image: none !important;
    border-color: rgba(0, 123, 255, 0.5) !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Save button - blue */
body #editor-actions #save-page-button,
body.dark-theme #editor-actions #save-page-button,
#editor-actions #save-page-button {
    background: rgba(0, 123, 255, 0.6) !important;
    background-image: none !important;
    border-color: rgba(0, 123, 255, 0.8) !important;
}

body #editor-actions #save-page-button:hover,
body.dark-theme #editor-actions #save-page-button:hover,
#editor-actions #save-page-button:hover {
    background: rgba(0, 123, 255, 0.8) !important;
    background-image: none !important;
    border-color: rgba(0, 123, 255, 1) !important;
}

/* Submit pending button - yellow */
body #editor-actions #submit-pending-button,
body.dark-theme #editor-actions #submit-pending-button,
#editor-actions #submit-pending-button {
    background: rgba(255, 193, 7, 0.6) !important;
    background-image: none !important;
    border-color: rgba(255, 193, 7, 0.8) !important;
}

body #editor-actions #submit-pending-button:hover,
body.dark-theme #editor-actions #submit-pending-button:hover,
#editor-actions #submit-pending-button:hover {
    background: rgba(255, 193, 7, 0.8) !important;
    background-image: none !important;
    border-color: rgba(255, 193, 7, 1) !important;
}

/* Publish button - green */
body #editor-actions #publish-page-button,
body.dark-theme #editor-actions #publish-page-button,
#editor-actions #publish-page-button {
    background: rgba(40, 167, 69, 0.6) !important;
    background-image: none !important;
    border-color: rgba(40, 167, 69, 0.8) !important;
}

body #editor-actions #publish-page-button:hover,
body.dark-theme #editor-actions #publish-page-button:hover,
#editor-actions #publish-page-button:hover {
    background: rgba(40, 167, 69, 0.8) !important;
    background-image: none !important;
    border-color: rgba(40, 167, 69, 1) !important;
}

/* Cancel button - gray */
body #editor-actions #cancel-edit-button,
body.dark-theme #editor-actions #cancel-edit-button,
#editor-actions #cancel-edit-button {
    background: rgba(108, 117, 125, 0.6) !important;
    background-image: none !important;
    border-color: rgba(108, 117, 125, 0.8) !important;
}

body #editor-actions #cancel-edit-button:hover,
body.dark-theme #editor-actions #cancel-edit-button:hover,
#editor-actions #cancel-edit-button:hover {
    background: rgba(108, 117, 125, 0.8) !important;
    background-image: none !important;
    border-color: rgba(108, 117, 125, 1) !important;
}

/* Page actions container */
#page-actions {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

/* Hide buttons by default - JS will show based on permissions */
#page-actions button {
    display: none !important;
}

/* ALL buttons in page-actions - base styles - override EVERYTHING */
body #page-actions button.show,
body.dark-theme #page-actions button.show {
    padding: 8px 16px !important;
    padding: 0.5em 1em !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    color: #e0e0e0 !important;
    background: rgba(50, 50, 50, 0.85) !important;
    background-image: none !important;
    border: 1px solid rgba(85, 85, 85, 0.6) !important;
    transition: all 0.2s ease !important;
    font-size: 0.9em !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    height: auto !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    transform: none !important;
    margin: 0 !important;
    text-shadow: none !important;
    width: auto !important;
    max-width: none !important;
}

/* Hover state for all page-actions buttons */
body #page-actions button:hover,
body.dark-theme #page-actions button:hover {
    background: rgba(0, 123, 255, 0.3) !important;
    background-image: none !important;
    border-color: rgba(0, 123, 255, 0.5) !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Edit button - blue */
body #page-actions #edit-page-button.show,
body.dark-theme #page-actions #edit-page-button.show,
#page-actions #edit-page-button.show {
    background: rgba(108, 117, 125, 0.6) !important;
    background-image: none !important;
    border-color: rgba(108, 117, 125, 0.8) !important;
}

body #page-actions #edit-page-button.show:hover,
body.dark-theme #page-actions #edit-page-button.show:hover,
#page-actions #edit-page-button.show:hover {
    background: rgba(108, 117, 125, 0.8) !important;
    background-image: none !important;
    border-color: rgba(108, 117, 125, 1) !important;
}

/* New article button - green */
body #page-actions #new-page-button.show,
body.dark-theme #page-actions #new-page-button.show,
#page-actions #new-page-button.show {
    background: rgba(40, 167, 69, 0.6) !important;
    background-image: none !important;
    border-color: rgba(40, 167, 69, 0.8) !important;
}

body #page-actions #new-page-button.show:hover,
body.dark-theme #page-actions #new-page-button.show:hover,
#page-actions #new-page-button.show:hover {
    background: rgba(40, 167, 69, 0.8) !important;
    background-image: none !important;
    border-color: rgba(40, 167, 69, 1) !important;
}

/* Delete button - red */
body #page-actions #delete-page-button.show,
body.dark-theme #page-actions #delete-page-button.show,
#page-actions #delete-page-button.show {
    background: rgba(220, 53, 69, 0.7) !important;
    background-image: none !important;
    border-color: rgba(220, 53, 69, 0.9) !important;
}

body #page-actions #delete-page-button.show:hover,
body.dark-theme #page-actions #delete-page-button.show:hover,
#page-actions #delete-page-button.show:hover {
    background: rgba(220, 53, 69, 0.9) !important;
    background-image: none !important;
    border-color: rgba(220, 53, 69, 1) !important;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 0.6em;
    }

    header h1 {
        font-size: 1.3em;
        width: 100%;
    }

    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-bottom: 10px;
    }

    .header-nav {
        width: 100%;
        justify-content: flex-start;
    }

    .user-greeting {
        width: 100%;
        margin-bottom: 5px;
    }

    .filter-bar {
        gap: 8px;
        padding: 8px 0;
        width: 100%;
    }

    .category-filters,
    .status-filters {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    .category-filters::-webkit-scrollbar,
    .status-filters::-webkit-scrollbar {
        display: none;
    }

    .category-filters {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .category-btn,
    .new-article-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 0.85em;
    }

    .new-article-btn {
        margin-left: 0;
    }

    .status-filters {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        padding-top: 6px;
    }

    .filter-label {
        width: 100%;
        margin-bottom: 4px;
    }

    .status-btn {
        flex: 0 0 auto;
        font-size: 0.75em;
        padding: 5px 8px;
    }

    .status-count {
        display: none;
    }

    #editor-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    #editor-category-wrapper,
    #editor-author-wrapper,
    #editor-dates-wrapper {
        width: 100%;
        margin-bottom: 10px;
    }

    #editor-category,
    #editor-author-name {
        width: 100%;
        max-width: none;
    }

    .date-inputs {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .date-inputs input[type="datetime-local"] {
        width: 100%;
    }

    .date-inputs span {
        display: none;
    }
}

/* ==================== SSR: Back to list button ==================== */
.back-to-list-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-elevated, #243042);
    color: var(--accent-blue, #3b82f6);
    text-decoration: none;
    border-radius: var(--radius-md, 8px);
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
}

.back-to-list-btn:hover {
    background: var(--accent-blue, #3b82f6);
    color: var(--text-primary, #e8eff6);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-blue, 0 0 24px rgba(59, 130, 246, 0.25));
}

/* ==================== SSR: Error block ==================== */
.ssr-error {
    text-align: center;
    padding: 3rem 1rem;
}

.ssr-error h2 {
    color: var(--accent-red, #ef4444);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.ssr-error .back-to-list-btn {
    margin-top: 1rem;
}

/* ==================== SEO Section in Editor ==================== */
#seo-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary, #111820);
    border-radius: var(--radius-md, 8px);
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
}

#seo-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary, #e8eff6);
}

#editor-meta-description {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg-tertiary, #1a2330);
    color: var(--text-primary, #e8eff6);
    border: 1px solid var(--border-color, rgba(255,255,255,0.15));
    border-radius: var(--radius-sm, 6px);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

#editor-meta-description:focus {
    outline: none;
    border-color: var(--accent-blue, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

#editor-meta-description::placeholder {
    color: var(--text-muted, #475569);
}

#meta-description-status {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
}

/* ==================== Slug Section ==================== */
#slug-section {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary, #111820);
    border-radius: var(--radius-md, 8px);
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
}
#slug-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary, #e8eff6);
}
#editor-slug {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg-tertiary, #1a2330);
    color: var(--text-primary, #e8eff6);
    border: 1px solid var(--border-color, rgba(255,255,255,0.15));
    border-radius: var(--radius-sm, 6px);
    font-size: 0.9rem;
    font-family: monospace;
    transition: border-color 0.2s ease;
}
#editor-slug:focus {
    outline: none;
    border-color: var(--accent-blue, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
#editor-slug::placeholder {
    color: var(--text-muted, #475569);
    font-family: inherit;
}
#slug-status {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
}

