* {
    box-sizing: border-box;
}

:root {
    --background: #f5f5f5;
    --surface: #ffffff;
    --border: #e2e2e2;
    --text: #202124;
    --muted: #6b7280;
    --accent: #1a73e8;
    --accent-dark: #1558b0;
    --hover: #f1f3f4;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--background);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.sidebar-nav i {
    width: 20px;
    margin-right: 8px;
    text-align: center;
}

/* =========================================================
   LOGIN
   ========================================================= */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.login-card {
    width: min(420px, calc(100% - 40px));
    padding: 42px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}


.login-mark,
.wordpress-mark {
    width: 36px;
    height: 36px;
    display: block;
    object-fit: contain;
}

.login-mark {
    margin-bottom: 24px;
}


.login-card h1 {
    margin: 0 0 28px;
    font-size: 28px;
}

.login-card label {
    display: block;
    margin: 16px 0 7px;

    font-size: 14px;
    font-weight: 600;
}

.login-card input {
    width: 100%;
    height: 46px;

    padding: 0 12px;

    border: 1px solid #c9cdd1;
    border-radius: 5px;

    outline: none;
}

.login-card input:focus {
    border-color: var(--accent);
}

.login-error {
    padding: 11px 13px;
    margin-bottom: 18px;

    border-radius: 5px;

    background: #fff0f0;
    color: #b42318;

    font-size: 14px;
}

.login-button {
    width: 100%;
    margin-top: 25px;
}


/* =========================================================
   COMMON BUTTONS
   ========================================================= */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;

    padding: 0 18px;

    border: 0;
    border-radius: 5px;

    cursor: pointer;

    font-weight: 600;
}

.button-primary {
    color: white;
    background: var(--accent);
}

.button-primary:hover {
    background: var(--accent-dark);
}

.button-secondary {
    background: #eef0f2;
}


/* =========================================================
   LEFT SIDEBAR
   ========================================================= */

.admin-page {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;

    width: 245px;

    display: flex;
    flex-direction: column;

    padding: 22px 14px;

    background: var(--surface);

    border-right: 1px solid var(--border);
}

.sidebar-brand {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 5px 12px 28px;
}

.site-name {
    overflow: hidden;

    font-weight: 600;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;

    gap: 3px;
}

.sidebar-nav a {
    padding: 12px 14px;

    border-radius: 5px;

    font-size: 15px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--hover);
}

.sidebar-nav .new-post {
    margin-bottom: 14px;

    color: white;
    background: var(--accent);

    text-align: center;
    font-weight: 600;
}

.sidebar-nav .new-post:hover {
    background: var(--accent-dark);
}


/* =========================================================
   CONTENT AREA
   ========================================================= */

.content-area {
    width: calc(100% - 245px);

    margin-left: 245px;

    padding: 0 48px 42px;
}


/* =========================================================
   TOP USER BAR
   ========================================================= */

.content-topbar {
    height: 64px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-menu {
    display: flex;
    align-items: center;

    gap: 16px;

    color: var(--muted);

    font-size: 13px;
}

.user-menu a {
    color: var(--accent);
}


/* =========================================================
   CONTENT HEADER
   ========================================================= */

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin: 22px 0 28px;
}

.content-header h1 {
    margin: 0;

    font-size: 30px;
}


/* =========================================================
   SEARCH AND STATUS CONTROLS
   ========================================================= */

.content-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;
}

.search-form {
    display: flex;

    flex: 1;

    max-width: 560px;

    gap: 8px;
}

.search-form input {
    flex: 1;

    height: 40px;

    padding: 0 13px;

    border: 1px solid #c9cdd1;
    border-radius: 5px;

    outline: none;

    background: white;
}

.search-form input:focus {
    border-color: var(--accent);
}

.status-filter select {
    height: 40px;

    min-width: 170px;

    padding: 0 12px;

    border: 1px solid #c9cdd1;
    border-radius: 5px;

    background: white;

    color: var(--text);
}


/* =========================================================
   CONTENT LIST
   ========================================================= */

.content-list {
    overflow: hidden;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 7px;
}

.content-row {
    display: grid;

    grid-template-columns:
        72px
        minmax(0, 1fr)
        130px
        150px;

    gap: 18px;

    align-items: center;

    min-height: 88px;

    padding: 12px 20px;

    border-bottom: 1px solid var(--border);
}

.content-row:last-child {
    border-bottom: 0;
}

.content-row:hover {
    background: #fafafa;
}


/* =========================================================
   THUMBNAIL
   ========================================================= */

.content-thumb {
    width: 60px;
    height: 52px;

    overflow: hidden;

    border-radius: 4px;

    background: #eeeeee;
}

.content-thumb img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* =========================================================
   TITLE AND DATE
   ========================================================= */

