@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&display=swap');

:root {
    --clip-height: 80px;
    --clip-notch: 3rem;
    --clip-notch-depth: calc(var(--clip-notch) * 0.6);
    --theme-primary: #9ED8BC;
    --theme-primary-hover: rgba(158, 216, 188, 0.5);
    --theme-gradient: linear-gradient(178deg, #FFF -0.28%, #9ED8BC 99.85%);
    --theme-active-text: inherit;
    --theme-dark: #1a2625;
    --theme-card: #ffffff;
    --theme-muted: rgba(26, 38, 37, 0.65);
    --theme-border: rgba(26, 38, 37, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Sora', sans-serif;
    background: var(--theme-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--theme-dark);
}

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

.top-menu {
    position: fixed;
    top: 0;
    right: 0;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.92);
    border-bottom-left-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    z-index: 200;
}

.top-menu a,
.top-menu button {
    border: 0;
    background: none;
    font: inherit;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    color: var(--theme-dark);
}

.top-menu a:hover,
.top-menu button:hover {
    background: var(--theme-primary-hover);
}

.top-menu .logout-btn {
    background: rgba(26, 38, 37, 0.08);
}

.top-menu .logout-btn:hover {
    background: rgba(26, 38, 37, 0.18);
}

.page-header {
    padding: 4.5rem 1rem 1.5rem;
    text-align: center;
}

.page-header .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.03em;
}

.page-header .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--theme-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.page-header h1 {
    margin: 1rem 0 0.35rem;
    font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.6rem);
}

.page-header p {
    margin: 0;
    color: var(--theme-muted);
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

.card {
    background: var(--theme-card);
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(26, 38, 37, 0.08);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.65);
}

.card + .card {
    margin-top: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(26, 38, 37, 0.08);
    font-size: 0.8rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--theme-border);
}

.list-item strong {
    display: block;
    margin-bottom: 0.15rem;
}

.muted {
    color: var(--theme-muted);
}

.button {
    border: none;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    background: var(--theme-primary);
    color: var(--theme-active-text);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button.secondary {
    background: rgba(26, 38, 37, 0.08);
    color: var(--theme-dark);
}

.button.ghost {
    background: transparent;
    border: 1px solid var(--theme-border);
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 15px rgba(26, 38, 37, 0.1);
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

label {
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--theme-border);
    font: inherit;
    background: rgba(255, 255, 255, 0.9);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.notice {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(26, 38, 37, 0.08);
}

.error-list {
    margin: 0;
    padding-left: 1.2rem;
    color: #b33a3a;
}

.wysiwyg {
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background: #fff;
    min-height: 220px;
    padding: 0.75rem;
    position: relative;
}

.wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.wysiwyg-toolbar button {
    border: 1px solid var(--theme-border);
    background: rgba(26, 38, 37, 0.05);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
}

.wysiwyg-toolbar button:hover {
    background: var(--theme-primary-hover);
}

.wysiwyg img {
    max-width: 100%;
    border-radius: 12px;
    margin: 0.5rem 0;
}

.wysiwyg img.is-selected {
    outline: 2px solid rgba(26, 38, 37, 0.25);
    outline-offset: 4px;
}

.wysiwyg a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.core-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.image-resizer {
    position: absolute;
    border: 1px dashed rgba(26, 38, 37, 0.35);
    pointer-events: none;
    z-index: 10;
}

.image-resizer-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--theme-primary);
    border: 2px solid #fff;
    border-radius: 4px;
    right: -7px;
    bottom: -7px;
    cursor: nwse-resize;
    pointer-events: auto;
    box-shadow: 0 2px 6px rgba(26, 38, 37, 0.2);
}

.section-title {
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

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

.table th,
.table td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid var(--theme-border);
}

@media (max-width: 720px) {
    .top-menu {
        position: static;
        margin: 0.5rem;
        border-radius: 12px;
    }

    .page-header {
        padding-top: 1.5rem;
    }

    .list-item {
        flex-direction: column;
        align-items: flex-start;
    }
}
