body.admin-body {
    margin: 0;
    font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: #f5f7fb;
    color: #0c1222;
}

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

code {
    background: #f3f6ff;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'Fira Code', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
}

.btn {
    border-radius: 10px;
    border: 1px solid #d4daed;
    background: #ffffff;
    padding: 10px 18px;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.btn.primary {
    background: #007cff;
    color: #fff;
    border-color: #007cff;
}

.btn.danger {
    background: #d64545;
    border-color: #d64545;
    color: #fff;
}

.btn.danger:hover {
    box-shadow: 0 12px 24px rgba(214, 69, 69, 0.25);
}

.btn.ghost {
    background: transparent;
    border-color: rgba(12, 18, 34, 0.2);
    color: #0c1222;
}

.btn.ghost:hover {
    box-shadow: none;
    transform: none;
    border-color: rgba(12, 18, 34, 0.35);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 25, 40, 0.12);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0;
    margin: 0 auto;
    max-width: 1100px;
    width: 100%;
    box-sizing: border-box;
}

.admin-header__title h1 {
    margin: 8px 0 0;
}

.eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #5b647a;
    font-weight: 700;
}

.admin-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-header__actions form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.login-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-main {
    max-width: 1100px;
    margin: 24px auto 60px;
    padding: 0 24px;
    box-sizing: border-box;
    width: 100%;
}

.grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.grid > * {
    width: 100%;
}

.card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e4e8f1;
    padding: 22px 24px;
    box-shadow: 0 16px 34px rgba(15, 25, 40, 0.08);
}

.login-card {
    text-align: center;
}

.login-form {
    width: 100%;
}

.admin-form {
    display: grid;
    gap: 18px;
    width: 100%;
}

.admin-form label {
    font-weight: 600;
    display: grid;
    gap: 6px;
    width: 100%;
}

.row > label,
.row-3 > label {
    min-width: 180px;
}

.row,
.row-3 {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

input,
textarea,
select {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #d4daed;
    font-family: inherit;
    font-size: 15px;
    background: #fff;
    box-sizing: border-box;
}

input[type="color"] {
    padding: 4px;
    height: 44px;
}

textarea {
    resize: vertical;
}

.muted {
    color: #5b647a;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-status {
    font-size: 14px;
    color: #5b647a;
    min-height: 20px;
}

.form-status.error {
    color: #c0392b;
}

.notice {
    border-left: 4px solid #4caf50;
    background: #f0fff4;
    color: #1b5e20;
    display: grid;
    gap: 6px;
}

.notice.notice--error {
    border-color: #d64545;
    background: #fff5f5;
    color: #7f1d1d;
}

.notice p {
    margin: 0;
}

.danger-card {
    border: 1px solid rgba(214, 69, 69, 0.35);
    background: #fff2f2;
    color: #5f1a1a;
}

.danger-form {
    display: grid;
    gap: 12px;
    max-width: 420px;
}

.danger-form label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    line-height: 1.5;
}

.checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.section-toggle-group {
    border: 1px solid #e4e8f1;
    border-radius: 14px;
    padding: 16px 18px 12px;
    background: #f9fbff;
    display: grid;
    gap: 12px;
}

.section-toggle-group legend {
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: 12px;
    color: #7a8295;
}

.section-toggle-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.section-toggle-grid .checkbox {
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #dce2f2;
}

.section-toggle-grid .checkbox span {
    flex: 1;
}

.poll-builder {
    border: 1px solid #e4e8f1;
    border-radius: 14px;
    padding: 16px;
    background: #f9fbff;
}

.poll-builder__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.poll-builder__templates {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.poll-builder__templates label {
    display: grid;
    gap: 6px;
    font-weight: 600;
    flex: 1 1 240px;
}

.poll-builder__templates .btn {
    align-self: flex-end;
}

#pollBuilderList {
    display: grid;
    gap: 12px;
}

.poll-question {
    background: #fff;
    border: 1px solid #dce2f2;
    border-radius: 12px;
    padding: 14px;
    display: grid;
    gap: 10px;
}

.poll-question__title {
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.poll-question__controls {
    display: flex;
    gap: 8px;
}

.poll-question__body {
    display: grid;
    gap: 8px;
}

.options-editor textarea {
    height: 90px;
}

.schema-json summary {
    font-weight: 600;
    cursor: pointer;
}

.poll-results-card {
    display: grid;
    gap: 16px;
}

.poll-results-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.poll-list {
    border: 1px solid #e4e8f1;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
    max-height: 320px;
    overflow-y: auto;
}

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

.poll-list th,
.poll-list td {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid #eef1f9;
    font-size: 14px;
}

.error-msg {
    color: #c00;
    font-weight: 600;
}

.login-form input {
    width: 200px;
    max-width: 100%;
}

.theme-backgrounds {
    border: 1px solid #e4e8f1;
    border-radius: 12px;
    padding: 16px;
    display: grid;
    gap: 12px;
    background: #f9fbff;
}

.theme-backgrounds legend {
    font-weight: 700;
    padding: 0 6px;
}

.theme-backgrounds label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.theme-backgrounds label span {
    font-size: 14px;
    color: #333c52;
}

.theme-backgrounds input {
    font-weight: 400;
}

.media-settings {
    border: 1px solid #e4e8f1;
    border-radius: 12px;
    padding: 16px;
    display: grid;
    gap: 12px;
    background: #fdfdff;
}

.media-settings legend {
    font-weight: 700;
    padding: 0 6px;
}

.media-settings .help-text {
    font-size: 13px;
    color: #5b647a;
    font-weight: 400;
    display: block;
}

.section-settings {
    border: 1px solid #e4e8f1;
    border-radius: 12px;
    padding: 16px;
    display: grid;
    gap: 10px;
    background: #f5f8ff;
}

.section-settings legend {
    font-weight: 700;
    padding: 0 6px;
}

@media (max-width: 700px) {
    .admin-header {
        padding: 24px 16px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .row > label,
    .row-3 > label {
        min-width: 0;
    }

    .admin-header__actions {
        width: 100%;
    }

    .admin-header__actions form {
        width: 100%;
    }

    .login-form input {
        flex: 1;
    }

    .poll-builder__templates {
        flex-direction: column;
        align-items: stretch;
    }

    .poll-builder__templates .btn {
        width: 100%;
    }
}