.content-title {
    margin-bottom: 6px;

    font-weight: 600;
}

.content-date {
    color: var(--muted);

    font-size: 13px;
}


/* =========================================================
   STATUS
   ========================================================= */

.content-status {
    text-align: center;
}

.status {
    display: inline-block;

    padding: 5px 9px;

    border-radius: 12px;

    font-size: 12px;
    font-weight: 600;
}

.status-publish {
    color: #146c43;
    background: #e8f5ed;
}

.status-draft {
    color: #765b00;
    background: #fff5cc;
}

.status-pending {
    color: #175cd3;
    background: #eaf2ff;
}

.status-private {
    color: #6941c6;
    background: #f1eafe;
}


/* =========================================================
   AUTHOR
   ========================================================= */

.content-author {
    color: var(--muted);

    font-size: 13px;

    text-align: right;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    padding: 70px 30px;

    text-align: center;
}

.empty-state h2 {
    margin: 0 0 8px;
}

.empty-state p {
    color: var(--muted);
}


/* =========================================================
   EDITOR
   ========================================================= */

.editor-page {
    min-height: 100vh;

    background: #f5f5f5;
}

.editor-topbar {
    height: 68px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 28px;

    background: white;

    border-bottom: 1px solid var(--border);
}

.editor-brand {
    display: flex;
    align-items: center;

    gap: 12px;

    font-weight: 600;
}

.editor-actions {
    display: flex;

    gap: 10px;
}

.editor-shell {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        280px;

    gap: 28px;

    max-width: 1280px;

    margin: 34px auto;

    padding: 0 28px;
}

.editor-form {
    min-width: 0;
}

.title-input {
    width: 100%;

    margin-bottom: 12px;

    padding: 12px 4px;

    border: 0;
    border-bottom: 1px solid var(--border);

    outline: none;

    background: transparent;

    font-size: 34px;
    font-weight: 500;
}

.title-input:focus {
    border-bottom-color: var(--accent);
}


/* =========================================================
   EDITOR TOOLBAR
   ========================================================= */

.editor-toolbar {
    display: flex;
    align-items: center;

    gap: 3px;

    min-height: 50px;

    padding: 5px 8px;

    background: white;

    border: 1px solid var(--border);
    border-bottom: 0;

    border-radius: 7px 7px 0 0;
}

.editor-toolbar button {
    min-width: 36px;
    height: 34px;

    padding: 0 8px;

    border: 0;
    border-radius: 4px;

    background: transparent;

    cursor: pointer;
}

.editor-toolbar button:hover {
    background: var(--hover);
}

.toolbar-divider {
    width: 1px;
    height: 25px;

    margin: 0 5px;

    background: var(--border);
}


/* =========================================================
   WYSIWYG EDITOR
   ========================================================= */

.wysiwyg {
    min-height: 600px;

    padding: 32px 38px;

    outline: none;

    background: white;

    border: 1px solid var(--border);

    border-radius: 0 0 7px 7px;

    line-height: 1.7;

    font-size: 16px;
}

.wysiwyg:focus {
    border-color: #b8cbe8;
}

.wysiwyg img {
    max-width: 100%;
    height: auto;
}


/* =========================================================
   EDITOR SIDEBAR
   ========================================================= */

.editor-sidebar {
    display: flex;
    flex-direction: column;

    gap: 16px;
}

.editor-panel {
    padding: 20px;

    background: white;

    border: 1px solid var(--border);
    border-radius: 7px;
}

.editor-panel h2 {
    margin: 0 0 17px;

    font-size: 16px;
}

.editor-panel p {
    margin: 0;
}

.editor-panel dl {
    margin: 0;
}

.editor-panel dt {
    margin-top: 14px;

    color: var(--muted);

    font-size: 12px;
}

.editor-panel dt:first-child {
    margin-top: 0;
}

.editor-panel dd {
    margin: 4px 0 0;

    font-size: 14px;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status-row form {
    margin: 0;
}

.not-editable {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 7px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    opacity: 0.7;
}


/* =========================================================
   SMALL SCREENS
   ========================================================= */

@media (max-width: 800px) {

    .sidebar {
        position: static;

        width: 100%;

        min-height: auto;
    }

    .admin-page {
        display: block;
    }

    .sidebar-nav {
        flex-direction: row;
    }

    .content-area {
        width: 100%;

        margin-left: 0;

        padding: 25px 18px;
    }

    .content-row {
        grid-template-columns:
            55px
            minmax(0, 1fr);
    }

    .content-status,
    .content-author {
        display: none;
    }

    .editor-shell {
        grid-template-columns: 1fr;

        padding: 0 15px;
    }

    .editor-sidebar {
        display: none;
    }
}
