:root {
    --color-primary: #0f172a;
    --color-secondary: #2563eb;
    --color-secondary-hover: #1d4ed8;
    --color-background: #ffffff;
    --color-surface: #f8fafc;
    --color-border: #e2e8f0;
    --color-muted: #64748b;
    --color-success: #16a34a;
    --color-warning: #f59e0b;
    --color-danger: #dc2626;
    --shadow-soft: 0 16px 45px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 22px 60px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    background: var(--color-surface);
    color: var(--color-primary);
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    line-height: 1.5;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.page-shell {
    min-height: 100vh;
}

.container {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
}

.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
}

.header-inner {
    min-height: 96px;
    display: grid;
    grid-template-columns: 220px 1fr auto;
    align-items: center;
    gap: 24px;
}

.brand img,
.site-footer img {
    width: 190px;
    height: auto;
}

.header-title p,
.auth-heading p {
    margin: 0 0 4px;
    color: var(--color-muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
}

.header-title h1,
.auth-heading h1 {
    margin: 0;
    font-size: clamp(1.6rem, 2vw, 2.2rem);
    line-height: 1.1;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--color-muted);
    font-weight: 600;
}

.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0 18px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 200ms ease, border-color 200ms ease, transform 200ms ease;
    white-space: nowrap;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--color-secondary);
    color: #ffffff;
}

.button-primary:hover {
    background: var(--color-secondary-hover);
}

.button-secondary {
    background: #ffffff;
    border-color: var(--color-border);
    color: var(--color-secondary);
}

.dashboard-section {
    padding: 32px 0;
}

.dashboard-section-compact {
    padding-top: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 24px;
}

.stat-card,
.preview-card,
.auth-panel,
.empty-state {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
}

.stat-card {
    min-height: 112px;
    padding: 24px;
}

.stat-card span {
    color: var(--color-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.stat-card strong {
    display: block;
    margin-top: 10px;
    font-size: 2rem;
    line-height: 1;
}

.search-placeholder {
    display: block;
}

.search-placeholder span {
    display: block;
    margin-bottom: 8px;
    color: var(--color-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.search-placeholder input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0 16px;
    background: #ffffff;
    color: var(--color-muted);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.preview-card {
    min-height: 520px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 200ms ease, transform 200ms ease;
}

.preview-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.preview-card-link {
    cursor: pointer;
}

.preview-card-link img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.preview-card-body {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.preview-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.preview-card h2 {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.25;
}

.preview-card p {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.95rem;
}

.preview-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0;
}

.preview-meta div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.preview-meta dt {
    color: var(--color-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.preview-meta dd {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    text-align: right;
}

.status {
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.status-draft {
    background: #f1f5f9;
    color: #475569;
}

.status-review {
    background: #fef3c7;
    color: #92400e;
}

.status-ready {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-published {
    background: #dcfce7;
    color: #166534;
}

.status-archived {
    background: #fee2e2;
    color: #991b1b;
}

.preview-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.preview-card-footer span {
    color: var(--color-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.empty-state {
    padding: 48px;
    color: var(--color-muted);
    font-weight: 700;
    text-align: center;
}

.site-footer {
    margin-top: 32px;
    padding: 32px 0;
    background: #ffffff;
    border-top: 1px solid var(--color-border);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    color: var(--color-muted);
    font-weight: 700;
}

.auth-layout {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-panel {
    width: min(100%, 440px);
    padding: 32px;
}

.auth-logo {
    width: 220px;
    margin-bottom: 32px;
}

.auth-form {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.field input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0 14px;
    background: #ffffff;
}

.field input:focus,
.search-placeholder input:focus,
.button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.22);
    outline-offset: 2px;
}

.message {
    margin-top: 24px;
    border-radius: 10px;
    padding: 12px 14px;
    font-weight: 700;
}

.message-error {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 1199px) {
    .header-inner {
        grid-template-columns: 180px 1fr;
    }

    .user-menu {
        grid-column: 1 / -1;
        justify-content: space-between;
        padding-bottom: 20px;
    }

    .stats-grid,
    .preview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .container {
        width: min(100% - 40px, 1280px);
    }

    .header-inner {
        min-height: 0;
        grid-template-columns: 1fr;
        padding: 24px 0;
    }

    .brand img,
    .site-footer img {
        width: 170px;
    }

    .stats-grid,
    .preview-grid {
        grid-template-columns: 1fr;
    }

    .preview-card {
        min-height: 0;
    }

    .preview-card-heading,
    .preview-card-footer,
    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .preview-card-footer .button {
        width: 100%;
    }
}

