* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Trebuchet MS, system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #e8f4f8 0%, #f0f8fc 100%);
    color: #2c3e50;
    min-height: 100vh;
    padding: 20px;
}

[v-cloak] {
    display: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(25, 118, 210, 0.15);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

h1 {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.header-subtitle {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 300;
}

.content {
    display: grid;
    grid-template-columns: 2.2fr 0.8fr;
    gap: 28px;
    padding: 36px 28px;
}

@media (max-width: 1024px) {
    .content {
        grid-template-columns: 1fr;
    }
}

.panel {
    background-color: #f8fbfd;
    border: 1px solid #e3f2fd;
    border-radius: 8px;
    padding: 25px;
}

.panel h2 {
    font-size: 18px;
    color: #1976d2;
    margin-bottom: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

input[type="number"],
input[type="text"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #b3e5fc;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background-color: #ffffff;
    color: #2c3e50;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

button {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.primary-button {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    padding: 12px 28px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.primary-button:hover {
    box-shadow: 0 6px 16px rgba(25, 118, 210, 0.4);
    transform: translateY(-2px);
}

.secondary-button {
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 10px 16px;
    border: 1px solid #b3e5fc;
    box-shadow: none;
    width: auto;
    margin-bottom: 0;
}

.secondary-button:hover {
    background-color: #bbdefb;
    border-color: #90caf9;
}

.remove-field {
    background-color: #ffebee;
    color: #c62828;
    padding: 8px 12px;
    border: 1px solid #ffcdd2;
    width: auto;
    box-shadow: none;
}

.remove-field:hover {
    background-color: #ffcdd2;
}

.schema-builder {
    margin-bottom: 20px;
}

.schema-fields {
    margin-bottom: 18px;
    max-height: 560px;
    overflow-y: auto;
    padding-right: 8px;
}

.schema-field {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: start;
    padding: 16px;
    background: white;
    border: 1px solid #eaf6ff;
    border-radius: 8px;
    margin-bottom: 12px;
}

.field-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    align-items: center;
}

.field-inputs input,
.field-inputs select,
.field-inputs textarea {
    padding: 10px 12px;
    font-size: 14px;
}

.field-main {
    grid-template-columns: 1fr 150px;
}

.field-name-input {
    max-width: 100%;
}

.type-select {
    width: 150px;
}

.method-select {
    max-width: 220px;
}

.enum-inputs {
    grid-template-columns: 1fr;
}
.enum-textarea {
    min-height: 90px;
    resize: vertical;
}

.range-inputs,
.date-inputs {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.unique-inputs {
    align-items: center;
    gap: 8px;
}
.unique-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.unique-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.unique-text {
    font-size: 13px;
}

.remove-field {
    background: transparent;
    color: #c62828;
    padding: 0;
    width: 28px;
    height: 28px;
    font-size: 16px;
    line-height: 1;
    border-radius: 4px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.remove-field:hover {
    color: #ff1744;
}

.row-top {
    display: grid;
    grid-template-columns: 1fr 150px 36px;
    gap: 12px;
    align-items: center;
}
.row-top .field-name-input {
    font-size: 15px;
    padding: 12px;
}
.row-bottom {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    align-items: flex-start;
}
.field-controls {
    flex: 1 1 auto;
}
.field-meta {
    flex: 0 0 220px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.validation-badge {
    background: #fff8e1;
    color: #e65100;
    border-left: 3px solid #ffb300;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.add-field-btn {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid #b3e5fc;
    background: #e9f7ff;
    color: #1976d2;
    border-radius: 8px;
    width: auto;
    font-weight: 700;
}
.add-field-btn:hover {
    background: #dff3ff;
}

.action-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
}
.action-row .left-actions,
.action-row .right-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.generate-btn {
    width: auto;
    padding: 10px 18px;
    min-width: 140px;
    margin-left: 8px;
}

.schema-preview {
    background-color: #263238;
    color: #81c784;
    padding: 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid #455a64;
    max-height: 140px;
    overflow-y: auto;
}

.loading {
    padding: 16px;
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 6px;
    color: #1565c0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.loading::before {
    content: '⟳';
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.error {
    padding: 16px;
    background-color: #ffebee;
    border: 1px solid #ef5350;
    border-radius: 6px;
    color: #c62828;
    font-weight: 600;
    white-space: pre-wrap;
    word-break: break-word;
}

.validation-warning {
    color: #e65100;
    background-color: #fff3e0;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    border-left: 3px solid #ff9800;
    white-space: nowrap;
}

.result-container {
    padding: 40px 30px;
    background-color: #f8fbfd;
}

.result-container h2 {
    color: #1976d2;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.export-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.export-btn {
    background: linear-gradient(135deg, #0288d1 0%, #0277bd 100%);
    color: white;
    padding: 10px 20px;
    box-shadow: 0 2px 8px rgba(2, 136, 209, 0.3);
}

.export-btn:hover {
    box-shadow: 0 4px 12px rgba(2, 136, 209, 0.4);
    transform: translateY(-2px);
}

.save-btn {
    background: linear-gradient(135deg, #3f51b5 0%, #2f3e9e 100%);
    color: white;
    padding: 10px 20px;
    box-shadow: 0 2px 8px rgba(63,81,181,0.3);
}

.save-btn:hover {
    box-shadow: 0 4px 12px rgba(63,81,181,0.4);
    transform: translateY(-2px);
}

.schema-delete-btn {
    background: transparent;
    border: 1px solid #ffd6d6;
    color: #c62828;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}

.schema-delete-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modal .secondary-button {
    padding: 6px 10px;
    font-size: 13px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

thead {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
}

th {
    color: white;
    padding: 14px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid #e3f2fd;
    font-size: 14px;
}

tbody tr:hover {
    background-color: #e3f2fd;
}

tbody tr:nth-child(even) {
    background-color: #f5f5f5;
}

tbody tr:nth-child(even):hover {
    background-color: #e3f2fd;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal {
    width: 100%;
    max-width: 520px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(2, 6, 23, 0.4);
}
.modal input[type="email"], .modal input[type="password"] {
    margin-top: 8px;
    margin-bottom: 8px;
}
.auth-error {
    color: #b71c1c;
    background: #ffebee;
    padding: 8px 12px;
    border-radius: 6px;
}
.auth-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

