/* Library-only Create/Edit form visual enhancement (reusable). No impact on School/global pages. */

.lib-form-page {
    position: relative;
    padding: 18px 12px 24px;
    border-radius: 14px;
    background:
        radial-gradient(900px 260px at 0% 0%, rgba(191, 219, 254, 0.45) 0%, rgba(191, 219, 254, 0) 60%),
        radial-gradient(700px 220px at 100% 10%, rgba(219, 234, 254, 0.55) 0%, rgba(219, 234, 254, 0) 60%),
        linear-gradient(180deg, #f4f9ff 0%, #eef6ff 45%, #f8fbff 100%);
    overflow: hidden;
}

.lib-form-page::before,
.lib-form-page::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
}

.lib-form-page::before {
    width: 520px;
    height: 180px;
    left: -120px;
    top: 40%;
    background: radial-gradient(ellipse at center, rgba(147, 197, 253, 0.18) 0%, rgba(147, 197, 253, 0) 70%);
}

.lib-form-page::after {
    width: 460px;
    height: 160px;
    right: -100px;
    bottom: 8%;
    background: radial-gradient(ellipse at center, rgba(196, 181, 253, 0.14) 0%, rgba(196, 181, 253, 0) 70%);
}

.lib-form-page > .lib-form-card {
    position: relative;
    z-index: 1;
}

.lib-form-card {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #dbeafe;
    border-radius: 16px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
    overflow: visible; /* keep Select2 dropdown visible */
}

.lib-form-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    border-bottom: 1px solid #e9eef7;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(135deg, #f5f3ff 0%, #eef4ff 55%, #f8fbff 100%);
}

.lib-form-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #7c3aed, #6d28d9);
    color: #fff;
    box-shadow: 0 8px 16px rgba(124, 58, 237, 0.25);
    flex-shrink: 0;
}

.lib-form-icon svg,
.lib-form-icon i {
    width: 22px;
    height: 22px;
    stroke: #fff;
}

.lib-form-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.lib-form-subtitle {
    margin: 3px 0 0;
    font-size: 13px;
    color: #4b5563;
}

.lib-form-card-body {
    padding: 22px 24px 24px;
}

.lib-form-card .erp-form {
    width: 100%;
}

.lib-form-card .erp-form-row {
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 14px;
}

.lib-form-card .erp-label {
    width: 180px;
    flex-shrink: 0;
    padding-top: 9px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.lib-form-card .erp-field {
    flex: 1;
    min-width: 0;
}

.lib-form-card .form-control,
.lib-form-card .form-select,
.lib-form-card input.erp-input,
.lib-form-card select.erp-input,
.lib-form-card textarea.erp-input {
    height: 40px;
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: 14px;
    padding: 8px 12px;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
}

.lib-form-card textarea.form-control,
.lib-form-card textarea.erp-input {
    height: auto;
    min-height: 84px;
}

.lib-form-card .form-control:focus,
.lib-form-card .form-select:focus,
.lib-form-card .erp-input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    outline: none;
}

/* Select2 alignment with inputs */
.lib-form-card .select2-container .select2-selection--single {
    height: 40px !important;
    min-height: 40px;
    border: 1px solid #d1d5db !important;
    border-radius: 10px !important;
    background: #fff;
    display: flex;
    align-items: center;
}
.lib-form-card .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px !important;
    padding-left: 12px;
    padding-right: 30px;
    color: #111827;
}
.lib-form-card .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px;
    right: 8px;
}
.lib-form-card .select2-container--default .select2-selection--single .select2-selection__clear {
    height: 38px;
    margin-right: 20px;
    font-weight: 600;
}
.lib-form-card .select2-container--default.select2-container--focus .select2-selection--single,
.lib-form-card .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.lib-form-card .select2-container { width: 100% !important; }

.lib-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
}

.lib-btn-primary,
.lib-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all .18s ease;
    border: 1px solid transparent;
}

.lib-btn-primary svg,
.lib-btn-primary i,
.lib-btn-secondary svg,
.lib-btn-secondary i {
    width: 16px;
    height: 16px;
}

.lib-btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.lib-btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }

.lib-btn-secondary {
    background: #fff;
    color: #2563eb;
    border-color: #93c5fd;
}
.lib-btn-secondary:hover { background: #eff6ff; color: #1d4ed8; border-color: #60a5fa; }

.lib-form-card .text-danger {
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

@media (max-width: 768px) {
    .lib-form-page { padding: 12px 6px 16px; }
    .lib-form-card-header { padding: 16px 16px; }
    .lib-form-card-body { padding: 18px 16px 20px; }
    .lib-form-card .erp-form-row { flex-direction: column; gap: 6px; margin-bottom: 12px; }
    .lib-form-card .erp-label { width: 100%; padding-top: 0; }
    .lib-form-actions { width: 100%; flex-wrap: wrap; }
}
