html {
    font-size: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f6f8;
    color: #222;
}

a {
    color: #1f4f99;
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    padding: 18px;
    margin-bottom: 20px;
}

.inner-card {
    margin-top: 16px;
    margin-bottom: 20px;
    background: #fafbfd;
    border: 1px solid #e5e7eb;
    box-shadow: none;
}

.filter-card {
    margin-bottom: 20px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(180px, 1fr)) auto;
    gap: 14px;
    align-items: end;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .form-row label {
        font-weight: 600;
        font-size: 13px;
    }

.search-box {
    min-width: 260px;
}

.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfd5dc;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

    .input:focus {
        outline: none;
        border-color: #7aa7e8;
        box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
    }

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: end;
}

.btn {
    display: inline-block;
    background: #1f6feb;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
}

    .btn:hover {
        background: #1859bc;
        text-decoration: none;
    }

    .btn.secondary {
        background: #6c757d;
    }

        .btn.secondary:hover {
            background: #5b636a;
        }

.warning-btn {
    background: #d4a017;
    color: #fff;
}

    .warning-btn:hover {
        background: #b8890f;
    }

.alert {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.success-box {
    background: #e8f7e8;
    color: #1f6a1f;
    border: 1px solid #b8dfb8;
}

.error-box {
    background: #fdeaea;
    color: #8a1f1f;
    border: 1px solid #efb3b3;
}

.warning-box {
    background: #fff4d6;
    color: #7a5a00;
    border: 1px solid #e7c96a;
}

.split-layout {
    display: grid;
    grid-template-columns: 48% 52%;
    gap: 20px;
}

.left-panel,
.right-panel {
    min-height: 500px;
}

    .left-panel h2,
    .right-panel h2 {
        margin-top: 0;
        margin-bottom: 16px;
    }

.table {
    width: 100%;
    border-collapse: collapse;
}

    .table th,
    .table td {
        text-align: left;
        padding: 10px 8px;
        border-bottom: 1px solid #e5e7eb;
        vertical-align: top;
    }

    .table th {
        background: #f8f9fb;
        font-size: 13px;
        font-weight: 700;
        color: #333;
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .table td a {
        font-weight: 600;
    }

.selected-row {
    background: #eaf3ff;
}

.multi-image-row {
    background-color: #fff8e1;
}

    .multi-image-row td {
        border-left: 3px solid #d4a017;
    }

.selected-row.multi-image-row {
    background: #f9f1c7;
}

.multi-image-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #d4a017;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    vertical-align: middle;
}

.multi-image-note {
    margin-top: 4px;
    font-size: 12px;
    color: #8a6d1d;
    font-weight: 600;
}

.count-pill {
    display: inline-block;
    min-width: 28px;
    text-align: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #d4a017;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
}

.count-zero {
    color: #666;
    font-size: 12px;
}

.article-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.image-block {
    margin-bottom: 24px;
}

.preview-image {
    display: block;
    max-width: 100%;
    max-height: 420px;
    border: 1px solid #d7dce2;
    border-radius: 8px;
    background: #fafafa;
    padding: 8px;
}

.preview-hidden {
    display: none;
}

.file-caption {
    margin-top: 8px;
    font-size: 13px;
    color: #555;
    word-break: break-word;
}

.file-info {
    margin-top: 4px;
    font-size: 12px;
    color: #555;
}

.file-warning {
    margin-top: 6px;
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    background: #fdeaea;
    color: #8a1f1f;
    border: 1px solid #efb3b3;
    font-size: 12px;
    font-weight: 700;
}

.upload-form {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 420px;
}

    .upload-form.small {
        max-width: 320px;
    }

.default-form {
    margin-top: 8px;
    margin-bottom: 4px;
}

.additional-box {
    margin-top: 24px;
}

    .additional-box h3 {
        margin-bottom: 12px;
    }

.additional-item {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid #e5e7eb;
}

.thumb {
    width: 140px;
    max-height: 120px;
    object-fit: contain;
    border: 1px solid #d7dce2;
    border-radius: 8px;
    background: #fafafa;
    padding: 6px;
}

.additional-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.details-badge {
    margin-left: 10px;
}

.validation-summary-errors {
    background: #fdeaea;
    color: #8a1f1f;
    border: 1px solid #efb3b3;
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.field-validation-error {
    color: #b42318;
    font-size: 12px;
}

footer {
    margin-top: 24px;
    padding: 16px 0;
    color: #666;
    font-size: 12px;
}

.login-wrapper {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.10);
    padding: 24px;
}

    .login-card h1 {
        margin-top: 0;
        margin-bottom: 18px;
        font-size: 24px;
    }

    .login-card .form-row {
        margin-bottom: 14px;
    }

    .login-card .btn {
        width: 100%;
    }

@media (max-width: 1200px) {
    .filters-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .split-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .container {
        padding: 12px;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .additional-item {
        grid-template-columns: 1fr;
    }

    .thumb {
        width: 100%;
        max-width: 220px;
    }

    .table th,
    .table td {
        padding: 8px 6px;
        font-size: 13px;
    }
}
