/* Form Controls - Refined borders and spacing */
.form-control,
.form-select {
    border: 1px solid #d1d5db !important;
    border-radius: 0.2rem !important;
    padding: 0.1rem 0.3rem !important;
    font-size: 0.7rem !important;
    line-height: 1.25rem !important;
    transition: all 0.15s ease-in-out !important;
    height: auto !important;
    min-height: 2rem !important;
}

.form-select {
    background-color: #fcfcfd !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    outline: none !important;
}

.form-control:disabled,
.form-select:disabled {
    background-color: #f3f4f6 !important;
    border-color: #e5e7eb !important;
    opacity: 0.6 !important;
}

/* Fused Table Override for Grid Inputs - Zero margin / border inside grid cells */
.table-fused td {
    padding: 0 !important;
}

.table-fused .form-control,
.table-fused .form-select,
.table-fused .form-control-xs,
.table-fused .form-select-xs {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    min-height: 1.8rem !important;
    height: 100% !important;
    padding: 0.15rem 0.35rem !important;
    background-color: transparent !important;
}

.table-fused .form-control:focus,
.table-fused .form-select:focus,
.table-fused .form-control-xs:focus,
.table-fused .form-select-xs:focus {
    background-color: #ffffff !important;
    box-shadow: inset 0 0 0 1px #0ea5e9 !important;
    outline: none !important;
}

/* Form Labels - Refined typography */
.form-label {
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    color: #374151 !important;
    margin-bottom: 0.25rem !important;
    letter-spacing: 0.01em !important;
}

/* Input Groups - Tighter spacing */
.row.g-3 {
    --bs-gutter-y: 0.5rem !important;
    --bs-gutter-x: 0.625rem !important;
}

/* Switch Controls - Refined appearance */
.form-check-input {
    width: 2.5rem !important;
    height: 1.25rem !important;
    border: 1px solid #d1d5db !important;
    border-radius: 1rem !important;
    cursor: pointer !important;
}

.form-check-input:checked {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
}

.form-check-input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.form-check-label {
    font-size: 0.8125rem !important;
    color: #6b7280 !important;
    margin-left: 0.5rem !important;
    cursor: pointer !important;
}

/* Modal Refinements */
.modal-header {
    padding: 1rem 1.25rem !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.modal-title {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    color: #111827 !important;
}

.modal-body {
    padding: 1.25rem !important;
}

.modal-footer {
    padding: 0.875rem 1.25rem !important;
    border-top: 1px solid #e5e7eb !important;
}

/* Buttons - Refined sizing */
.btn-sm {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.80rem !important;
    border-radius: 0.375rem !important;
    font-weight: 500 !important;
}

.btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.80rem !important;
    border-radius: 0.375rem !important;
    font-weight: 500 !important;
    transition: all 0.15s ease-in-out !important;
}

/* Alert Refinements */
.alert {
    border-radius: 0.4rem !important;
    border: 1px solid transparent !important;
    padding: 0.7rem 1rem !important;
    font-size: 0.65rem !important;
}

.alert-warning {
    background-color: #fef3c7 !important;
    border-color: #fde68a !important;
    color: #92400e !important;
}

.alert-danger {
    background-color: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

/* Small text refinement */
small.text-muted {
    font-size: 0.75rem !important;
    color: #9ca3af !important;
    display: block !important;
    margin-top: 0.25rem !important;
}

/* Card refinements */
.card {
    border: 1px solid #e5e7eb !important;
    border-radius: 0.5rem !important;
}

.card-header {
    border-bottom: 1px solid #e5e7eb !important;
    background-color: #ffffff !important;
}

/* Badge refinements */
.badge {
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    padding: 0.25rem 0.625rem !important;
    border-radius: 0.375rem !important;
}

/* Required field indicator */
.text-danger {
    color: #dc2626 !important;
}

/* Input validation states */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #ef4444 !important;
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: #10b981 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {

    .form-control,
    .form-select {
        font-size: 0.855rem !important;
        min-height: 2.5rem !important;
    }

    .form-label {
        font-size: 0.84rem !important;
    }
}