:root {
    --primary: #2563eb;
    --muted: #e5e7eb;
    --bg: #f9fafb;
    --fg: #111827;
    --fg-muted: #6b7280;
}

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--fg);
    margin: 24px;
}

.header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 16px;
}

.logo {
    position: absolute;
    left: 0;
    height: clamp(18px, 6vw, 24px);
    width: auto;
}

.tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--muted);
    margin-bottom: 16px;
}

.tab {
    padding: 10px 14px;
    border: 1px solid var(--muted);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: var(--bg);
    color: var(--fg-muted);
    cursor: pointer;
    user-select: none;
    font-size: clamp(0.50rem, 1.2vw, 0.75rem);
}

.tab.active {
    background: #fff;
    color: var(--fg);
    border-color: var(--primary);
}

.panel {
    display: none;
    border: 1px solid var(--muted);
    border-radius: 0 6px 6px 6px;
    padding: 16px;
}

.panel.active {
    display: block;
}

form .row {
    margin-bottom: 12px;
}

label {
    display: inline-block;
    min-width: 220px;
}

input[type="text"],
input[type="date"],
select {
    padding: 6px 8px;
    width: 320px;
}

.actions {
    margin-top: 16px;
}

button {
    padding: 8px 12px;
    cursor: pointer;
}

.note {
    color: var(--fg-muted);
    font-size: 0.95rem;
}

.page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 1100px) {
    .page {
        grid-template-columns: 1fr 1fr !important;
    }
}

.preview-card {
    border: 1px solid var(--muted);
    border-radius: 6px;
    padding: 12px;
    background: #fff;
    min-height: 300px;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.preview-frame {
    width: 100%;
    height: 70vh;
    border: none;
    background: #f8fafc;
}

.loader {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

textarea {
    font-family: inherit;
    padding: 8px;
    border: 1px solid var(--muted);
    border-radius: 4px;
}

.field-inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ck-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--fg-muted);
    font-size: 0.95rem;
}

.select2-container .select2-selection--single {
    height: 32px !important;
    padding: 2px 6px !important;
    font-size: 14px !important;
    border: 1px solid var(--muted);
    border-radius: 4px;
}

.select2-selection__rendered {
    line-height: 28px !important;
    font-size: 14px !important;
}

.select2-selection__arrow {
    height: 28px !important;
}