*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: #f4f6f8;
    color: #1a1a2e;
    line-height: 1.5;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #1a1a2e;
    color: #fff;
}

.topbar__brand {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-weight: 700;
    font-size: 1.1rem;
}

.topbar__brand-link {
    color: #fff;
    text-decoration: none;
}

.topbar__nav {
    display: flex;
    gap: 1rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.topbar__nav a {
    color: #cbd5e1;
    text-decoration: none;
}

.topbar__nav a:hover {
    color: #fff;
}

.topbar__user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-header { margin-bottom: 1.5rem; }

.page-header h1 { margin: 0 0 0.25rem; }

.muted { color: #6b7280; margin: 0; }

.back-link {
    display: inline-block;
    margin-bottom: 0.5rem;
    color: #4f46e5;
    text-decoration: none;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.card h2 { margin-top: 0; font-size: 1.1rem; }

.form label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form input[type="email"],
.form input[type="password"],
.form input[type="text"],
.form input[type="file"],
.form select,
.form textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-family: inherit;
}

.import-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.import-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.import-grid--5 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.import-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.card--builders {
    border-color: #c4b5fd;
}

.builder-import h3 {
    margin-top: 0;
}

.import-grid h3 {
    margin-top: 0;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
    .import-grid { grid-template-columns: 1fr; }
    .import-grid--3 { grid-template-columns: 1fr; }
    .import-grid--5 { grid-template-columns: 1fr; }
    .import-grid--2 { grid-template-columns: 1fr; }
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

.form-row--4 {
    grid-template-columns: 1fr 1fr 1fr auto;
}

.section-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 1.5rem 0;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn--ghost-dark {
    background: #f3f4f6;
    color: #374151;
}

.form-field--action { padding-bottom: 1rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
}

.btn--primary { background: #4f46e5; color: #fff; }
.btn--primary:hover { background: #4338ca; }
.btn--success { background: #059669; color: #fff; }
.btn--success:hover { background: #047857; }
.btn--ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.3); }
.btn--small { padding: 0.35rem 0.75rem; font-size: 0.85rem; background: #eef2ff; color: #4338ca; }

.inline-form { display: inline; }

.auth-card {
    max-width: 400px;
    margin: 4rem auto;
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

.auth-card h1 { margin: 0 0 0.25rem; }

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert--error { background: #fef2f2; color: #991b1b; }
.alert--success { background: #ecfdf5; color: #065f46; }
.alert--info { background: #eff6ff; color: #1e40af; }

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
}

.badge--success { background: #ecfdf5; color: #065f46; }
.badge--warning { background: #fffbeb; color: #92400e; }
.badge--muted { background: #f3f4f6; color: #4b5563; }

.checklist { margin: 0 0 1rem; padding-left: 1.25rem; }
.checklist li { margin-bottom: 0.5rem; }

.preview-frame {
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    padding: 1.5rem;
    background: #fafafa;
}

@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
}
