* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background: #f3f4f8;
    color: #15142b;
}

a {
    text-decoration: none;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #140d46, #3d2490);
}

.login-card {
    width: 390px;
    background: #fff;
    border-radius: 18px;
    padding: 35px;
    box-shadow: 0 25px 60px rgba(0,0,0,.25);
}

.login-logo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #f1edff;
    color: #3d2490;
    font-size: 32px;
    margin-bottom: 18px;
}

.login-card h1 {
    margin: 0 0 8px;
}

.login-card p {
    color: #666;
    margin-bottom: 22px;
}

.login-card input,
.login-card button {
    width: 100%;
    height: 48px;
    border-radius: 10px;
    margin-bottom: 14px;
}

.login-card input {
    border: 1px solid #ddd;
    padding: 0 14px;
}

.login-card button {
    border: none;
    background: #3d2490;
    color: white;
    font-weight: 800;
    cursor: pointer;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 270px;
    background: #120d3c;
    color: white;
    padding: 24px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 24px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    margin-bottom: 18px;
}

.brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #fff;
    color: #3d2490;
    display: grid;
    place-items: center;
    font-size: 22px;
}

.admin-brand strong {
    display: block;
    font-size: 18px;
}

.admin-brand small {
    color: #d7d0ff;
}

.admin-menu {
    display: grid;
    gap: 8px;
}

.admin-menu a {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #f6f4ff;
    padding: 13px 14px;
    border-radius: 12px;
    font-weight: 700;
}

.admin-menu a:hover {
    background: rgba(255,255,255,.1);
}

.admin-main {
    flex: 1;
    padding: 28px;
}

.admin-topbar {
    min-height: 86px;
    background: #fff;
    border-radius: 18px;
    padding: 22px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,.06);
    margin-bottom: 24px;
}

.admin-topbar h1 {
    margin: 0 0 6px;
}

.admin-topbar p {
    margin: 0;
    color: #666;
}

.preview-btn,
.primary-btn,
.secondary-btn,
.danger-btn {
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 10px;
    padding: 12px 18px;
    font-weight: 800;
    cursor: pointer;
}

.preview-btn,
.primary-btn {
    background: #3d2490;
    color: #fff;
}

.secondary-btn {
    background: #eee9ff;
    color: #3d2490;
}

.danger-btn {
    background: #ffe8e8;
    color: #b00020;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-bottom: 24px;
}

.stat-card,
.admin-card {
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,.06);
}

.stat-card {
    color: #15142b;
    display: grid;
    gap: 8px;
}

.stat-card i {
    color: #3d2490;
    font-size: 28px;
}

.stat-card strong {
    font-size: 30px;
}

.stat-card span {
    color: #666;
    font-weight: 700;
}

.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.quick-actions a {
    background: #f2efff;
    color: #3d2490;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 800;
}

.admin-form label {
    display: block;
    margin: 16px 0 8px;
    font-weight: 800;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 12px;
    font-size: 15px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 700;
}

.alert-success {
    background: #eafff0;
    color: #13743a;
}

.alert-danger {
    background: #ffe8e8;
    color: #b00020;
}

.editor-preview-layout,
.builder-layout {
    display: grid;
    grid-template-columns: minmax(0, 52%) minmax(0, 48%);
    gap: 22px;
    align-items: start;
}

.preview-panel {
    background: #fff;
    padding: 14px;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,.06);
    position: sticky;
    top: 24px;
}

.preview-panel iframe {
    width: 100%;
    height: 720px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: white;
}

.builder-head h2 {
    margin-bottom: 6px;
}

.builder-head p {
    color: #666;
}

.sortable-list {
    display: grid;
    gap: 14px;
    margin: 18px 0;
}

.sortable-item,
.service-editor-item {
    background: #fafaff;
    border: 1px solid #e1ddf5;
    border-radius: 14px;
    padding: 16px;
}

.sortable-item {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 12px;
}

.sortable-item strong {
    display: block;
}

.sortable-item small,
.muted {
    color: #777;
}

.drag-handle {
    cursor: grab;
    color: #3d2490;
}

.repeater-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.table-list {
    display: grid;
    gap: 10px;
}

.table-row {
    display: flex;
    justify-content: space-between;
    background: #fafaff;
    padding: 14px;
    border-radius: 10px;
}

@media(max-width: 1000px) {
    .admin-shell {
        display: block;
    }

    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .dashboard-grid,
    .editor-preview-layout,
    .builder-layout,
    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .preview-panel {
        position: relative;
    }
}
