* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f3f4f6;
    color: #111827;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-box {
    width: min(420px, 92vw);
    background: #fff;
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .12);
}

label {
    display: block;
    font-weight: 700;
    margin: 14px 0 6px;
}

input,
textarea,
select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font: inherit;
    background: #fff;
}

textarea {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.55;
}

button,
.button {
    border: 0;
    background: #111827;
    color: white;
    padding: 11px 14px;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    font-weight: 700;
}

.button-secondary {
    background: #2563eb;
}

.button-light {
    background: #e5e7eb;
    color: #111827;
}

.full {
    width: 100%;
    text-align: center;
    margin-top: 18px;
}

.alert {
    padding: 12px;
    border-radius: 10px;
    margin: 12px 0;
}

.success {
    background: #dcfce7;
    color: #166534;
}

.error {
    background: #fee2e2;
    color: #991b1b;
}

/* Layout admin */

.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #111827;
    color: #fff;
    padding: 22px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 26px;
}

.sidebar a {
    display: block;
    color: #e5e7eb;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 10px;
    margin: 4px 0;
}

.sidebar a:hover,
.sidebar a.active {
    background: #f97316;
    color: #fff;
}

.admin-main {
    padding: 24px;
}

.topbar {
    height: 56px;
    background: #fff;
    border-radius: 16px;
    padding: 0 18px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 30px rgba(15, 23, 42, .05);
}

.panel {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, .05);
    margin-bottom: 20px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.panel-head > div {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Dashboard */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat {
    background: #fff;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, .05);
}

.stat strong {
    display: block;
    font-size: 34px;
}

.stat span {
    color: #6b7280;
}

/* Table */

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid #e5e7eb;
    padding: 12px;
    text-align: left;
    vertical-align: middle;
}

th {
    font-size: 13px;
    text-transform: uppercase;
    color: #6b7280;
}

table a {
    text-decoration: none;
}

table small {
    color: #6b7280;
}

/* Badge */

.badge {
    display: inline-block;
    background: #eef2ff;
    color: #3730a3;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
}

.badge-green {
    background: #dcfce7;
    color: #166534;
}

.badge-yellow {
    background: #fef3c7;
    color: #92400e;
}

.badge-blue {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Score */

.score {
    display: inline-block;
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 700;
}

.score.good {
    background: #dcfce7;
    color: #166534;
}

.score.warn {
    background: #fef3c7;
    color: #92400e;
}

.score.bad {
    background: #fee2e2;
    color: #991b1b;
}

/* Form filter */

.filters {
    display: flex;
    gap: 10px;
    margin: 12px 0 18px;
}

.filters input {
    max-width: 360px;
}

/* Editor */

.post-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 20px;
}

.editor-main,
.editor-side {
    min-width: 0;
}

.sticky {
    position: sticky;
    top: 20px;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.editor-toolbar button {
    background: #e5e7eb;
    color: #111827;
    padding: 8px 10px;
}

.seo-box {
    border: 2px solid #e5e7eb;
}

.google-preview {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    margin: 16px 0;
    background: #fafafa;
}

.preview-title {
    color: #1a0dab;
    font-size: 19px;
    line-height: 1.3;
}

.preview-url {
    color: #006621;
    font-size: 14px;
    margin: 3px 0;
}

.preview-desc {
    color: #545454;
    font-size: 14px;
}

.checklist ul {
    padding-left: 0;
    list-style: none;
}

.checklist li {
    padding: 7px 0;
    border-bottom: 1px solid #f1f5f9;
}

/* CKEditor */

.ck-editor__editable {
    min-height: 460px;
    font-size: 16px;
    line-height: 1.7;
}

.ck-content h2 {
    font-size: 24px;
    margin-top: 26px;
    margin-bottom: 12px;
}

.ck-content h3 {
    font-size: 20px;
    margin-top: 22px;
    margin-bottom: 10px;
}

.ck-content p {
    margin-bottom: 12px;
}

.ck-content ul,
.ck-content ol {
    padding-left: 28px;
}

.ck-content img {
    max-width: 100%;
    height: auto;
}

/* Media */

.grid-two {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 20px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.media-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px;
}

.media-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    background: #f3f4f6;
    margin-bottom: 10px;
}

/* SEO warning */

.issue-list {
    margin: 0;
    padding-left: 18px;
}

.issue-list li {
    margin-bottom: 4px;
    color: #b45309;
    font-size: 13px;
}

.text-muted {
    color: #9ca3af;
}

.text-good {
    color: #16a34a;
    font-weight: 700;
}

/* Action links */


.action-links a,
.action-links button {
    font-size: 13px;
    line-height: 1;
}

.action-links a:hover {
    text-decoration: underline;
}

.action-links .separator {
    color: #d1d5db;
}

.inline-form {
    display: inline;
    margin: 0;
    padding: 0;
}


.link-button:hover {
    text-decoration: underline;
}


/* Common */

.thumb {
    width: 100%;
    border-radius: 12px;
    margin: 10px 0;
}

small {
    display: block;
    color: #6b7280;
    margin: 5px 0 10px;
}

/* Responsive */

@media (max-width: 1100px) {
    .media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        height: auto;
        position: static;
    }

    .post-editor,
    .grid-two,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .media-grid {
        grid-template-columns: 1fr;
    }
}

.actions-cell {
    min-width: 170px;
    white-space: nowrap;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    border: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
    cursor: pointer;
    white-space: nowrap;
}

.action-btn.edit {
    background: #dbeafe;
    color: #1d4ed8;
}

.action-btn.view {
    background: #dcfce7;
    color: #166534;
}

.action-btn.delete {
    background: #fee2e2;
    color: #991b1b;
}

.action-btn:hover {
    opacity: 0.85;
    text-decoration: none !important;
}

.inline-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

.inline-form button {
    font-family: inherit;
}
/* Unified action buttons */

.actions-cell {
    min-width: 180px;
    white-space: nowrap;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.action-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 30px;
    padding: 0 10px !important;
    border-radius: 8px;
    border: 0 !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
    cursor: pointer;
    white-space: nowrap;
    margin: 0 !important;
}

.action-btn:hover {
    opacity: 0.85;
    text-decoration: none !important;
}

.action-btn.edit {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
}

.action-btn.view {
    background: #dcfce7 !important;
    color: #166534 !important;
}

.action-btn.restore {
    background: #dcfce7 !important;
    color: #166534 !important;
}

.action-btn.delete {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

.action-btn.gray {
    background: #e5e7eb !important;
    color: #374151 !important;
}

.inline-form {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
}

.inline-form button {
    font-family: inherit;
}

table .action-buttons a,
table .action-buttons button {
    text-decoration: none !important;
}

.keyword-group {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    margin-bottom: 22px;
    overflow: hidden;
    background: #fff;
}

.keyword-group.duplicate {
    border-color: #f59e0b;
}

.keyword-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
}

.keyword-head h3 {
    margin: 0;
    font-size: 18px;
}

.keyword-suggestion {
    background: #fff7ed;
    border-top: 1px solid #fed7aa;
    padding: 12px 16px;
    color: #9a3412;
    font-size: 14px;
}

.autosave-status {
    grid-column: 1 / -1;
    margin-bottom: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 13px;
}

.autosave-status.saving {
    background: #eff6ff;
    color: #1d4ed8;
}

.autosave-status.saved {
    background: #dcfce7;
    color: #166534;
}

.autosave-status.error {
    background: #fee2e2;
    color: #991b1b;
}