body {
    overflow-x: hidden;
}

.a4-page {
    width: 210mm;
    padding: 20px 30px; 
    margin: 0 auto;
    background: white;
    transform-origin: top center;
    transition: transform 0.3s ease;
    box-sizing: border-box;
    font-size: 12.5px; 
}

.printing-mode {
    transform: none !important;
    width: 794px !important;
    height: auto !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 9999;
    background: white !important;
    padding: 20px 30px !important;
}
.section-title {
    font-size: 0.75rem; 
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem; 
    padding-bottom: 0.2rem;
    border-bottom: 2px solid #f1f5f9;
}


.a4-page > div > div {
    margin-bottom: 0.8rem !important;
}

.a4-page > div:first-child {
    padding-bottom: 0.7rem !important;
    margin-bottom: 0.7rem !important;
}

.a4-page .space-y-6 > div {
    margin-bottom: 0.6rem !important;
}

.a4-page .space-y-7 > div {
    margin-bottom: 0.7rem !important;
}

.a4-page p {
    line-height: 1.4 !important;
    margin-bottom: 0.3rem;
}

.a4-page h4 {
    margin-bottom: 0.2rem !important;
}

.a4-page .space-y-5 > div {
    margin-bottom: 0.5rem !important;
}

.a4-page .space-y-8 > div {
    margin-bottom: 0.9rem !important;
}

.a4-page .flex.flex-wrap.gap-2 {
    gap: 0.4rem !important;
}

.a4-page .w-32.h-32 {
    width: 5rem !important;
    height: 5rem !important;
}

.editor-sidebar {
    background-color: #0f172a;
    border-right: 1px solid #1e293b;
    color: #cbd5e1;
}

.input-dark {
    width: 100%;
    background-color: #1e293b;
    border: 1px solid #334155;
    color: white;
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s;
}

.input-dark:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    background-color: #0f172a;
}

.input-dark::placeholder {
    color: #64748b;
}

.input-transparent {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    outline: none;
    transition: border 0.2s;
}
.input-transparent:focus {
    border-bottom-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.editor-section {
    background: #1e293b;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid #334155;
    margin-bottom: 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #94a3b8;
}
.section-header:hover {
    color: white;
}

.btn-add {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #60a5fa;
    background-color: rgba(59, 130, 246, 0.1);
    border: 1px dashed rgba(59, 130, 246, 0.3);
    border-radius: 0.5rem;
    transition: all 0.2s;
}
.btn-add:hover {
    background-color: rgba(59, 130, 246, 0.2);
    border-color: #60a5fa;
}

.btn-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: all 0.2s;
    color: #94a3b8;
}
.btn-icon:hover {
    background: #334155;
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
    transition: all 0.2s;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.3);
}

.delete-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: #ef4444;
    opacity: 0;
    transition: opacity 0.2s;
}
.group:hover .delete-btn {
    opacity: 1;
}

.custom-scroll::-webkit-scrollbar {
    width: 6px;
}
.custom-scroll::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}
.custom-scroll::-webkit-scrollbar-track {
    background: #0f172a;
}

.preview-area {
    background-color: #64748b;
    background-image: 
        radial-gradient(#94a3b8 1px, transparent 1px),
        radial-gradient(#94a3b8 1px, transparent 1px);
    background-position: 0 0, 20px 20px;
    background-size: 40px 40px;
    overflow-x: hidden; 
}

@media (max-width: 1024px) {
    .a4-page {
        min-height: auto;
    }
}