* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #667eea;
}

header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1.1em;
}

.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

select, input[type="number"] {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    background: white;
    transition: border-color 0.3s;
    min-width: 150px;
}

select:focus, input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.btn-generate {
    padding: 10px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-generate:active {
    transform: translateY(0);
}

.info-box {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    color: #1565c0;
    display: none;
}

.info-box.show {
    display: block;
}

.preview-area {
    min-height: 200px;
}

.sheet-container {
    margin-bottom: 40px;
}

.sheet-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 5px;
}

.sheet {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.sheet-side {
    flex: 1;
    min-width: 0;
}

.side-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.1em;
}

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

.page {
    aspect-ratio: 0.7;
    border: 2px solid #333;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    background: white;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.page:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page.blank {
    background: repeating-linear-gradient(
        45deg,
        #f5f5f5,
        #f5f5f5 10px,
        #e0e0e0 10px,
        #e0e0e0 20px
    );
    color: #999;
}

.page.rotated {
    background: #fff3e0;
}

.page-number {
    color: #333;
}

.page.blank .page-number {
    color: #999;
}

.signature-info {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 5px;
    color: #e65100;
    font-size: 0.95em;
}

@media (max-width: 768px) {
    .sheet {
        flex-direction: column;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-generate {
        width: 100%;
    }
}
